hacktricks/linux-hardening/linux-post-exploitation/pam-pluggable-authentication-modules.md

77 lines
5.6 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 inatangazwa 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 kipekee wa [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Jiunge na** 💬 [**Kikundi cha Discord**](https://discord.gg/hRep4RUj7f) au [**kikundi cha telegram**](https://t.me/peass) au **tufuate** kwenye **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
* **Shiriki mbinu zako za kudukua kwa kuwasilisha PRs kwa** [**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
## Taarifa Msingi
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
**PAM (Moduli za Uthibitishaji Zinazoweza Kusanikishwa)** inafanya kazi kama kifaa cha usalama ambacho **inathibitisha utambulisho wa watumiaji wanaojaribu kupata huduma za kompyuta**, kudhibiti upatikanaji wao kulingana na vigezo mbalimbali. Ni kama mlinzi wa dijiti, ikihakikisha kuwa ni watumiaji walioruhusiwa tu ndio wanaweza kutumia huduma maalum wakati inawezekana kupunguza matumizi yao ili kuzuia mzigo wa mfumo.
2024-02-07 04:06:18 +00:00
2024-02-11 02:13:58 +00:00
### Faili za Usanidi
2024-02-07 04:06:18 +00:00
2024-02-11 02:13:58 +00:00
- **Mifumo ya Solaris na UNIX** kwa kawaida hutumia faili ya usanidi ya kati iliyo katika eneo la `/etc/pam.conf`.
- **Mifumo ya Linux** inapendelea njia ya saraka, ikihifadhi usanidi maalum wa huduma ndani ya `/etc/pam.d`. Kwa mfano, faili ya usanidi kwa huduma ya kuingia inapatikana katika `/etc/pam.d/login`.
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
Mfano wa usanidi wa PAM kwa huduma ya kuingia unaweza kuonekana kama ifuatavyo:
2021-06-23 17:08:03 +00:00
```text
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_nologin.so
auth sufficient /lib/security/pam_ldap.so
auth required /lib/security/pam_unix_auth.so try_first_pass
account sufficient /lib/security/pam_ldap.so
account required /lib/security/pam_unix_acct.so
password required /lib/security/pam_cracklib.so
password required /lib/security/pam_ldap.so
password required /lib/security/pam_pwdb.so use_first_pass
session required /lib/security/pam_unix_session.so
```
2024-02-11 02:13:58 +00:00
### **Maeneo ya Usimamizi wa PAM**
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
Maeneo haya, au vikundi vya usimamizi, vinajumuisha **uthibitisho**, **akaunti**, **nenosiri**, na **kikao**, kila moja ikihusika na vipengele tofauti vya mchakato wa uthibitisho na usimamizi wa kikao:
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
- **Uthibitisho**: Inathibitisha kitambulisho cha mtumiaji, mara nyingi kwa kumuuliza nenosiri.
- **Akaunti**: Inashughulikia uthibitisho wa akaunti, ikichunguza hali kama uanachama wa kikundi au vizuizi vya wakati wa siku.
- **Nenosiri**: Inasimamia sasisho za nenosiri, ikiwa ni pamoja na ukaguzi wa utata au kuzuia mashambulizi ya kamusi.
- **Kikao**: Inasimamia hatua wakati wa kuanza au kumaliza kikao cha huduma, kama vile kufunga saraka au kuweka mipaka ya rasilimali.
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
### **Mipangilio ya Moduli ya PAM**
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
Mipangilio inaamua jinsi moduli itakavyojibu mafanikio au kushindwa, ikichochea mchakato wa uthibitisho kwa ujumla. Hii ni pamoja na:
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
- **Inahitajika**: Kushindwa kwa moduli inayohitajika kunasababisha kushindwa kwa mwisho, lakini baada ya kuchunguzwa kwa moduli zote zinazofuata.
- **Inahitajika Mara moja**: Kukatishwa kwa mchakato mara moja baada ya kushindwa.
- **Inatosha**: Mafanikio yanapuuza ukaguzi wa sehemu iliyobaki ya eneo hilo isipokuwa moduli inayofuata inashindwa.
- **Hiari**: Inasababisha kushindwa tu ikiwa ni moduli pekee katika safu.
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
### Mfano wa Skena
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
Katika mazingira yenye moduli nyingi za uthibitisho, mchakato unafuata mpangilio thabiti. Ikiwa moduli ya `pam_securetty` inagundua kuwa kituo cha kuingia hakiruhusiwi, kuingia kwa mtumiaji wa mizizi kunazuiliwa, lakini moduli zote bado zinashughulikiwa kutokana na hadhi yake ya "inahitajika". Moduli ya `pam_env` inaweka mazingira ya pembejeo, ikisaidia uzoefu wa mtumiaji. Moduli za `pam_ldap` na `pam_unix` zinafanya kazi pamoja kuthibitisha mtumiaji, na `pam_unix` inajaribu kutumia nenosiri lililotolewa hapo awali, ikiboresha ufanisi na uwezo katika njia za uthibitisho.
2021-06-23 17:08:03 +00:00
2024-02-11 02:13:58 +00:00
## Marejeo
2024-02-07 04:06:18 +00:00
* [https://hotpotato.tistory.com/434](https://hotpotato.tistory.com/434)
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 (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 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) za kipekee
* **Jiunge na** 💬 [**Kikundi cha Discord**](https://discord.gg/hRep4RUj7f) au [**kikundi cha telegram**](https://t.me/peass) au **tufuate** kwenye **Twitter** 🐦 [**@hacktricks_live**](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>