4 -- de-anonimize users behind nat.
5 -- returns first 9 chars of dns, i.e. your dns
14 serv
:setoption("reuseaddr",true)
15 assert(serv
:bind("0.0.0.0",113))
21 local r
= socket
.select(ins
, nil)
23 local newc
=serv
:accept()
24 table.insert(ins
,newc
)
26 for _
,v
in ipairs(r
) do
27 local ln
= v
:receive("*l") or ""
28 local p1
, p2
= ln
:match("^(%d*)[ \t]*,[ \t]*(%d*)")
29 if ln
and p1
and p2
then socket
.protect(function()
32 local remhost
, remport
= socket
.try(v
:getpeername())
33 local rp
=io
.popen("conntrack -L conntrack -p tcp --state ESTABLISHED --orig-port-dst "..p2
.." --reply-port-dst "..p1
.." -d "..remhost
,"r")
34 local rpl
= rp
:read("*l") or ""
36 local h
=rpl
:match(".-src%=([^ ]*) ")
38 local hn
=socket
.try(socket
.dns
.tohostname(h
or ""))
39 local rhn
=hn
:match("^([^.]*)"):sub(1,9)
40 socket
.try(v
:setoption("linger", {on
=true,timeout
=5}))
41 socket
.try(v
:send(p1
.." , "..p2
.." : USERID : UNIX : "..rhn
.."\r\n"))
45 for idx
,tv
in ipairs(ins
) do