808 show dns fqdn ips - #809
Merged
Merged
Conversation
Contributor
|
The automated linter doesn't like the naming of one of the methods. Please change the name to match the suggested name: |
Author
|
Thanks @Zalgo2462 ! Changed the name and it passed the tests. I updated the PR to reflect the function name change. Thanks for the new commands! |
Zalgo2462
suggested changes
Jul 13, 2023
Zalgo2462
left a comment
Contributor
There was a problem hiding this comment.
One small code change to be made. Otherwise, its looking good to me.
| return cli.NewExitError("Specify a database", -1) | ||
| } | ||
|
|
||
| f := c.Args().Get(1) |
Contributor
There was a problem hiding this comment.
Please rename this fqdn and remove line 42 since these variables are assigned the same value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a new command,
show-dns-fqdn-ips, which will print all the IP addresses associated with a specified FQDN. Also updates the readme to include the new command.Needed to change the function name
HostnameIPResultsinpkg/hostname/results.gotoIPResultsto satisfy the linter.Related Issue
closes #808
Testing
Obtain FQDN to test against
adservice.google.comis usually a good choice as it is widely used.zcat dns.* | nice zcutter.py query -C | sort | less -S -x 20to view a list of FQDNs to choose from. Choose one that is used more than once.Acquire list of IPs to compare RITA command against
zgrep adservice.google.com dns.* | cut -d$'\t' -f22 | sort | uniq | cut -d, -f2Alternatively, if you have zcutter installed, you can run the following command:
zcat dns.* | nice zcutter.py query answers -C | grep adservice.google.com | sort -u | cut -d, -f2NOTE: replace
adservice.google.comwith your own FQDN if you chose to find your own to test against.Test
show-dns-fqdn-ipsStart DB (assuming you are using MongoDB):
sudo systemctl start mongodImport dataset: rita import <files/directory to import>
./rita show-dns-fqdn-ips <database> <fqdn>(e.g.
./rita show-dns-fqdn-ips empire adservice.google.comTest flags
-Hshould show a human-readable view with an ASCII table.-nnshould show the resolved IPs along with the network name separated by a delimiter (comma if none is specified)Hand -nnshould show the table with both IPs and the network namesTest error handling
./rita show-dns-fqdn-ipsshould prompt the user to specify a database./rita show-dns-fqdn-ips <database>should prompt the user to specify an FQDN