Skip to content

Don't error in send_cleanup with empty batches (like with --dryrun)#766

Merged
zakird merged 3 commits intomainfrom
phillip/765
Jan 22, 2024
Merged

Don't error in send_cleanup with empty batches (like with --dryrun)#766
zakird merged 3 commits intomainfrom
phillip/765

Conversation

@phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Jan 21, 2024

Fixes #765 , more details are available there.
Changes:

  1. Don't error when send_batch is called with an empty batch
  2. Don't call send_batch with --dryrun in send_batch cleanup

Testing without --dryrun

$ sudo ./src/zmap  -p 80 --source-mac=74:a6:cd:d3:07:df -n 65 -c 1                      
Jan 21 15:02:01.655 [INFO] zmap: By default, ZMap will output the unique IP addresses of hosts that respond successfully (e.g., SYN-ACK packet). This is equivalent to running ZMap with the following flags: --output-module=csv --output-fields=saddr --output-filter='success=1 && repeat=0' --no-header-row. If you want all responses, explicitly set an output module or set --output-filter="".
Jan 21 15:02:01.655 [INFO] dedup: Response deduplication method is full
Jan 21 15:02:01.684 [INFO] recv: duplicate responses will be excluded from output
Jan 21 15:02:01.684 [INFO] recv: unsuccessful responses will be excluded from output
 0:00 0%; send: 3 1 p/s (3.24 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
209.87.59.95
25.234.63.152
20.219.200.226
 0:01 100%; send: 65 done (8.32 Kp/s avg); recv: 3 3 p/s (2 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 4.62%
Jan 21 15:02:03.694 [INFO] zmap: completed

Testing with --dryrun

sudo ./src/zmap  -p 80 --source-mac=74:a6:cd:d3:07:df -n 2 -c 1 --dryrun

Jan 21 15:02:46.977 [INFO] zmap: By default, ZMap will output the unique IP addresses of hosts that respond successfully (e.g., SYN-ACK packet). This is equivalent to running ZMap with the following flags: --output-module=csv --output-fields=saddr --output-filter='success=1 && repeat=0' --no-header-row. If you want all responses, explicitly set an output module or set --output-filter="".
Jan 21 15:02:46.978 [INFO] dedup: Response deduplication method is full
Jan 21 15:02:47.004 [WARN] zmap: too few targets relative to senders, dropping to one sender
Jan 21 15:02:47.005 [INFO] send: dryrun mode -- won't actually send packets
tcp { source: 60311 | dest: 80 | seq: 3443441354 | checksum: 0X98EF }
ip { saddr: 192.168.116.160 | daddr: 142.87.195.165 | checksum: 0X6054 }
eth { shost: 74:a6:cd:d3:07:df | dhost: 06:28:38:19:36:12 }
------------------------------------------------------
tcp { source: 35134 | dest: 80 | seq: 2921426704 | checksum: 0XC8E }
ip { saddr: 192.168.116.160 | daddr: 91.65.84.78 | checksum: 0X2C2 }
eth { shost: 74:a6:cd:d3:07:df | dhost: 06:28:38:19:36:12 }
------------------------------------------------------
Jan 21 15:02:47.006 [INFO] zmap: completed

@phillip-stephens phillip-stephens linked an issue Jan 21, 2024 that may be closed by this pull request
@phillip-stephens phillip-stephens marked this pull request as ready for review January 21, 2024 23:03
@zakird zakird merged commit 746b232 into main Jan 22, 2024
@zakird zakird deleted the phillip/765 branch January 22, 2024 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Erroneous error message printed with --dryrun

2 participants