dhcp / iptables: Evil Twin gives wifi but does not send user to my website












0















So I set up an Evil Twin AP and when a user connects, it transmits wifi data and all of that but it does not initally send the user to my fake website on apache2 localhost port 80. Here are my configs:
/etc/network/interfaces:



# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


/etc/dhcpd/dhcpd.conf:



authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.128 netmask 255.255.255.128 {
option subnet-mask 255.255.255.128;
option routers 192.168.1.129;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8;
range 192.168.1.130 192.168.1.140;
}


So I run my airbase command on my wireless adapter and set up my iptables and routes. This is probably where I am doing something wrong:
routes.sh:



#!/bin/sh
ifconfig at0 up
ifconfig at0 192.168.1.129 netmask 255.255.255.128
route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat --append POSTROUTING --out-interface wlp3s0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80
iptables -t nat -A POSTROUTING -j MASQUERADE


This line is the one that supposedly links my servers website to anyone who joins the Access Point:



iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80


I am not good at all with iptables and routing and it would be amazing if someone could help. Cheers.










share|improve this question


















  • 1





    Are you expecting the website to show up immediately after connection, or when someone tries to visit a real http: website?

    – grawity
    Dec 25 '18 at 18:37











  • When someone tries to visit a real website, that would be the best case scenario.

    – Hakorou
    Dec 25 '18 at 18:49


















0















So I set up an Evil Twin AP and when a user connects, it transmits wifi data and all of that but it does not initally send the user to my fake website on apache2 localhost port 80. Here are my configs:
/etc/network/interfaces:



# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


/etc/dhcpd/dhcpd.conf:



authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.128 netmask 255.255.255.128 {
option subnet-mask 255.255.255.128;
option routers 192.168.1.129;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8;
range 192.168.1.130 192.168.1.140;
}


So I run my airbase command on my wireless adapter and set up my iptables and routes. This is probably where I am doing something wrong:
routes.sh:



#!/bin/sh
ifconfig at0 up
ifconfig at0 192.168.1.129 netmask 255.255.255.128
route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat --append POSTROUTING --out-interface wlp3s0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80
iptables -t nat -A POSTROUTING -j MASQUERADE


This line is the one that supposedly links my servers website to anyone who joins the Access Point:



iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80


I am not good at all with iptables and routing and it would be amazing if someone could help. Cheers.










share|improve this question


















  • 1





    Are you expecting the website to show up immediately after connection, or when someone tries to visit a real http: website?

    – grawity
    Dec 25 '18 at 18:37











  • When someone tries to visit a real website, that would be the best case scenario.

    – Hakorou
    Dec 25 '18 at 18:49
















0












0








0








So I set up an Evil Twin AP and when a user connects, it transmits wifi data and all of that but it does not initally send the user to my fake website on apache2 localhost port 80. Here are my configs:
/etc/network/interfaces:



# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


/etc/dhcpd/dhcpd.conf:



authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.128 netmask 255.255.255.128 {
option subnet-mask 255.255.255.128;
option routers 192.168.1.129;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8;
range 192.168.1.130 192.168.1.140;
}


So I run my airbase command on my wireless adapter and set up my iptables and routes. This is probably where I am doing something wrong:
routes.sh:



#!/bin/sh
ifconfig at0 up
ifconfig at0 192.168.1.129 netmask 255.255.255.128
route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat --append POSTROUTING --out-interface wlp3s0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80
iptables -t nat -A POSTROUTING -j MASQUERADE


This line is the one that supposedly links my servers website to anyone who joins the Access Point:



iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80


I am not good at all with iptables and routing and it would be amazing if someone could help. Cheers.










share|improve this question














So I set up an Evil Twin AP and when a user connects, it transmits wifi data and all of that but it does not initally send the user to my fake website on apache2 localhost port 80. Here are my configs:
/etc/network/interfaces:



# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


/etc/dhcpd/dhcpd.conf:



authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.128 netmask 255.255.255.128 {
option subnet-mask 255.255.255.128;
option routers 192.168.1.129;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8;
range 192.168.1.130 192.168.1.140;
}


So I run my airbase command on my wireless adapter and set up my iptables and routes. This is probably where I am doing something wrong:
routes.sh:



#!/bin/sh
ifconfig at0 up
ifconfig at0 192.168.1.129 netmask 255.255.255.128
route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat --append POSTROUTING --out-interface wlp3s0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80
iptables -t nat -A POSTROUTING -j MASQUERADE


This line is the one that supposedly links my servers website to anyone who joins the Access Point:



iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.88.222:80


I am not good at all with iptables and routing and it would be amazing if someone could help. Cheers.







networking routing iptables dhcp ubuntu-18.04






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 25 '18 at 18:36









HakorouHakorou

11




11








  • 1





    Are you expecting the website to show up immediately after connection, or when someone tries to visit a real http: website?

    – grawity
    Dec 25 '18 at 18:37











  • When someone tries to visit a real website, that would be the best case scenario.

    – Hakorou
    Dec 25 '18 at 18:49
















  • 1





    Are you expecting the website to show up immediately after connection, or when someone tries to visit a real http: website?

    – grawity
    Dec 25 '18 at 18:37











  • When someone tries to visit a real website, that would be the best case scenario.

    – Hakorou
    Dec 25 '18 at 18:49










1




1





Are you expecting the website to show up immediately after connection, or when someone tries to visit a real http: website?

– grawity
Dec 25 '18 at 18:37





Are you expecting the website to show up immediately after connection, or when someone tries to visit a real http: website?

– grawity
Dec 25 '18 at 18:37













When someone tries to visit a real website, that would be the best case scenario.

– Hakorou
Dec 25 '18 at 18:49







When someone tries to visit a real website, that would be the best case scenario.

– Hakorou
Dec 25 '18 at 18:49












0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1387634%2fdhcp-iptables-evil-twin-gives-wifi-but-does-not-send-user-to-my-website%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1387634%2fdhcp-iptables-evil-twin-gives-wifi-but-does-not-send-user-to-my-website%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]