Results 1 to 9 of 9

Thread: Starting isc-dhcp-server fails!

  1. #1

    Question Starting isc-dhcp-server fails!

    Hi,

    I'm trying to set up a rouge AP on my Kali Sana 64-bit running as a virtual machine on virtualbox and I get to a point where I can't start my DHCP Server.

    [....] Starting isc-dhcp-server (via systemctl): isc-dhcp-server.serviceJob for isc-dhcp-server.service failed because the control process exited with error code. See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
    failed!
    This is the report I get by running the command
    Code:
    systemctl status isc-dhcp-server.service
    :

    isc-dhcp-server.service - LSB: DHCP server
    Loaded: loaded (/etc/init.d/isc-dhcp-server; bad; vendor preset: enabled)
    Active: failed (Result: exit-code) since Mon 2016-01-25 02:25:18 CET; 45s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 2011 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

    Jan 25 02:25:18 myvkali systemd[1]: Starting LSB: DHCP server...
    Jan 25 02:25:18 myvkali dhcpd[2017]: Internet Systems Consortium DHCP Serve....3
    Jan 25 02:25:18 myvkali dhcpd[2017]: Copyright 2004-2015 Internet Systems C...m.
    Jan 25 02:25:18 myvkali dhcpd[2017]: All rights reserved.
    Jan 25 02:25:18 myvkali dhcpd[2017]: For info, please visit https://www.isc...p/
    Jan 25 02:25:18 myvkali isc-dhcp-server[2011]: dhcpd service already running...!
    Jan 25 02:25:18 myvkali systemd[1]: isc-dhcp-server.service: Control proces...=1
    Jan 25 02:25:18 myvkali systemd[1]: Failed to start LSB: DHCP server.
    Jan 25 02:25:18 myvkali systemd[1]: isc-dhcp-server.service: Unit entered f...e.
    Jan 25 02:25:18 myvkali systemd[1]: isc-dhcp-server.service: Failed with re...'.
    Hint: Some lines were ellipsized, use -l to show in full.
    This is the contents of my
    Code:
    dhcpd.conf
    file:

    authoritative;
    default-lease-time 600;
    max-lease-time 7200;
    subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.1;
    option subnet-mask 255.255.255.0;
    option domain-name "freewifi";
    option domain-name-servers 192.168.1.1;
    range 192.168.1.2 192.168.1.254;
    }

  2. #2
    Join Date
    2016-Jan
    Posts
    14
    You probably forgot to type the interface in /etc/default/isc-dhcp-server.

  3. #3
    Quote Originally Posted by Fuzzer View Post
    You probably forgot to type the interface in /etc/default/isc-dhcp-server.
    Your assumption was right, however even with adding "at0" to interfaces, I still get the same error.

    I will simply put the full steps that I do here:

    Code:
    airmon-ng start wlan0
    airmon-ng check kill
    airbase-ng -c 11 -e freewifi wlan0mon
    Code:
    ifconfig at0 192.168.1.1 netmask 255.255.255.0
    ifconfig at0 mtu 1400
    route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A PREROUTING -p udp -j DNAT --to 192.168.1.0
    iptables -P FORWARD ACCEPT
    iptables --append FORWARD --in-interface at0 -j ACCEPT
    iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
    iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
    Code:
    touch /var/lib/dhcp/dhcpd.leases
    dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid at0
    /etc/init.d/isc-dhcp-server start

  4. #4
    Join Date
    2016-Jan
    Posts
    14
    Make sure the interfaces are up.
    The service doesn't start because you already started dhcpd in the previous command.
    The conf file is normally under /etc/dhcp/dhcpd.conf
    Please edit that file and follow the steps below:

    Code:
    # pgrep dhcpd | xargs kill -9
    # rm /var/run/dhcpd.pid
    # systemctl start isc-dhcp-server

  5. #5
    The interfaces are all up.

    So I moved my /etc/dhcpd.conf to /etc/dhcp/dhcpd.conf after configuring the iptables and then did the following:

    Code:
    dhcpd -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid at0
    pgrep dhcpd | xargs kill -9
    rm /var/run/dhcpd.pid
    systemctl start isc-dhcp-server
    I then checked if the DHCP server was running and it was!

    However I don't get an internet connection on the client that connects to the Fake AP and it is very unstable (it keeps connecting/disconnecting). I am able to ping out of the client to 4.2.2.4 on the short time frame until I lose connectivity and there is no "freewifi" on my list anymore.

    This also keeps popping up on my airbase terminal window.

    Client XX:XX:XX:XX:XX:XX associated (unencrypted) to ESSID: "freewifi"
    I also noticed a very strange behaviour right after starting airbase which is I get two ESSIDs broadcastet. One being "freewifi" and the other named "default". I have no idea where it comes from!!!

    I'm using a TL-WN722N btw.
    Last edited by bahador_b_92; 2016-01-30 at 19:30.

  6. #6
    Join Date
    2016-Jan
    Posts
    14
    You don't have to start the program with "dhcpd -cf ..." if you intend to start the dhcp service.
    It is either one or the other.

    In regards to the "default" ESSID there was a bug opened for it:
    https://trac.aircrack-ng.org/ticket/1647

    I don't know if it is already included in the kali package.

  7. #7
    Join Date
    2013-Jul
    Posts
    844

  8. #8
    Join Date
    2016-Jul
    Posts
    1
    Did you got the solution for you problem @bahador_b_92?. I am also facing the same problem. My phones are able to connect to Access Point but they get disconnected after few seconds. They automatically connnect and after a few seconds disconnect. This keeps happening for hours. My lease-time is same as you. In 1 minute my moblie connects and disconnects around 10 times. Please help...!!! Thank you

  9. #9
    Join Date
    2013-Jul
    Posts
    844
    MTeams is unsure if this will be helpful however if you are using Network Manager(NM) to provide the internet connection(IC) then you are killing NM function when you evoke airmon-ng check kill.

    If you do not provide internet access you can setup a rogue AP and pass the phish onto a phishing page BUT you cannot pass the client on to internet access if you kill NM.

    Accessing the internet on one device and setting up a rogue AP on another device can be done. Read thru the comments in the netmanmac thread for starters.

    MTeams

Similar Threads

  1. Starting isc-dhcp-server fails!
    By diabawii in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2016-08-09, 17:12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •