Bug#706766: Diff for this fix
João Salavisa
joao.salavisa at gmail.com
Tue Mar 14 23:38:35 UTC 2017
Sorry, now using a proper patch creation method :)
Index: dsniff/arpspoof.c
===================================================================
--- dsniff.orig/arpspoof.c
+++ dsniff/arpspoof.c
@@ -300,18 +300,22 @@ main(int argc, char *argv[])
signal(SIGINT, cleanup);
signal(SIGTERM, cleanup);
- for (;;) {
- struct host *target = targets;
- while(target->ip) {
- arp_send(l, ARPOP_REPLY, my_ha, spoof.ip,
- (target->ip ? (u_int8_t *)&target->mac : brd_ha),
- target->ip,
- my_ha);
- if (poison_reverse) {
- arp_send(l, ARPOP_REPLY, my_ha, target->ip, (uint8_t *)&spoof.mac,
spoof.ip, my_ha);
- }
- target++;
- }
+ for (;;) {
+ if (!n_targets) {
+ arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, brd_ha, 0, my_ha);
+ } else {
+ struct host *target = targets;
+ while(target->ip) {
+ arp_send(l, ARPOP_REPLY, my_ha, spoof.ip,
+ (target->ip ? (u_int8_t *)&target->mac : brd_ha),
+ target->ip,
+ my_ha);
+ if (poison_reverse) {
+ arp_send(l, ARPOP_REPLY, my_ha, target->ip, (uint8_t
*)&spoof.mac, spoof.ip, my_ha);
+ }
+ target++;
+ }
+ }
sleep(2);
}
On Wed, Mar 8, 2017 at 9:23 PM João Salavisa <joao.salavisa at gmail.com>
wrote:
> Sorry, now in a patch format
>
> diff -ub ./arpspoof.c ../orig.dsniff/dsniff-2.4b1+debian/arpspoof.c
> --- ./arpspoof.c 2017-03-07 22:21:45.037692254 +0000
> +++ ../orig.dsniff/dsniff-2.4b1+debian/arpspoof.c 2017-03-07
> 22:09:32.000000000 +0000
> @@ -46,8 +46,6 @@
> static int cleanup_src_own = 1;
> static int cleanup_src_host = 0;
>
> -int n_targets;
> -
> static void
> usage(void)
> {
> @@ -162,17 +160,11 @@
> fprintf(stderr, "Cleaning up and re-arping targets...\n");
> for (i = 0; i < rounds; i++) {
> struct host *target = targets;
> -
> + while(target->ip) {
> uint8_t *src_ha = NULL;
> if (cleanup_src_own && (i%2 || !cleanup_src_host)) {
> src_ha = my_ha;
> }
> -
> - if (!n_targets) {
> - arp_send(l, ARPOP_REPLY, (u_int8_t *)&spoof.mac, spoof.ip, brd_ha,
> 0, src_ha);
> - sleep(1);
> - } else {
> - while(target->ip) {
> /* XXX - on BSD, requires ETHERSPOOF kernel. */
> if (fw) {
> arp_send(l, ARPOP_REPLY,
> @@ -194,12 +186,11 @@
> target++;
> }
> }
> - }
>
> exit(0);
> }
>
> - int
> +int
> main(int argc, char *argv[])
> {
> extern char *optarg;
> @@ -207,7 +198,7 @@
> char pcap_ebuf[PCAP_ERRBUF_SIZE];
> char libnet_ebuf[LIBNET_ERRBUF_SIZE];
> int c;
> -
> + int n_targets;
> char *cleanup_src = NULL;
>
> spoof.ip = 0;
> @@ -304,12 +295,6 @@
> signal(SIGTERM, cleanup);
>
> for (;;) {
> - if (!n_targets) {
> - arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, brd_ha, 0, my_ha);
> - if (poison_reverse) {
> - arp_send(l, ARPOP_REPLY, my_ha, target->ip, (uint8_t
> *)&spoof.mac, spoof.ip, my_ha);
> - }
> - } else {
> struct host *target = targets;
> while(target->ip) {
> arp_send(l, ARPOP_REPLY, my_ha, spoof.ip,
> @@ -321,7 +306,6 @@
> }
> target++;
> }
> - }
>
> sleep(2);
> }
>
>
> On Tue, Mar 7, 2017 at 10:13 PM João Salavisa <joao.salavisa at gmail.com>
> wrote:
>
> Here you go!
>
> diff -b ./arpspoof.c ../orig.dsniff/dsniff-2.4b1+debian/arpspoof.c
> 49,50d48
> < int n_targets;
> <
> 165c163
> <
> ---
> > while(target->ip) {
> 170,175d167
> <
> < if (!n_targets) {
> < arp_send(l, ARPOP_REPLY, (u_int8_t *)&spoof.mac, spoof.ip, brd_ha,
> 0, src_ha);
> < sleep(1);
> < } else {
> < while(target->ip) {
> 197d188
> < }
> 202c193
> < int
> ---
> > int
> 210c201
> <
> ---
> > int n_targets;
> 307,312d297
> < if (!n_targets) {
> < arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, brd_ha, 0, my_ha);
> < if (poison_reverse) {
> < arp_send(l, ARPOP_REPLY, my_ha, target->ip, (uint8_t
> *)&spoof.mac, spoof.ip, my_ha);
> < }
> < } else {
> 324d308
> < }
>
>
> On Tue, Feb 28, 2017 at 10:19 PM Marcos Fouces <mfouces at yahoo.es> wrote:
>
> Hello João
>
> Could you create a patch and post it in this thread?
>
> Thank you very much for the fix!
>
> Greetings,
>
> Marcos
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-security-team/attachments/20170314/ca1043e8/attachment-0001.html>
More information about the Pkg-security-team
mailing list