Reconnaissance and Automation: Tying User Management, OSINT, and Python Together
This final project pulled three genuinely different skill areas together into one piece of work: managing user accounts at the system level, gathering reconnaissance on a real public domain using standard open-source intelligence tools, and then writing a Python script to automate part of that reconnaissance process.
Most of the individual labs I've worked through recently each focused on one tool or one specific technique in isolation. This final project pulled three genuinely different skill areas together into one piece of work: managing user accounts at the system level, gathering reconnaissance on a real public domain using standard open-source intelligence tools, and then writing a Python script to automate part of that reconnaissance process. None of these three parts depend on each other technically, but together they represent a realistic slice of what a security or sysadmin role actually involves day to day: account hygiene, information gathering, and automating the repetitive parts of both.
Part 1: User Account Lifecycle Management
The first part worked through the complete lifecycle of a local Linux user account, create, rename, update credentials, and finally delete, each step using the correct purpose-built command rather than trying to force one tool to do another's job.
Creating the account used
adduser , run with elevated privileges, since creating accounts is an administrative action requiring root access. adduser (as opposed to the lower-level useradd ) is the more guided, interactive option on most Debian-based systems like Kali, handling details like home directory creation and default group assignment with less manual configuration required.Renaming the account used
usermod , the standard tool for modifying properties of an existing user account. One detail mattered specifically here: before renaming, I had to make sure no active processes were still running under the current username. That's not an arbitrary caution, a username change while the OS still has live processes associated with the old name can cause the rename to fail or leave the system in an inconsistent state, since the kernel is tracking those processes by user ID and associated metadata that the rename operation needs to update cleanly.Updating the password used
passwd , specifically targeted at the renamed account, the dedicated, purpose-built tool for setting or resetting a specific user's credentials, rather than trying to edit anything manually.Deleting the account used
deluser with the --remove-home option specifically. That flag matters: without it, deleting a user account removes the account itself but can leave its home directory, and everything still sitting in it, behind on the disk. Including --remove-home ensures a complete account teardown, both the account and its associated files, rather than a partial cleanup that leaves orphaned data sitting around after the user is technically gone.The assessment structure for this part was itself a good habit: saving the full, exact command used for each step, not just confirming the action completed. That's a real operational practice, documented commands are auditable and repeatable; vague memory of "I think I used usermod for something" isn't.
Part 2: OSINT Reconnaissance on a Real Public Domain
The second part moved from local system administration to external reconnaissance, gathering publicly available information about a real domain,
ibm.com , using three standard, widely-used tools, each one surfacing a different category of information.whois queries domain registry records, publicly available information about who registered a domain and when. Running it against ibm.com surfaced the domain's creation year along with registrant name and organization details. This is entirely public record information, the same kind of data anyone can look up through a domain registrar's own public lookup tools, but whois is the standard command-line way to query it directly.dig (Domain Information Groper) queries DNS records directly, a fundamentally different category of information than registration data. Running dig against ibm.com returned the domain's A record, its IPv4 address, along with identifying which specific DNS server had actually responded to the query. Where whois tells you who owns a domain, dig tells you how that domain actually resolves on the network right now, two genuinely different, complementary pieces of reconnaissance.Nmap's service version detection (
-sV ) ran against scanme.nmap.org , the Nmap project's own officially sanctioned public test target, set up specifically so people can legally practice scanning it. Unlike a basic port scan that just reports open or closed, version detection goes further, attempting to identify the specific service and version running behind each open port, and in this case, surfaced information suggesting the target's underlying operating system as well.Putting these three together illustrates something worth understanding clearly: each tool answers a genuinely different question.
whois answers "who registered this domain and when." dig answers "how does this domain currently resolve on the network." Nmap answers "what's actually running on the systems behind that resolution." None of the three substitutes for either of the others; a real reconnaissance phase of an investigation or an authorized assessment typically needs all three, layered together, not just one.Part 3: Automating Part of That Process
The final part took one specific piece of that reconnaissance workflow, DNS lookups via
dig , and wrapped it in a small Python script ( dig.py ), building on exactly the same "wrap an existing tool" pattern from automating Nmap in an earlier lab.The script's requirements were specific: use the
os module to actually execute the dig command, prompt the user interactively for a domain name rather than hardcoding one, save the resulting output to a file named dig_output.txt , and print a clear confirmation message telling the user exactly where that output had been saved.That last requirement, the confirmation message, is a small but genuinely important piece of good tool design. A script that silently writes a file somewhere, with no indication of what happened or where the result landed, forces the user to go hunting for output they're not even certain was actually created. An explicit print statement confirming the save location closes that gap immediately, removing any doubt about whether the script actually did what it was supposed to.
Using the
os module here (rather than subprocess , which the earlier Nmap-wrapping lab used) is itself worth noting. Both modules are capable of executing external system commands from within Python, os.system() is a simpler, more direct interface, while subprocess offers considerably more control, capturing output programmatically, handling arguments as a structured list instead of a raw command string, and generally being the more robust choice recommended for anything beyond the simplest cases. Seeing both approaches across these labs is a useful contrast: os.system() gets something working quickly and simply, while subprocess is the better foundation to actually build on for anything more involved.What Tying These Three Parts Together Actually Demonstrates
A few things stood out about why this specific combination, account management, OSINT reconnaissance, and automation, makes sense as a single capstone rather than three unrelated exercises.
Documentation discipline applies at every scale, from a single command to a full reconnaissance workflow. Saving the exact command used for a user management task, and recording the specific findings from each reconnaissance tool, are both instances of the same underlying habit: a security or sysadmin task isn't really complete until there's a clear, reviewable record of exactly what was done and what was found.
Different tools exist because they answer genuinely different questions, not because one is simply "better" than another.
whois , dig , and Nmap each surface a different category of information about the same target. Treating them as interchangeable, or skipping two because the third seemed sufficient, would leave real gaps in an actual investigation or assessment.Automating a manual process is most valuable once you've actually understood the manual process first. Writing a script to automate
dig lookups only makes sense, and only gets built correctly, once you genuinely understand what dig does, what its output means, and why you'd want to save it. Automation without that underlying understanding just produces a script that works by accident rather than by design.A good script tells you what it did, not just that it finished. The explicit confirmation message requirement in the
dig.py script is a small detail that reflects a real, general principle: automation that runs silently and leaves the user guessing about its results is worse than no automation at all, because it adds a layer of uncertainty on top of whatever time it saved.Final Thoughts
This final project worked because its three parts, while technically independent, all reinforced the same underlying discipline: do the task correctly with the right purpose-built tool, document exactly what was done, and where repetition makes sense, automate it, but only once the underlying manual process is actually understood well enough to automate correctly.
That's a genuinely realistic shape for security and sysadmin work more broadly: a mix of hands-on account management, careful information gathering using the right tool for each specific question, and automation built on top of real understanding rather than in place of it.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article