c++ program, which generates multi protocol packets.
-
I downloaded and installed crafter library on my debian machine. The installation is as easy as described
in
libcrafter.
I made a few examples to practice crafter.
IP and MAC address.
TCP.
-
In this page I create a few packets, each with a different upper layer protocol:
UDP, TCP and ICMP.
Packet * pck = new Packet(ether_header / ip / UDP() / RawLayer("UDPData"));
pck->FillPkt();
pck_cont.push_back(*pck);
pck->RawString();
delete pck;
pck = new Packet(ether_header / ip / TCP() / RawLayer("TCPData"));
pck_cont.push_back(*pck);
delete pck;
pck = new Packet(ether_header / ip / ICMP() / RawLayer("ICMPData"));
pck_cont.push_back(*pck);
delete pck;
-
At the end of program, I print the content of each packet and erase the packet, using
vector erase function.
vector<Packet>::iterator it_pck;
for(it_pck = pck_cont.begin() ; it_pck != pck_cont.end() ; it_pck++) {
cout << "pck_cont" << endl;
it_pck->RawString();
}
pck_cont.erase (pck_cont.begin(), pck_cont.end());
-
To get more info, send an e mail with crafter multi-gen
in the subject.
|