PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [Tutorial] Wie installiere ich 3proxy mit http(s) und Socks5 Support



FLX
16.10.2015, 02:40
# System updaten

apt-get update

# Installiere den gcc compiler und make

apt-get install make gcc -y

# testen ob es korrekt installiert wurde

which gcc
ausgabe sollte lauten /user/bin/gcc

which make
ausgabe sollte lauten /user/bin/make

# erstelle einen temporären Ordner

mkdir /tmp/proxy

# betrete den Ordner

cd /tmp/proxy

# Download 3proxy tarball

wget http://3proxy.ru/0.7.1.2/3proxy-0.7.1.2.tgz

# Entpacke den tarball

tar -xvzf 3proxy-0.7.1.2.tgz

# Betrete das 3proxy Verzeichniss

cd 3proxy/

# Kompiliere 3proxy zu einer ausführbaren Datei

make -f Makefile.Linux

# Betritt das Source Verzeichniss

cd src/

# Erstelle einen 3proxy Ordner im Homeverzeichniss

mkdir /root/3proxy

# Verschiebe 3proxy in das Home Verzeichniss

mv 3proxy /root/3proxy/

# Betritt den neuen Ordner

cd /root/3proxy/

# Erstelle eine leere Datei

touch 3proxy.cfg

# Öffnen die Datei und füge folgendes ein

nano 3proxy.cfg


##Main##
#Starting 3proxy as a service/daemon
daemon

#DNS Servers to resolve domains and for the local DNS cache
#that providers faster resolution for cached entries
nserver 8.8.8.8
nserver 8.8.4.4
nscache 65536

#Authentication
#CL = Clear Text, CR = Encrypted Passswords (MD5)
#Add MD5 users with MD5 passwords with "" (see below)
#users "user:CR:$1$lFDGlder$pLRb4cU2D7GAT58YQvY49."
users szenebox:CL:sz3n3b0x

#Logging
log /var/log/3proxy/3proxy.log D
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
rotate 30

#Auth type
#auth strong = username & password
auth strong

#Binding address
external 0.0.0.0
internal 0.0.0.0
#http-s
auth strong
# We want to protect internal interface
deny * * 127.0.0.1,192.168.1.1
# and llow HTTP and HTTPS traffic.
allow * * * 80-88,8080-8088 HTTP
allow * * * 443,8443 HTTPS
proxy -a -p3128
#SOCKS5
auth strong
flush
allow szenebox
maxconn 384
socks -p49994

# Erstelle ein log Verzeichniss

mkdir /var/log/3proxy

# Start 3proxy

./3proxy 3proxy.cfg

# Teste ob 3proxy läuft / Kill Befehle

ps ax | grep 3proxy
Kill 3proxy
kill -9 3proxypid

# Verbindung testen

curl -v -U USERNAME:PASSWORT -x SERVER_IP:HTTP_PORT google.com 2>&1 | grep Connected -m 1

ausgabe sollte lauten
Connected to SERVER_IP (SERVER_IP) port HTTP_PORT (#0)


# Starte 3proxy beim Serverstart, öffne /etc/rc.local und füge folgendes vor exit 0 ein

sleep 30s
/root/3proxy/3proxy /root/3proxy/3proxy.cfg

Logindaten sollten natürlich angepasst werden.
Im Script wird folgendes benutz:


Username: szenebox
Passwort: sz3n3b0x
Socks5 Port: 49994
http(s) Port: 3128


Verwendet werden die Google DNS Server.
Getestet wurde das ganze bisher unter Debian und Ubuntu (Fresh Install)
Ich hoffe ich hab nix vergessen ;)

inc
16.10.2015, 10:14
hot, danke dir! macht es sinn den user und das pw auf MD5 zu ändern? (CR = Encrypted Passswords (MD5))

mfg inc

Phil
16.10.2015, 12:55
sehr schöne Anleitung!

Allerdings unter Ubuntu, beim Starten von ./3proxy 3proxy.cfg zeigt sich keine Veränderung.

FLX
16.10.2015, 13:54
hot, danke dir! macht es sinn den user und das pw auf MD5 zu ändern? (CR = Encrypted Passswords (MD5))

mfg inc

Kann man machen, zugegeben ich mach es auch nicht immer aber wechsle auch die Passwörter in rotierenden Intervalen.


sehr schöne Anleitung!

Allerdings unter Ubuntu, beim Starten von ./3proxy 3proxy.cfg zeigt sich keine Veränderung.

Was wird ausgegeben wenn du *ps ax | grep 3proxy* im Terminal eingibst?

FLX
25.11.2016, 16:44
hier noch nen passendes init-script dazu


touch /etc/init.d/3proxy

chmod +x /etc/init.d/3proxy

cat > "/etc/init.d/3proxy" <<END
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: 3proxy tiny proxy server
#
#
#
#

case "\$1" in
start)
echo Starting 3Proxy

/etc/3proxy/3proxy /etc/3proxy/3proxy.cfg
;;

stop)
echo Stopping 3Proxy
/usr/bin/killall 3proxy
;;

restart|reload)
echo Reloading 3Proxy
/usr/bin/killall -s USR1 3proxy
;;
*)
echo Usage: \$0 "{start|stop|restart}"
exit 1
esac
exit 0

END