Skip to content

Commit

Permalink
Reorder code to give domain parameter preference over target
Browse files Browse the repository at this point in the history
Fixes 1N3#20
  • Loading branch information
Christian Lerrahn committed Oct 27, 2019
1 parent a3c6f83 commit 5e22e7d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions blackwidow
Original file line number Diff line number Diff line change
Expand Up @@ -267,23 +267,24 @@ else:
ans = scan
level = 1

#using a domain and a port or a URL?
# using a domain and a port or a URL?
if ":" not in target:

if (len(str(domain)) > 4):
if len(str(target)) > 6:
url = target + ":" + port #big change here
#print "url is: " + url
else:
url = "http://" + str(domain) + ":" + port
#print "url is: " + url

if len(str(domain)) > 4:
target = "http://" + domain + ":" + port
#print "target is: " + target
else:
parsed_uri = urlparse(target)
domain = '{uri.netloc}'.format(uri=parsed_uri)
#print "domain after parsed_uri is now: " + domain

if (len(str(target)) > 6):
url = target + ":" + port #big change here
#print "url is: " + url
else:
url = "http://" + str(domain) + ":" + port
#print "url is: " + url
else:
url = target
globalURL = target
Expand Down

0 comments on commit 5e22e7d

Please sign in to comment.