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

[REQUEST] Support for DNS lookup during scan #105

Closed
gaby opened this issue Jul 1, 2023 · 11 comments
Closed

[REQUEST] Support for DNS lookup during scan #105

gaby opened this issue Jul 1, 2023 · 11 comments
Labels
feature-request New feature or request

Comments

@gaby
Copy link
Contributor

gaby commented Jul 1, 2023

The problem you currently have with this project
After scanning a /24 with +20 devices they all show up with the same name on the UI. It would be very useful if we could specify one or many DNS servers to find the Name of each device using it's ipv4 address

Describe the solution you'd like
Add a flag or settings option to use a DNS server to convert use the IPv4 address of the device to do a DNS lookup and use that Name when adding the device. This should only apply to devices that have both a ipv4/ipv6 address AND the name is not "Unknown"

@seriousm4x seriousm4x added the feature-request New feature or request label Jul 1, 2023
@seriousm4x
Copy link
Owner

Good idea 👍🏼

This should only apply to devices that have both a ipv4/ipv6 address AND the name is not "Unknown"

Why that? My first thought was to make a DNS request when the device is Unknown.

@seriousm4x
Copy link
Owner

I've added this. When the device is "Unknown" it will perform a reverse dns lookup. I can't specify the dns server in go, so it will use the default system dns server. For docker containers the dns can be changed like this: https://github.com/seriousm4x/UpSnap/blob/master/docker-compose.yml#L16-L18

@gaby
Copy link
Contributor Author

gaby commented Jul 1, 2023

Good idea 👍🏼

This should only apply to devices that have both a ipv4/ipv6 address AND the name is not "Unknown"

Why that? My first thought was to make a DNS request when the device is Unknown.

When scanning something like /24, anything that doesnt have device shows as "Unknown" for me. While addresses that do have a device show up with the devics manufacturer name. 🤔

@seriousm4x
Copy link
Owner

seriousm4x commented Jul 1, 2023

So your table shows every IP address in the range?
What is the output of nmap -sn -oX - 192.168.1.0/24 --host-timeout 500ms? (replace your range)

@CygnusHyoga
Copy link

CygnusHyoga commented Jul 1, 2023

I can confirm what gaby comments:

  • Device that doesnt have device shows as "Unknown" for me too.
  • Addresses that do have a device show up with the devices manufacturer name.

Can we add the two columns? Hostname for DNS Hostname and MAC Vendor for MAC Vendor?

For example:

Hostname | IP | MAC Address | MAC Vendor | Netmask

This will be more easy to identify devices from the their DNS lookups although those devices who do not have a MAC Vendor.

I test how Angry IP Scanner show MAC Vendor for devices with no real device (virtual devices) and shows it as: [n/a]. I think this is ok, because they are non real devices.

@gaby
Copy link
Contributor Author

gaby commented Jul 1, 2023

I can confirm what gaby comments:

  • Device that doesnt have device shows as "Unknown" for me too.
  • Addresses that do have a device show up with the devices manufacturer name.

Can we add the two columns? Hostname for DNS Hostname and MAC Vendor for MAC Vendor?

For example:

Hostname | IP | MAC Address | MAC Vendor | Netmask

This will be more easy to identify devices from the their DNS lookups although those devices who do not have a MAC Vendor.

I test how Angry IP Scanner show MAC Vendor for devices with no real device (virtual devices) and shows it as: [n/a]. I think this is ok, because they are non real devices.

I like this idea, that's exactly the behavior i am seeing after doing a /24 scan

@seriousm4x
Copy link
Owner

Can we add the two columns? Hostname for DNS Hostname and MAC Vendor for MAC Vendor?

Great idea. Here is how I choose the device name now:

  1. DNS resolves? -> Pick the DNS name
  2. DNS doesn't resolve? -> Fall back to mac vendor name
  3. DNS doesn't resolve and no mac vendor name? -> don't add device to the table

This will also eliminate all "Unknown" device names. Mac vendor can still show as unknown, but thats not relevant.

scan

@gaby
Copy link
Contributor Author

gaby commented Jul 1, 2023

Can we add the two columns? Hostname for DNS Hostname and MAC Vendor for MAC Vendor?

Great idea. Here is how I choose the device name now:

  1. DNS resolves? -> Pick the DNS name
  2. DNS doesn't resolve? -> Fall back to mac vendor name
  3. DNS doesn't resolve and no mac vendor name? -> don't add device to the table

This will also eliminate all "Unknown" device names. Mac vendor can still show as unknown, but thats not relevant.

scan

Yeah that should cover all the use cases :-) I like it!

@CygnusHyoga
Copy link

Fantastic! :-)

@seriousm4x
Copy link
Owner

Beta build is done. Tell me if it's fixed :)
https://github.com/seriousm4x/UpSnap/releases/tag/3.3.0-beta.4

@CygnusHyoga
Copy link

It's work perfect! The only problem is visual one...the IP and MAC columns are too close together, maybe they need a little more space so they can be seen correctly.

IPMAC

seriousm4x added a commit that referenced this issue Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants