-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import Urls from Burp Suite - Feature #17
base: master
Are you sure you want to change the base?
Changes from 1 commit
f0669a2
bfa7437
7eb4eaa
535e43b
f80ea3a
aab4f31
47b29b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
import tld | ||
import json | ||
import tempfile | ||
|
||
import csv | ||
|
||
def host(string): | ||
if string and '*' not in string: | ||
|
@@ -67,3 +67,13 @@ def extractHeaders(headers): | |
except IndexError: | ||
pass | ||
return sorted_headers | ||
|
||
def url_from_logs(inp_file): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's call it |
||
urls = [] | ||
with open(inp_file, 'r') as file: | ||
log_csv = csv.DictReader(file) | ||
for line in log_csv: | ||
url = line['Host']+line['Path'] | ||
if url not in urls: | ||
urls.append(url) | ||
return urls | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a newline |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
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, url_from_logs | ||
from core.colors import bad, end, red, run, good, grey, green, white, yellow | ||
|
||
|
||
|
@@ -29,6 +29,7 @@ | |
parser.add_argument('-t', help='thread count', dest='threads', type=int, default=2) | ||
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('-f', help='import from burp logs', dest='file') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
parser.add_argument('--headers', help='add headers', dest='header_dict', nargs='?', const=True) | ||
args = parser.parse_args() | ||
|
||
|
@@ -39,6 +40,7 @@ | |
inp_file = args.inp_file | ||
json_file = args.json_file | ||
header_dict = args.header_dict | ||
log_file = args.file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change the position of this line according to it's length. |
||
|
||
if type(header_dict) == bool: | ||
header_dict = extractHeaders(prompt()) | ||
|
@@ -54,7 +56,10 @@ | |
'Connection': 'close', | ||
} | ||
|
||
urls = create_url_list(target, inp_file) | ||
if inp_file: | ||
urls = create_url_list(target, inp_file) | ||
elif log_file: | ||
urls = url_from_logs(log_file) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
if log_file:
urls = url_from_logs(log_file)
else:
urls = create_url_list(target, inp_file) |
||
|
||
def cors(target, header_dict, delay): | ||
url = target | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add it before "import tld"