Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ARP ping #423

Merged
merged 18 commits into from
Feb 9, 2021
Merged

Conversation

ArnoStiefvater
Copy link
Member

@ArnoStiefvater ArnoStiefvater commented Jan 20, 2021

What:

Use libnet for arp ping for alive detection.

Why:

Robust implementation of arp ping as it was not stable before. The arp ping is part of the experimental (currently default off) alive detection feature.

How:

Can be tested with cli front-end for the alive test https://github.com/greenbone/boreas/ and do some scans with it.

sudo boreas --target "0:0:0:0:0:ffff:c0a8:384b,192.168.42.42" --arp

Checklist:

We call pingip_send() not always with the same
libnet_t which means that ptags should not be
static.
We can reuse the libnet context if the interface
for a given packet is the same as the privously
used one.
We do not need to resolve the address here because
it is done somewhere else and saved in the
gvm_host_t.
If we already have a src address we do not need to
find one.
Else we send the last packet as payload for the
new one.
Better would be to use ptags for reuse and
modification of packets.
mattmundell
mattmundell previously approved these changes Jan 26, 2021
send_arp_v4 only takes IPv4 in text form and not
IPv6 mapped IPv4 string in text form.
Use always the same default interface found
by pcap_findalldevs if we have not found one
on our own as the default interface should not
change during different pings.

Use pcap_findalldevs instead of pcap_lookupdev.
Reduce number of debug messages by unifying
messages with same meaning.
@ArnoStiefvater ArnoStiefvater marked this pull request as ready for review February 8, 2021 10:09
@ArnoStiefvater ArnoStiefvater merged commit 207a005 into greenbone:master Feb 9, 2021
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.

3 participants