Lan Address Change and Redirecting?

Posted by josephchrzempiec 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Lan Address Change and Redirecting?
January 01, 2017 06:25AM
Hello i have a couple of Questions. I asked in the IRC chat but maybe this would be better for Everyone in case they would like to know also. But is it possible to change the Piratebox.lan address to a .com address like yourwebsite.com would it still work or would it need to be a .lan address?

Second Question is it possible when they open a browser that it automatically takes them to that address or if they type in a address it redirects them to your address?
Re: Lan Address Change and Redirecting?
January 03, 2017 02:21AM
Hello i have tested changing the piratebox.lan address to a piratebox.com address and it does work. Reason is because most people are use to typing a Dot com address and not a Dot lan address.

So my next Question is there a way if i type in google.com or msn.com it can automatically redirect to the piratebox address? The thing is when i type in www.google.com or www.msn.com it says Page can not be displayed. And most people won't know how to get to the Piratebox address. Or maybe it can automatically go to that address after the browser is open. I know using Captive Portal works once whey connect to the wifi it opens the browser automatically and goes to that page. Well people might think that is a little crazy. So i was wondering IF Just when the browser is open that it can go to the Piratebox page.
Re: Lan Address Change and Redirecting?
January 03, 2017 05:19AM
It does not matter which domain is used. All domains are resolved with the IP address of the piratebox, so it is not necessarily needed to change the domain to piratebox.com.

Opening the browser on a device and opening a specific address is not possible. This action means that you might start any application on the clients computer, which is not really appreciated.
Mobile devices check if the internet is available, which we fake (Learn more about it). You need to restrict the fake for 5-10 minutes to implement a sort of captive portal again. This still needs to be done :-/

Anyway, I hope that helps a bit.

best regards
Matthias
Re: Lan Address Change and Redirecting?
January 03, 2017 05:29AM
This is what I'm confused about. Say If I'm the end user I know nothing about Piratebox at all. And say i connect to the piratebox wifi. What is suppose to happen? I would think that i would type in a address like facebook or Google and even something like yahoo website page. But when i do Nothing happens Page can not be displayed. But i wouldn't know to go to piratebox.lan address unless someone tells me correct? Then with my cellphone or laptop i Would just disconnect from the piratebox wifi and find another wifi to go to right? Then what's next?
Re: Lan Address Change and Redirecting?
January 03, 2017 05:46AM
Yes, that is totally true. The time changed about that.
I usually recommend in using flyers (at lamp poles) to advertise and give a small howto about it.
Re: Lan Address Change and Redirecting?
January 03, 2017 05:58AM
I was looking at some youtube videos about Fake Access points. And one thing all of them had was If they type in google.com or facebook that they was redirect to a ip address. Could that be done too?
Re: Lan Address Change and Redirecting?
January 03, 2017 06:10AM
Please provide a link
Re: Lan Address Change and Redirecting?
January 03, 2017 06:21AM
This is what i did for a search [www.youtube.com]

and the 2 videos i found are

[youtu.be]
and
[youtu.be]
Re: Lan Address Change and Redirecting?
January 03, 2017 06:28AM
Ok, the first link: [youtu.be] is exactly what we do. In his browser, he is entering google.com and he gets directed to HTTP google.com. The video is now around 3 years old, today chrome does automatically use HTTPS (encrypted), which would not work for him - neither for us.

