Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #11711
    Atul Koshta
    Participant

    I have successfully created fake AP manually using dnsmasq and hostapd but when i connect to this wifi i do not get internet access.
    PS:Connected android device.There exist both arrows in wifi signal:outgoing as well as incoming
    Please help me!

    #11718
    Zaid Sabih
    Moderator

    Hello Atul,
    The most common cause for this issue is iptables, maybe there’s a rule there that is preventing the connection, please run the following command to remove any rules that might be preventing this from working:

    iptables --flush
    iptables --table nat --flush
    iptables --delete-chain
    iptables --table nat --delete-chain
    iptables -P FORWARD ACCEPT

    Then follow the steps shown again.
    Also please make sure you are using the right interfaces when following the steps.

    #11729
    Atul Koshta
    Participant

    Hello sir,
    I followed exactly same steps as you told in video lectures.Although i created fake AP but i am unable to give internet service to it.As a result whenever any device connects to my fake AP,it does not have any internet service in it.
    1. Host connected to my fake AP is not directed to my server’s index.php.Rather an error is shown on his screen that ‘site can’t be reached’
    2.UNABLE TO RESTART dnsmasq (unable to run : dnsmasq -C <dnsmasq.conf file path>)2nd time after running ones.I face the following error whenever i edit dnsmasq.conf file and try to run same command again:

    ERROR : dnsmasq: failed to bind DHCP server socket: Address already in use

    *For now i need your help primarily to provide internet access to client connected to my fake AP
    PS: I used exactly same conf file and same ip granting commands that you used to created fake AP.

    #11740
    Zaid Sabih
    Moderator

    Can you please show me the result of ifconfig BEFORE starting the fake AP, and can you please show me the config files you’re using?

    #11743
    Atul Koshta
    Participant

    #JUST AFTER STARTING MACHINE AND PLUGGING IN ADAPTER

    root@kali:~# ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
    inet6 fe80::a00:27ff:fe59:1b51 prefixlen 64 scopeid 0x20<link>
    ether 08:00:27:59:1b:51 txqueuelen 1000 (Ethernet)
    RX packets 9 bytes 1920 (1.8 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 37 bytes 3138 (3.0 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 28 bytes 1428 (1.3 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 28 bytes 1428 (1.3 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    root@kali:~# iwconfig wlan0
    wlan0 IEEE 802.11 ESSID:off/any
    Mode:Managed Access Point: Not-Associated Tx-Power=off
    Retry short limit:7 RTS thr:off Fragment thr:off
    Encryption key:off

    # I used following conf file n my recent try which was 24 hours ago:
    #dnsmasq.conf
    interface=wlan0
    dhcp-range=192.168.1.2,192.168.1.100,8h
    dhcp-option=3,192.168.1.1
    dhcp-option=6,192.168.1.1
    address=/#/192.168.1.1

    #hostapd.conf
    interface=wlan0
    ssid=Stark Industry
    channel=5
    driver=nl80211

    #11761
    Zaid Sabih
    Moderator

    I was most interested in seeing the values for wlan0, why did it not show up when you ran
    ifconfig
    ??

    #11764
    Atul Koshta
    Participant

    There happened some error, sir, I apologize for that error. Here is the result of ifconfig when I plugged in the adapter after starting the machine:
    root@kali:~# ifconfig
    eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
    ether 08:00:27:59:1b:51 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 16 bytes 960 (960.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 16 bytes 960 (960.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
    ether 00:c0:ca:96:64:e9 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 1 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    #after this I followed the same procedure as I described in another topic. Everything works fine, target pc is able to connect my fake AP, able to browse my localhost 192.168.1.1 index.php, but explicitly by typing 192.168.1.1 in the URL

    #11766
    Atul Koshta
    Participant

    Hello Zaid sir,
    I just want to tell you that I moved a step ahead and I wish I could solve rest of my problem myself. I will get back to you if I face any further obstacle.
    Thanks a lot for your assistance.

    #11780
    Zaid Sabih
    Moderator

    Great stuff, I’m glad you figured it out πŸ™‚

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.