|
L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t hBog'liq linuxbasicsforhackersleafpad /etc/hosts
You should now see your hosts file, which will look something like
Figure 3-3.
Figure 3-3: A default Kali Linux
hosts
file
By default, the hosts file contains only a mapping for your localhost, at
127.0.0.1, and your system’s hostname (in this case, Kali, at 127.0.1.1). But you
can add any IP address mapped to any domain you’d like. As an example of
how this might be used, you could map www.bankofamerica.com to your local
website, at 192.168.181.131.
127.0.0.1 localhost
127.0.1.1 kali
192.168.181.131 bankofamerica.com
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Make certain you press
tab
between the IP address and the domain
key—not the spacebar.
As you get more involved in your hacking endeavors and learn about
tools like
dnsspoof
and Ettercap, you’ll be able to use the hosts file to direct
any traffic on your LAN that visits www.bankofamerica.com to your web server
at 192.168.181.131.
Pretty easy, right?
Analyzing and Managing Networks
37
Summary
Any hacker needs some basic Linux networking skills to connect, analyze,
and manage networks. As you progress, these skills will become more and
more useful for doing reconnaissance, spoofing, and connecting to target
systems.
E XERCISES
Before you move on to Chapter 4, try out the skills you learned from this chapter
by completing the following exercises:
1. Find information on your active network interfaces.
2. Change the IP address on
eth0
to 192.168.1.1.
3. Change your hardware address on
eth0
.
4. Check whether you have any available wireless interfaces active.
5. Reset your IP address to a DHCP-assigned address.
6. Find the nameserver and email server of your favorite website.
7. Add Google’s DNS server to your
/etc/resolv.conf
file so your system
refers to that server when it can’t resolve a domain name query with
your local DNS server.
|
| |