Socks v5 protocol

T

Tannev Vitaliy

Hello, only I start to study this language. And at once a greater
problem: ((

I can not understand connection under the report socks5 in any way, and
connection, inquiry of the version and methods of authorization passes
successfully, and here when I try to transfer the removed host and port
I socks-server does not see the address in inquiry, in broad gullies
writes, approximately it:

[11/Jun/2008:16:45:39 MSD] [19267] 192.168.0.9 "" "CONNECT" CONNREFUSED
0 0 - (192.168.0.9:51012 -> 210.199.9.0:0)
[11/Jun/2008:16:45:39 MSD] [19270] [ERRO] $ConnectServing$: (Connection
timed out).
[11/Jun/2008:16:45:39 MSD] [19270] 192.168.0.9 "" "CONNECT" CONNREFUSED
0 0 - (192.168.0.9:51014 -> 210.199.9.0:0)
[11/Jun/2008:16:45:39 MSD] [19272] [ERRO] $ConnectServing$: (Connection
timed out).
[11/Jun/2008:16:45:39 MSD] [19272] 192.168.0.9 "" "CONNECT" CONNREFUSED
0 0 - (192.168.0.9:51016 -> 210.199.9.0:0)


And here a code of connection:


................
sock.setHost("194.67.23.111",25)
..............
def hextobin(str)
temp = str.gsub("\s", "");
ret = []
(0...temp.size()/2).each{|index| ret[index] = [temp[index*2,
2]].pack("H2")}
return ret
end

def setHost(domain,port)
host=domain
h="05 01 00"
if host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
ip=[$1.to_i,$2.to_i,$3.to_i,$4.to_i].pack('CCC')
h+=" 01 " +[host.size].pack('C')+ip
else
h+=" 03" + [host.size].pack('C') + host
end
h+=[port].pack('n')
@sock.write(hextobin(h))
[email protected](1).unpack("H*").to_s
return t[3..3]
end
.............



As we see, I ask ip: 194.67.23.111:25, and up to socks-server reaches:
210.199.9.0:0.... I Turn out somehow not so I pack data: (((.. Prompt
please, that can be not so: (((
 
R

Robert Klemme

2008/6/11 Tannev Vitaliy said:
Hello, only I start to study this language. And at once a greater
problem: ((

I can not understand connection under the report socks5 in any way, and
connection, inquiry of the version and methods of authorization passes
successfully, and here when I try to transfer the removed host and port
I socks-server does not see the address in inquiry, in broad gullies
writes, approximately it:

[11/Jun/2008:16:45:39 MSD] [19267] 192.168.0.9 "" "CONNECT" CONNREFUSED
0 0 - (192.168.0.9:51012 -> 210.199.9.0:0)
[11/Jun/2008:16:45:39 MSD] [19270] [ERRO] $ConnectServing$: (Connection
timed out).
[11/Jun/2008:16:45:39 MSD] [19270] 192.168.0.9 "" "CONNECT" CONNREFUSED
0 0 - (192.168.0.9:51014 -> 210.199.9.0:0)
[11/Jun/2008:16:45:39 MSD] [19272] [ERRO] $ConnectServing$: (Connection
timed out).
[11/Jun/2008:16:45:39 MSD] [19272] 192.168.0.9 "" "CONNECT" CONNREFUSED
0 0 - (192.168.0.9:51016 -> 210.199.9.0:0)


And here a code of connection:


................
sock.setHost("194.67.23.111",25)
..............
def hextobin(str)
temp = str.gsub("\s", "");
ret = []
(0...temp.size()/2).each{|index| ret[index] = [temp[index*2,
2]].pack("H2")}
return ret
end

def setHost(domain,port)
host=domain
h="05 01 00"
if host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
ip=[$1.to_i,$2.to_i,$3.to_i,$4.to_i].pack('CCC')
h+=" 01 " +[host.size].pack('C')+ip
else
h+=" 03" + [host.size].pack('C') + host
end
h+=[port].pack('n')
@sock.write(hextobin(h))
[email protected](1).unpack("H*").to_s
return t[3..3]
end
.............



As we see, I ask ip: 194.67.23.111:25, and up to socks-server reaches:
210.199.9.0:0.... I Turn out somehow not so I pack data: (((.. Prompt
please, that can be not so: (((

I do not know SOCKS but "CONNREFUSED" usually indicates a network issue, namely:
- firewall blocks access
- there is nothing listening on the socket
- maybe even system is down.

Also, it seems weird that you want to access port 0 (the log says
"210.199.9.0:0") - AFAIK this is reserved and not possible anyways.

Cheers

robert
 
T

Tannev Vitaliy

I wish to get access to:
194.67.23.111:25,
but probably data spoil, or I incorrectly send them as socks-server,
thinks, that I want will be connected to:
210.199.9.0:0....

sock.setHost (" 194.67.23.111", 25)

And up to a server why that other data reach: (
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top