IsraelTorres

checksccmports.sh

Oct 17th, 2011
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Israel Torres
  3. # 2011/10/17
  4. # SCCM 2007 Port Connection Checker using nmap
  5.  
  6. #UDP
  7. function nmap_check_sccm_udp {
  8. IPADDRESS=$1
  9. sudo nmap -p53,67,68,69,135,137,138,500,636,2701,2702,4011,63000-64000 -sU -P0 $IPADDRESS 2> /dev/null | grep -E 'open|filtered|closed'
  10. }
  11. #TCP
  12. function nmap_check_sccm_tcp {
  13. IPADDRESS=$1
  14. sudo nmap -p80,135,139,389,443,445,636,1433,16992,16993,16995,1723,2701,2702,3268,3269,3389,8530,8531,9971 -sS -P0 $IPADDRESS 2> /dev/null | grep -E 'open|filtered|closed'
  15. }
  16.  
  17. function nmap_check_sccm_all {
  18. IPADDRESS=$1
  19. echo "checking UPD SCCM ports on $IPADDRESS ..."
  20. nmap_check_sccm_udp $IPADDRESS
  21. echo "checking TCP SCCM ports on $IPADDRESS ..."
  22. nmap_check_sccm_tcp $IPADDRESS
  23. }
  24.  
  25. TESTIP1='10.10.10.10'
  26. TESTIP2='10.10.11.10'
  27.  
  28. nmap_check_sccm_all $TESTIP1
  29. nmap_check_sccm_all $TESTIP2
  30.  
  31. #EOF
  32.  
RAW Paste Data