hacktricks/generic-methodologies-and-resources/pentesting-network/lateral-vlan-segmentation-bypass.md

82 lines
4.9 KiB
Markdown
Raw Normal View History

# Lateral VLAN Segmentation Bypass
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-09-30 10:43:59 +00:00
<details>
<summary>Support HackTricks</summary>
2022-09-30 10:43:59 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-09-30 10:43:59 +00:00
</details>
{% endhint %}
2022-09-30 10:43:59 +00:00
Ikiwa ufikiaji wa moja kwa moja kwa swichi upo, ugawaji wa VLAN unaweza kupuuziliwa mbali. Hii inahusisha kubadilisha mipangilio ya bandari iliyounganishwa kuwa hali ya trunk, kuanzisha interfaces za virtual kwa VLAN zinazolengwa, na kuweka anwani za IP, ama kwa njia ya kidinamik (DHCP) au kwa njia ya statiki, kulingana na hali (**kwa maelezo zaidi angalia [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)).**
2022-09-30 10:43:59 +00:00
Kwanza, utambulisho wa bandari maalum iliyounganishwa unahitajika. Hii kwa kawaida inaweza kufanywa kupitia ujumbe wa CDP, au kwa kutafuta bandari kupitia **include** mask.
2022-09-30 10:43:59 +00:00
**Ikiwa CDP haifanyi kazi, utambulisho wa bandari unaweza kujaribiwa kwa kutafuta anwani ya MAC**:
2022-09-30 10:43:59 +00:00
```
SW1(config)# show mac address-table | include 0050.0000.0500
```
Kabla ya kubadilisha kuwa hali ya trunk, orodha ya VLAN zilizopo inapaswa kuandaliwa, na vitambulisho vyao kubainishwa. Vitambulisho hivi kisha vinapewa kiunganishi, na kuwezesha ufikiaji wa VLAN mbalimbali kupitia trunk. Bandari inayotumika, kwa mfano, inahusishwa na VLAN 10.
2022-09-30 10:43:59 +00:00
```
SW1# show vlan brief
```
**Kuhamia katika hali ya trunk kunahusisha kuingia katika hali ya usanidi wa kiunganishi**:
2022-09-30 10:43:59 +00:00
```
SW1(config)# interface GigabitEthernet 0/2
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
```
Kuhamia kwenye hali ya trunk kutasababisha usumbufu wa muda katika muunganisho, lakini hii inaweza kurejeshwa baadaye.
2022-09-30 10:43:59 +00:00
Mikondo ya virtual kisha inaundwa, inatolewa ID za VLAN, na inactivated:
2024-02-07 04:06:18 +00:00
```bash
sudo vconfig add eth0 10
sudo vconfig add eth0 20
sudo vconfig add eth0 50
sudo vconfig add eth0 60
sudo ifconfig eth0.10 up
sudo ifconfig eth0.20 up
sudo ifconfig eth0.50 up
sudo ifconfig eth0.60 up
2022-09-30 10:43:59 +00:00
```
Kisha, ombi la anwani linafanywa kupitia DHCP. Vinginevyo, katika hali ambapo DHCP haiwezekani, anwani zinaweza kuwekwa kwa mikono:
2024-02-07 04:06:18 +00:00
```bash
sudo dhclient -v eth0.10
sudo dhclient -v eth0.20
sudo dhclient -v eth0.50
sudo dhclient -v eth0.60
2022-09-30 10:43:59 +00:00
```
Mfano wa kuweka anwani ya IP ya kudumu kwenye kiunganishi (VLAN 10):
2024-02-07 04:06:18 +00:00
```bash
sudo ifconfig eth0.10 10.10.10.66 netmask 255.255.255.0
2022-09-30 10:43:59 +00:00
```
Connectivity inajaribiwa kwa kuanzisha maombi ya ICMP kwa milango ya default ya VLANs 10, 20, 50, na 60.
2022-09-30 10:43:59 +00:00
Hatimaye, mchakato huu unaruhusu kupita kwa segmentation ya VLAN, hivyo kuwezesha ufikiaji usio na kikomo kwa mtandao wowote wa VLAN, na kuweka msingi wa hatua zinazofuata.
2022-09-30 10:43:59 +00:00
## References
2022-09-30 10:43:59 +00:00
2024-02-03 14:45:32 +00:00
* [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)
2022-09-30 10:43:59 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-09-30 10:43:59 +00:00
<details>
<summary>Support HackTricks</summary>
2022-09-30 10:43:59 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-09-30 10:43:59 +00:00
</details>
{% endhint %}