Practical Example of OS Security: Gaining Access Through Weak Passwords
Jose Pacheco
Disney Aspire | Physical Security Professional Master's in CIS and Cybersecurity CompTIA A+ / Network+ / Security+ Certified BS in Psychology & Criminal Justice | Red Team Enthusiast
During my journey through TryHackMe’s Operating System Security room, I got a deeper understanding of how critical it is to secure our operating systems, be it on a smartphone or a laptop. Every day, we interact with operating systems like Windows, macOS, Linux, iOS, and Android, without realizing how vulnerable they can be if left unprotected. This room taught me not only the theory but also gave me hands-on experience in exploiting weaknesses that exist in operating systems.
In this article, I’ll walk you through what I learned about operating system security and, more importantly, the practical exercise I completed?—?gaining access to a target system by exploiting weak passwords and then escalating privileges to root.
Understanding Operating System?Security
Before I dive into the practical example, it’s important to explain the basic security principles surrounding operating systems. Operating System Security (OS Security) ensures that the data on our devices remains private, accurate, and accessible. This is typically referred to as the CIA Triad:
These security concerns become even more critical when we consider the vast amount of personal and professional information stored on our devices?—?whether it’s private photos, work documents, or saved passwords in our browsers.
Common OS Security Vulnerabilities
One of the key things I learned from the room is how attackers exploit vulnerabilities in operating systems to compromise the CIA Triad. Some of the most common vulnerabilities include:
Practical Example: Gaining Access Through Weak Passwords
In this exercise, I played the role of an attacker trying to gain access to a Linux machine by exploiting a weak password. This hands-on example gave me an understanding of just how vulnerable a system can be if simple security best practices aren’t followed.
Step 1: Connecting to the Target?Machine
I started by launching the AttackBox and the target machine in the TryHackMe room. Once both were up, I opened the terminal on the AttackBox and initiated an SSH connection to the target machine, where the user “sammie” was my target.
Based on a clue I found in the scenario, the password for “sammie” was found on a sticky note in the office, which read: dragon. This highlights how common bad password practices can compromise an entire system.
Here’s the command I used to connect:
After entering the password dragon, I was in!
领英推荐
Step 2: Elevating Privileges to?Root
Once I gained access as “sammie,” my next objective was to escalate my privileges to root (the administrator account on Linux). Having root access means complete control over the system, allowing me to view or modify any file.
To do this, I needed to figure out the password for another user, “johnny.” The TryHackMe room provided a list of the most commonly used weak passwords, and I started systematically trying them out. By the time I reached the seventh password, abc123, I successfully logged in as johnny:
su - johnny
After logging in as Johnny, I ran the history command to see if Johnny had carelessly typed the root password in the terminal before, and sure enough, there it was:
The password happyHack!NG appeared in Johnny’s history, and using this password, I switched to the root account:
su - root
Once I had root access, I confirmed it by using the whoami command, which returned root.
Step 3: Retrieving the Final?Flag
With root access, I had full control over the system. The final task was to retrieve a file called flag.txt located in the root directory. I used the ls command to list the files and cat to display the content of the flag file.
ls
cat flag.txt
I successfully captured the flag: THM{YouGotRoot}.
Conclusion
This exercise reinforced just how vulnerable operating systems can be if they aren’t properly secured. The use of weak passwords, poor file permissions, and leaving command history exposed are all mistakes that open the door for attackers. Through this TryHackMe room, I’ve seen firsthand how these vulnerabilities can be exploited in real-world scenarios.
As a takeaway, here are some key lessons I learned:
By improving basic security hygiene, we can make operating systems much harder for attackers to exploit. Whether it’s my smartphone or my laptop, I now understand how important it is to secure the operating systems running on these devices.
#Cybersecurity #OSSecurity #OperatingSystemSecurity #TryHackMe #BlueTeam #PrivilegeEscalation #LinuxSecurity #SSH #WeakPasswords #PasswordSecurity #RootAccess #Infosec #SystemSecurity #CyberThreats #SecurityAwareness #PenetrationTesting #SecurityBestPractices #CyberHygiene #PrivilegeManagement #DigitalSecurity
Cybersecurity Analyst || Network Security || Assisted in configuring security policies || Conducted vulnerability assessments || Firewall Configuration
5 个月This is great information. Your walkthrough is very clear and explains completely how critical it is to have and protect secure passwords.