This configuration allows us to start the
hostapd
service. We provide the SSID as well
as the radio channel to be used. We are also telling
hostapd
to broadcast the SSID and
not expect that the client specifically ask for it. You also need to provide the encryp‐
tion
and authentication parameters, depending on your needs. We’ll be using WEP
for this. You can see a start-up of
hostapd
in
Example 7-11
. What you’ll see is a
-B
parameter, which tells
hostapd
to run in the background as a daemon.
The final
parameter is the configuration file. Since we are providing it, there is no default, and
so it doesn’t much matter where the configuration file is stored.
Example 7-11. Starting hostapd
root@savagewood:/# hostapd -B /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 9c:ef:d5:fd:24:c5 and ssid
"FreeWiFi"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0:
AP-ENABLED
From the configuration and the start-up messages, you will see that the name of the
SSID was
FreeWiFi
, which you can see being advertised in
Figure 7-8
. This means
that our Kali Linux systems is successfully advertising the SSID as expected. This will
allow users only to connect to our wireless AP. It doesn’t
let users do anything after
they have connected. To do that, we need a second interface to send the traffic out to.
There are a few ways to do that. You could bounce through a cellular connection, a
second wireless network, or just run out to a wired interface.
Figure 7-8. List of SSIDs including FreeWiFi
Going Rogue | 227
Even if we have
a second network interface, though, we need to do a couple of other
things. To start, we need to tell the Linux kernel that it’s okay to pass traffic from one
interface to another. Unless we set that kernel parameter,
the operating system will
not allow the traffic to go anywhere after it has entered the system. We can do that by
running
sysctl -w net.ipv4.ip_forward
. To make this change permanent, the file
/etc/
sysctl.conf
needs to be edited to set that parameter. That will allow Linux to accept the
packets in and forward
them out another interface, based on the routing table the
operating system has.
With all this in place, you can have your very own AP for whatever purpose you
would like. This can include just keeping track of the clients that attempt to connect
to you. This may give you a sense of potentially malicious users. To do more compli‐
cated and potentially
malicious things of our own, we should get a little extra help.