# 1. Perform Active Sniffing

## 1. Perform mac flooding using macof

MAC flooding is a technique used to compromise the security of network switches that connect network segments or network devices. Attackers use the MAC flooding technique to force a switch to act as a hub, so they can easily sniff the traffic.

```
sudo macof -i ens33 -n 10
```

{% hint style="info" %}
-i interface

-n number of packets to send
{% endhint %}

<figure><img src="https://2218819509-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrUBnODuUX4EQ8P27uc5D%2Fuploads%2FiHju8I8k5jOetLPgiiwZ%2Fimage.png?alt=media&#x26;token=7c26199a-2b4f-4427-8475-d13834e4372f" alt=""><figcaption></figcaption></figure>

targeting an  IP address

```
sudo macof -i ens33 -d 192.168.18.1
```

## 2. Perform a DHCP Starvation Attack using Yersinia

In a DHCP starvation attack, an attacker floods the DHCP server by sending a large number of DHCP requests and uses all available IP addresses that the DHCP server can issue. As a result, the server cannot issue any more IP addresses, leading to a Denial-of-Service (DoS) attack.

Start the Yersinia in an interactive mode.

```
sudo yersinia -I
```

press h for help, q to exit help

F2 to open DHCP attack mode. DHCP fields will be shown in the bottom

<figure><img src="https://2218819509-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrUBnODuUX4EQ8P27uc5D%2Fuploads%2FILx8pITxztDdcAwyyjoq%2Fimage.png?alt=media&#x26;token=b2afd52b-cc91-45d8-bc90-8383329e9a0d" alt=""><figcaption></figcaption></figure>

press x to list attack options and the type 1 to conduct DHCP starvation attack.

<figure><img src="https://2218819509-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrUBnODuUX4EQ8P27uc5D%2Fuploads%2Fb7QzWDvDGg1jcgZFcsfx%2Fimage.png?alt=media&#x26;token=33868765-8b0e-4270-93a8-e686ae2607b0" alt=""><figcaption></figcaption></figure>

## <mark style="color:red;">3. Perform Arp poisoning using arpspoof</mark>

Use the following command&#x20;

```
arpspoof -i eth0 -t 192.168.18.1 192.168.18.14
```

{% hint style="info" %}
192.168.18.14 is the target IP
{% endhint %}

Now poison the other machine

```
arpspoof -i eth0 -t 192.168.18.14 192.168.18.1
```

## <mark style="color:red;">4. Man in the Middle attack using cain and able</mark>

<figure><img src="https://2218819509-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrUBnODuUX4EQ8P27uc5D%2Fuploads%2Fbp7kMBQ6G8pV3ha6eNxW%2Fimage.png?alt=media&#x26;token=9b59706b-217c-435e-b7d0-a49d1a530035" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2218819509-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrUBnODuUX4EQ8P27uc5D%2Fuploads%2FywDARHmAAIdalsvuy0EV%2Fimage.png?alt=media&#x26;token=5fded70e-7ace-4e83-919d-ff4000524d2d" alt=""><figcaption></figcaption></figure>

## <mark style="color:red;">5. Spoof mac with TMAC and SMAC</mark>

<https://technitium.com/tmac/>

<https://smac-tool.com/>&#x20;

## <mark style="color:red;">6. Spoof Linux mac using macchanger</mark>

```
ifconfig eth0 down
Macchanger –r eth0
Ifconfig eth0 up
```

To view the mac address

```
macchanger -s eth0
```

{% embed url="<https://www.udemy.com/course/ethical-hacker-practical/?referralCode=289CF01CF51246BCAD6C>" %}
