added path to not be dropped issue #27
This commit is contained in:
15
corsy.py
15
corsy.py
@@ -6,7 +6,7 @@ import json
|
||||
import argparse
|
||||
|
||||
from core.tests import active_tests
|
||||
from core.utils import host, prompt, format_result, create_url_list
|
||||
from core.utils import host, prompt, format_result, create_url_list, create_stdin_list
|
||||
from core.colors import bad, end, red, run, good, grey, green, white, yellow
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ parser.add_argument('-t', help='thread count', dest='threads', type=int, default
|
||||
parser.add_argument('-d', help='request delay', dest='delay', type=float, default=0)
|
||||
parser.add_argument('-q', help='don\'t print help tips', dest='quiet', action='store_true')
|
||||
parser.add_argument('--headers', help='add headers', dest='header_dict', nargs='?', const=True)
|
||||
parser.add_argument('-v', help='verbose', dest='verbose',type=str, default=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
delay = args.delay
|
||||
@@ -39,6 +40,10 @@ threads = args.threads
|
||||
inp_file = args.inp_file
|
||||
json_file = args.json_file
|
||||
header_dict = args.header_dict
|
||||
verbose = args.verbose
|
||||
|
||||
if verbose:
|
||||
print ('verbos is enabled')
|
||||
|
||||
if type(header_dict) == bool:
|
||||
header_dict = extractHeaders(prompt())
|
||||
@@ -54,7 +59,13 @@ else:
|
||||
'Connection': 'close',
|
||||
}
|
||||
|
||||
|
||||
# PIPE output from other tools such as httprobe etc
|
||||
if ( sys.stdin.isatty()):
|
||||
urls = create_url_list(target, inp_file)
|
||||
else:
|
||||
urls = create_stdin_list(target, sys.stdin)
|
||||
|
||||
|
||||
def cors(target, header_dict, delay):
|
||||
url = target
|
||||
@@ -62,7 +73,7 @@ def cors(target, header_dict, delay):
|
||||
parsed = urlparse(url)
|
||||
netloc = parsed.netloc
|
||||
scheme = parsed.scheme
|
||||
url = scheme + '://' + netloc
|
||||
url = scheme + '://' + netloc + parsed.path
|
||||
return active_tests(url, root, scheme, header_dict, delay)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user