nerdexam
EC-Council

312-50V10 · Question #921

You start performing a penetration test against a specific website and have decided to start from grabbing all the links from the main page. What Is the best Linux pipe to achieve your milestone?

The correct answer is C. wget https://stte.com | grep "< a href=\*http" | grep "site.com". Fetching a webpage and piping its HTML through grep to filter anchor tags is the standard Linux command-line approach for extracting all hyperlinks from a target page.

Footprinting and Reconnaissance

Question

You start performing a penetration test against a specific website and have decided to start from grabbing all the links from the main page. What Is the best Linux pipe to achieve your milestone?

Options

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    4% (1)
  • C
    91% (21)

Why each option

Fetching a webpage and piping its HTML through grep to filter anchor tags is the standard Linux command-line approach for extracting all hyperlinks from a target page.

Adirb https://site.com | grep "site"

dirb is a web directory brute-force scanner that discovers hidden paths by testing a wordlist against a server - it does not parse or extract anchor tags from HTML.

Bcurl -s https://sile.com | grep `'< a href-\'http" | grep "Site-com- | cut -d "V" -f 2

Although curl outputs to stdout and pipes naturally to grep, the command in choice B contains multiple syntax errors including broken quoting and malformed grep patterns that would cause it to fail.

Cwget https://stte.com | grep "< a href=\*http" | grep "site.com"Correct

The wget command retrieves the full HTML of the target URL and its output can be piped into grep to pattern-match anchor tags such as 'a href' and isolate hyperlinks from the page source. Adding a second grep filter for the site's domain further narrows results to on-site links, completing the link-harvesting goal with a simple pipe chain.

Dwgethttps://site.com | cut-d"http-

The command in choice D is syntactically incomplete, with a broken cut invocation and no valid grep filter, making it non-functional for extracting links.

Concept tested: Linux CLI link harvesting with wget and grep pipe

Source: https://www.gnu.org/software/wget/manual/wget.html

Topics

#web crawling#link extraction#curl wget#web reconnaissance

Community Discussion

No community discussion yet for this question.

Full 312-50V10 Practice