Net::F...Simple(3pm)
π Net::F...Simple(3pm) π
okay bestie, so this is the page for Net::F...Simple(3pm) β a User Contributed Perl Documentation page, and it's literally frame crafting made easy. yes the header truncates it, it's giving mysterious. iykyk.
β¨ NAME β¨
Net::Frame::Simple β frame crafting made easy. periodt. π
πΈ SYNOPSIS πΈ
# We build a TCP SYN
my $src = '192.168.0.10';
my $target = '192.168.0.1';
my $port = 22;
use Net::Frame::Simple qw($NoUnableToUnpackWarnings $NoModuleNotFoundWarnings);
use Net::Frame::Layer::IPv4;
use Net::Frame::Layer::TCP;
$NoUnableToUnpackWarnings = 1;
$NoModuleNotFoundWarnings = 1;
my $ip4 = Net::Frame::Layer::IPv4->new(
src => $src,
dst => $target,
);
my $tcp = Net::Frame::Layer::TCP->new(
dst => $port,
options => "\x02\x04\x54\x0b",
payload => 'test',
);
my $oSimple = Net::Frame::Simple->new(
layers => [ $ip4, $tcp ],
);
# Now, the frame is ready to be send to the network
# We open a sender object, and a retriever object
use Net::Write::Layer3;
use Net::Frame::Dump::Online;
my $oWrite = Net::Write::Layer3->new(dst => $target);
my $oDump = Net::Frame::Dump::Online->new(dev => $oDevice->dev);
$oDump->start;
$oWrite->open;
# We send the frame
$oSimple->send($oWrite);
# And finally, waiting for the response
until ($oDump->timeout) {
if (my $recv = $oSimple->recv($oDump)) {
print "RECV:\n".$recv->print."\n";
last;
}
}
$oWrite->close;
$oDump->stop;
π¦ DESCRIPTION π¦
so this module is part of the Net::Frame frame crafting framework π
it's totally optional, but bestie, it can make playing with the network far easier π
basically, it hides the complexity of frame forging, sending, and receiving, by handing you helper methods that internally figure out how to assemble frames and find responses to probes. it's giving main character energy while doing all the boring background work.
for example, it will take care of computing lengths and checksums, and matching a response frame to the requesting frame. no cap. π₯
π ATTRIBUTES π
rawβ where the packed frame will be stored, or used to unpack a raw string taken from the network (or elsewhere).timestampβ the frame timestamp. β°firstLayerβ we cannot know by which layer a frame begins, so this tells how to start unpacking raw data.paddingβ sometimes frames are padded to achieve 60 bytes in length. the padding gets stored here, or if you craft a frame, you can manually add your own padding.truncatedβ a binary flag stating when a raw frame has been truncated (or not).replyβ when therecvmethod is called, and a corresponding reply has been found, it is stored here. πlayersβ this one is an arrayref. it stores all layers to use within theNet::Frame::Simpleobject.refβ this is a hashref that stores all layers. the key is the layer type (example:TCP:$oSimple->ref->{TCP}). if the frame contains multiple layers of the same type, only the one found at upper level will be kept (in fact, the latest analyzed one, aka LIFO).
β¨ METHODS β¨
π«Ά The constructor era
new (hash)β object constructor. you can pass attributes in a hash as a parameter. also note that when you call it with thelayersattribute set, it will automatically callcomputeLengths,computeChecksumsandpackfor you π and when you pass therawattribute, it will callunpackfor you too, building layers and storing them in thelayersattribute.newFromDump (hashref)β whenNet::Frame::Dump'snextmethod is called, and there is a frame waiting, it returns a hashref with specific values. you can directly use it as a parameter for this method, which will create a newNet::Frame::Simpleobject. convenient much? π
πΈ The math-and-pack girlies
computeLengthsβ this one hides the manual hassle of calling thecomputeLengthsmethod for each layer. it takes no parameter, it will know internally what to do. you may set the global variable$NoComputeLengthsto1to avoid computing lengths.computeChecksumsβ same as above, but for checksums. you MUST call the previous one before this one. you may set the global variable$NoComputeChecksumsto1to avoid computing checksums. π€packβ will pack all layers to therawattribute, ready to be sent to the network.unpackβ will unpack a raw string from therawattribute into respective layers. by default, a warning will be displayed if unable to unpack the next layer. you may disable this message by setting the global variable$NoUnableToUnpackWarningsto1. furthermore,unpack()will try to load a module and print a warning in case it is not able to load it. you may disable this message by setting the global variable$NoModuleNotFoundWarningsto1.
π¦ The speed + send + recv section
getKeygetKeyReverse
these two methods are basically used to increase the speed when using the recv method. β‘
recv (Net::Frame::Dump object)β when you want to search for the response of your probe, you call it by specifying from whichNet::Frame::Dumpobject to search. it then returns aNet::Frame::Simpleobject if a match is found, orundefif not.send (Net::Write object)β will send to theNet::Writeobject the raw string describing theNet::Frame::Simpleobject.reSend (Net::Write object)β you can alsoreSendthe frame, it will only rewrite it to the network if no reply has already been found. πprintβ prints all layers in human readable format.dumpβ dumps the raw string in hexadecimal format.
π SEE ALSO π
Net::Write, Net::Frame::Dump
π AUTHOR π
Patrice <GomoR> Auffret
π COPYRIGHT AND LICENSE π
Copyright (c) 2006-2017, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.
and that's the whole page bestie π«Ά this was perl v5.34.0, dated 2022-06-16, and it's the Net::F...Simple(3pm) manual β go forth and craft frames, you absolute icon β¨ππ
π¦ where this page comes from
- debian bookworm: libnet-frame-simple-perl 1.09-2 Β· Artistic-1.0-Perl
- debian trixie: libnet-frame-simple-perl 1.09-2 Β· Artistic-1.0-Perl
- ubuntu noble: libnet-frame-simple-perl 1.09-2 Β· Artistic-1.0-Perl
- ubuntu resolute: libnet-frame-simple-perl 1.09-2 Β· Artistic-1.0-Perl
- ubuntu stonking: libnet-frame-simple-perl 1.09-2 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms