Find Invisible Users In Gmail


Finding who is invisible is something that I always wanted to do.It’s always fun to ping a person who feels none can see him/her online. While studying XMPP protocol I found out that even when the person is offline the chat client knows that person is online.
The Chat Client should know who all are really online at any given time.This is because even when the person is invisible he/she should have a buddy list showing online users.

Ah!! Guess you did’nt understand a word till now.Let me try making it simpler.

Let’s assume two users A and B are online now.Both A and B are Available (ie the chat client shows them online).Both A and B has a list of online users in his chat client(eg:google talk,gmail inbox chat,pidgin). Now this online users need to be kept constantly updated. This is done by the XMPP protocol(this is the protocol used by google for it’s chat).Now even if B is invisible still it needs to keep it’s online users list updated as it needs to show B the online users.
So whenever B logs into his account it initially sends a presence notification to all the users in it’s contacts list saying that B is online as “Please show me online in our online user list”.
All online users respond back with their online status and status message.
This is where the invisible people shows up.The chat server replies back with their status. The only difference in them is that they respond with their status as “Unavailable“.
So my aim was to find out all users that respond back to me with Unavailable status and display them.
Ok enough of explanation of how it works let’s see the code

#!/bin/perl

use strict;
use Net::XMPP;

my $sttime=time;
print "Username:$ARGV[0]\n";
my $username = "$ARGV[0]";
my $password = "$ARGV[1]";

my $resource = "SNIFFER";

my $hostname = 'talk.google.com';
my $port = 5222;
my $componentname = 'gmail.com';
my $Contype = 'tcpip';
my $tls = 1;

my %online;
my $Con = new Net::XMPP::Client();
$Con->SetCallBacks(presence=>\&presence_ch);

my $status = $Con->Connect(
hostname => $hostname, port => $port,
componentname => $componentname,
connectiontype => $Contype, tls => $tls);

if (!(defined($status))) {
print "ERROR:  XMPP connection failed.\n";
print "        ($!)\n";
exit(0);
}

# Change hostname
my $sid = $Con->{SESSION}->{id};
$Con->{STREAM}->{SIDS}->{$sid}->{hostname} = $componentname;

# Authenticate
my @result = $Con->AuthSend(
username => $username, password => $password,
resource => $resource);

if ($result[0] ne "ok") {
print "ERROR: Authorization failed: $result[0] - $result[1]\n";
exit(0);
}
else
{
print "Logged in Sucessfull!\nInvisible Users:\n";
}
$Con->PresenceSend(show=>"Available");
sub presence_ch
{
my $p=0;
my $x;
my $presence = pop;
my $from = $presence->GetFrom();
$from =~ s/([a-zA-Z@.]*)\/(.*)/$1/;
if($presence->GetType() eq "unavailable")
{
if (exists $online{$from})
{
delete($online{$from});
}
else
{
$online{$from}=$presence->GetType()."!!" .$presence->GetStatus();
print $from."\n";
}
}
else
{
$online{$from}=$presence->GetType()."!!" .$presence->GetStatus();
}
}
my $currtime;
while(1)
{
$currtime=time;
if($currtime-$sttime>10)
{last;}
my $res=$Con->Process(1);
if(!(defined($res))){ last;}}

XMPP protocol needs SSL encryption.So you need to install the perl modules for it.So before trying out the code make sure u have the following modules:

  • IO ::Socket ::SSL (>=0.81)
  • XML ::Stream
  • Net ::XMPP
  • Authen ::SASL

To install the packages open the CPAN shell using the command

sudo perl -MCPAN -e 'shell'

Followed by

install <module name>

for each of the module listed above
Also you need to install the package send-xmpp and it’s dependecies

sudo apt-get install send-xmpp

Run the program by running it as

perl invi.pl <username> <password>

If you need Windows Version of the tool, check the Comment #39
Worked?? Did’nt work?? Comment me


