nerdexam
CompTIA

PT0-002 · Question #485

Given the following Bash code snippet: Which of the following would be achieved?

The correct answer is D. File download. The provided Bash code snippet wget -O output.txt http://example.com/file.zip would achieve a file download. The wget command is used to retrieve content from web servers, with the -O flag specifying the output filename.

Post-exploitation and lateral movement

Question

Given the following Bash code snippet:

Which of the following would be achieved?

Options

  • AUser enumeration
  • BDirectory brute-force attack
  • CPort scan
  • DFile download

How the community answered

(35 responses)
  • A
    3% (1)
  • B
    3% (1)
  • D
    94% (33)

Why each option

The provided Bash code snippet `wget -O output.txt http://example.com/file.zip` would achieve a file download. The `wget` command is used to retrieve content from web servers, with the `-O` flag specifying the output filename.

AUser enumeration

User enumeration typically involves attempting to guess valid usernames, often through authentication mechanisms, not by using `wget` to download a specific file.

BDirectory brute-force attack

A directory brute-force attack involves systematically trying to discover hidden directories or files on a web server, which is not the function of a single `wget` command targeting a known file.

CPort scan

A port scan involves checking for open ports on a target system, usually with tools like Nmap, and is unrelated to downloading a file using `wget`.

DFile downloadCorrect

The `wget` command is a command-line utility used for retrieving content from web servers. The `-O output.txt` option specifies that the downloaded content from `http://example.com/file.zip` should be saved to a local file named `output.txt`. Therefore, this command directly performs a file download.

Concept tested: Linux command-line tools - wget for file download

Source: https://linux.die.net/man/1/wget

Topics

#Bash scripting#File download#Command-line utilities#Data transfer

Community Discussion

No community discussion yet for this question.

Full PT0-002 Practice