server-murder/server/proxy-server/main.py
2024-12-02 11:37:48 +01:00

21 lines
588 B
Python

from scapy.layers.http import *
from scapy.layers.ntlm import *
class Custom_HTTP_Server(HTTP_Server):
def answer(self, pkt):
if pkt.Path == b"/":
return HTTPResponse() / (
"<!doctype html><html><body><h1>OK</h1></body></html>"
)
else:
return HTTPResponse(
Status_Code=b"404",
Reason_Phrase=b"Not Found",
) / (
"<!doctype html><html><body><h1>404 - Not Found</h1></body></html>"
)
server = HTTP_Server.spawn(
port=80,
iface="eth0",
)