{"id":948,"date":"2013-02-12T19:58:55","date_gmt":"2013-02-12T19:58:55","guid":{"rendered":"https:\/\/www.phillips321.co.uk:443\/?p=948"},"modified":"2015-05-05T12:39:15","modified_gmt":"2015-05-05T11:39:15","slug":"raspberry-pi-as-a-joke-hotspot","status":"publish","type":"post","link":"https:\/\/www.phillips321.co.uk\/2013\/02\/12\/raspberry-pi-as-a-joke-hotspot\/","title":{"rendered":"Raspberry Pi as a joke Hotspot"},"content":{"rendered":"<p>So this entire post is inspired by <a href=\"mailto:jwright@willhackforsushi.com\" target=\"_blank\">Joshua Wright<\/a> @ <a href=\"http:\/\/www.willhackforsushi.com\/\" target=\"_blank\">willhackforsushi.com<\/a>. If you dont know the story; basically his neighbours were stealing his wifi so he thought it wuld be a good idea to mess with them.<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-948 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.phillips321.co.uk\/2013\/02\/12\/raspberry-pi-as-a-joke-hotspot\/bbc\/'><img width=\"150\" height=\"150\" src=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2013\/02\/bbc-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" loading=\"lazy\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.phillips321.co.uk\/2013\/02\/12\/raspberry-pi-as-a-joke-hotspot\/google\/'><img width=\"150\" height=\"150\" src=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2013\/02\/google-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" loading=\"lazy\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.phillips321.co.uk\/2013\/02\/12\/raspberry-pi-as-a-joke-hotspot\/google2\/'><img width=\"150\" height=\"150\" src=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2013\/02\/google2-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" loading=\"lazy\" \/><\/a>\n\t\t\t<\/dt><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<p>He created <a href=\"http:\/\/neighbor.willhackforsushi.com\/\" target=\"_blank\">a VM<\/a> that broadcasts an open SSID and performs MitM &#8216;attacks&#8217; against the clients. The <a href=\"http:\/\/neighbor.willhackforsushi.com\/hacking-friends.pdf\" target=\"_blank\">pdf of the slides is well worth a read<\/a> as that is where this idea for the pi came from.<\/p>\n<p>What&#8217;s important to note that his idea is based around a VM, all i&#8217;m doing here is porting his idea to the Raspberry Pi platform for a smaller, cheaper and low power solution&#8230;.. so full props to Joshua Wright!<\/p>\n<p>First off with any time you use a new <a href=\"http:\/\/www.raspberrypi.org\/downloads\" target=\"_blank\">raspbian<\/a> image you should update it:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get update<\/span> ; <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get<\/span> <span class=\"re5\">-y<\/span> upgrade<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Install the required packages:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get install<\/span> isc-dhcp-server apache2 squid3 hostapd php5 imagemagick ghostscript jp2a libwww-perl libwww-robotrules-perl<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Update network details to match the following:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">cat<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>network<span class=\"sy0\">\/<\/span>interfaces<br \/>\nauto lo<br \/>\niface lo inet loopback<br \/>\nauto eth0<br \/>\niface eth0 inet dhcp<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Configure DHCP server for wifi interface:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">cat<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>dhcp<span class=\"sy0\">\/<\/span>dhcpd.conf <br \/>\nauthoritative;<br \/>\ndefault-lease-time <span class=\"nu0\">600<\/span>;<br \/>\nmax-lease-time <span class=\"nu0\">7200<\/span>;<br \/>\noption subnet-mask 255.255.255.0;<br \/>\noption broadcast-address 10.0.0.255;<br \/>\noption routers 10.0.0.1;<br \/>\noption domain-name-servers 8.8.8.8, 8.8.4.4;<br \/>\nsubnet 10.0.0.0 netmask 255.255.255.0 <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; range 10.0.0.10 10.0.0.254;<br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Configure squid with the following properties:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">cat<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>squid3<span class=\"sy0\">\/<\/span>squid.conf <br \/>\nacl manager proto cache_object<br \/>\nacl localhost src 127.0.0.1<span class=\"sy0\">\/<\/span><span class=\"nu0\">32<\/span> ::<span class=\"nu0\">1<\/span><br \/>\nacl to_localhost dst 127.0.0.0<span class=\"sy0\">\/<\/span><span class=\"nu0\">8<\/span> 0.0.0.0<span class=\"sy0\">\/<\/span><span class=\"nu0\">32<\/span> ::<span class=\"nu0\">1<\/span><br \/>\nacl localnet src 10.0.0.0<span class=\"sy0\">\/<\/span><span class=\"nu0\">24<\/span><br \/>\nacl SSL_ports port <span class=\"nu0\">443<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">80<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"co0\"># http<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">21<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"co0\"># ftp<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">443<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co0\"># https<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">70<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"co0\"># gopher<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">210<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co0\"># wais<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">1025<\/span>-<span class=\"nu0\">65535<\/span> &nbsp;<span class=\"co0\"># unregistered ports<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">280<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co0\"># http-mgmt<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">488<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co0\"># gss-http<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">591<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co0\"># filemaker<\/span><br \/>\nacl Safe_ports port <span class=\"nu0\">777<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co0\"># multiling http<\/span><br \/>\nacl CONNECT method CONNECT<br \/>\nhttp_access allow manager localhost<br \/>\nhttp_access deny manager<br \/>\nhttp_access deny <span class=\"sy0\">!<\/span>Safe_ports<br \/>\nhttp_access deny CONNECT <span class=\"sy0\">!<\/span>SSL_ports<br \/>\nhttp_access allow localhost<br \/>\nhttp_access allow localnet<br \/>\nhttp_access deny all<br \/>\nhttp_port <span class=\"nu0\">3128<\/span> transparent<br \/>\ncoredump_dir <span class=\"sy0\">\/<\/span>var<span class=\"sy0\">\/<\/span>spool<span class=\"sy0\">\/<\/span>squid3<br \/>\nrefresh_pattern ^ftp: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">1440<\/span> &nbsp; &nbsp;<span class=\"nu0\">20<\/span><span class=\"sy0\">%<\/span> &nbsp; &nbsp; <span class=\"nu0\">10080<\/span><br \/>\nrefresh_pattern ^gopher: &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"nu0\">1440<\/span> &nbsp; &nbsp;<span class=\"nu0\">0<\/span><span class=\"sy0\">%<\/span> &nbsp; &nbsp; &nbsp;<span class=\"nu0\">1440<\/span><br \/>\nrefresh_pattern <span class=\"re5\">-i<\/span> <span class=\"br0\">&#40;<\/span><span class=\"sy0\">\/<\/span>cgi-bin<span class=\"sy0\">\/|<\/span>\\?<span class=\"br0\">&#41;<\/span> <span class=\"nu0\">0<\/span> &nbsp; &nbsp; <span class=\"nu0\">0<\/span><span class=\"sy0\">%<\/span> &nbsp; &nbsp; &nbsp;<span class=\"nu0\">0<\/span><br \/>\nrefresh_pattern <span class=\"br0\">&#40;<\/span>Release<span class=\"sy0\">|<\/span>Packages<span class=\"br0\">&#40;<\/span>.gz<span class=\"br0\">&#41;<\/span><span class=\"sy0\">*<\/span><span class=\"br0\">&#41;<\/span>$ &nbsp; &nbsp; &nbsp;<span class=\"nu0\">0<\/span> &nbsp; &nbsp; &nbsp; <span class=\"nu0\">20<\/span><span class=\"sy0\">%<\/span> &nbsp; &nbsp; <span class=\"nu0\">2880<\/span><br \/>\nrefresh_pattern . &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">0<\/span> &nbsp; &nbsp; &nbsp; <span class=\"nu0\">20<\/span><span class=\"sy0\">%<\/span> &nbsp; &nbsp; <span class=\"nu0\">4320<\/span><br \/>\nurl_rewrite_children <span class=\"nu0\">10<\/span><br \/>\nurl_rewrite_program <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>squid3<span class=\"sy0\">\/<\/span>url_rewrite_program<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Copy the contents of service to \/opt\/squid\/sbin and change the perms(see end of post for the downloads):<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">chmod<\/span> +x <span class=\"sy0\">\/<\/span>opt<span class=\"sy0\">\/<\/span>squid<span class=\"sy0\">\/<\/span>sbin<span class=\"sy0\">\/*<\/span>.pl<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Copy the contents of www to \/var\/www and change the perms of tmp(see end of post for the downloads):<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">chmod<\/span> <span class=\"re5\">-R<\/span> <span class=\"nu0\">777<\/span> <span class=\"sy0\">\/<\/span>var<span class=\"sy0\">\/<\/span>www<span class=\"sy0\">\/<\/span>tmp<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Copy the following hostap details to \/etc\/hostapd\/hostapd.conf:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"re2\">interface<\/span>=wlan0<br \/>\n<span class=\"re2\">driver<\/span>=nl80211<br \/>\n<span class=\"re2\">ssid<\/span>=HotelWiFi<br \/>\n<span class=\"re2\">channel<\/span>=<span class=\"nu0\">1<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>And finally copy the script written by Joshua Wright to \/root\/neightbours.sh:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/>42<br \/>43<br \/>44<br \/>45<br \/>46<br \/>47<br \/>48<br \/>49<br \/>50<br \/>51<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"co0\">#!\/bin\/bash<\/span><br \/>\n<span class=\"re2\">SDIR<\/span>=<span class=\"sy0\">\/<\/span>opt<span class=\"sy0\">\/<\/span>squid<span class=\"sy0\">\/<\/span>sbin<br \/>\n<span class=\"kw1\">function<\/span> list_services <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">printf<\/span> <span class=\"st0\">&quot;%20s &nbsp;%s<span class=\"es1\">\\n<\/span>&quot;<\/span> <span class=\"st0\">&quot;Service Name&quot;<\/span> <span class=\"st0\">&quot;Service Function&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">printf<\/span> <span class=\"st0\">&quot;%20s &nbsp;%s<span class=\"es1\">\\n<\/span>&quot;<\/span> <span class=\"st0\">&quot;------------&quot;<\/span> <span class=\"st0\">&quot;----------------&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">for<\/span> service <span class=\"kw1\">in<\/span> <span class=\"sy0\">`<\/span><span class=\"kw2\">ls<\/span> <span class=\"re1\">$SDIR<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> <span class=\"re5\">-v<\/span> not-working<span class=\"sy0\">`<\/span>; <span class=\"kw1\">do<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re2\">desc<\/span>=<span class=\"sy0\">`<\/span><span class=\"kw2\">grep<\/span> DEF: <span class=\"re1\">$SDIR<\/span><span class=\"sy0\">\/<\/span><span class=\"re1\">$service<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sed<\/span> <span class=\"st_h\">'s\/.*DEF: \/\/'<\/span><span class=\"sy0\">`<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">printf<\/span> <span class=\"st0\">&quot;%20s: %s<span class=\"es1\">\\n<\/span>&quot;<\/span> <span class=\"re1\">$service<\/span> <span class=\"st0\">&quot;<span class=\"es2\">$desc<\/span>&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">done<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">printf<\/span> <span class=\"st0\">&quot;<span class=\"es1\">\\n<\/span>&quot;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"kw1\">if<\/span> <span class=\"br0\">&#91;<\/span> <span class=\"re5\">-z<\/span> <span class=\"re4\">$1<\/span> <span class=\"br0\">&#93;<\/span> <span class=\"sy0\">||<\/span> <span class=\"br0\">&#91;<\/span> <span class=\"re5\">-z<\/span> <span class=\"re4\">$2<\/span> <span class=\"br0\">&#93;<\/span> <span class=\"sy0\">||<\/span> <span class=\"br0\">&#91;<\/span> <span class=\"re5\">-z<\/span> <span class=\"re4\">$3<\/span> <span class=\"br0\">&#93;<\/span>; <span class=\"kw1\">then<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; list_services<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;Usage: $0 wifi_interface internet_interface service_name&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">echo<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">exit<\/span><br \/>\n<span class=\"kw1\">fi<\/span><br \/>\n<span class=\"kw1\">if<\/span> <span class=\"br0\">&#91;<\/span> <span class=\"sy0\">!<\/span> <span class=\"re5\">-f<\/span> <span class=\"re1\">$SDIR<\/span><span class=\"sy0\">\/<\/span><span class=\"re4\">$3<\/span> <span class=\"br0\">&#93;<\/span> ; <span class=\"kw1\">then<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">printf<\/span> <span class=\"st0\">&quot;<span class=\"es1\">\\n<\/span>!!! Invalid service name: %s<span class=\"es1\">\\n<\/span><span class=\"es1\">\\n<\/span>&quot;<\/span> <span class=\"re4\">$3<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; list_services<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">exit<\/span><br \/>\n<span class=\"kw1\">fi<\/span><br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Setting IP address on $1&quot;<\/span><br \/>\n<span class=\"kw2\">ifconfig<\/span> <span class=\"re4\">$1<\/span> 10.0.0.1<span class=\"sy0\">\/<\/span><span class=\"nu0\">24<\/span><br \/>\n<br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Starting DHCP server&quot;<\/span><br \/>\n<span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>init.d<span class=\"sy0\">\/<\/span>isc-dhcp-server stop <span class=\"sy0\">&gt;\/<\/span>dev<span class=\"sy0\">\/<\/span>null<br \/>\n<span class=\"kw2\">sleep<\/span> <span class=\"nu0\">2<\/span><br \/>\n<span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>init.d<span class=\"sy0\">\/<\/span>isc-dhcp-server start <span class=\"sy0\">&gt;\/<\/span>dev<span class=\"sy0\">\/<\/span>null<br \/>\n<br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Removing old temporary files&quot;<\/span><br \/>\n<span class=\"kw2\">rm<\/span> <span class=\"re5\">-rf<\/span> <span class=\"sy0\">\/<\/span>var<span class=\"sy0\">\/<\/span>www<span class=\"sy0\">\/<\/span>tmp<span class=\"sy0\">\/*<\/span> <span class=\"nu0\">2<\/span><span class=\"sy0\">&gt;\/<\/span>dev<span class=\"sy0\">\/<\/span>null<br \/>\n<br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Configuring Squid Proxy for $3&quot;<\/span><br \/>\n<span class=\"kw2\">rm<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>squid3<span class=\"sy0\">\/<\/span>url_rewrite_program<br \/>\n<span class=\"kw2\">ln<\/span> <span class=\"re5\">-s<\/span> <span class=\"re1\">$SDIR<\/span><span class=\"sy0\">\/<\/span><span class=\"re4\">$3<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>squid3<span class=\"sy0\">\/<\/span>url_rewrite_program<br \/>\nservice squid3 restart<br \/>\n<br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Setting firewall rules&quot;<\/span><br \/>\niptables <span class=\"re5\">--flush<\/span><br \/>\niptables <span class=\"re5\">--table<\/span> nat <span class=\"re5\">--flush<\/span><br \/>\niptables <span class=\"re5\">--delete-chain<\/span><br \/>\niptables <span class=\"re5\">--table<\/span> nat <span class=\"re5\">--append<\/span> POSTROUTING <span class=\"re5\">--out-interface<\/span> <span class=\"re4\">$2<\/span> <span class=\"re5\">-j<\/span> MASQUERADE<br \/>\niptables <span class=\"re5\">--append<\/span> FORWARD <span class=\"re5\">--in-interface<\/span> <span class=\"re4\">$1<\/span> <span class=\"re5\">-j<\/span> ACCEPT<br \/>\niptables <span class=\"re5\">--table<\/span> nat <span class=\"re5\">-A<\/span> PREROUTING <span class=\"re5\">-i<\/span> <span class=\"re4\">$1<\/span> <span class=\"re5\">-p<\/span> tcp <span class=\"re5\">--destination-port<\/span> <span class=\"nu0\">80<\/span> <span class=\"re5\">-j<\/span> REDIRECT <span class=\"re5\">--to-port<\/span> <span class=\"nu0\">3128<\/span><br \/>\n<br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Setting up routing&quot;<\/span><br \/>\nsysctl <span class=\"re5\">-w<\/span> net.ipv4.ip_forward=<span class=\"nu0\">1<\/span> <span class=\"sy0\">&gt;\/<\/span>dev<span class=\"sy0\">\/<\/span>null<br \/>\n<br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;[+] Starting wireless AP, press CTRL+C to end&quot;<\/span><br \/>\nhostapd <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>hostapd<span class=\"sy0\">\/<\/span>hostapd.conf<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>And dont forget to make it executable!:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">chmod<\/span> +x <span class=\"sy0\">\/<\/span>root<span class=\"sy0\">\/<\/span>neighbours.sh<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Maybe add a rule to prevent access to your uplink IP subnet:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\">iptables <span class=\"re5\">-A<\/span> FORWARD <span class=\"re5\">-i<\/span> <span class=\"re1\">$WIFI<\/span> <span class=\"re5\">-o<\/span> <span class=\"re1\">$LAN<\/span> <span class=\"re5\">-d<\/span> <span class=\"br0\">&#123;<\/span>192.168.0.0<span class=\"sy0\">\/<\/span><span class=\"nu0\">16<\/span>,172.16.0.0<span class=\"sy0\">\/<\/span><span class=\"nu0\">12<\/span>,10.0.0.0<span class=\"sy0\">\/<\/span><span class=\"nu0\">8<\/span><span class=\"br0\">&#125;<\/span> <span class=\"re5\">-j<\/span> DROP<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Should you wish to download the image(for 8GB SD) you can do so from here:<br \/>\n<a href=\"https:\/\/github.com\/phillips321\/raspberrypi-joke-hotspot\" target=\"_blank\">https:\/\/github.com\/phillips321\/raspberrypi-joke-hotspot<\/a><br \/>\nOr just get the scripts and code via svn from here:<br \/>\n<a href=\"https:\/\/github.com\/phillips321\/raspberrypi-joke-hotspot\" target=\"_blank\">https:\/\/github.com\/phillips321\/raspberrypi-joke-hotspot<\/a><\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">svn co<\/span> https:<span class=\"sy0\">\/\/<\/span>github.com<span class=\"sy0\">\/<\/span>phillips321<span class=\"sy0\">\/<\/span>raspberrypi-joke-hotspot raspberrypi-joke-hotspot<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"<p>So this entire post is inspired by Joshua Wright @ willhackforsushi.com. If you dont know the story; basically his neighbours were stealing his wifi so he thought it wuld be a good idea to mess with them. He created a VM that broadcasts an open SSID and performs MitM &#8216;attacks&#8217; against the clients. The pdf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":977,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[354,83,355,358,357,331,330,360,353,359,25,356],"_links":{"self":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/948"}],"collection":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/comments?post=948"}],"version-history":[{"count":37,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/948\/revisions"}],"predecessor-version":[{"id":1233,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/948\/revisions\/1233"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media\/977"}],"wp:attachment":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media?parent=948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/categories?post=948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/tags?post=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}