Archive for July 2008

Monitor GMAIL Account Activity Using Perl

As recently noted over at my favorite website lifehacker.com…Google has recently added a nice feature to GMAIL that allows you to see your account activity.
If you scroll to the bottom of you Inbox, you will see something that looks like this.

This really got me thinking. This is a great feature, however its lacking in a few areas.
1) I’d like to know when suspicious activity is occuring. Although the likelyhood is low (that someone is trying to hack in…at least I  think), I’d still like to have alerts that tell me there is an issue.
2)  I’d also like tracking details in case there is an issue, I can try to figure out who it is,and where they are coming from.  Actually, when I first looked at this, I noticed someone or somethign was hitting me from 67.228.182.163. Using my technical efficentcies…I was able to track it back to Xoopit. Another service I found over at lifehacker.com.
The process was basically taking the IP in the activity window and doing a whois lookup. The problem is that the whois, generally returns the ISP. However, luckily there was an RWHOIS available. That pointed me to Xoopit!
Well, from here I decided to write a script that will run every 30 mins, Alert me if something looks suspicious.
It does the following.
1) Logs into Gmail.
2) Pulls up Account Activity Page
3) Parses Page.
4) If IP is not in the whitelist…
a. does a Whois Loopup on the IP
b. generates

5) If the count of suspicious IP’s is > 0. Sends and email using Gmail as SMTP server to whomever cares to know.
HERE IS THE CODE: Use it as you wish. If you have issues or like it, please leave comments.

#!c:\\perl\\bin
#use strict;
use WWW::Mechanize;
use HTTP::Cookies;
use HTML::TableExtract;
use Net::Whois::IP qw(whoisip_query);
use chilkat;
our $count = 0;
my %Whitelist =
(
‘67.228.182.163′ => ‘Xoopit’,
‘ip.ip.ip.ip’ => ‘Work’
);
 
my $capture = GetGoogleActivity();
my $HTML = ParseActivity($capture);
 
print "Count = $count\n";
if ($count > 0) {
DoEmail("GMAIL: Possible Suspicious Activity", $HTML);
}
 
 
 
sub GetGoogleActivity {
###go to login page and login.
my $url = "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=1k96igf4806cy&ltmpl=default&ltmplcache=2&hl=en";
my $username = "someone@gmail.com";
my $password = "password";
my $mech = […]

MAGIC FORMULA CHANGES FOR THE WEEK OF 07-07-2008

THESE STOCKS HAVE BEEN DROPPED:
AFCE
BIDZ
DFZ
FTAR
IUSA
KLAC
LGTY
SYX
VRGY
WINS
THESE STOCKS HAVE BEEN ADDED:
APKT
HANS
JCOM
MNST
MTW
NVDA
PROJ
RAIL
TRA
UEPS

Import Subscriptions into Google Reader

 1) Go to http://www.google.com/reader (you must have a google  account)
 

2) Click Manage Subscriptions in the feeds pane as seen above.
 
3) Click the Import/Export Tab
4) Browse to the file you want to import
5) and then click Upoad
 

Using Evernote and BlogJet Simplify my Wordpress Blogging!

Although I have been in the technology field for ~10 years, I am rather new to blogging, and am quite frustrated with how difficult is seems to be to post an entry which has a bunch of images in it. This is especially true when you are writing up a how to with screen shots and […]

HOW TO Merge PDF files using PDFSAM

“PDF Split and Merge is an easy to use tool to merge and split pdf documents. Console and GUI versions are available. The GUI is written in Java Swing and it provides functions to select files and set options. It’s made over the iText library.”
You will need the Java Run Time environment installed on […]

FLEX 3 Custom Event Listener with Popup window

Create the custom Event.
In this case I will need to pass an object along with the event.
Save the actionscript as ParseFixClickEvent.as
package modules.FIXParser.Events
{
import flash.events.Event;
 
public class ParseFixClickEvent extends Event
{
public var params:Object;
public static const PARSE:String = “parseEvent”;
public function ParseFixClickEvent(params:Object, type:String )
{
super(type);
this.params = params;
}
public override function clone():Event {      
     return new ParseFixClickEvent(params,type);
    }
public override function toString():String
  {
   return formatToString(”ParseFixClickEvent”,”type”);
  }
}
}
 
 
In my case I […]

Free Windows Screen Capture Program

Recently I’ve been trying to put some tutorials together and I needed a better application to handle my screen shots that windows PrintScreen and Alt-Print Screen. I wanted to be able to take small parts of an application without having to do an alt-PrintScreen and then edit it in my favorite image editor MS Paint […]

Using FireUploader to Move Files To And From Google Docs

is is a video tutorial for using FireUploader (firefox plugin) to upload to GoogleDocs.


Warning: stristr() [function.stristr]: Empty delimiter in /home/thegard5/public_html/gregjessup/wp-content/plugins/wassup/wassup.php on line 2093