Advertisement
TheProxyGuru

Untitled

Mar 16th, 2017
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ############################################################################################################################
  4. # Author : Decorous @ Hackforums.net (https://hackforums.net/member.php?action=profile&uid=3360107)
  5. # Description : A Squid3 proxy server installer using username & password based authentication with no logging for Ubuntu
  6. # Usage : Save this file as SPSI then run : bash SPSI [port] [username] [password] (ex: bash SPSI 1337 foo bar)
  7. ############################################################################################################################
  8.  
  9. if [ "$#" -ne 3 ]; then
  10. exit 1
  11. fi
  12.  
  13. clear
  14.  
  15. echo "============================================="
  16. echo "Squid 3 Proxy Server Installer"
  17. echo "============================================="
  18.  
  19. IP=$(curl -s http://ident.me |cut -d " " -f 5)
  20. PORT=$1
  21. USERNAME=$2
  22. PASSWORD=$3
  23.  
  24. sleep 5
  25. echo "Updating system ..."
  26. sudo apt-get -y update &> /dev/null
  27. echo "Installing Squid3 ..."
  28. sudo apt-get -y install apache2-utils squid3 &> /dev/null
  29. echo "Configuring username & password ..."
  30. sudo htpasswd -b -c /etc/squid3/passwd $USERNAME $PASSWORD &> /dev/null
  31. echo "Copying original Squid3 config file ..."
  32. sudo mv /etc/squid3/squid.conf /etc/squid3/squid.conf.sample
  33. echo "Downloading custom Squid3 config file ..."
  34. sudo wget --no-check-certificate -O /etc/squid3/squid.conf http://pastebin.com/raw/cm2vSJzs &> /dev/null
  35. echo "http_port $PORT" | cat - /etc/squid3/squid.conf > tmp && mv tmp /etc/squid3/squid.conf
  36. sudo cp /etc/init/squid3.conf /etc/init.d/squid3
  37. echo "Creating domain BlackList file ..."
  38. sudo touch /etc/squid3/blacklist.acl
  39. echo "Starting Squid3 service ..."
  40. sudo service squid3 restart &> /dev/null
  41. echo "Enabling Squid3 as a service ..."
  42. sudo update-rc.d squid3 defaults &> /dev/null
  43. echo "Allowing port in IPTables ..."
  44. sudo iptables -I INPUT -p tcp --dport $PORT -j ACCEPT &> /dev/null
  45. echo "Saving IPTables ..."
  46. sudo iptables-save &> /dev/null
  47.  
  48. echo "Done!"
  49. echo "============================================="
  50. echo "IP : $IP"
  51. echo "Port : $PORT"
  52. echo "Username : $USERNAME"
  53. echo "Password : $PASSWORD"
  54. echo "============================================="
  55. echo "Happy browsing! :)"
  56. echo "============================================="
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement