Aluf

Cisco Scanner

Jan 20th, 2015
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #
  3. # Python Cisco Scanner
  4. #EDUCATIONAL USE ONLY.
  5. #
  6.  
  7. from socket import *
  8. import threading
  9.  
  10. print "Cisco Router Scanner."
  11. target,output = (raw_input("Class C IP: "), raw_input("Logfile: "))
  12. f = open(output, 'w')
  13. for i in range(1, 255):
  14.         t = target + '.' + str(i)
  15.         setdefaulttimeout(0.5)
  16.         s = socket(AF_INET,SOCK_STREAM)
  17.         try:
  18.                 print "Trying %s\r" % (t,)
  19.                 s.connect((t, 22))
  20.                 data = s.recv(3)
  21.                 s.close()
  22.                 print t
  23.                 print data
  24.                 if data == "":        
  25.                         f.write("Cisco router found at: %s\n" % (t,))
  26.         except Exception,e:
  27.                 s.close()
  28. f.close()
Advertisement
Add Comment
Please, Sign In to add comment