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:
#!/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"); }

In reply to Net::Pcap with wireless by trevelyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.