exam questions

Exam PT0-001 All Questions

View all questions & answers for the PT0-001 exam

Exam PT0-001 topic 1 question 47 discussion

Actual exam question from CompTIA's PT0-001
Question #: 47
Topic #: 1
[All PT0-001 Questions]

A penetration tester wants to script out a way to discover all the RPTR records for a range of IP addresses. Which of the following is the MOST efficient to utilize?

  • A. nmap -p 53 -oG dnslist.txt | cut -d ג€:ג€ -f 4
  • B. nslookup -ns 8.8.8.8 << dnslist.txt
  • C. for x in {1...254}; do dig -x 192.168.$x.$x; done
  • D. dig -r > echo ג€8.8.8.8ג€ >> /etc/resolv.conf
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
kloug
2 years, 2 months ago
bbbbbbbb
upvoted 1 times
kloug
2 years, 2 months ago
The correct answer is B. RPTR (Reverse Pointer) records are used to map IP addresses to domain names in reverse DNS resolution. In order to discover RPTR records for a range of IP addresses, one can provide a list of IP addresses to the nslookup command and instruct it to perform reverse DNS lookups. The -ns option specifies the IP address of the DNS server to use for the lookup. Therefore, using nslookup with the appropriate options and providing the IP addresses in a file (dnslist.txt) would be the most efficient way to discover all the RPTR records for a range of IP addresses.
upvoted 1 times
...
...
miabe
2 years, 9 months ago
Selected Answer: C
looks good to me
upvoted 1 times
...
FluffyJohnson
4 years ago
Absolutely C. On my LAN, if I run for x in {1..254}; do dig 192.168.0.$x; done, it's query my nameserver for each IP in the /24. Doesn't save to a file and I wouldn't say it's the most efficient but out of all the choices the most relevant.
upvoted 4 times
...
TestBanger
4 years, 5 months ago
C: Only dig -x returns DNS pointer records ABD will not resolve PTR records
upvoted 4 times
...
mr_robot
4 years, 10 months ago
Tested "nmap -p 53 8.8.8.8" only and got the following: Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-23 10:45 AUS Eastern Standard Time Nmap scan report for dns.google (8.8.8.8) Host is up (0.0045s latency). PORT STATE SERVICE 53/tcp open domain Nmap done: 1 IP address (1 host up) scanned in 1.90 seconds Tested "nmap -p 53 -oG dnslist.txt local_fileserver_ipaddress | cut -d ":" -f 4" and it resolved the IP to the hostname and output the result in a dnslist.txt file. I know there is no IP range specified but I think this is the "MOST efficient to utilize" as per the question.
upvoted 3 times
...
D1960
4 years, 11 months ago
Actually, none of these work. Arguably, C comes closest. Although, C will absolutely not work.
upvoted 1 times
...
mr_robot
5 years ago
I would go for C. - http://www.telecom.otago.ac.nz/tele301/student_html/reverse-zones.html Tried A from Kali Linux, and got “WARNING: No targets were specified, so 0 hosts scanned.” - Tried B from Windows and D from Linux with no luck. - Tried C from Linux and got “dig: '254}...{1.254}...{1.168.192.in-addr.arpa.' is not a legal name (empty label)”, but I guess I need to configure DNS server on this VM but at least it returned something.
upvoted 2 times
mr_robot
5 years ago
Also in order for A to work we need to have -iL and a txt file specified with a range of IP addresses to scan, as -oG is just outputting results from nothing to dnslist.txt file in this example right?
upvoted 2 times
...
D1960
4 years, 11 months ago
C. does not look right. you will get: 192.168.1.1 192.168.2.2 192.168.3.3 Also the range specified in C has too many dots, should be two, not three. That might be a typo.
upvoted 2 times
mr_robot
4 years, 11 months ago
Found a better example of a complete DNS reverse lookup from: https://serverfault.com/questions/7056/whats-the-reverse-dns-command-line-utility for ip in {1..254..1}; do dig -x 1.1.1.$ip | grep $ip >> dns.txt; done; So in this example, maybe we could use something like this if we had only 1 x variable? for x in (1..254..1); do dig -x 192.168.10.$x; done
upvoted 1 times
D1960
4 years, 10 months ago
Yes, that would work - if you used curly brackets instead of parens. So it may just be a typo. However, there is no need for {1..254..1} when {1..254} does the same thing.
upvoted 1 times
...
...
...
...
D1960
5 years, 1 month ago
I don't see A specifying a range. In fact, I think only C specifies any kind of range.
upvoted 3 times
...
jon34thna
5 years, 1 month ago
I agree with the rest "C" is the right answer.
upvoted 3 times
...
amankry
5 years, 4 months ago
C is right answer.
upvoted 4 times
...
zgwy
5 years, 7 months ago
Wrong...C...the answer is part of a larger python script
upvoted 4 times
D1960
5 years, 2 months ago
C does not look like python https://www.w3schools.com/python/python_for_loops.asp
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago