trevelyn has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I created a Perl app that searches Airodump's output plain text file for MAC addresses and matches one that is specified. I would like to have no dependencies anymore and I would like to create a program that reads all data from a wireless device that is NOT associated with an AP, but simply sniffing (wardriving).
I have the proper drivers installed on WeakNet Linux to sniff in promiscuous mode, and I can with Airodump-ng.
I have tried utilizing all I can in CPAN, including: Net::Pcap; Net::PcapUtils; NetPacket::Ethernet;
None seem to work properly when I specify a wireless device rather than a wired device and all I want to do is to be able to drive around and decode the packets from, say, wlan0 to pull out MAC addresses in which i can search for a particular MAC specified.
I would rather not have someone else code this as I would like to learn more than anything, but I just want to know the right direction. Or maybe have some code samples.
Thanks in advance,
Douglas. here is the code I have that produces output, just wrong output:
I have the proper drivers installed on WeakNet Linux to sniff in promiscuous mode, and I can with Airodump-ng.
I have tried utilizing all I can in CPAN, including: Net::Pcap; Net::PcapUtils; NetPacket::Ethernet;
None seem to work properly when I specify a wireless device rather than a wired device and all I want to do is to be able to drive around and decode the packets from, say, wlan0 to pull out MAC addresses in which i can search for a particular MAC specified.
I would rather not have someone else code this as I would like to learn more than anything, but I just want to know the right direction. Or maybe have some code samples.
Thanks in advance,
Douglas. here is the code I have that produces output, just wrong output:
#!/usr/bin/perl -w use Net::Pcap; use NetPacket::Ethernet; use strict; my $err; my $dev = "wlan0"; my $object; $object = Net::Pcap::open_live($dev, 2048, 0, 0, \$err); Net::Pcap::loop($object, -1, \&syn_packets, '') || die 'Unable to perf +orm packet capture'; Net::Pcap::close($object); sub syn_packets { my ($user_data, $header, $packet) = @_; my $eth_obj = NetPacket::Ethernet->decode($packet); print("$eth_obj->{src_mac} : $eth_obj->{dest_mac}\n"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::Pcap with wireless
by jbt (Chaplain) on Sep 13, 2009 at 03:52 UTC | |
Re: Net::Pcap with wireless
by traveler (Parson) on Sep 13, 2009 at 16:27 UTC | |
by trevelyn (Novice) on Sep 13, 2009 at 17:10 UTC | |
by traveler (Parson) on Sep 13, 2009 at 17:55 UTC | |
by trevelyn (Novice) on Sep 13, 2009 at 18:21 UTC | |
by traveler (Parson) on Sep 14, 2009 at 21:58 UTC | |
by trevelyn (Novice) on Oct 25, 2009 at 16:32 UTC | |
by Khen1950fx (Canon) on Oct 25, 2009 at 20:59 UTC | |
| |
Re: Net::Pcap with wireless
by apl (Monsignor) on Sep 13, 2009 at 13:35 UTC |
Back to
Seekers of Perl Wisdom