Skip to content

Comments

store domain as input if provided#106

Merged
ehsandeep merged 9 commits intoprojectdiscovery:devfrom
leesoh:main
Apr 26, 2023
Merged

store domain as input if provided#106
ehsandeep merged 9 commits intoprojectdiscovery:devfrom
leesoh:main

Conversation

@leesoh
Copy link
Contributor

@leesoh leesoh commented Apr 21, 2023

resolves #105

before:

$ echo "hackerone.com" | asnmap -silent -json
{"timestamp":"2023-04-21 10:44:57.438696847 -0600 MDT","input":"104.16.99.52","as_number":"AS9498","as_name":"BBIL-AP BHARTI Airtel Ltd.","as_country":"IN","as_range":["102.129.206.0/23","102.129.208.0/20","102.129.224.0/19","102.130.0.0/15","102.132.0.0/14","102.136.0.0/13","102.144.0.0/12","102.160.0.0/11","102.192.0.0/10","103.0.0.0/8","104.0.0.0/5","112.0.0.0/4"]}
{"timestamp":"2023-04-21 10:44:57.45290937 -0600 MDT","input":"104.16.100.52","as_number":"AS9498","as_name":"BBIL-AP BHARTI Airtel Ltd.","as_country":"IN","as_range":["102.129.206.0/23","102.129.208.0/20","102.129.224.0/19","102.130.0.0/15","102.132.0.0/14","102.136.0.0/13","102.144.0.0/12","102.160.0.0/11","102.192.0.0/10","103.0.0.0/8","104.0.0.0/5","112.0.0.0/4"]}
{"timestamp":"2023-04-21 10:44:57.471475348 -0600 MDT","input":"2606:4700::6810:6334","as_number":"AS13335","as_name":"CLOUDFLARENET","as_country":"US","as_range":["2606:4700::/47"]}
{"timestamp":"2023-04-21 10:44:57.485204484 -0600 MDT","input":"2606:4700::6810:6434","as_number":"AS13335","as_name":"CLOUDFLARENET","as_country":"US","as_range":["2606:4700::/47"]}

after:

$ echo "hackerone.com" | asnmap -silent -json
{"timestamp":"2023-04-21 10:59:28.052074685 -0600 MDT","input":"hackerone.com","as_number":"AS9498","as_name":"BBIL-AP BHARTI Airtel Ltd.","as_country":"IN","as_range":["102.129.206.0/23","102.129.208.0/20","102.129.224.0/19","102.130.0.0/15","102.132.0.0/14","102.136.0.0/13","102.144.0.0/12","102.160.0.0/11","102.192.0.0/10","103.0.0.0/8","104.0.0.0/5","112.0.0.0/4"]}
{"timestamp":"2023-04-21 10:59:28.065921281 -0600 MDT","input":"hackerone.com","as_number":"AS9498","as_name":"BBIL-AP BHARTI Airtel Ltd.","as_country":"IN","as_range":["102.129.206.0/23","102.129.208.0/20","102.129.224.0/19","102.130.0.0/15","102.132.0.0/14","102.136.0.0/13","102.144.0.0/12","102.160.0.0/11","102.192.0.0/10","103.0.0.0/8","104.0.0.0/5","112.0.0.0/4"]}
{"timestamp":"2023-04-21 10:59:28.080044683 -0600 MDT","input":"hackerone.com","as_number":"AS13335","as_name":"CLOUDFLARENET","as_country":"US","as_range":["2606:4700::/47"]}
{"timestamp":"2023-04-21 10:59:28.09444922 -0600 MDT","input":"hackerone.com","as_number":"AS13335","as_name":"CLOUDFLARENET","as_country":"US","as_range":["2606:4700::/47"]}

@ehsandeep ehsandeep changed the base branch from main to dev April 21, 2023 17:09
@leesoh
Copy link
Contributor Author

leesoh commented Apr 21, 2023

@ehsandeep, I forgot to update the client tests as well. Those have now been added.

@ehsandeep ehsandeep requested a review from ShubhamRasal April 21, 2023 17:37
@leesoh
Copy link
Contributor Author

leesoh commented Apr 21, 2023

One possible limitation to my implementation is that this will result in duplicate entries in the output.

For instance, example.com resolves to three IPs, but we prefer domain in the output, which would display example.com three times instead of each IP. The ASN and IP ranges would still reflect the difference, though, so this might be acceptable.

@ShubhamRasal ShubhamRasal requested a review from Mzack9999 April 26, 2023 06:42
@ehsandeep ehsandeep merged commit fc035f0 into projectdiscovery:dev Apr 26, 2023
@ehsandeep ehsandeep removed the request for review from ShubhamRasal April 26, 2023 09:28
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.

When domain is provided, input is IP

4 participants