leonteale

Pentesting Automator Script

Oct 23rd, 2012
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.30 KB | None | 0 0
  1. #!/bin/bash
  2. #Colours
  3. #Black       0;30     Dark Gray     1;30
  4. #Blue        0;34     Light Blue    1;34
  5. #Green       0;32     Light Green   1;32
  6. #Cyan        0;36     Light Cyan    1;36
  7. #Red         0;31     Light Red     1;31
  8. #Purple      0;35     Light Purple  1;35
  9. #Brown       0;33     Yellow        1;33
  10. #Light Gray  0;37     White         1;37
  11. red=`echo -e "\033[31m"`
  12. lcyan=`echo -e "\033[36m"`
  13. yellow=`echo -e "\033[33m"`
  14. green=`echo -e "\033[32m"`
  15. blue=`echo -e "\033[34m"`
  16. purple=`echo -e "\033[35m"`
  17. normal=`echo -e "\033[m"`
  18.  
  19. while :
  20.     do
  21. clear
  22. echo "$yellow                _                        _             "
  23. echo "$yellow     /\        | |                      | |            "
  24. echo "$yellow    /  \  _   _| |_ ___  _ __ ___   __ _| |_ ___  _ __ "
  25. echo "$yellow   / /\ \| | | | __/ _ \| '_ \` _ \ / _\` | __/ _ \| '__|"
  26. echo "$yellow  / ____ \ |_| | || (_) | | | | | | (_| | || (_) | | "  
  27. echo "$yellow /_/    \_\__,_|\__\___/|_| |_| |_|\__,_|\__\___/|_|$normal"
  28. echo "$lcyan  -- Created by Leon Teale"
  29. echo ""
  30. echo "$purple Please Enter The Target Domain$normal";
  31. read target
  32. echo ""
  33.     mkdir -p ~/Desktop/$target
  34. echo "$blue +-------------------------------------------+"
  35. echo "$blue |                                           |"
  36. echo "$blue | $yellow 1. Recon$normal                              $blue   |$normal"
  37. echo "$blue | $yellow 2. Brute Force$normal                        $blue   |$normal"
  38. #echo "$blue | 3. $yellow The Harvester$normal          |"
  39. #echo "$blue | 4. $yellow OS FingerPrinting$normal      |"
  40. #echo "$blue | 5. $yellow Password bruteforcing$normal  |"
  41. #echo "$blue | 6. $yellow Metagoofil$normal             |"
  42. echo "$blue |                                           |"
  43. echo "$blue +-------------------------------------------+"
  44. echo ""
  45. read opt
  46. case $opt in
  47.  
  48. 1)clear
  49. echo "$yellow                _                        _             "
  50. echo "$yellow     /\        | |                      | |            "
  51. echo "$yellow    /  \  _   _| |_ ___  _ __ ___   __ _| |_ ___  _ __ "
  52. echo "$yellow   / /\ \| | | | __/ _ \| '_ \` _ \ / _\` | __/ _ \| '__|"
  53. echo "$yellow  / ____ \ |_| | || (_) | | | | | | (_| | || (_) | | "  
  54. echo "$yellow /_/    \_\__,_|\__\___/|_| |_| |_|\__,_|\__\___/|_|$normal"
  55. echo "$lcyan  -- Created by Leon Teale"
  56. echo ""
  57. echo "$blue +-------------------------------------------+"
  58. echo "$blue |                                           |"
  59. echo "$blue | $green Running Recon..  $normal                     $blue   |$normal"
  60. echo "$blue | $yellow Once the script finishes running the$normal$blue     |$normal"
  61. echo "$blue | $yellow results will be saved to the Desktop$normal$blue     |"
  62. #echo "$blue | 5. $yellow Password bruteforcing$normal  |"
  63. #echo "$blue | 6. $yellow Metagoofil$normal             |"
  64. echo "$blue |                                           |"
  65. echo "$blue +-------------------------------------------+"
  66. echo ""
  67. echo "[->                  ]0%"
  68.  
  69. #DNS Enumeration
  70. /pentest/enumeration/dns/dnsrecon/dnsrecon.py -t brt,std,axfr -D /pentest/enumeration/dns/dnsrecon/namelist.txt -d $target > /tmp/$target.dnsrecon.txt.tmp
  71. cat /tmp/$target.dnsrecon.txt.tmp | grep '[^\.][0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}[^\.]' | grep -vE 'Trying|TCP|MX|NS|SOA|Has' | awk {'print $3 "    " $4'} | sort -u  > ~/Desktop/$target/dnsrecon.txt
  72. echo "" >> ~/Desktop/$target/dnsrecon.txt
  73. rm -rf /tmp/$target.dnsrecon.txt.tmp
  74. echo "[--->                ]25%"
  75.  
  76. #Email Harvester
  77. /pentest/enumeration/theharvester/theHarvester.py -l 500 -b all -d $target > /tmp/$target.emails.txt.tmp
  78. cat /tmp/$target.emails.txt.tmp |  grep @ | grep -vE 'cmartore' > ~/Desktop/$target/emails.txt
  79. rm -rf /tmp/$target.emails.txt.tmp
  80. echo "[--------->          ]50%"
  81.  
  82. #MetaGooFil to get usernames from stored online documents
  83. echo "---- MetaGooFill Users ----" > ~/Desktop/$target/users.txt
  84. mkdir -p ~/Desktop/$target/metagoofil.tmp/
  85. /pentest/enumeration/google/metagoofil/metagoofil.py -d $target -t doc,xls,docx -l 200 -n 50 -o ~/Desktop/$target/metagoofil.tmp/ -f ~/Desktop/$target/users.html
  86. cat ~/Desktop/$target/users.html | sed 's/useritem/\n/g' | grep '">' | grep -vE 'head' | awk -F "<" {'print $1'} | cut -d">" -f2 | sed -e "s/^ \{1,\}//" >> ~/Desktop/$target/users.txt
  87. echo "" >> ~/Desktop/$target/users.txt
  88. rm -rf ~/Desktop/$target/metagoofil.tmp/
  89. #rm -rf /tmp/$target/users.txt.tmp
  90. echo "[--------------->    ]75%"
  91.  
  92. #Format obtained emails to possible usernames and add to end of users list if found by MetaGooFil
  93. echo "---- Users formatted from emails addresses found ----" >> ~/Desktop/$target/users.txt
  94. cat ~/Desktop/$target/emails.txt | cut -f1 -d"@" >> ~/Desktop/$target/users.txt
  95. echo "[----------------->  ]88%"
  96.  
  97. #Get the Name Servers
  98. echo "---- Name Servers ----" >> ~/Desktop/$target/dnsrecon.txt
  99. dig ns $target | grep -v '^;' | grep $target | awk {'print $5'} >> ~/Desktop/$target/dnsrecon.txt
  100. echo "" >> ~/Desktop/$target/dnsrecon.txt
  101.  
  102. #Get Mx records
  103. echo "---- MX Records ----" >> ~/Desktop/$target/dnsrecon.txt
  104. dig mx $target | grep -v '^;' | grep $target | awk {'print $6'} >> ~/Desktop/$target/dnsrecon.txt
  105.  
  106. #Get Whois info
  107. whois $target > ~/Desktop/$target/whois.txt
  108. echo "[------------------->]100%"
  109.  
  110.  
  111.  
  112. read enterkey;;
  113.  
  114. 2)
  115.  
  116.  
  117.  
  118. read enterkey;;
  119.  
  120. *) echo "$red Please Enter A Valid Option$normal"
  121. read enterkey;;
  122.  
  123. esac
  124. done
Advertisement
Add Comment
Please, Sign In to add comment