Attacks and Exploits

A tester's Bash loop runs a password-spraying tool once per host. Results must accumulate in spray.log across runs, and error messages must appear neither on screen nor in the log. Which two redirections should be added to the command? (Choose two.)

Choose 2 answers

Show the answer

Correct answersE. 2>/dev/nullF. >> spray.log

AWhy not this: Sends stderr to the same place as stdout, so errors would end up in the log.

BWhy not this: Without -a, tee overwrites the file each run, and stderr still prints to the screen.

CWhy not this: Feeds the file into standard input; it does not save any output.

DWhy not this: Overwrites the file on every run, so earlier results are lost.

EWhy this is right: Discards stderr, so errors show up neither on screen nor in the log.

FWhy this is right: Appends standard output to the file, so results accumulate across runs.

Appending with >> keeps earlier results, and 2>/dev/null discards stderr. A single > overwrites the file on every run, and 2>&1 would merge the errors into the log.