Advertisement
infodox

rdp_scan.py

Nov 15th, 2011
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #Scans a range and outputs a list of targets with the Remote Desktop port open :)
  3.  
  4. import sys
  5. from scapy import *
  6. conf.verb=0
  7.  
  8. if len(sys.argv) != 2:
  9.     print "Usage: ./rdp_scan.py <target>"
  10.     print "Where <target> is a range like 192.168.1.0/24"
  11.     sys.exit(1)
  12.  
  13. target=sys.argv[1]
  14.  
  15. p=IP(dst=target)/TCP(dport=3389, flags="S")
  16. ans,unans=sr(p, timeout=9)
  17.  
  18. for a in ans:
  19.     if a[1].flags == 2:
  20.         print a[1].src
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement