> For the complete documentation index, see [llms.txt](https://hackzzz.gitbook.io/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hackzzz.gitbook.io/welcome/everything-about-and-notes/network-pentesting/dns-spoofing-+-apache2.md).

# DNS spoofing + apache2

<figure><img src="https://1589701199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9hCCmXtAKNvbIKRqULt%2Fuploads%2FNO3KoQt5nJZTNy6Vxefn%2Fdnsspoof1.png?alt=media&amp;token=22dc1c5e-3060-40b2-9465-ccafcf664361" alt=""><figcaption></figcaption></figure>

First, set you *html page* and start the ***apache2*** service.

<figure><img src="https://1589701199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9hCCmXtAKNvbIKRqULt%2Fuploads%2FYOeRYd6jnWmqXG6loXMz%2Fdnsspoof2.png?alt=media&amp;token=76735ab4-bff6-4260-b677-4ba0922738bc" alt=""><figcaption></figcaption></figure>

Now, configure the ***`/etc/ettercap/etter.conf`*** and set these **2** variables to **0**.

<figure><img src="https://1589701199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9hCCmXtAKNvbIKRqULt%2Fuploads%2FMeOL4qnVw2nBIMJRpUXQ%2Fdnsspoof3.png?alt=media&amp;token=a3761ae5-bb4e-4c75-95d3-e3f51422a628" alt=""><figcaption></figcaption></figure>

Third step, open the ***`/etc/ettercap/etter.dns`*** and set the domains you want to spoof.

<figure><img src="https://1589701199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9hCCmXtAKNvbIKRqULt%2Fuploads%2FG4QUTeGrde4bzv87gWVN%2Fdnsspoof4.png?alt=media&amp;token=fab56448-3fc8-4db2-9350-73a72a338def" alt=""><figcaption></figcaption></figure>

Now start an *ARP spoof* with **ettercap**.

<figure><img src="https://1589701199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9hCCmXtAKNvbIKRqULt%2Fuploads%2FAvrh9Sys975vKVYts3Ui%2Fdnsspoof5.png?alt=media&amp;token=2fcfa595-743f-40bf-924a-4f424a003cae" alt=""><figcaption></figcaption></figure>

Later than, go to *plugins* and double click the **dns\_spoof** plugin.

{% hint style="info" %}
This will **not** work if the website you are spoofing haves **HSTS** security.
{% endhint %}
