No Annihilannic. It errors out with no directory/or file like i said above. I worked on it for a little and i got it outputting cannont read m2.pcap because its not a file.?
Here what i changed it too.
my $dir = 'C:\\Documents and Settings\\jordant\\Desktop\\Dump\\';
opendir(DIR...
Alright so i tryed adding this into my code but for some reason i get an error.
Here is the exact message:
ERROR: Can't read log C:./Documents: No such file or directory.
The directory does exist tho. I can even put back the exact path with it going to that directory to m1.pcap and it...
Ive got it working properly now. But here is my final question. If i have it reading a log file like so:
$log->read("C:\\Documents and Settings\\jordant\\Desktop\\Dump\\m1.pcap")
How could i get it so it reads within the Dump folder but all files that are .pcap?
i will run into problems...
Is there another value other then localtime to be used? I added all the variables for local time and the $month comes back as 1-172 counting up by 1. because of $month = $month + 1;
my year is insanley big 300,000. My time is just my current computer time.
I need something to grab the times...
Year is way off. sometimes gives the ecop 1969. Do you have a code to output time from the pcap when packets were taken?
I went another path and getting wrong dates as well.
use Time::HiRes qw(gettimeofday);
@HiResTime = gettimeofday();
($sec,$min,$hour,$day,$month,$year) =...
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secs + $msecs/1000);
Thats my time string but it seems to not work correctly.
I get the right month and day. But year and Mins/Sec are off.
Ive got the Pcap reading out because i can use the print command to see it. But how would i get it into mysql?
#Login to mysql
$dbh = DBI->connect('DBI:mysql:test', 'root', 'password'
) || die "Could not connect to +database: $DBI::errstr";
#The Headers in Table
$dbh->do("CREATE...
Ok so i did some more research and found a cleaner code with more lables for easier identifcation.
#!/usr/bin/perl
use Net::TcpDumpLog;
use NetPacket::Ethernet;
use NetPacket::IP;
use NetPacket::TCP;
use strict;
use warnings;
my $log = Net::TcpDumpLog->new();
$log->read("/Dump/m1.pcap")...
Hi i am just learning perl for a company project they want me to make a pcap reader that puts the information into mysql.
I looked into what i would need and realized that tcpdumplog would be good for reading the pcap file but i am not sure where to go with the code to get it to save in record...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.