1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fix #2293: assertion failed probe->tryno == maxtries

When tying UDP payloads to tryno, we were exceeding the maxtries in
order to send all available payloads, leading to assertion failures.
Currently there are not more than 4 payloads for any given port; most
have none, many have 1, very few have more. So we will send them all at
the same time with the same source port/tryno.
This commit is contained in:
dmiller
2021-08-06 02:47:55 +00:00
parent 1ebd91fc0c
commit 9c97e008f7
5 changed files with 61 additions and 48 deletions

View File

@@ -66,9 +66,13 @@
#define PAYLOAD_FILENAME "nmap-payloads"
const char *get_udp_payload(u16 dport, size_t *length, u8 tryno);
const char *udp_port2payload(u16 dport, size_t *length, u8 tryno);
size_t udp_payload_count(u16 dport);
// Semi-arbitrary limit, but we use u8 for indexing/retrieval
// and we send all payloads at once and need to not overwhelm.
#define MAX_PAYLOADS_PER_PORT 0xff
const char *get_udp_payload(u16 dport, size_t *length, u8 index);
const char *udp_port2payload(u16 dport, size_t *length, u8 index);
u8 udp_payload_count(u16 dport);
int init_payloads(void);
#endif /* PAYLOAD_H */