Jump to content

For all those scripters waiting for that!


lil Toady

Recommended Posts

  • MTA Team

since we can't trace people using dnsstuff (/slap Tommis) we had no new trace scripts..

Well, here's one new i wrote today ;)

EDIT: The script now works both with SA and 0.5

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.getid($1,$4),$v1,-1),$2)
 if ($3 == !trace) {
   if (%a == -1) mta.msg $1 $2 Error - Absent ID
   else my.trace $1 %a
 }
}
alias my.trace {
 set %my.trace $1 $2
 if (!$sock(my.trace $+ $mta.ip($1,$2))) sockopen my.trace $+ $mta.ip($1,$2) www.completewhois.com 80
}
on *:SOCKOPEN:my.trace*:{
 tokenize 32 %my.trace
 if ($sockerr > 0) {
   sockclose $sockname
   mta.say $1 Trace: An error has occured. (socket error)
 }
 else {
   sockwrite -n $sockname GET /cgi2/rbl_lookup.cgi?query= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1
   sockwrite -n $sockname User-Agent: MSIE 6.0
   sockwrite -n $sockname Host: www.completewhois.com
   sockwrite $sockname $crlf 
 }
}
on *:SOCKCLOSE:my.trace*:{
 unset %my.trace
}
on *:SOCKREAD:my.trace*:{
 var %t
 sockread %t
 if (country-rirdata isin %t) {
   tokenize 32 %my.trace
   if ($right($gettok($dialog(mta).title,6,32),-1) < 4) mta.say $1 $+($mta.name($1,$2),$chr(40),$mta.ip($1,$2),$chr(41)) - Location: $gettok(%t,2-,58)
   else mta.text $1 $+($mta.nick($1,$2),$chr(40),$mta.ip($1,$2),$chr(41)) - Location: $gettok(%t,2-,58)
   sockclose $sockname
 }
}

have fun

Edited by Guest
Link to post
  • 3 weeks later...
since we can't trace people using dnsstuff (/slap Tommis) we had no new trace scripts..

Well, here's one new i wrote today ;)

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
 if ($3 == !trace) {
   if (%a == -1) mta.msg $1 $2 Error - Absent ID
   else my.trace $1 %a
 }
}
alias my.trace {
 set %my.trace $1 $2
 if (!$sock(my.trace $+ $mta.ip($1,$2))) sockopen my.trace $+ $mta.ip($1,$2) www.completewhois.com 80
}
on *:SOCKOPEN:my.trace*:{
 tokenize 32 %my.trace
 if ($sockerr > 0) {
   sockclose $sockname
   mta.say $1 Trace: An error has occured.
 }
 else {
   sockwrite -n $sockname GET /cgi2/rbl_lookup.cgi?query= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1
   sockwrite -n $sockname User-Agent: MSIE 6.0
   sockwrite -n $sockname Host: www.completewhois.com
   sockwrite $sockname $crlf 
 }
}
on *:SOCKCLOSE:my.trace*:{
 unset %tr.*
}
on *:SOCKREAD:my.trace*:{
 var %t
 sockread %t
 if (country-rirdata isin %trace) {
   tokenize 32 %my.trace
   mta.say $1 $+($mta.name($1,$2),$chr(40),$mta.ip($1,$2),$chr(41)) - Location: $gettok(%t,2-,58)
   sockclose $sockname
 }
}

have fun

You have an error in it :wink:

i guess u neatened it up to post it here and missed one of ur vars.

also, urs is for vc of course, use this for SA:

on *:SIGNAL:mta.command:{
 var %a = $iif((!$4),$2,$iif($mta.getid($1,* $+ $4 $+ *),$v1,$2))
 if ($3 == !trace) my.trace $1 %a
}
alias my.trace {
 set %my.trace $1 $2
 if (!$sock(my.trace $+ $mta.ip($1,$2))) sockopen my.trace $+ $mta.ip($1,$2) www.completewhois.com 80
}
on *:SOCKOPEN:my.trace*:{
 tokenize 32 %my.trace
 if ($sockerr > 0) {
   sockclose $sockname
   mta.text $1 Trace: An error has occured.
 }
 else {
   sockwrite -n $sockname GET /cgi2/rbl_lookup.cgi?query= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1
   sockwrite -n $sockname User-Agent: MSIE 6.0
   sockwrite -n $sockname Host: www.completewhois.com
   sockwrite $sockname $crlf 
 }
}
on *:SOCKCLOSE:my.trace*:{
 unset %tr.*
}
on *:SOCKREAD:my.trace*:{
 var %t
 sockread %t
 if (country-rirdata isin %t) {
   tokenize 32 %my.trace
   mta.text $1 $mta.nick($1,$2) ( $+ $mta.ip($1,$2) $+ ) - Location: $gettok(%t,2-,58)
   sockclose $sockname
 }
}

