I am trying to run a SOCKS server which listens for SOCKS connections on localhost. There will actually be SSH tunnels reaching this server if you are wondering about the purpose. I based the configuration off the suggestions in the documentation but it isn't working.
Here is my config:
errorlog: /var/log/sockd.errlog
logoutput: /var/log/sockd.log
internal: 127.0.0.1 port = 1080
external: eth0
user.notprivileged: nobody
clientmethod: none
socksmethod: none
client pass {
from: 127.0.0.0/24 to: 0.0.0.0/0
log: error # connect disconnect
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bind connect udpassociate
log: error # connect disconnect iooperation
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bindreply udpreply
log: error # connect disconnect iooperation
}
These are the errors I'm getting in the log, which I don't really understand. I could not find much on Google about them...
Sep 26 12:11:49 (1474906309.183623) sockd[7168]: info: Dante/server[1/1] v1.4.1 running
Sep 26 12:12:25 (1474906345.212038) sockd[7171]: info: block(1): tcp/connect ]: 127.0.0.1.41578 127.0.0.1.1080 -> 94.102.58.15.41578 0.0.0.1.80: connect(2) to 0.0.0.1.80 from 94.102.58.15.41578 failed: Invalid argument
Sep 26 12:12:25 (1474906345.212157) sockd[7171]: info: block(1): tcp/accept ]: 127.0.0.1.41578 127.0.0.1.1080: request was not performed due to error: connect(2) to 0.0.0.1.80 from 94.102.58.15.41578 failed: Invalid argument
Sep 26 12:12:25 (1474906345.212675) sockd[7171]: info: block(1): tcp/connect ]: 127.0.0.1.41579 127.0.0.1.1080 -> 94.102.58.15.41579 0.0.0.1.80: connect(2) to 0.0.0.1.80 from 94.102.58.15.41579 failed: Invalid argument
Sep 26 12:12:25 (1474906345.212703) sockd[7171]: info: block(1): tcp/accept ]: 127.0.0.1.41579 127.0.0.1.1080: request was not performed due to error: connect(2) to 0.0.0.1.80 from 94.102.58.15.41579 failed: Invalid argument
Sep 26 12:12:25 (1474906345.213155) sockd[7171]: info: block(1): tcp/connect ]: 127.0.0.1.41580 127.0.0.1.1080 -> 94.102.58.15.41580 0.0.0.1.80: connect(2) to 0.0.0.1.80 from 94.102.58.15.41580 failed: Invalid argument
Sep 26 12:12:25 (1474906345.213182) sockd[7171]: info: block(1): tcp/accept ]: 127.0.0.1.41580 127.0.0.1.1080: request was not performed due to error: connect(2) to 0.0.0.1.80 from 94.102.58.15.41580 failed: Invalid argument
Your SOCKS client is probably sending a request using the SOCKS4A protocol which is an extension to SOCKS4 that allows clients to send destination domain names rather than IP addresses to the proxy server.
Unfortunately, Dante doesn't support SOCKS4A as of version 1.4.2. Its status page lists the protocols it supports.
Modify the client to resolve the remote hostname to an IP address locally before sending its request to the proxy server and it should work. Or, better, use the SOCKS5 protocol if it's supported by the networking libraries you're using.
The block-messages means the SOCKS client is requesting that Dante connects to the IP address 0.0.0.1, port 80. Since that is an invalid IP address, the connect fails, and that is what Dante reports.
In other words, the problem is on the SOCKS client side.