Advertisement
Guest User

sdfsdfsdfsdf

a guest
Oct 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. #!/bin/bash
  2. #HwScript
  3.  
  4. echo -e "Enter your target ip/url:"
  5. read ip
  6. echo -e "Enter your scan type: (SYN, CONNECT, ACK, UDP, FIN, XMAS)"
  7. read -r type
  8. case $type in
  9. SYN)
  10. type=sS
  11. ;;
  12. CONNECT)
  13. type=sT
  14. ;;
  15. ACK)
  16. type=sA
  17. ;;
  18. *)
  19. echo -e "Script does not support this type. Make sure to choose one of the six provided and type in all caps."
  20. exit 1
  21. esac
  22.  
  23. echo -e "Would you like to output to a file or to the shell? (f/s)"
  24. read -r fs
  25. if [ $fs = f ]; then
  26. nmap -$type -v $ip >> /root/Desktop/output.txt
  27. echo -e "Generated file 'output.txt' on Desktop"
  28. if grep -q 'http' /root/Desktop/output.txt ; then
  29. echo -e "It appears your target is listening on port 80, would you like to try and grab the header? (y/n)"
  30. read new1
  31. if [ $new1 = y ]; then
  32. echo -e "Would you like to append this to your output file? (y/n)"
  33. read new2
  34. if [ $new2 = y ]; then
  35. nmap -sV --script=http-headers $ip >> /root/Desktop/output.txt
  36. else
  37. nmap -sV --script=http-headers $ip
  38.  
  39. fi
  40. fi
  41. fi
  42. else
  43. echo -e "Outputting to shell"
  44. nmap -$type -v $ip | tee temp.txt
  45. fi
  46. if grep -q 'http' /root/temp.txt ; then
  47. echo -e "It appears your target is listening on port 80, would you like to try and grab the header? (y/n)"
  48. read new3
  49. if [ $new3 = y ]; then
  50. echo -e "Would you like to output to a file or to the shell? (y/n)"
  51. read new4
  52. if [ $new4 = y ]; then
  53. nmap -sV --script=http-headers $ip >> /root/Desktop/output.txt
  54. echo -e "Generated file 'output.txt on Desktop"
  55. rm -preserve-root temp.txt
  56. else
  57. nmap -sV --script=http-headers $ip
  58. rm --preserve-root temp.txt
  59. fi
  60. else rm --preserve-root temp.txt
  61. fi
  62. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement