Saataa Andagii !
This commit is contained in:
parent
f7cf2333c5
commit
556380e4f1
5 changed files with 28 additions and 28 deletions
1
server/proxy-server/.gitignore
vendored
Normal file
1
server/proxy-server/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.venv/
|
|
@ -1,6 +1,7 @@
|
|||
FROM python:alpine
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN pip install -r requirements.txt
|
||||
RUN apk add libpcap bash && pip install -r requirements.txt
|
||||
EXPOSE 80
|
||||
CMD python main.py
|
||||
CMD ["python", "-u", "main.py"]
|
||||
|
||||
|
|
|
@ -1,21 +1,10 @@
|
|||
from scapy.layers.http import *
|
||||
from scapy.layers.ntlm import *
|
||||
from scapy.all 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>"
|
||||
)
|
||||
PORT = 80
|
||||
|
||||
def handler(pkt):
|
||||
print(pkt)
|
||||
|
||||
if __name__ == "__main__":
|
||||
sniff(filter=f"tcp port {PORT}", prn=handler)
|
||||
|
||||
server = HTTP_Server.spawn(
|
||||
port=80,
|
||||
iface="eth0",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue