tehsyntx

Honeypot skeleton for PHP-Injection attacks

Mar 2nd, 2014
5,218
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.18 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. """
  4. Simple skeleton for a honeypot targeting PHP Injection attacks. Use/change as you see fit, try to at least give some cred if you find it useful. :)
  5. Requries: MongoDB, pymongo, bottle
  6. Author: @tehsyntx
  7. thembits.blogspot.com
  8. """
  9.  
  10. from bottle import run, route, error, response, request
  11. import datetime
  12. import simplejson
  13. import pymongo
  14. import os
  15. import base64
  16.  
  17.  
  18. WORKDIR = '/honeydata/'
  19.  
  20. @error(400)
  21. def badreq(error):
  22.     response.status = 200
  23.     return ''
  24.  
  25. @error(404)
  26. def notfound(error):
  27.  
  28.     response.status = 200
  29.     ip = request['REMOTE_ADDR']
  30.     hlog = pymongo.Connection().honey.http
  31.  
  32.     if request.method == 'POST':
  33.         pdata = request.body.read()
  34.    
  35.         resp = 'POST %s HTTP/1.1\n' % request.path
  36.         for key in request.headers.keys():
  37.             resp += '%s : %s\n' % (key, request.headers[key])
  38.         resp += '\n'
  39.         resp += '%s\n' % pdata
  40.  
  41.         idata = base64.b64encode(resp)
  42.    
  43.         hlog.insert({ "honeysrc" : "honeypot_name", # Change to for example your hostname
  44.                         "src" : ip,
  45.                         "method" : "POST",
  46.                         "time" : str(datetime.datetime.utcnow())[:-7],
  47.                         "data" : idata})
  48.  
  49.         response.headers['Server'] = 'Apache'
  50.  
  51.         return ''
  52.  
  53.     elif request.method == 'GET' and 'http:' in request.path:
  54.         try:
  55.             resp = 'GET %s HTTP/1.1\n' % request.path
  56.             for key in request.headers.keys():
  57.                     resp += '%s: %s\n' % (key, request.headers[key])
  58.    
  59.             idata = base64.b64encode(resp)
  60.        
  61.             hlog.insert({ "honeysrc" : "honeypot_name", # Change to for example your hostname
  62.                             "src" : ip,
  63.                             "method" : "GET",
  64.                             "time" : str(datetime.datetime.utcnow())[:-7],
  65.                             "data" : idata})
  66.    
  67.             response.headers['Server'] = 'Apache'
  68.         except:
  69.             return str(e)
  70.        
  71.         # Return content of injected file (Google is often used to verify vulnerability before injecting)
  72.         if 'google' in request.path and 'humans' in request.path:
  73.             return open('%shumans.txt' % WORKDIR, 'r').read()  
  74.  
  75.     else:
  76.         response.headers['Server'] = 'Apache'
  77.         return ''
  78.  
  79. @route('/')
  80. def root():
  81.     response.headers['Server'] = 'Apache'
  82.     return '' # Change to return some real page for more "realistic" look.
  83.  
  84. run(host='10.10.10.10', port=8080) # Make sure to change IP (..and port)
Advertisement
Comments
  • User was banned
  • User was banned
  • Quinwatir
    231 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment