mirror of
https://github.com/mfontanini/libtins
synced 2026-01-30 05:24:26 +01:00
Modified some PacketSender and BaseSniffer functions to take references instead of pointers.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <tins/network_interface.h>
|
||||
#include <tins/utils.h>
|
||||
#include <tins/ethernetII.h>
|
||||
#include <tins/packet_sender.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace Tins;
|
||||
@@ -40,13 +41,13 @@ int do_arp_spoofing(NetworkInterface iface, IPv4Address gw, IPv4Address victim,
|
||||
EthernetII::address_type gw_hw, victim_hw;
|
||||
|
||||
// Resolves gateway's hardware address.
|
||||
if(!Utils::resolve_hwaddr(iface, gw, &gw_hw, &sender)) {
|
||||
if(!Utils::resolve_hwaddr(iface, gw, &gw_hw, sender)) {
|
||||
cout << "Could not resolve gateway's ip address.\n";
|
||||
return 5;
|
||||
}
|
||||
|
||||
// Resolves victim's hardware address.
|
||||
if(!Utils::resolve_hwaddr(iface, victim, &victim_hw, &sender)) {
|
||||
if(!Utils::resolve_hwaddr(iface, victim, &victim_hw, sender)) {
|
||||
cout << "Could not resolve victim's ip address.\n";
|
||||
return 6;
|
||||
}
|
||||
@@ -71,7 +72,7 @@ int do_arp_spoofing(NetworkInterface iface, IPv4Address gw, IPv4Address victim,
|
||||
EthernetII to_victim(iface, victim_hw, info.hw_addr, victim_arp);
|
||||
while(true) {
|
||||
// Just send them once every 5 seconds.
|
||||
if(!sender.send(&to_gw) || !sender.send(&to_victim))
|
||||
if(!sender.send(to_gw) || !sender.send(to_victim))
|
||||
return 7;
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user