Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion core/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import csv
import tld
import json
import tempfile


def host(string):
if string and '*' not in string:
return tld.get_fld(string, fix_protocol=True, fail_silently=True)
Expand Down Expand Up @@ -67,3 +67,13 @@ def extractHeaders(headers):
except IndexError:
pass
return sorted_headers

def burp_parser(inp_file):
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
10 changes: 8 additions & 2 deletions corsy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import argparse

from core.tests import active_tests
from core.utils import host, prompt, format_result, create_url_list
from core.colors import bad, end, red, run, good, grey, green, white, yellow
from core.utils import host, prompt, format_result, create_url_list, burp_parser


print('''
Expand All @@ -30,16 +30,19 @@
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('-b', help='input file has Burp Suite logs', dest='burp_log', action='store_true')
args = parser.parse_args()

delay = args.delay
quiet = args.quiet
target = args.target
threads = args.threads
inp_file = args.inp_file
burp_log = args.burp_log
json_file = args.json_file
header_dict = args.header_dict


if type(header_dict) == bool:
header_dict = extractHeaders(prompt())
elif type(header_dict) == str:
Expand All @@ -54,7 +57,10 @@
'Connection': 'close',
}

urls = create_url_list(target, inp_file)
if burp_log:
urls = burp_parser(inp_file)
else:
urls = create_url_list(target, inp_file)

def cors(target, header_dict, delay):
url = target
Expand Down