The second video [www.youtube.com] is the same :-(
Re: Lan Address Change and Redirecting?
January 03, 2017 06:35AM
Hello i understand that. My device my raspberry pi setup with piratebox. And if they connect to the wifi and go to the browser and type in www.google.com or even google.com They should get redirected to the piratebox.lan webpage correct? But the problem is Every device from my cellphone, laptop and desktop when i type in www.google.com or google.com it gives me a page can not be displayed. I had 3 friends over i try to connect all of there cellphones and laptops to test and get the same thing Page can not be displayed. But if type in piratebox.lan address that is the only thing that will display. Unlike that videos if they type in google.com it displays the apache page and you are saying on your setup It should do the same right? But for some reason it doesn't
Re: Lan Address Change and Redirecting?
January 03, 2017 06:55AM
so basically, the issue - especially with google.com is, that most browsers automatically assume a https connection:
Language: PHP
https://google.com

But only http works
Language: PHP
http://google.com
. Today most browsers automatically change this back to https.

last option is that you possibly, you have an issue with your client. If you have the option to run a commandline on the client, try to run the following command while being connected to your piratebox
ping google.com
If that turns out to show the ip 192.168.77.1 , everything is ok. (On linux cancel wit CTRL+C).

As I said, the videos a old and two years ago there were no auto-completion to https.

HTTPS is an encrypted connection. We do not support https connections, because in our use case it might be blocked by the browser (it detects a invalid certificate) or you get an error messages because of a self signed certificate.
Re: Lan Address Change and Redirecting?
January 03, 2017 07:00AM
Hello i understand now about the https secure stuff but what about a non https say like intervisionradio.com if i type in www.intervisionradio.com or internetvisionradio.com nothing happens Same thing. Even if i type in [www.intervisionradio.com] or [intervisionradio.com] We get the same problem. No page can not be displayed.
Re: Lan Address Change and Redirecting?
January 03, 2017 07:45AM
Did you try & verify the ping output?
Re: Lan Address Change and Redirecting?
January 03, 2017 07:53AM
How do you ping a address like google.com If the device is not on the internet?

I did try to ping it just to see what it does and i got back ping: socket: Operation not Permitted.
Re: Lan Address Change and Redirecting?
January 03, 2017 07:55AM
the ping is for testing which IP your client (not the piratebox) does reach.. it is the easiest way to test name resolution.

If you get a permission denied error, you are running a bad distro tongue sticking out smiley , try
sudo ping google.com
Re: Lan Address Change and Redirecting?
January 03, 2017 08:04AM
Clearing I'm still new at this and forgot the sudo part. I did get a reply from it

64 bytes from piratebox.lan (192.168.77.1): icmp_seq=1 ttl=64 time=0.113 ms
Re: Lan Address Change and Redirecting?
January 03, 2017 08:08AM
ping usually runs from a non privileged user (non sude), but in your case somebody removed the needed SUID (?) bit on the ping executable... anyway.

This was executed on your client.

Can you verify if you have a proxy configuration in your browser active?
Re: Lan Address Change and Redirecting?
January 03, 2017 08:55AM
I can ping and that is great at least that is working. So what i did was clear all my cookies and cache from my browsers and tried again. And to my luck nothing. No [google.com] or [yahoo.com] or [exmaple.com] all pages can not be displayed. So this is what i did. I have another blank micro Sd card a 8gb not a fast one a class 4 card i loaded piratebox image on it did the same test. And Guess what happen next? Well i can ping out and when i typed in [google.com] or any of address with http in it i was able to get it seeing the Piratebox page. So there was something wrong with the other image on my other Sd card. Now that is a big step there. Which brings me to the other URL problem of no one not knowing to take out the S in https address. Is there a way to support both https and http? Most browsers including mobile ones Do https and no one is going to know how to take out that s in it.
Re: Lan Address Change and Redirecting?
January 03, 2017 09:21AM
Quote

. And Guess what happen next? Well i can ping out and when i typed in [google.com] or any of address with http in it i was able to get it seeing the Piratebox page.
Then it has nothing to do with https, then there is something wrong with your configuration on the other SD card :-) , so basically, did you change something? Can you remember and do you want to fix that?

@https
Yes, you can enable https with some effort, but as I wrote before, I am not sure if that solves all the issues.
If you really want to try, you can follow the Lighttpd HowToSimpleSSL tutorial but edit /opt/piratebox/conf/lighttpd/lighttpd.conf instead of the one in /etc
Re: Lan Address Change and Redirecting?
January 03, 2017 09:28AM
Only thing i changed was change anything that was piratebox.lan to piratebox.com That was all. Oh and deleted all the files from the content folder then uploaded my own webpage. I did get php working.