Guest User

Untitled

a guest
Jul 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function args() {
  4. declare -a ARGS=()
  5. man=$(man $1 | cut -d' ' -f8 | grep -F "-" | cut -d',' -f1 | cut -d'=' -f1 | cut -d'[' -f1)
  6. for arg in ${man}
  7. do
  8. ARGS+=($arg)
  9. done
  10.  
  11. for i in "${ARGS[@]}"
  12. do
  13. fuzz $1 $i
  14. done
  15. }
  16.  
  17. function fuzz() {
  18. CMD=$(perl -e "alarm 3; exec @ARGV" "$1 $2 id")
  19. if echo $CMD | grep -q "uid=1000"
  20. then
  21. echo "[+] Success: $1 $2 id" | tee -a ~/arg_results.txt
  22. fi
  23. }
  24.  
  25. function bins() {
  26. funcs=$(ls $1 | grep -Ev "sh|bash|dash|rbash|tmux|screen|zsh")
  27. for f in $funcs
  28. do
  29. args $f
  30. done
  31. }
  32.  
  33. bins "/bin"
  34. bins "/usr/bin"
Add Comment
Please, Sign In to add comment