Thanks Rob #!/usr/bin/perl -w # find.hackers version 1.1sf by Jason "FrogBoy" Blakey # Nov 6 / 1997 # jblakey@istar.ca # ps - sf stands for stupid fix - in the case where there is a recorded call with # no username... # This program, when fed a radius logfile, builds 2 hash tables... # and scans those hash tables for instances where a single username # has been used from greater than a specified number of phone numbers. # It also scan for instances where a single number has connected # using a number of different usernames... # Here we define the minimum number of numbers that a single username # should connected from... $minnumofnums = 1; # And here we define the minimum number of names that a single phonenum should # connect from... $minnumofnames = 1; # NOTHING AFTER THIS POINT SHOULD HAVE TO BE CHANGED... if ($#ARGV != 0){ print "Usage: find.hackers <radius logfile>\n"; exit(); } open(FILE,$ARGV[0]); $founduser = 0; while ($currentline = <FILE>){ chop($currentline); if ($currentline =~ /User-Name = "(\S+)"/){ $currentuser = $1; $founduser = 1; } elsif (($currentline =~ /Calling-Station-Id = "(\d+)"/) && $founduser){ $currentnum = $1; $founduser = 0; if (!$numbers{$currentnum}){ $numbers{$currentnum} = $currentuser; } elsif ( $numbers{$currentnum} !~ /$currentuser/){ $numbers{$currentnum} = "$numbers{$currentnum}\n$currentuser"; } if (!$users{$currentuser}){ $users{$currentuser} = "$currentnum"; } elsif ($users{$currentuser} !~ /$currentnum/){ $users{$currentuser} = "$users{$currentuser}\n$currentnum"; } } } close(FILE); print " ########## Here are the usernames -> numbers ##########\n"; @userkeys = keys(%users); foreach $i (0 .. $#userkeys){ undef(@foo); @foo = split(/\n/,$users{$userkeys[$i]}); if ($#foo > $minnumofnums){ $number = $#foo + 1; print "$userkeys[$i] has connected from $number different numbers...\n"; print "They are:\n"; print "$users{$userkeys[$i]}\n\n"; } } print " ########## And now for the numbers -> usernames ##########\n"; @numberkeys = keys(%numbers); foreach $i (0 .. $#numberkeys){ undef(@foo); @foo = split(/\n/,$numbers{$numberkeys[$i]}); if ($#foo > $minnumofnames){ $number = $#foo + 1; print"$numberkeys[$i] has used $number different usernames...\n"; print"They are:\n"; print "$numbers{$numberkeys[$i]}\n\n"; } } ---- Robert Hof, Head-Honcho-Type If at first you don't succeed, then NETinc - The Internet People skydiving definitely isn't for you.... ++ Ascend Users Mailing List ++ To unsubscribe: send unsubscribe to ascend-users-request@bungi.com To get FAQ'd: <<A HREF="http://www.nealis.net/ascend/faq">http://www.nealis.net/ascend/faq</A>> </PRE> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <HR> <UL> <LI>Prev by Date: <STRONG><A HREF="msg10880.html">(ASCEND) Radius dialout problem with 1800</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg10878.html">Re: (ASCEND) 2 maxes and radius</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg10906.html">Re: (ASCEND) Link-Comp-MS-Stac stops working (fwd)</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg10880.html">(ASCEND) Radius dialout problem with 1800</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="mail2.html#10879"><STRONG>Main</STRONG></A></LI> <LI><A HREF="thrd247.html#10879"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> </BODY> </HTML>