Skip to content

Commit 9ecfd1b

Browse files
tcstooltcstool
authored andcommitted
Remove yes_tag and replace w/string conversion
1 parent 2bccf32 commit 9ecfd1b

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

nsmweb.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ def getApps(webPort,victim,uri,https,verb,requestHeaders):
4343
possAddrs = []
4444
timeVulnsStr = []
4545
timeVulnsInt = []
46-
yes_tag = ['y', 'Y']
47-
no_tag = ['n', 'N']
4846
appUp = False
4947
strTbAttack = False
5048
intTbAttack = False
@@ -264,7 +262,7 @@ def getApps(webPort,victim,uri,https,verb,requestHeaders):
264262

265263
doTimeAttack = raw_input("Start timing based tests (y/n)? ")
266264

267-
if doTimeAttack in yes_tag:
265+
if doTimeAttack.lower() == "y":
268266
print "Starting Javascript string escape time based injection..."
269267
req = urllib2.Request(uriArray[18], None, requestHeaders)
270268
start = time.time()
@@ -306,7 +304,7 @@ def getApps(webPort,victim,uri,https,verb,requestHeaders):
306304
if lt24 == True:
307305
bfInfo = raw_input("MongoDB < 2.4 detected. Start brute forcing database info (y/n)? ")
308306

309-
if bfInfo in yes_tag:
307+
if bfInfo.lower == "y":
310308
getDBInfo()
311309

312310

@@ -330,7 +328,7 @@ def getApps(webPort,victim,uri,https,verb,requestHeaders):
330328

331329
fileOut = raw_input("Save results to file (y/n)? ")
332330

333-
if fileOut in yes_tag:
331+
if fileOut.lower() == "y":
334332
savePath = raw_input("Enter output file name: ")
335333
fo = open(savePath, "wb")
336334
fo.write ("Vulnerable URLs:\n")
@@ -692,7 +690,7 @@ def postApps(victim,webPort,uri,https,verb,postData,requestHeaders):
692690

693691
fileOut = raw_input("Save results to file (y/n)? ")
694692

695-
if fileOut in yes_tag:
693+
if fileOut.lower() == "y":
696694
savePath = raw_input("Enter output file name: ")
697695
fo = open(savePath, "wb")
698696
fo.write ("Vulnerable Requests:\n")
@@ -974,7 +972,6 @@ def buildUri(origUri, randValue):
974972

975973
def getDBInfo():
976974
curLen = 0
977-
yes_tag = ['y', 'Y']
978975
nameLen = 0
979976
gotFullDb = False
980977
gotNameLen = False
@@ -1039,7 +1036,7 @@ def getDBInfo():
10391036

10401037
getUserInf = raw_input("Get database users and password hashes (y/n)? ")
10411038

1042-
if getUserInf in yes_tag:
1039+
if getUserInf.lower() == "y":
10431040
charCounter = 0
10441041
nameCounter = 0
10451042
#find the total number of users on the database
@@ -1189,7 +1186,7 @@ def getDBInfo():
11891186
pwdHash = ""
11901187
crackHash = raw_input("Crack recovered hashes (y/n)?: ")
11911188

1192-
while crackHash in yes_tag:
1189+
while crackHash.lower() == "y":
11931190
menuItem = 1
11941191
for user in users:
11951192
print str(menuItem) + "-" + user

0 commit comments

Comments
 (0)