← 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
- Which language is sweep.sh written in, and what gives it away?
- As written, which addresses does the loop sweep?
- Change one number so the loop stays in scope: seq 1 ___
- A server in scope blocks ping but runs a website. What does the script do with it?
- What does >> "$OUT" do on the nmap line?
- 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.