DNS Spoofing MITM

Hi everyone,

Im stuck at runing apache2 hosting location when i run bettercap and spoof my target url it doesnt work

I check the status of apache2 and the html file is hosting in 127.0.0.1

which is not the default interface of the “IP address to map the domains to. (default=)”

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://httpd.apache.org/docs/2.4/

Nov 05 12:38:37 kali systemd[1]: Starting The Apache HTTP Server…
Nov 05 12:38:37 kali apachectl[1918]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive glob>
Nov 05 12:38:37 kali systemd[1]: Started The Apache HTTP Server.
Nov 05 13:07:42 kali systemd[1]: Stopping The Apache HTTP Server…
Nov 05 13:07:42 kali apachectl[3799]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive glob>
Nov 05 13:07:42 kali systemd[1]: apache2.service: Succeeded.
Nov 05 13:07:42 kali systemd[1]: Stopped The Apache HTTP Server.

I hope im making some sense

thank you

Hi Lunaribis,

Please restart Apache 2 and flush any IP table rules
iptables -F && /etc/init.d/apache2 restart

Then reboot Kali, and run bettercap as shown in the lecture. If you still have issues, then kindly show me the following:

  • ifconfig in Kali

  • ipconfig in the target machine

  • The caplet file contents “spoof.cap”

  • Kali’s network settings, so just right-click the Kali machine from Virtual box >> Settings >> Network, take a screenshot and post it here please.

Thank you.

Hi AJS

thankyou for your reply

the net work on my virtualbox is connected to NAT network ( both target machine and and kali are on the same nat network)

what im having trouble with is when i start apache2

the defualt web page for my local webserver is 10.0.2.15 (which is the defult ) but when i going into /var/www/html and changed the content of the index.html file

it doesnt show when i go to 10.0.2.15 on my browser BUT

if i go to 127.0.0.1 thats where the index.html file that i made chages to would show

I hope im making sense

thankyou :))

Hi Luaribis,

Please make sure that you restart the web server again by service apache2 restart after you made the changes to /var/www/html/index.html, and please note that the 127.0.0.1 is the loopback IP address which will routes the requests to the local machine, so it’s normal that you’re seeing the new page when you open it as http://127.0.0.1:80 (Apache 2 runs on port 80 by default), so please make sure that you’re typing the correct IP address of Kali, just do ifconfig and see.

If you still have issues, then you can change the port of Apache 2, then restart the web server and access Kali IP address again:

gedit /etc/apache2/ports.conf

Change the port from 80 to another port (e.g. 3377) >> Save & Quit.

Restart Apache 2:
/etc/init.d/apache2 restart

Check again:
firefox localhost:3377

Regards, AJ.

Hey AJS,

Thankyou so much for you support! but im still having problems with this issue.

I have done what you said
1.restart apache2
2.changed the port to 3377 save&quit
and after i run

it show the new modified index.html file

BUT

when i type my local ip which is 10.0.2.15 it goes stright back to the Apache2 Debian Default Page. :sweat:

Ive skiped this chapter and move on to the next but i would like to understand what im doing wrong here.

is there anymeterial or other courses in station x i can go and study more on this?

Thank you veryy much! AJS

Hi Lunaribis,

Please try to reset apache2 to use whatever you put in /var/www using the following command:
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/

And delete the browsing data from the browser (history, cookies ….etc). Then restart it as shown above, and let me know. For more info, please check out the followoing post:

Please let me know if you face any issue again.

Hi Lunaribis,

Please try to reset apache2 to use whatever you put in /var/www using the following command:
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/

And delete the browsing data from the browser (history, cookies ….etc). Then restart it as shown above, and let me know. For more info, please check out the following post:

Please let me know if you face any issues again.

Thank you AJS i really appreciate your support

this is what i did im not sure its correct but it seems to be working


If you just change the port or add more ports here, you will likely also

have to change the VirtualHost statement in

/etc/apache2/sites-enabled/000-default.conf

Listen 3377

IfModule ssl_module>

Listen 3377

/IfModule>

IfModule mod_gnutls.c>

Listen 3377

/IfModule>

vim: syntax=apache ts=4 sw=4 sts=4 sr noet


:grin:

Great stuff! Glad you managed to figure it out :slight_smile: