Proxychains

Antivirus, forensics, intrusion detection, cryptography, etc.
Post Reply
Message
Author
labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

Proxychains

#1 Post by labbe5 »

https://fossbytes.com/how-to-use-proxyc ... ind-proxy/

Proxychains is a tool for Linux or UNIX-Like systems that allows you to run almost any program behind a proxy, even SOCKS. You can use it to update your system, download something using wget, push to remote using git, and with several applications while you are behind a proxy server. It can even chain several proxies together, so, if you want to hack something without losing your cover, chain together several proxies and it would get very difficult to trace you back.

Proxychains is available in the official repository of almost every Linux variant. I would rather recommend Proxychains-ng (new generation) aka proxychains4 as it is a latest and more stable release.

When to use it ?
1) When the only way to get "outside" from your LAN is through proxy server.
2) To get out from behind restrictive firewall which filters outgoing ports.
3) To use two (or more) proxies in chain:
like: your_host <--> proxy1 <--> proxy2 <--> target_host
4) To "proxify" some program with no proxy support built-in (like telnet)
5) Access intranet from outside via proxy.
6) To use DNS behind proxy.
7) To access hidden tor onion services.


Some cool features:

* This program can mix different proxy types in the same chain
like: your_host <-->socks5 <--> http <--> socks4 <--> target_host
* Different chaining options supported
random order from the list ( user defined length of chain ).
exact order (as they appear in the list )
dynamic order (smart exclude dead proxies from chain)
* You can use it with most TCP client applications, possibly even network
scanners, as long as they use standard libc functionality.
pcap based scanning does not work.
* You can use it with servers, like squid, sendmail, or whatever.
* DNS resolving through proxy.


# defaults set to "tor"
socks4 127.0.0.1 9050
socks5 127.0.0.1 9050

Oh, and you also don't need to use "socks4", only "socks5". Leaving it that way will only make your traffic go through TOR in socks4, then go back to your machine (127.0.0.1) and use yourself as another proxy, this time through socks5, in other words, slow as fuck.

Source : https://null-byte.wonderhowto.com/forum ... k-0180942/

Further reading :
https://codingsec.net/2016/05/use-proxy ... ali-linux/
https://linuxhint.com/proxychains-tutorial/
https://anonymous-proxy-servers.net/en/ ... hains.html
https://www.linuxbabe.com/desktop-linux ... oxy-server
https://www.sunnyhoi.com/how-to-setup-p ... ali-linux/
https://shortrecipes.blogspot.com/2015/ ... ng-or.html

Proxychains is a built-in feature of Kali Linux, so you can easily try it out.
Alternatively, you can use katoolin to install some or all Kali tools on a Ubuntu (derivatives) OS : https://github.com/LionSec/katoolin

Further reading :
https://null-byte.wonderhowto.com/how-t ... s-0154619/
https://null-byte.wonderhowto.com/how-t ... b-0130581/
https://www.linuxbabe.com/desktop-linux ... oxy-server
https://proxy-list.org/english/index.php
https://www.socks-proxy.net/

List of Censorship-free DNS servers :
https://anonymous-proxy-servers.net/wik ... NS_servers

Configure the DNS server for host name resolving

For resolving DNS host names the DNS server 4.2.2.2 is used by default. This server is not for public use any more and not working stable. We highly recommed the usage of another DNS server! You may change the DNS server in the script "/usr/lib/proxychains3/proxyresolv" (Debian, Ubuntu) or "/usr/bin/proxyresolv" (SuSE, Redhat). Open the script with a text editor ans replace the value for $DNS_SERVER by an other censorship free server. DNS_SERVER=62.75.219.7
Source : https://anon.inf.tu-dresden.de/help/jap ... hains.html

If proxychains failed to launch properly, try this tutorial :
https://samiux.blogspot.com/2013/05/how ... buntu.html

Hey there. I don't know if you've found the solution yet, but I was having the same problem, and I got it working. I wish I could take credit for it, but truthfully, I followed a guide at http://samiux.blogspot.com/2013/05/h...on-ubuntu.html . What I had to do was:

vi /etc/privoxy/config
Then add:
forward-socks5 / 127.0.0.1:9050 . (make sure to add the period)
forward 192.168.*.*/ . (because I'm behind a router)

Then

/etc/init.d/tor restart
/etc/init.d/privoxy restart

after that edit your proxychains.conf file and change the tor proxy line

from

socks4a 127.0.0.1 9050

to

socks5 127.0.0.1 9050

When I ran a #proxychains iceweasel it loaded up just fine. Like I said, the details are on the Samiux's Blog site. Hope this helps you out too!!

Source : https://forums.kali.org/showthread.php? ... ot-working

If proxychains is not working for all or some of your apps, github may be of help :

ProxyChains is a UNIX program, that hooks network-related libc functions
in DYNAMICALLY LINKED programs via a preloaded DLL (dlsym(), LD_PRELOAD)
and redirects the connections through SOCKS4a/5 or HTTP proxies.
It supports TCP only (no UDP/ICMP etc).

The way it works is basically a HACK; so it is possible that it doesn't
work with your program, especially when it's a script, or starts
numerous processes like background daemons or uses dlopen() to load
"modules" (bug in glibc dynlinker).
It should work with simple compiled (C/C++) dynamically linked programs
though.

If your program doesn't work with proxychains, consider using an
iptables based solution instead; this is much more robust.

https://github.com/rofl0r/proxychains-ng

And try using : proxychains ng (new generation) :
https://sourceforge.net/projects/proxychains-ng/files/

Finally, there is a GUI :
https://sourceforge.net/projects/proxychainsgui/

Post Reply