dsniff  2.4b2
About: A collection of tools for network auditing
  Fossies Dox: dsniff-2.4b2.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

arpspoof.c File Reference
#include "config.h"
#include <sys/types.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <err.h>
#include <libnet.h>
#include <pcap.h>
#include "arp.h"
#include "version.h"
Include dependency graph for arpspoof.c:

Go to the source code of this file.

Functions

char * ether_ntoa (struct ether_addr *)
 
static void usage (void)
 
static int arp_send (int op, u_char *sha, u_int32_t spa, u_char *tha, u_int32_t tpa)
 
static int arp_find (u_int32_t ip, struct ether_addr *mac)
 
static void cleanup (int sig)
 
int main (int argc, char *argv[])
 

Variables

static struct ether_addr spoof_mac target_mac
 
static u_int32_t spoof_ip
 
static u_int32_t target_ip
 
static char * intf
 
libnet_t * l
 
char errbuf [LIBNET_ERRBUF_SIZE]
 
libnet_ptag_t arp_id
 
libnet_ptag_t eth_id
 

Function Documentation

◆ arp_find()

static int arp_find ( u_int32_t  ip,
struct ether_addr *  mac 
)
static

Definition at line 115 of file arpspoof.c.

References arp_cache_lookup(), and arp_send().

Referenced by cleanup(), and main().

◆ arp_send()

static int arp_send ( int  op,
u_char *  sha,
u_int32_t  spa,
u_char *  tha,
u_int32_t  tpa 
)
static

Definition at line 47 of file arpspoof.c.

References arp_id, eth_id, ETHER_ADDR_LEN, ether_ntoa(), l, and pkt.

Referenced by arp_find(), cleanup(), and main().

◆ cleanup()

static void cleanup ( int  sig)
static

Definition at line 136 of file arpspoof.c.

References arp_find(), arp_send(), spoof_ip, target_ip, and target_mac.

Referenced by main().

◆ ether_ntoa()

char* ether_ntoa ( struct ether_addr *  )

Definition at line 49 of file ethers.c.

Referenced by arp_send().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 154 of file arpspoof.c.

References arp_find(), arp_send(), cleanup(), errbuf, errx(), intf, l, spoof_ip, target_ip, target_mac, and usage().

◆ usage()

static void usage ( void  )
static

Definition at line 39 of file arpspoof.c.

References VERSION.

Referenced by main().

Variable Documentation

◆ arp_id

libnet_ptag_t arp_id

Definition at line 36 of file arpspoof.c.

Referenced by arp_send().

◆ errbuf

char errbuf[LIBNET_ERRBUF_SIZE]

Definition at line 35 of file arpspoof.c.

Referenced by main(), and tcp_raw_input().

◆ eth_id

libnet_ptag_t eth_id

Definition at line 36 of file arpspoof.c.

Referenced by arp_send().

◆ intf

char* intf
static

Definition at line 32 of file arpspoof.c.

Referenced by main(), and pcap_init().

◆ l

libnet_t* l

◆ spoof_ip

u_int32_t spoof_ip
static

Definition at line 31 of file arpspoof.c.

Referenced by cleanup(), and main().

◆ target_ip

u_int32_t target_ip
static

Definition at line 31 of file arpspoof.c.

Referenced by cleanup(), and main().

◆ target_mac

struct ether_addr spoof_mac target_mac
static

Definition at line 30 of file arpspoof.c.

Referenced by cleanup(), and main().