LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2024, 02:23 PM   #1
linuxdragon20
LQ Newbie
 
Registered: Feb 2024
Posts: 2

Rep: Reputation: 0
Exclamation Proxychains4 NOT working (denied/socket error/timeout)


Hi, newbie here, this is these errors i get after having launched firefox with proxychains4
Code:
#proxychains4 firefox
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] Dynamic chain  ...  127.0.0.1:9050  ...  127.0.0.1:9050 <--denied
[proxychains] Dynamic chain  ...  127.0.0.1:9050  ...  contile.services.mozilla.com:443 [proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
<--socket error or timeout!
[proxychains] Dynamic chain  ...  127.0.0.1:9050  ...  contile.services.mozilla.com:443

this is the resolv.conf
Code:
#Generated by NetworkManager
search MONTEVIA
nameserver 8.8.8.8

This is the what the status is when I start the tor service on Kali linux (dual boot OS):
Code:
#tor.service 
- Anonymizing overlay network for TCP (multi-instance-master)      
Loaded: loaded (/usr/lib/systemd/system/tor.service; disabled; preset: disabled)      
Active: active (exited) since Fri 2024-02-09 16:21:01 CET; 3s ago     
Process: 18240 ExecStart=/bin/true (code=exited, status=0/SUCCESS)    
Main PID: 18240 (code=exited, status=0/SUCCESS)         
CPU: 1ms  Feb 09 16:21:01 kali systemd[1]: Starting tor.service 
- Anonymizing overlay network for TCP (multi-instance-> Feb 09 16:21:01 kali systemd[1]: Finished tor.service 
- Anonymizing overlay network for TCP (multi-instance->
Now as far as I know, the "Loaded: loaded disabled" should have it 'enabled' in it to have tor working. I am trying to use proxychains4 with tor, but it's not working



my proxychains4.conf
Code:
# proxychains.conf  VER 4.x
#
#        HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS.


# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
dynamic_chain
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
#strict_chain
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
#round_robin_chain
#
# Round Robin - Each connection will be done via chained proxies
# of chain_len length
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped).
# the start of the current proxy chain is the proxy after the last
# proxy in the previously invoked proxy chain.
# if the end of the proxy chain is reached while looking for proxies
# start at the beginning again.
# otherwise EINTR is returned to the app
# These semantics are not guaranteed in a multithreaded environment.
#
#random_chain
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see  chain_len) from the list.
# this option is good to test your IDS :)
Hi, newbie here, this is the errors i get after having launched firefox with proxychains4
# Make sense only if random_chain or round_robin_chain
#chain_len = 2

# Quiet mode (no output from library)
#quiet_mode

## Proxy DNS requests - no leak for DNS data
# (disable all of the 3 items below to not proxy your DNS requests)

# method 1. this uses the proxychains4 style method to do remote dns:
# a thread is spawned that serves DNS requests and hands down an ip
# assigned from an internal list (via remote_dns_subnet).
# this is the easiest (setup-wise) and fastest method, however on
# systems with buggy libcs and very complex software like webbrowsers
# this might not work and/or cause crashes.
proxy_dns

#method 2. use the old proxyresolv script to proxy DNS requests
# in proxychains 3.1 style. requires `proxyresolv` in $PATH
# plus a dynamically linked `dig` binary.
# this is a lot slower than `proxy_dns`, doesn't support .onion URLs,
# but might be more compatible with complex software like webbrowsers.
#proxy_dns_old

#method 3. use proxychains4-daemon process to serve remote DNS requests.
# this is similar to the threaded `proxy_dns` method, however it requires
# that proxychains4-daemon is already running on the specified address.
# on the plus side it doesn't do malloc/threads so it should be quite
# compatible with complex, async-unsafe software.
# note that if you don't start proxychains4-daemon before using this,
# the process will simply hang.
#proxy_dns_daemon 127.0.0.1:1053

# set the class A subnet number to use for the internal remote DNS mapping
# we use the reserved 224.x.x.x range by default,
# if the proxified app does a DNS request, we will return an IP from that range.
# on further accesses to this ip we will send the saved DNS name to the proxy.
# in case some control-freak app checks the returned ip, and denies to 
# connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x.
# of course you should make sure that the proxified app does not need
# *real* access to this subnet. 
# i.e. dont use the same subnet then in the localnet section
#remote_dns_subnet 127 
#remote_dns_subnet 10
remote_dns_subnet 224

# Some timeouts in milliseconds
tcp_read_time_out 15000
tcp_connect_time_out 8000

### Examples for localnet exclusion
## localnet ranges will *not* use a proxy to connect.
## note that localnet works only when plain IP addresses are passed to the app,
## the hostname resolves via /etc/hosts, or proxy_dns is disabled or proxy_dns_old used.

## Exclude connections to 192.168.1.0/24 with port 80
# localnet 192.168.1.0:80/255.255.255.0

## Exclude connections to 192.168.100.0/24
# localnet 192.168.100.0/255.255.255.0

## Exclude connections to ANYwhere with port 80
# localnet 0.0.0.0:80/0.0.0.0
# localnet [::]:80/0

## RFC6890 Loopback address range
## if you enable this, you have to make sure remote_dns_subnet is not 127
## you'll need to enable it if you want to use an application that 
## connects to localhost.
# localnet 127.0.0.0/255.0.0.0
# localnet ::1/128

## RFC1918 Private Address Ranges
# localnet 10.0.0.0/255.0.0.0
# localnet 172.16.0.0/255.240.0.0
# localnet 192.168.0.0/255.255.0.0

### Examples for dnat
## Trying to proxy connections to destinations which are dnatted,
## will result in proxying connections to the new given destinations.
## Whenever I connect to 1.1.1.1 on port 1234 actually connect to 1.1.1.2 on port 443
# dnat 1.1.1.1:1234  1.1.1.2:443

## Whenever I connect to 1.1.1.1 on port 443 actually connect to 1.1.1.2 on port 443
## (no need to write :443 again)
# dnat 1.1.1.2:443  1.1.1.2

## No matter what port I connect to on 1.1.1.1 port actually connect to 1.1.1.2 on port 443
# dnat 1.1.1.1  1.1.1.2:443

## Always, instead of connecting to 1.1.1.1, connect to 1.1.1.2
# dnat 1.1.1.1  1.1.1.2

# ProxyList format
#       type  ip  port [user pass]
#       (values separated by 'tab' or 'blank')
#
#       only numeric ipv4 addresses are valid
#
#
#        Examples:
#
#               socks5  192.168.67.78   1080    lamer   secret
#               http    192.168.89.3    8080    justu   hidden
#               socks4  192.168.1.49    1080
#               http    192.168.39.93   8080    
#               
#
#       proxy types: http, socks4, socks5, raw
#         * raw: The traffic is simply forwarded to the proxy without modification.
#        ( auth types supported: "basic"-http  "user/pass"-socks )
#
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
socks4          127.0.0.1 9050
socks5         127.0.0.1 9050

I am aware that proxychains needs time to be perfectly in sync. So these are the status of time services of my machine
Code:
#systemctl status systemd-timesyncd.service            
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-02-10 00:01:49 CET; 34min left
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 585 (systemd-timesyn)
     Status: "Contacted time server 162.159.200.123:123 (2.debian.pool.ntp.org)."
      Tasks: 2 (limit: 14156)
     Memory: 1.8M (peak: 2.8M)
        CPU: 105ms
     CGroup: /system.slice/systemd-timesyncd.service
             └─585 /usr/lib/systemd/systemd-timesyncd

Feb 10 00:01:49 kali systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization...
Feb 10 00:01:49 kali systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.
Feb 10 00:01:56 kali systemd-timesyncd[585]: Network configuration changed, trying to establish connection.
Feb 10 00:01:59 kali systemd-timesyncd[585]: Network configuration changed, trying to establish connection.
Feb 09 23:02:28 kali systemd-timesyncd[585]: Contacted time server 162.159.200.123:123 (2.debian.pool.ntp.or>
Feb 09 23:02:28 kali systemd-timesyncd[585]: Initial clock synchronization to Fri 2024-02-09 23:02:28.557401>
lines 1-18/18 (END)

and...
Code:
#timedatectl                                                  
               Local time: Fri 2024-02-09 23:27:41 CET
           Universal time: Fri 2024-02-09 22:27:41 UTC
                 RTC time: Fri 2024-02-09 22:27:41
                Time zone: Europe/Amsterdam (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no


Note: I have uninstalled tor, proxychains, ntp, apt updated and apt upgraded then reinstalled them all, but to no avail.
 
Old 02-13-2024, 07:07 PM   #2
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 798

Rep: Reputation: 256Reputation: 256Reputation: 256
Firefox can't speak socks to websites directly. Set a forwarding proxy like Privoxy in front of it. If you are going to do that, you can just point FF at Privoxy. proxychains is more for stuff that can't use proxies on its own. I see you already have NG. The old one doesn't work. Anyway, that's how I do it.

Code:
[ProxyList]
# add proxy here ...
# defaults set to "tor"
#socks4         127.0.0.1 9050
http    127.0.0.1 8118
Code:
proxychains4 -q ncat -v xdfrj2quh5wf4atnpbc7mi4yxqp6lnmqtycdvlgndkknpsrdxoxq.b32.i2p
Ncat: Version 7.94 ( https://nmap.org/ncat )

Ncat: Connected to 224.0.0.1:31337.
Look!  A ladder!  Maybe it leads to heaven, or a sandwich!
 
Old 02-14-2024, 04:30 PM   #3
linuxdragon20
LQ Newbie
 
Registered: Feb 2024
Posts: 2

Original Poster
Rep: Reputation: 0
Hi, thanks for noticing. I've actually tried your 1st code, of adding the http proxy, but didn't work
Quote:
# add proxy here ...
# defaults set to "tor"
#socks4 127.0.0.1 9050
http 127.0.0.1 8118
for the second code, I am not sure what it does, but it didn't work out
Quote:
proxychains4 -q ncat -v xdfrj2quh5wf4atnpbc7mi4yxqp6lnmqtycdvlgndkknpsrdxoxq.b32.i2p
as for privoxy, i downloaded it, but couldn't find a tutorial on how to use it to anonymize the system. if you would like to refer me to proper tutorials, it would extremely help.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify UDP receive socket buffer size for an open socket (not at system level, but socket level) barz_83_LQ Linux - Networking 2 11-27-2017 07:56 PM
Connecting client socket to server socket only once in socket programming srinietrx Programming 5 08-20-2017 11:53 AM
Proxychains4 not working well with free proxies BadArnold Linux - Software 2 05-25-2016 03:20 PM
Apt-get not working via proxychains4 hack3rcon Debian 0 09-01-2015 11:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration