Skip to content

Commit

Permalink
Merge pull request deadbits#10 from ohdae/development
Browse files Browse the repository at this point in the history
Portscan module
  • Loading branch information
ohdae committed Apr 5, 2012
2 parents 8f5091e + 188ca61 commit 2056910
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/Modules/Custom/portscan
@@ -0,0 +1,17 @@
# Simple port-scan module. Will scan ports 1-1000. Not threaded, might take a long time on external IPs. Specify an IP address via ./Intersect.py 192.168.1.4
def portscan():
if len(sys.argv) <=2:
print("[!] Must specify an IP address!")
Shutdown()

ipaddr = sys.argv[2]
print("[+] Starting portscan of: %s " % ipaddr)

for i in range(1, 1000):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

result = s.connect_ex((ipaddr, i))
if(result == 0) :
print("[+] Port open %d " % (i,))
s.close()

2 changes: 1 addition & 1 deletion src/Templates/payload_template.py
Expand Up @@ -99,7 +99,7 @@ def signalHandler(signal, frame):
def Shutdown():
if not os.listdir(Temp_Dir):
os.rmdir(Temp_Dir)

sys.exit()

def whereis(program):
for path in os.environ.get('PATH', '').split(':'):
Expand Down

0 comments on commit 2056910

Please sign in to comment.