Link to post
  • MTA Team

can't see what did you change :P maybe just cause im a bit sleepy. w/e yeh few days ago i updated the script in the first post without testing it, just tested and it was returning "HTTP 1.1 OK" instead of location :P fixed already and updated my first post

Link to post
can't see what did you change :P maybe just cause im a bit sleepy. w/e yeh few days ago i updated the script in the first post without testing it, just tested and it was returning "HTTP 1.1 OK" instead of location :P fixed already and updated my first post

heh, well when i read thru it i noticed,

if (country-rirdata isin %trace) {

maybe u had it as %trace before then changed it to %t.

Also, unset %tr.* what r u unsetting? i dont see any vars set beginning with %tr, shouldnt it be unset %my.* ?

Link to post
  • MTA Team

yeah, first time i posted the script i had 3 global vars, %tr.sid, %tr.pid, %tr.ip, then thought of useing only one variable, edited the post without testing, so got some mistakes :P Should be ok now, Thnx

Link to post
mta:vc? or mta:sa?

Which is this for?

the one i posted was for sa, note: mta.nick($1,$2)

the one above it is for vc, note: mta.name($1,$2)

if u want it for VC remember to fix the error in this line:

if (country-rirdata isin %trace) {

to:

if (country-rirdata isin %t) {

have fun:)

Edited by Guest
Link to post

Hey,

That is because of teh site, dns-stuff.com blocking the use of gus with thier site. They claim it to be illegal for my scripts to use thier site. I still find this funny, but heck, they blocked it. So, inspite of that, master has saved the day and created this script, with a new site :P So, just replace it with this one. This will fix the problem. Btw, nice job mastah ;)

Cya,

Tommis

Link to post

So... This is what i done:

This was there:

on *:SOCKREAD:gus.trace*:{
 sockread %trace
 tokenize 32 %trace
 if (IP: isin %trace) set %iptracer.ip $2-
 elseif (Country: isin %trace) set %iptracer.c $remove($2-,[,],(High))
 elseif (City: isin %trace) {
   mta.text %tr.serv %tr.name $+ (IP: $ClassB(%iptracer.ip) $+ .***.*** $+ ) - Location: %iptracer.c
   if ((%iptracer.ip) && (%iptracer.c) && (%iptracer.ip != Unknown) && (%iptracer.c != unresolved)) !writeini -n " $+ $scriptdir $+ gus.dns.ini" CACHE $ClassC(%iptracer.ip) %iptracer.c
   sockclose $sockname
 }
 unset %trace
 .timerruns 1 1 unset %ip
}
on *:DNS:{
 if ($raddress) {
   if ($raddress isnum) {
     write " $+ $scriptdirdns.tmp $+ " $raddress
     gus.trace
   }
   else { 
     var %tot = $dns(0)
     var %i = 1
     if (%tot > 1) {
       while (%i  0) {
   sockclose $sockname
   mta.text $1 Trace: An error has occured.
 }
 else {
   sockwrite -n $sockname GET /cgi2/rbl_lookup.cgi?query= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1
   sockwrite -n $sockname User-Agent: MSIE 6.0
   sockwrite -n $sockname Host: www.completewhois.com
   sockwrite $sockname $crlf
 }
}
on *:SOCKCLOSE:my.trace*:{
 unset %tr.*
}
on *:SOCKREAD:my.trace*:{
 var %t
 sockread %t
 if (country-rirdata isin %t) {
   tokenize 32 %my.trace
   mta.text $1 $mta.nick($1,$2) ( $+ $mta.ip($1,$2) $+ ) - Location: $gettok(%t,2-,58)
   sockclose $sockname
 }
} 

And it isnt still work =S What i do wrong?

Link to post
  • 3 months later...
  • 2 months later...
  • 2 weeks later...
  • 2 months later...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...