PATCH//NOTES Open it in the app
← All hands-on practice
Ethical hacking · 10 min

Fix the recon script

A tester left a Bash script that sweeps the client's addresses. Before it runs again, read it line by line and decide what has to change.

Start it: free, in your browser, no account

What you will do

  1. Which language is sweep.sh written in, and what gives it away?
  2. As written, which addresses does the loop sweep?
  3. Change one number so the loop stays in scope: seq 1 ___
  4. A server in scope blocks ping but runs a website. What does the script do with it?
  5. What does >> "$OUT" do on the nmap line?
  6. Which variable holds the name of the results file?

Exam objectives it practises

  • CompTIA A+ Core 2 4.8 Scripting basics
  • CompTIA PenTest+ 2.3 Modifying scripts for recon
  • CompTIA PenTest+ 4.10 Scripting to automate attacks

A short teaching script. Real teams usually feed a scope file to nmap (-iL) rather than looping over ping; the ideas are the same.