forked from c0ll3cti0n/exploitpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnmap.py
More file actions
34 lines (32 loc) · 1.17 KB
/
Copy pathnmap.py
File metadata and controls
34 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import sys
import subprocess
import os
port = sys.argv[1]
platform = sys.platform
if platform.startswith('win'):
print "Running on Windowss"
print "Starting Exploit Pack - Server.."
print "Listening on port:",port
subprocess.call("cmd.exe /K nc.exe -l %s"%port,shell=True)
elif platform.startswith('linux'):
file = open(port, "w")
file.write("clear\n")
file.write("echo Running on Linux\n")
file.write("echo Starting Exploit Pack - Server..\n")
file.write("echo Listening on port: %s \n"%port)
file.write("nc -l %s \n"%port)
file.close()
subprocess.call("chmod +x %s"%port,shell=True)
subprocess.call("xterm -hold -e %s"%port,shell=True)
elif platform.startswith('darwin'):
file = open(port, "w")
file.write("clear\n")
file.write("echo Running on OSX\n")
file.write("echo Starting Exploit Pack - Server..\n")
file.write("echo Listening on port: %s \n"%port)
file.write("nc -l %s \n"%port)
file.close()
subprocess.call("chmod +x %s"%port,shell=True)
subprocess.call("open -a Terminal %s"%port,shell=True)
else:
print "Sorry I could not detect the platform"