Saataa Andagii !
This commit is contained in:
parent
f7cf2333c5
commit
556380e4f1
5 changed files with 28 additions and 28 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1 @@
|
||||||
.venv/
|
|
||||||
|
|
|
@ -1,19 +1,28 @@
|
||||||
services:
|
services:
|
||||||
proxy-server:
|
proxy-server:
|
||||||
image: proxy-server:latest
|
build:
|
||||||
|
context: ./proxy-server
|
||||||
|
dockerfile: Dockerfile
|
||||||
container_name: proxy-server
|
container_name: proxy-server
|
||||||
networks:
|
networks:
|
||||||
- server
|
server:
|
||||||
|
ipv4_address: 172.16.150.100
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- 8080:80
|
||||||
|
|
||||||
web-server:
|
web-server:
|
||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
container_name: web-server
|
container_name: web-server
|
||||||
networks:
|
networks:
|
||||||
- server
|
server:
|
||||||
|
ipv4_address: 172.16.150.101
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
server:
|
server:
|
||||||
external: false
|
ipam:
|
||||||
name: server
|
driver: default
|
||||||
|
config:
|
||||||
|
- subnet: 172.16.150.0/24
|
||||||
|
|
||||||
|
|
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
|
FROM python:alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pip install -r requirements.txt
|
RUN apk add libpcap bash && pip install -r requirements.txt
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD python main.py
|
CMD ["python", "-u", "main.py"]
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,10 @@
|
||||||
from scapy.layers.http import *
|
from scapy.all import *
|
||||||
from scapy.layers.ntlm import *
|
|
||||||
|
|
||||||
class Custom_HTTP_Server(HTTP_Server):
|
PORT = 80
|
||||||
def answer(self, pkt):
|
|
||||||
if pkt.Path == b"/":
|
def handler(pkt):
|
||||||
return HTTPResponse() / (
|
print(pkt)
|
||||||
"<!doctype html><html><body><h1>OK</h1></body></html>"
|
|
||||||
)
|
if __name__ == "__main__":
|
||||||
else:
|
sniff(filter=f"tcp port {PORT}", prn=handler)
|
||||||
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",
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue