WHOIS IP Tracker

By Kaj on May 05, 2013

This script is triggered when you're an IRC operator and you're using WHOIS.

The script will track the IP of the user using www.ip-tracker.org and output the geographical information at the end of the whois:

Kaj is Kaj@sadmin. Kaj
Kaj is connecting from *@host ip
Kaj is a Services Administrator
Kaj End of /WHOIS list.

Kaj is connnecting from (Contintent: Europe (EU), Country: Belgium, State: Vlaams-Brabant, City: city, ISP: Telenet N.V.)
Kaj is at Organization Telenet N.V.

; IP Tracker Script by Kaj
; ONLY WORKS FOR IRC OPERS!
; Checks users their IP @ ip-tracker.org

raw 378:*: {
  if ($regex($1-,/is connecting from [*][@](.+)\s(.+)/)) {
    var %host $regml(1)
    var %ip $regml(2)

    set %tracknick $$2
    set %trackip %ip

    sockopen ip-tracker ip-tracker.org 80
  }
}

on *:SOCKOPEN:ip-tracker: {
  if ($sockerr) { 
    echo -a Error: $sock(tracert).wsmsg  
  }
  else {
    sockwrite -n $sockname GET /locator/ip-lookup.php?ip= $+ %trackip HTTP/1.0
    sockwrite -n $sockname Host: www.ip-tracker.org
    sockwrite -n $sockname Connection: Keep-Alive
    sockwrite -n $sockname $crlf
  }
}

on *:SOCKREAD:ip-tracker: { 
  sockread %ip-tracker

  if $regex(%ip-tracker,/<th>IP Address:</th> <td class='tracking'>([^<>]+)/) {
    var %ip $regml(1)
  }

  if $regex(%ip-tracker,/<th>Hostname:</th> <td>([^<>]+)/) {
    var %host $regml(1)
  }

  if $regex(%ip-tracker,/<th>Continent:<\/th><td class='tracking'>([^<>]+)/) {
    var %continent $regml(1)
  }

  if $regex(%ip-tracker,/<th>Country:</th><td>([^<>]+)/) {
    var %country $remove($regml(1),&nbsp;)
  }

  if $regex(%ip-tracker,/<th>Capital:</th><td class='tracking'>([^<>]+)/) {
    var %capital $regml(1)
  }

  if $regex(%ip-tracker,/<th>State:</th><td class='tracking'>([^<>]+)/) {
    var %state $regml(1)
  }

  if $regex(%ip-tracker,/<th>City Location:</th><td>([^<>]+)/) {
    var %city $regml(1)
  }

  if $regex(%ip-tracker,/<th>ISP:</th><td class='tracking'>([^<>]+)/) {
    var %isp $regml(1)
  }

  if $regex(%ip-tracker,/<th>Organization:</th><td>([^<>]+)/) {
    var %organization $regml(1)

    echo -a %tracknick is connnecting from (Contintent: %continent $+ , Country: %country $+ , State: %state $+ , City: %city $+ , ISP: %isp $+ )
    echo -a %tracknick is at Organization %organization
  }
}

Comments

Sign in to comment.
[[Chris]]   -  Jun 19, 2018

Please update this, it does not work anymore :(

 Respond  
play4free2   -  Jan 14, 2014

It has quit displaying City and State. Looks like they changed the website some. If the city or state are showing on the website as unknown it shows unknown. But If the city and state are showing on the website it don't show them.

nox`  -  Jan 15, 2014
on *:sockread:ip-tracker: {
  var %ip-tracker
  sockread %ip-tracker
  if ($regex(track-ip,%ip-tracker,/<th>(?!IDD)([^<]+)<\/th><td(?: class='(?:tracking(?: lessimpt)?|vazno)')?>(.+?)<\/td>/g)) echo 7 -ag $remove($regsubex($str(;,$regml(track-ip,0)),//g,$gettok($regml(track-ip,\n),1,38) $chr(32)),;)
}
Sign in to comment

play4free2   -  May 06, 2013

I added this to my mIRC client yesterday and it works good, I do have a question. I do a little coding myself but am no good at sockets. I checked the website that this pulls from and saw that it checks for proxies, is there anyway to add that to this?

blackvenomm666  -  May 06, 2013

yes there is a way to add it to it

 -  Jun 20, 2013

Love the script, but it does not dis[lay the city. I get this every time:

Piero is connnecting from (Contintent: Africa (AF), Country: South Africa, State: Northern Cape, City: , ISP: )
Piero is at Organization Telkom-Internet

No city displayed

play4free2  -  Jun 21, 2013

@raycomp Try this, Change line 57 to:

 if $regex(%ip-tracker,/<th>City Location:</th><td>([^<>]+)/) { 

I changed it in mine and it's working now.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.