Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.56 KB | None | 0 0
  1. #!/bin/bash
  2. # Created by Nova
  3. # Tested on PI 3 & Debian Stretch
  4. # https://nova.ws/pi-tor-socks/
  5.  
  6. apt-get update
  7. apt-get upgrade -y
  8. apt-get install -y mc htop psmisc git make gcc python3-pip hostapd iptables-persistent wvdial tor tor-arm dnsmasq netdiag tcpdump
  9.  
  10. #Disable some garbage
  11. systemctl disable avahi-daemon
  12. systemctl stop avahi-daemon
  13.  
  14. #Stop curent service | we will start it later
  15. systemctl stop tor
  16. systemctl stop dnsmasq
  17.  
  18. # Install 3proxy
  19. cd ~
  20. git clone https://github.com/z3APA3A/3proxy
  21. cd 3proxy/ && make -f Makefile.Linux
  22. mkdir -p /lib/3proxy/
  23. mv bin/TransparentPlugin.ld.so /lib/3proxy/
  24. mv bin/PCREPlugin.ld.so /lib/3proxy/
  25. mv bin/TrafficPlugin.ld.so /lib/3proxy/
  26. mv bin/StringsPlugin.ld.so /lib/3proxy/
  27. mv bin/3proxy /usr/bin/
  28. cd ~
  29. rm -rf 3proxy
  30.  
  31. # Install dnsproxy
  32. cd ~
  33. git clone https://github.com/jtripper/dns-tcp-socks-proxy
  34. cd dns-tcp-socks-proxy && make
  35. mkdir -p /etc/dnsproxy
  36. mv dns_proxy.conf /etc/dnsproxy/
  37. mv dns_proxy /usr/bin/
  38. cd ~
  39. rm -rf dns-tcp-socks-proxy
  40.  
  41. #Download Def Conf & install it
  42. cd ~
  43. curl https://nova.ws/dl/release/pi_tor_socks/pi_tor_socks_conf.tar.gz | tar xz
  44. mv conf/dnsmasq.conf /etc/dnsmasq.conf
  45. mv conf/dns_proxy.conf /etc/dnsproxy/dns_proxy.conf
  46. mv conf/resolv.conf /etc/dnsproxy/resolv.conf
  47. mv conf/hostapd.conf /etc/hostapd/hostapd.conf
  48. mv conf/interfaces /etc/network/interfaces
  49. mv conf/sysctl.conf /etc/sysctl.conf
  50. mv conf/wvdial.conf /etc/wvdial.conf
  51. mv conf/3proxy.cfg /etc/3proxy.cfg
  52. mv conf/service/3proxy.service /lib/systemd/system/
  53. mv conf/service/dnsproxy.service /lib/systemd/system/
  54. mv conf/service/webmanager.service /lib/systemd/system/
  55. cd ~
  56. rm -rf conf
  57.  
  58. #Some change hostapd
  59. sed -i /etc/default/hostapd -e '/DAEMON_CONF=/c DAEMON_CONF="/etc/hostapd/hostapd.conf"'
  60.  
  61. #Download web-manager interface & install it
  62. curl https://nova.ws/dl/release/pi_tor_socks/pi_tor_socks_web.tar.gz | tar xz
  63. mv app /opt/
  64.  
  65. ## Install couple python libary
  66. pip3 install flask
  67. pip3 install requests
  68. pip3 install pysocks
  69.  
  70. ## Install & run our & other service
  71. systemctl enable 3proxy
  72. systemctl enable dnsproxy
  73. systemctl enable webmanager
  74. systemctl enable dnsmasq
  75. systemctl enable tor
  76. systemctl enable hostapd
  77.  
  78. #Install & save iptables rules
  79. iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 22 -j REDIRECT --to-ports 22
  80. iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 5000 -j REDIRECT --to-ports 5000
  81. iptables -t nat -A PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 6666
  82. iptables-save > /etc/iptables/rules.v4
  83.  
  84. ## Seems all done but need reboot
  85. echo "All done, need reboot"
  86. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement