Net::Lorcon2 - Raw wireless packet injection using the Lorcon2 library
use Net::Lorcon2 qw(:subs); my $if = "wlan0"; my $driver = "mac80211"; my $packet = "G"x100; # # Usage in an OO-way # my $lorcon = Net::Lorcon2->new( interface => $if, driver => $driver, ); $lorcon->setInjectMode; my $t = $lorcon->sendBytes($packet); if (! $t) { print "[-] Unable to send bytes\n"; exit 1; } # # Usage with lorcon2 library API # my $drv = lorcon_find_driver($driver); if (! $drv) { print STDERR "[-] Unable to find DRV for [$driver]\n"; exit 1; } my $lorcon = lorcon_create($if, $drv); if (! $lorcon) { print STDERR "[-] lorcon_create failed\n"; exit 1; } my $r = lorcon_open_inject($lorcon); if ($r == -1) { print STDERR "[-] lorcon_open_inject: ".lorcon_get_error($lorcon)."\n"; exit 1; } my $t = lorcon_send_bytes($lorcon, length($packet), $packet); print "T: $t\n";
This module enables raw 802.11 packet injection provided you have a Wi-Fi card supported by Lorcon2.
Lorcon2 can be obtained from http://802.11ninja.net/svn/lorcon/.
This version has been tested against the following revision:
http://802.11ninja.net/svn/lorcon/tags/lorcon2-200911-rc1
Constructs a new Net::Lorcon2 object. device is the name of the device to use for packet injection. driver is the driver to use (one of the names returned from getcardlist)
Net::Lorcon2
device
driver
Sets the inject mode for the card.
Send raw data in the air.
Load them: use Net::Lorcon2 qw(:consts);
lorcon2(7), 802.11 Wireless Networks by Matthew Gast.
Patrice <GomoR> Auffret, <gomor at cpan dot org> (current maintainer and developper of Net::Lorcon2)
David Leadbeater, <dgl at dgl dot cx> (original author)
Copyright (C) 2010-2015 by Patrice <GomoR> Auffret
Copyright (C) 2007-2008 by David Leadbeater and Patrice <GomoR> Auffret
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Net::Lorcon2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Lorcon2
CPAN shell
perl -MCPAN -e shell install Net::Lorcon2
For more information on module installation, please visit the detailed CPAN module installation guide.