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.
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)- A3% (1)
- B3% (1)
- D94% (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.
User enumeration typically involves attempting to guess valid usernames, often through authentication mechanisms, not by using `wget` to download a specific file.
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.
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`.
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
Community Discussion
No community discussion yet for this question.