text stringlengths 1 93.6k |
|---|
return decayed_lr
|
def cos_decay_lr(step, boundaries, values, max_steps):
|
# decay learning rate with a cosine function
|
if 'svhn' in FLAGS.dataset_name:
|
ratio = 1. - (float(max_steps - (step + 1)) / float(max_steps))
|
decayed_lr = np.cos(math.pi/2*ratio)* values[0]
|
else:
|
if step < boundaries[0]:
|
decayed_lr = values[0]
|
else:
|
ratio = 1. - (float(max_steps - (step + 1)) / float(max_steps - boundaries[0]))
|
decayed_lr = np.cos(math.pi/2*ratio)
|
decayed_lr = decayed_lr * values[0]
|
return decayed_lr
|
def sin_decay_lr(step, boundaries, values, max_steps):
|
# decay learning rate with a sine function
|
if 'svhn' in FLAGS.dataset_name:
|
ratio = 1.- (float(max_steps - (step + 1)) / float(max_steps))
|
decayed_lr = 1 - np.sin(math.pi/2*ratio)
|
decayed_lr = decayed_lr * values[0]
|
else:
|
if step < boundaries[0]:
|
decayed_lr = values[0]
|
else:
|
ratio = 1.- (float(max_steps - (step + 1)) / float(max_steps - boundaries[0]))
|
decayed_lr = 1 - np.sin(math.pi/2*ratio)
|
decayed_lr = decayed_lr * values[0]
|
return decayed_lr
|
def decay_lr(step, boundaries, values, max_steps):
|
# use cosine or sine learning rate decay schedule may further improve results
|
if FLAGS.decay_lr_type == 'linear':
|
decayed_lr = linear_decay_lr(step, boundaries, values, max_steps)
|
elif FLAGS.decay_lr_type == 'cosine':
|
decayed_lr = cos_decay_lr(step, boundaries, values, max_steps)
|
elif FLAGS.decay_lr_type == 'sine':
|
decayed_lr = sin_decay_lr(step, boundaries, values, max_steps)
|
else:
|
raise ValueError('decay_lr_type %s was not recognized.')
|
return decayed_lr
|
# <FILESEP>
|
# Bulk Path Traversal Scanner
|
# Intended only for educational and testing in corporate environments.
|
# https://twitter.com/nav1n0x https://github.com/ifconfig-me takes no responsibility for the code, use at your own risk.
|
# Do not attack a target you don't have permission to engage with.
|
# May give false positives, so confirm the results in the poc file, using Burp Suite etc.
|
import asyncio
|
import aiohttp
|
import argparse
|
import random
|
from colorama import init, Fore, Style #
|
DEFAULT_BATCH_SIZE = 150
|
DEFAULT_BATCH_DELAY = 1.5
|
DEFAULT_TIMEOUT = 1.8
|
DEFAULT_RETRY_COUNT = 1
|
RESPONSE_SIZE_LIMIT = 1024 * 10 # 10 KB
|
init(autoreset=True)
|
user_agents = [
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.160 Safari/537.36", #
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246",
|
"Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36",
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9"
|
]
|
headers = {
|
"Upgrade-Insecure-Requests": "1",
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
"Accept-Encoding": "gzip, deflate, br",
|
"Accept-Language": "en-US,en;q=0.9",
|
"Connection": "close"
|
}
|
successful_attempts = 0
|
failed_attempts = 0
|
timeout_attempts = 0
|
ascii_art = """
|
____
|
____ _____ ___ _/_ | ____
|
/ \\\\__ \\\\ \\/ /| |/ \\
|
| | \\/ __ \\\\ / | | | \\
|
|___| (____ /\\_/ |___|___| /
|
\\/ \\/ v.0.2.1 \\/
|
# Bulk Path Traversal Scanner
|
# Intended only for educational and testing in corporate environments.
|
# https://twitter.com/nav1n0x/ https://github.com/ifconfig-me takes no responsibility for the code, use at your own risk.
|
# Do not attack a target you don't have permission to engage with.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.