TTOPM commited on
Commit
d122044
·
verified ·
1 Parent(s): fc78fec

Create tarpit.py

Browse files
Files changed (1) hide show
  1. belel-shield/resilience/tarpit.py +24 -0
belel-shield/resilience/tarpit.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Belel Tarpit
4
+ Creates a simple tarpit server that accepts connections but never responds.
5
+ This ties up hostile bots without sending traffic back.
6
+ """
7
+
8
+ import socket
9
+
10
+ HOST = "0.0.0.0"
11
+ PORT = 8080
12
+
13
+ def run_tarpit():
14
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
15
+ s.bind((HOST, PORT))
16
+ s.listen(5)
17
+ print(f"🪤 Belel Tarpit listening on {HOST}:{PORT} ...")
18
+ while True:
19
+ conn, addr = s.accept()
20
+ print(f"[+] Tarpitted connection from {addr}")
21
+ # Do nothing — connection stays open forever
22
+
23
+ if __name__ == "__main__":
24
+ run_tarpit()