ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 78 - PT0-003 discussion

Report
Export

A penetration tester completed OSINT work and needs to identify all subdomains for mydomain.com. Which of the following is the best command for the tester to use?

A.
nslookup mydomain.com /path/to/results.txt
Answers
A.
nslookup mydomain.com /path/to/results.txt
B.
crunch 1 2 | xargs -n 1 -I 'X' nslookup X.mydomain.com
Answers
B.
crunch 1 2 | xargs -n 1 -I 'X' nslookup X.mydomain.com
C.
dig @8.8.8.8 mydomain.com ANY /path/to/results.txt
Answers
C.
dig @8.8.8.8 mydomain.com ANY /path/to/results.txt
D.
cat wordlist.txt | xargs -n 1 -I 'X' dig X.mydomain.com
Answers
D.
cat wordlist.txt | xargs -n 1 -I 'X' dig X.mydomain.com
Suggested answer: D

Explanation:

Using dig with a wordlist to identify subdomains is an effective method for subdomain enumeration. The command cat wordlist.txt | xargs -n 1 -I 'X' dig X.mydomain.com reads each line from wordlist.txt and performs a DNS lookup for each potential subdomain.

Step-by-Step Explanation

Command Breakdown:

cat wordlist.txt: Reads the contents of wordlist.txt, which contains a list of potential subdomains.

xargs -n 1 -I 'X': Takes each line from wordlist.txt and passes it to dig one at a time.

dig X.mydomain.com: Performs a DNS lookup for each subdomain.

Why This is the Best Choice:

Efficiency: xargs efficiently processes each line from the wordlist and passes it to dig for DNS resolution.

Automation: Automates the enumeration of subdomains, making it a practical choice for large lists.

Benefits:

Automates the process of subdomain enumeration using a wordlist.

Efficiently handles a large number of subdomains.

Reference from Pentesting Literature:

Subdomain enumeration is a critical part of the reconnaissance phase in penetration testing. Tools like dig and techniques involving wordlists are commonly discussed in penetration testing guides.

HTB write-ups often detail the use of similar commands for efficient subdomain enumeration.

Penetration Testing - A Hands-on Introduction to Hacking

HTB Official Writeups

asked 02/10/2024
Sander de Beus
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first