shell-plug.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. # A shell script to use as plugin that includes several pentesting helpers, such as:
  3. # * Wordlists
  4. # * Env. Variables
  5. # * aliases
  6. # base variables
  7. WORDLIST_PATH="$HOME/documents/tools/lists"
  8. PROJ_FILE=$HOME/.pentest_proj
  9. IP_FILE=$HOME/.pentest_target
  10. function pentest {
  11. echo "Pentest Shortuts Plugins"
  12. echo "[*] Aliases: "
  13. echo " pentest : display help for the commands and shortcuts"
  14. echo ""
  15. echo "[*] Env. Variables: "
  16. echo " ROCKYOU : $ROCKYOU"
  17. echo " WLIST_DIRS : $WLIST_DIRS"
  18. echo " WLIST_FILES : $WLIST_FILES"
  19. echo ""
  20. echo "[*] Functions:"
  21. echo " set_ip <ip> : set global env variable \$IP to <ip>"
  22. echo " get_ip : prints \$ip"
  23. echo " set_proj : set global env variable \$P to the current path"
  24. echo " get_proj : prints \$P"
  25. echo ""
  26. echo "[*] Set Configuration:"
  27. echo " \$Target : $IP"
  28. echo " \$Proj. Path: $P"
  29. }
  30. function set_ip {
  31. if [ "$1" != "" ]; then
  32. echo "[*] Setting IP to $1"
  33. echo "$1" > $IP_FILE
  34. # export the scope IP as global variable
  35. export IP=$(cat $IP_FILE)
  36. fi
  37. }
  38. function set_proj {
  39. echo "[*] Setting Project Path to $(pwd)"
  40. echo "$(pwd)" > $PROJ_FILE
  41. # export the scope IP as global variable
  42. export P=$(cat $PROJ_FILE)
  43. }
  44. function get_proj {
  45. echo $P
  46. }
  47. function get_ip {
  48. # print the ip, for using this function
  49. echo $IP
  50. }
  51. function init {
  52. # autoload target IP into $IP
  53. if [ -f $IP_FILE ]; then
  54. export IP=$(cat $IP_FILE)
  55. fi
  56. # autoload project path into $P
  57. if [ -f $PROJ_FILE ]; then
  58. export P=$(cat $PROJ_FILE)
  59. fi
  60. # Wordlist bindings
  61. export ROCKYOU=$WORDLIST_PATH/common-wordlists/passwords/rockyou.txt
  62. export WLIST_DIRS=$WORDLIST_PATH/common-wordlists/web/raft-large-directories.txt
  63. export WLIST_FILES=$WORDLIST_PATH/common-wordlists/web/raft-large-files.txt
  64. }
  65. # call init() function
  66. init