Linux PrivEsc
Tools/Skills: Linux CLI, assigned privileges, command injection, privilege escalation
SYNOPSIS
From inside of a user's (non-root/admin) account, run a binary that's stored in root.
By identifying a command that allowed for unintended privilege escalation (simplecopy), I was able to copy the root directory, including the binary into my account. This allowed me to see the name of what I needed to run. From there, I was able to use a command injection to escalate my privileges to root long enough to run the binary.
Clue
SOLUTION
Identify the command that allows for unintended privilege escalation:
simplecopy
Copy the root directory into the elf directory → observe the name of the file in the root directory:
“runmetoanswer”
Remember the hint: “escalate privileges inside this terminal and then run the binary in /root”
simplecopy
→ escalates privileges/home/elf/runmetoanswer
→ would run the binary if I had escalated privileges.Combine:
simplecopy /root/* "/home/elf; /home/elf/runmetoanswer"
Answer: “santa”
PROCESS
A lot of trial and error
A lot of the hints in the discord channel that others had provided
I used ChatGPT anytime I thought it might help (and even some moments I didn’t think it would, but hoped it might)
My first moment of hope: When I managed to successfully copy the root directory into my directory. This allowed me to see the name of what I wanted to execute, but I still couldn’t execute it.
Discord Hints
Simple Copy
Should be one, simple command
Command Injection
Consider different ways to combine commands
Link for how-to do a command injection: Ultimately this led to me figuring out the answer
Extra trial and error for:using the quotation marks, where to put the quotation marks, the semicolon, and the space after the semicolon.
Example Prompts:
Would any of these contain information about ways to perform a privilege escalation? . .dockerenv boot etc lib lib64 media opt root sbin sys usr .. bin dev home lib32 libx32 mnt proc run srv tmp var
How do I list with information about access?
What are command separators?
Last updated