Skip to content

Commit

Permalink
only use own hw address by default for arpspoof
Browse files Browse the repository at this point in the history
  • Loading branch information
wertarbyte committed Nov 30, 2011
1 parent 44a0015 commit 86b5485
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion arpspoof.8
Expand Up @@ -26,7 +26,10 @@ Specify the interface to use.
.IP "\fB-c \fIown|host|both\fR"
Specify which hardware address t use when restoring the arp configuration;
while cleaning up, packets can be send with the own address as well as with
the address of the host.
the address of the host. Sending packets with a fake hw address can disrupt
connectivity with certain switch/ap/bridge configurations, however it works
more reliably than using the own address, which is the default way arpspoof
cleans up afterwards.
.IP "\fB-t \fItarget\fR"
Specify a particular host to ARP poison (if not specified, all hosts
on the LAN). Repeat to specify multiple hosts.
Expand Down
19 changes: 10 additions & 9 deletions arpspoof.c
Expand Up @@ -239,25 +239,26 @@ main(int argc, char *argv[])
usage();
}

if (!cleanup_src || strcmp(cleanup_src, "host")==0) { /* default! */
/* only use the target hw address when cleaning up;
* this can screw up some bridges and scramble access
* for our own host.
*/
cleanup_src_own = 0;
cleanup_src_host = 1;
} else if (strcmp(cleanup_src, "own")==0) {
if (!cleanup_src || strcmp(cleanup_src, "own")==0) { /* default! */
/* only use our own hw address when cleaning up,
* not jeopardizing any bridges on the way to our
* target
*/
cleanup_src_own = 1;
cleanup_src_host = 0;
} else if (strcmp(cleanup_src, "host")==0) {
/* only use the target hw address when cleaning up;
* this can screw up some bridges and scramble access
* for our own host, however it resets the arp table
* more reliably
*/
cleanup_src_own = 0;
cleanup_src_host = 1;
} else if (strcmp(cleanup_src, "both")==0) {
cleanup_src_own = 1;
cleanup_src_host = 1;
} else {
errx(1, "Invalid parameter to -c: use 'own', 'host' or 'both'.");
errx(1, "Invalid parameter to -c: use 'own' (default), 'host' or 'both'.");
usage();
}

Expand Down

0 comments on commit 86b5485

Please sign in to comment.