reading wtmp

 code, perl, security, tech  Comments Off on reading wtmp
Sep 102012
 

Have a wtmp file you need read? A nice perl one liner to do so: perl -we ‘@type=("Empty","Run Lvl","Boot","New Time","Old Time","Init","Login","Normal","Term","Account");$recs = ""; while (<>) {$recs .= $_};foreach (split(/(.{384})/s,$recs)) {next if length($_) == 0;my ($type,$pid,$line,$inittab,$user,$host,$t1,$t2,$t3,$t4,$t5) = $_ =~/(.{4})(.{4})(.{32})(.{4})(.{32})(.{256})(.{4})(.{4})(.{4})(.{4})(.{4})/s;if (defined $line && $line =~ /\w/) {$line =~ s/\x00+//g;$host =~ s/\x00+//g;$user =~ s/\x00+//g;printf("%s %-8s %-12s %10s %-45s\n",scalar(gmtime(unpack("I4",$t3))),$type[unpack("I4",$type)],$user,$line,$host)}}print"\n"’ < /var/log/wtmp Thanks to: http://www.hcidata.info/wtmp.htm

 Posted by at 6:27 pm on September 10, 2012  Tagged with: , ,

The Sleep of Reason Produces Monsters

 art, philosophy, rememberance, science, security  Comments Off on The Sleep of Reason Produces Monsters
Sep 102012
 
The Sleep of Reason Produces Monsters

A monumental work… what a great line as well.  From the immortal Goya. Always stay vigilant….   (Image from the truly marvelous Met Museum of Art web pages, they have wonderful hi-def scans of so much… thanks!!!  What a tremendous way to bring art to the people – this bit isn’t even being physically shown right now, but I can get a real idea of what it’s about by […]