Skip to content

Commit 72bcc9b

Browse files
committed
Document some advice
plus minor changes
1 parent bdd5b2f commit 72bcc9b

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,31 @@ source port and configure your firewall to drop traffic on this port, e.g.:
7575
Since UDP is connection-less there is no need to prevent interference, though this
7676
is still a good idea to prevent your OS from sending unnecessary ICMPv6 unreachable
7777
responses (fi6s also tries this by default).
78+
79+
### Selecting the source IP
80+
81+
A big advantage of IPv6 is the large address space, and another way of avoiding
82+
the IP stack problem described above is to just use a different source IP.
83+
84+
This IP should not be assigned to your local machine, but it *must* be statically routed
85+
to your machine, because fi6s will not answer NDP queries.
86+
87+
To check if an IP is working correctly you can simply ping a known public IP, e.g.:
88+
89+
# ./fi6s --icmp --source-ip $your_ip 2001:4860:4860::8888
90+
91+
## Limitations
92+
93+
In order to permit the design of fi6s some assumptions had to be made about
94+
the network environment. These do not impact typical usage at all but listed here
95+
for completeness.
96+
97+
This means fi6s may not perform as expected or outright not work if:
98+
* you have a non-trivial routing table (it will be ignored. fi6s expects a single gateway)
99+
* you are scanning targets in the local network (fi6s does not do neighbor discovery)
100+
* you have a connection-tracking firewall
101+
* your IP or router's MAC changes mid-scan ¯\\\_(ツ)_
102+
* your network has consistent packet loss
103+
104+
For banner collection note that fi6s does not come with anything resembling a real TCP
105+
stack. It merely supports sending one query and reading response data that follows. Resends are not implemented.

src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ int main(int argc, char *argv[])
233233
if(mode == M_PRINT_NETWORK && argc - optind == 0) {
234234
// permitted for convenience
235235
} else if(argc - optind < 1) {
236-
log_raw("No target specification(s) given.");
236+
log_raw("No target specification(s) given%s.",
237+
argc == 1 ? ", try --help" : "");
237238
return 1;
238239
}
239240
}
@@ -523,6 +524,10 @@ static void usage(void)
523524
printf(" For example, you could perform a scan that captures banners but only extract open/closed ports:\n");
524525
printf(" $ fi6s -o scan.bin --output-format binary -b 2001:db8::xx\n");
525526
printf(" $ fi6s --readscan scan.bin --show-closed\n");
527+
#ifndef NDEBUG
528+
printf("\n");
529+
printf("(debug build)\n");
530+
#endif
526531
}
527532

528533
static inline bool is_all_ff(const uint8_t *buf, int len)

src/scan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ static inline int source_port_rand(void)
462462
{
463463
int v;
464464
v = rand() & 0xffff; // random 16-bit number
465-
v |= 16384; // ensure that 1) it's not zero 2) it's >= 16384
465+
if(v < 16384)
466+
v = 16384;
466467
return v;
467468
}

0 commit comments

Comments
 (0)