, , , , , , ,

  1. #1 by dolly on October 23, 2010 - 1:16 am

    hi srijith and vyompv
    hope u will fix it soon…plz help

  2. #2 by Srijith R on October 24, 2010 - 12:45 pm

    Hey I dont see a way to fix it currently. There is not distinction between offline and invisible that i can notice currently. I will try to get a method.

  3. #3 by vjjoe on October 28, 2010 - 5:53 am

    hey, don’t invisible user need to constantly ping everyone to get their status? or it is the available user who broadcast their status to the world? if it is the first case,is there a way to find out the users who keep on pinging you but not visible? i am not sure if that make sense, i am not technical. thanks

  4. #4 by Yogesh on November 4, 2010 - 11:16 am

    Well, look at the bright side guys .. you made GOOGLE change THEIR code :)
    Good job ;)
    Cheers

  5. #5 by a2l on November 4, 2010 - 12:17 pm

    hii srijith,

    wat vjjoe said is correct… right..?? so there must b some way…. hope you ll find it soon…. :-)

  6. #6 by a2l on November 5, 2010 - 6:13 am

    Hey wat I hve understood is presence->GetType() is not returning any value….. so wat??? ;)

  7. #7 by dolly on November 8, 2010 - 9:41 pm

    hey what i hv seen is it is working for ids logged from orkut but not gmail…it can help u may b

  8. #8 by dolly on November 8, 2010 - 9:48 pm

    and here is a python script may b its using some other hole in security , don’t know working or not ..

    http://securityoverride.com/forum/viewthread.php?thread_id=692&rowstart=0

  9. #9 by vyompv on November 14, 2010 - 2:07 pm

    HI Srijith and others

    There is one final way to find invisible users on gmail. Check out this new way.

    http://vyompvblog.blogspot.com/2010/06/find-invisible-users-of-gtalk-gmail.html

    Check out before it gets patched by Google.

  10. #10 by Vijay on December 11, 2010 - 12:38 pm

    hey, thanks. Srijith & vyompv
    by the way wats ur age guys ?

  11. #11 by Srijith R on December 13, 2010 - 8:18 am

    Why does it matter?

  12. #12 by Saurabh on March 27, 2011 - 4:46 am

    Hi,

    After putting invi.pl username password

    i m getting this

    sendxmpp version 0.0.8, Copyright (c) 2004,2005 Dirk-Jan C. Binnema
    usage: sendxmpp [options]
    or refer to the the sendxmpp manpage

    How will i get the information?? Please help sir..

  13. #13 by gargi on July 4, 2011 - 5:35 pm

    Hi. I have followed all stpes mentioned in #39. but when i enter my username it not type anything after USername field. but it gives “ERROR: Authorization failed” error and my username is entered in after path name where we typed perl invi.pl. Can anyone please help me to solve this error and find invisible person?

  14. #14 by Srijith R on July 5, 2011 - 8:59 am

    I can help you solve the authentication issue but still the script doesn’t show invisible users now. Google has changed the way it notifies the invisible users. I need to figure out a new way to find invisible users.

  15. #15 by Harshdeep on August 9, 2011 - 6:37 pm

    Hello, I checked out the #39 comment. But didn’t get it. how to install those packages on windows. install is not recognized as command by windows??

    Can you please tell me how to do the same..
    Thanks in advance.

  16. #16 by Harshdeep on August 9, 2011 - 7:46 pm

    ERROR: XMPP connection failed.
    (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

  17. #17 by Srijith R on August 10, 2011 - 8:12 am

    The Way google used XMPP changed. I need to change the script to work on the changes

  18. #18 by RJ on August 23, 2011 - 2:53 am

    any update on the new version of the script??or any other way to find invisible users in gmail?

  19. #19 by Cait on October 13, 2011 - 2:34 am

    I read about your script to find invisible users in gmail. Were you able to update it?

    Thanks,
    Caity

  20. #20 by Srijith R on October 13, 2011 - 2:53 am

    Hi Cait,
    I don’t see there is a difference in the messages send from google for invisible vs offline. Currently I don’t see a method. But will post one as soon as I find another way to get it.

  21. #21 by Ravi on November 11, 2011 - 1:25 pm

    Hi Srijith R,

    first i thank you for your excellent work.
    Every thing working fine, it logs in, but its not displaying anything after showing the message “Invisible users: ”
    and returing back to cmd path i am running on win xp.

    Pls reply if i am doing any mistake.

  22. #22 by Arun on November 18, 2011 - 8:11 pm

    Ahh.. I’m not patient enough to work this much! :D
    Is there any workaround without manually using this script but using some clients like empathy?

    For finding the people who have blocked us there is a trick using empathy! right?

  23. #23 by Arun on November 18, 2011 - 8:14 pm

    Also one more thing sreejith, now I think facebook is also using XMPP for its chat!
    So may be you will be able to make a similar thing for it ! :)

  24. #24 by Mohan on November 26, 2011 - 7:35 pm

    Hi, I’m able to run the script successfully in winXP. But I’m not seeing Invisible users list as expected.

  25. #25 by Kannan on December 1, 2011 - 8:40 pm

    I am getting the following error while installing
    IO::Socket::SSL

    the program can’t start because libeay32_.dll is missing from your computer.Try reinstalling the program to fix this problem.”

  26. #26 by STeve on December 5, 2011 - 8:29 pm

    Well I dont think there is a “smart” way now to do this. The only way is by the “go off record” and ping method. This is kinda silly.

    Anyway, the reason is.. when a person goes invisible google sets the presence info in its server (IQ format) with “invisible” attribute to true. But when it broadcasts the presence stanza it doesnt give out that info. It just gives whether the person is available or unavailable. and if available the status is also attached. (default and dnd (busy)).

    Ive tried this. Ive created a java code using smack to listen to presence changes of my contacts. and when when a contact goes invisible I get the “unavailable” presence packet only. And this info is stored on the server and hence even if the user is offline the presence info is available. So the user is effectively offline when they are invisible.

    But the google talk doc lies something. It says “when a user updates it presence the presence info is sent to all contacts “UNLESS” the user is invisible!! ”

    I thought I could use this. But when I listened to the server it seem to send presence info all the time. So theres no way as of now.

    But if someone can think outta the box we can crack this.

  27. #27 by Mangesh on January 16, 2012 - 11:47 am

    I tried it so many times but following error occurs:-

    “use” not allowed in expression at invi.pl line 2, at end of line
    syntax error at invi.pl line 2, near “use strict”
    BEGIN not safe after errors–compilation aborted at invi.pl line 4.

  28. #28 by Srijith R on February 2, 2012 - 10:00 pm

    I think there is something wrong with your perl installation or how you run it. If “use strict” is the only line which gives an issue. You can remove that line. Its not essential to run the code.

  29. #29 by Pankaj on March 13, 2012 - 11:23 pm

    done same as instructed above in comment#39 on windows
    but giving error

    ERROR: Authorization failed: -

  30. #30 by a on May 28, 2012 - 10:42 pm

    This doesn’t work anymore (testing with my own two accounts).

(will not be published)


Switch to our mobile site