-
Notifications
You must be signed in to change notification settings - Fork 2
Fixed Code Execution bug on fsociety #1
Changes from 6 commits
b34b267
d6e7ffb
0a12e56
31ce86e
67cd70b
d8477b3
ba18e08
9d28d77
c760f9e
00505d6
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 |
---|---|---|
|
@@ -466,8 +466,18 @@ def install(self): | |
def run(self): | ||
clearScr() | ||
print(self.nmapLogo) | ||
target = raw_input(self.targetPrompt) | ||
self.menu(target) | ||
target = raw_input(self.targetPrompt).split(' ')[0] | ||
test_target = target.split('/') | ||
try: | ||
socket.gethostbyname(test_target[0]) | ||
if len(test_target) > 1: | ||
try: | ||
int(test_target[1]) | ||
except KeyboardInterrupt: | ||
informationGatheringMenu() | ||
self.menu(target) | ||
except KeyboardInterrupt: | ||
informationGatheringMenu() | ||
|
||
def menu(self, target): | ||
clearScr() | ||
|
@@ -558,8 +568,17 @@ def __init__(self): | |
self.install() | ||
clearScr() | ||
print(self.wpscanLogo) | ||
target = raw_input(" Enter a Target: ") | ||
self.menu(target) | ||
target = raw_input(" Enter a Target: ").split(' ')[0] | ||
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. Splitting != sanitizing inputs |
||
test_target = '' | ||
if target[0:4] == 'http': | ||
test_target = target | ||
else: | ||
test_target = 'http://'+target | ||
try: | ||
urllib2.urlopen(test_target) | ||
self.menu(target) | ||
except KeyboardInterrupt: | ||
informationGatheringMenu() | ||
|
||
def installed(self): | ||
return (os.path.isdir(self.installDir)) | ||
|
@@ -618,10 +637,19 @@ def __init__(self): | |
self.install() | ||
clearScr() | ||
print(self.CMSmapLogo) | ||
target = raw_input(" Enter a Target: ") | ||
self.run(target) | ||
response = raw_input(continuePrompt) | ||
|
||
target = raw_input(" Enter a Target: ").split(' ')[0] | ||
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. Splitting != sanitizing |
||
test_target = '' | ||
if target[0:4] == 'http': | ||
test_target = target | ||
else: | ||
test_target = 'http://'+target | ||
try: | ||
urllib2.urlopen(test_target) | ||
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. Hi 😄, The characters used inside a valid url are also evaluated as valid
I understand it's difficult fixing this type of issue, so I think it's ok using also an external library to validate the Regards, |
||
self.run(target) | ||
response = raw_input(continuePrompt) | ||
except KeyboardInterrupt: | ||
informationGatheringMenu() | ||
|
||
def installed(self): | ||
return (os.path.isdir(self.installDir)) | ||
|
||
|
@@ -686,9 +714,18 @@ def __init__(self): | |
self.install() | ||
clearScr() | ||
print(self.doorkLogo) | ||
target = raw_input(" Enter a Target: ") | ||
self.run(target) | ||
response = raw_input(continuePrompt) | ||
target = raw_input(" Enter a Target: ").split(' ')[0] | ||
test_target = '' | ||
if target[0:4] == 'http': | ||
test_target = target | ||
else: | ||
test_target = 'http://'+target | ||
try: | ||
urllib2.urlopen(test_target) | ||
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. Same above: the Mik |
||
self.run(target) | ||
response = raw_input(continuePrompt) | ||
except KeyboardInterrupt: | ||
informationGatheringMenu() | ||
|
||
def installed(self): | ||
return (os.path.isdir(self.installDir)) | ||
|
@@ -1073,7 +1110,6 @@ def bsqlbf(): | |
os.system("perl bsqlbf.pl -url %s" % cbsq) | ||
os.system("rm bsqlbf.pl") | ||
|
||
|
||
def atscan(): | ||
print ("Do You To Install ATSCAN ?") | ||
if yesOrNo(): | ||
|
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.
Splitting the
hostname
or theurl
, which areuser-supplied
inputs doesn't prevent malicious attackers from injecting successfully other commands likels
orshutdown
, which could provoke anyway a DOS issue or unexpected behaviors.The
target
should be sanitized properly 😄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.
You can confirm what I'm saying just inputting as
target
the followingurl
:test.cominvalid&&ls
, and you'll receive in thefinal output
also thels
command execution, which shows the file in the directory.Video attached:
