hacktricks/linux-hardening/privilege-escalation/ssh-forward-agent-exploitation.md

54 lines
3.5 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 kwenye HackTricks** au **kupakua HackTricks kwa 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>
2024-02-11 02:13:58 +00:00
# Muhtasari
2024-02-11 02:13:58 +00:00
Unaweza kufanya nini ikiwa unagundua ndani ya usanidi wa `/etc/ssh_config` au ndani ya usanidi wa `$HOME/.ssh/config` hii:
```
ForwardAgent yes
```
2024-02-11 02:13:58 +00:00
Ikiwa wewe ni mzizi ndani ya mashine, labda unaweza **kupata uhusiano wowote wa ssh uliofanywa na wakala wowote** ambao unaweza kupata katika saraka ya _/tmp_
2024-02-11 02:13:58 +00:00
Jifanya kuwa Bob kwa kutumia moja ya ssh-agent ya Bob:
```bash
SSH_AUTH_SOCK=/tmp/ssh-haqzR16816/agent.16816 ssh bob@boston
```
2024-02-11 02:13:58 +00:00
## Kwa nini hii inafanya kazi?
2024-02-11 02:13:58 +00:00
Unapoweka kipengele `SSH_AUTH_SOCK` unapata ufikiaji wa funguo za Bob ambazo zimetumiwa katika uhusiano wa ssh wa Bob. Kisha, ikiwa funguo yake binafsi bado iko hapo (kawaida itakuwepo), utaweza kupata ufikiaji kwa mwenyeji yeyote kwa kuitumia.
2024-02-11 02:13:58 +00:00
Kwa kuwa funguo binafsi imehifadhiwa kwenye kumbukumbu ya wakala bila kusimbwa, nadhani ikiwa wewe ni Bob lakini haujui nenosiri la funguo binafsi, bado unaweza kupata ufikiaji kwa wakala na kuitumia.
2024-02-11 02:13:58 +00:00
Chaguo lingine ni kwamba mtumiaji mmiliki wa wakala na root wanaweza kupata ufikiaji wa kumbukumbu ya wakala na kuchukua funguo binafsi.
2024-02-11 02:13:58 +00:00
# Maelezo marefu na utumiaji
2024-02-11 02:13:58 +00:00
**Angalia [utafiti halisi hapa](https://www.clockwork.com/insights/ssh-agent-hijacking/)**
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua AWS kutoka mwanzo hadi kuwa bingwa na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</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 kwenye HackTricks** au **kupakua HackTricks kwa muundo wa PDF** Angalia [**MPANGO WA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi wa 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) za 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 PR kwa** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>