10 ms·
Free Hotel Wifi with Python and Selenium
- deleted 8y ago[deleted]
- pizza 8y agoOne time I was stuck in Jomo Kenyatta International Airport for 9 hours for a layover and wrote a similar script, macchanger and all :)
- mosselman 8y agoWriting such a script was probably more fun than what you did with the internet connection afterwards :).
- TheHistoryBuff 8y agoIs it irony that one of your interests is "algorithmic ethics"?
- brunoTbear 8y agoI thought this was going to be a cool kit for brute-forcing room number/last name pairs which seems to be an increasingly common hotel wifi auth method. My guess is most hotel wifi access pages lack anti-automation (I've seen CAPTCHA on airplane wifi, but never hotel wifi) and there are enough Smiths/Lopezes/Kims/Lis out there that if you try each of those against every room number (100-1000) you could reasonably get free wifi in minutes. An optimization could include changing MAC address between each attempt to defeat rate limiting on the part of the access point.
- StavrosK 8y ago> there are enough Smiths/Lopezes/Kims/Lis out there that if you try each of those against every room number (100-1000) you could reasonably get free wifi in minutes Stolen wifi, since someone will end up getting charged for it.
- donkeyd 8y agoIt's often free, but protected by this combination of number and name. Just check that before trying and you're not really hurting anybody.
- johannes1234321 8y agoIn Case it is free there is no reason not to use your name. For privacy you should tunnel your traffic anyways.
- Scoundreller 8y agoSometimes it’s free for their “diamond members” or whatever, but not for random consumers.
- donkeyd 8y agoUnless you're not staying in the hotel, just visiting, for whatever reason. If I remember correctly, some Vegas hotels worked this way.
- scrollaway 8y agoThese gateways almost always let you pay for wifi inline. The name/room guards are for people who get complimentary wifi. Honestly though I stopped going to hotels that don't offer complimentary wifi and breakfast. That means no Hilton or Marriott. All Holiday inn hotels I've dealt with have been scores nicer than the "high end" crap Hilton pretends to be.
- suvelx 8y agoWhat is it with Hotels and shitty, restricted wifi in the west? I can't say I've stayed in a lot of hotels, but of the ones I have stayed in, it's only ever been an issue in the West. Perhaps that's a part of the reason I enjoy holidays in East Asia. I get the feeling wifi there is a just a thing, you get access to it, it works. And nearly all the hotels I've stayed in also offer a free phone that you can take with you if you need data outside of the hotel. Yet, in the west, you're lucky if you get some paltry free allowance. For a business who's aim is "make your stay enjoyable" they're doing a pretty shit job of it.
- mosselman 8y agoWiFi in China, in general, was incredibly shitty and I have been in hotels in 'the west' where I'd get 50 mbit, but I have also had crappy wifi experiences. So I think you get shitty internet in both east and west, as is to be expected when 50 or more devices try to stream Netflix at the same time on the same internet connection. Luckily, in the EU at least, you can roam with your own 4G connection everywhere and having a 120 KB/s connection is a thing of the past.
- Spacemolte 8y agoExactly. Of the 6 or so different resort hotels i have visited in the canary islands etc, maybe one had good wifi/internet. But since the EU rules changed, i just connected via 4G - problem solved.
- disiplus 8y agoin eu you can roam free but unlimited is limited, i had a unlimited connection in my country but in roaming its 10gb
- mosselman 8y agoIt still beats paying €5/MB like in the olden days.
- celticninja 8y ago
- sytelus 8y agoThis is even more useful on international airports many of which only allow 1hr of free wifi. Are there any macchanger equivalents for Windows as well?
- Insanity 8y agoOh yeah most airports I have been at had bad wi-fi. Some you pay X for an hour, and then still get connection issues..
- pizza 8y agoYou can use Powershell on Windows I think: https://docs.microsoft.com/en-us/powershell/module/netadapter/set-netadapter?view=win10-ps https://docs.microsoft.com/en-us/powershell/module/netadapte... You could just call a process from within python that sets it that way
- Spacemolte 8y agoI think i expected something more advanced, but in reality I really love how simple/few lines of code such a task can be accomplished. It's a great reminder to keep things simple.
- silur 8y agooh god what a totally new and revolutionary idea that definitely has a place on hackernews: you can automate things with a computer!
- dsr_ 8y ago... to do something mildly unethical, in a way which, if it became very common, would change the marketplace unpredictably and certainly not necessarily for the better. You were being sarcastic, but it does fit right in.
- conqrr 8y agoCant wait to try this on an international flight of 14 hrs. Emirates only gives 2hrs of connectivity/20mb, so will have to do a lot of resets and on an android phone as well.
- gdfasfklshg4 8y agoI would be careful doing something that the airline could call "hacking" on a flight!
- m-s 8y agoYou could share your computer‘s Internet connection via Bluetooth. I find reverse-tethering quite useful when the WiFi provider limits access to one device at a time. With iOS devices I also have the option to use my Mac‘s connection over USB.
- sleepyhead 8y agoPlease don't. Data on the connections that a flight uses is not cheap and speed is slow. Other passengers would have a worse experience if someone exploits data usage.
- conqrr 8y agoI wasn't thinking about the narrow bandwidth available and actual costs. You are right, i am changing my mind since it doesn't seem ethical.
- pnutjam 8y agoYou'll probably run out of it's in the DHCP scope anyway.
- ghaff 8y agoHonestly, long plane rides are my time to read books and watch movies. OK, there are sometimes specific circumstances where you need to work on the Internet while flying to a big meeting or whatever. But I avoid it whenever possible. I don't actually need to be online all the time.
- trishmapow2 8y agoExpected something a bit more than a basic MAC change. But I guess simple things work best sometimes - I used to do this on Wi-Fi trains that had a 20MB limit.
- Beefin 8y agoMy question is how did he/she know that it was the MAC address that the WiFi used ?
- Illniyar 8y ago"And a router tells devices apart is by their MAC addresses" There is no other identifiable information a router can get out of a device without authentication
- pbhjpbhj 8y agoThat sounded wrong to me (I like a challenge), and of course some clever guys have already been and got at least 94% success at remote device fingerprinting. See p.1702 and use of carrier frequency offset (CFO) for fingerprinting, this paper discusses other methods and auth of AP/devices too; https://www.cs.ucr.edu/~zhiyunq/pub/infocom18_wireless_fingerprinting.pdf https://www.cs.ucr.edu/~zhiyunq/pub/infocom18_wireless_finge... .
- skyhawk 8y agoIn most implementations, MAC addresses are the only indication of the device
- mettamage 8y agoSimple, effective, I'm surprised this works in this day and age.
- qwerty456127 8y agoThe whole idea of non-free hotel WiFi is ridiculous. It's like charging extra for tap water you use. It can only make sense if the hotel is really really cheap.
- celticninja 8y agoI have found that the more expensive the hotel is to stay at, the greater the chance they charge for wifi/internet access. At cheap hotels they use it to attract customers, at expensive hotels they use it to gouge the customer for a little more. It is usually because expensive hotels know that people staying there for work will expense it, so there is little cost for the user in those situations but the hotel gets some extra income.
- qwerty456127 8y ago> I have found that the more expensive the hotel is to stay at, the greater the chance they charge for wifi/internet access. A curious observation. Thanks. I'm not really informed about expensive hotels, almost everything I know is about the middle segment. > At cheap hotels they use it to attract customers At the hotel market of the region I know guests wouldn't even consider booking a hotel that doesn't list free WiFi (unless it's really fantastic in other aspects and/or unbelievably cheap) and they would put submit a negative review if they came and there was no free WiFi (even if it wasn't advertised and they've just didn't notice), it's like if there was no free water in the WC. > but the hotel gets some extra income. And the guest gets some extra headache with authentication and billing instead of just turning WiFi on and using it.
- tertius 8y agoUpsell is real.
- deleted 8y ago[deleted]
- mikestew 8y agoPlaces without free WiFi aren’t meant for the likes of you and me: those that pay their own way. It’s meant for people that are going to expense it. I would never stay at a Hilton property if I were paying. I have to wonder if the staff don’t have a chuckle over the couple “treating themselves” by staying at the Hilton when Best Western offers a better stay for less.
- kkarpkkarp 8y agoMost of hotels TVs are connected to ethernet cables. Travel always with your own router, disconnect cable from TV and connect to router. You have free internet
- Pawka 8y agoWow never thought about that. Have you tried that? Just curious if it is possible reach servers outside hotel's network?
- Havoc 8y agoYup. The eth often has even less security on it than wifi
- lotsofpulp 8y agoOnly a small fraction of hotels are wired with Ethernet, and usually it’s the largest hotels in city areas. Even then, I doubt most have Ethernet to the TV.
- eddieroger 8y agoI did this for about a year after noticing that the Marriotts I tended to stay at were exposing Ethernet on the new desk/entertainment centers they'd retrofit in the chain. After that year, I started noticing that the ports were dead, usually just unplugged from the wall, but then those started to go out. Eventually, those fancy A/V panels were boarded over with plastic, then eventually fully replaced with plastic insets. But for a short while, it was the promised land, and the moral of the story is that your mileage may vary these days.
- pbhjpbhj 8y agoThe article links https://wiki.archlinux.org/index.php/MAC_address_spoofing https://wiki.archlinux.org/index.php/MAC_address_spoofing Which says that systemd-networkd can be set to spoof MAC but "needs a reboot", does it really need a reboot or is restarting (or ifdown, reload, ifup) enough?
- Pawka 8y agoifdown and ifup is enough.
- scarface74 8y agoWith all of the major carriers offering “unlimited data” in the US, I don’t even bother with WiFi anymore.
- na85 8y agoQuestion from a non-American. Why did you put "unlimited data" in scare quotes? Is it not actually unlimited?
- tsukikage 8y agoUsually "subject to a fair use policy". In other words, it's limited, but they don't tell you the limit up front.
- chungy 8y agoTypically you still have a limit on LTE. Something around 4GB of LTE data before getting dropped to UMTS with no cap.
- akuji1993 8y agoUMTS is basically being capped though.
- systemtest 8y agoI have a 3G subscription and have no problem getting 10 megabit/s on tethering. That is enough for 1080p Netflix/YouTube and easily enough for webbrowsing.
- akuji1993 8y agoAh, my mistake, I switched GRPS and UMTS in my head. In my country, you are being capped to GPRS speed when your limit is reached.
- United857 8y agoTechnically unlimited but usually throttled after ~10GB or so in my experience.
- pvtmert 8y agoif you use linux and network-manager, check "random mac" box for that connection, add post-connection-hook to `curl` with post data; use $RANDOM for mail address, even use root.$RANDOM@localhost.localdomain probably it will authenticate you.
- peterburkimsher 8y agoI did the same when visiting Taizé in France, whose free WiFi only lasted for 15 minutes at a time! The Terminal command on a Mac, for WiFi, is: sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx At CERN in Geneva I had a different problem: MAC addresses are registered to staff. My dad retired, and his Thunderbolt Ethernet adaptor was still registered. When I plugged it into my laptop, I not only got his MAC address, but also his device name! My shell started calling my computer a different name! If you're afraid to use Terminal, you can also install the MacSpoofer preference pane: http://www.macspoofer.com http://www.macspoofer.com
- darkarmani 8y agoThat's because your mac is configured to accept the hostname given to it via DHCP. You can change that setting if you don't like it.
- Cenk 8y agoFor OS X there’s a nice little menubar app called LinkLiar: https://halo.github.io/LinkLiar/ https://halo.github.io/LinkLiar/
- deleted 8y ago[deleted]
- yakshaving_jgt 8y agoYou can achieve the same thing (minus the Selenium part) on MacOS with this: https://jezenthomas.com/free-internet-on-trains/ https://jezenthomas.com/free-internet-on-trains/ I would paste the code snippet, but it doesn't format nicely on HN.
- omaranto 8y agoIndent with four spaces: function remac { sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') sudo networksetup -detectnewhardware echo $(ifconfig en0 | grep ether) } EDIT: Two spaces is enough.
- majewsky 8y agoTwo spaces indentation is enough afair.
- omaranto 8y agoLet me check: function remac { sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') sudo networksetup -detectnewhardware echo $(ifconfig en0 | grep ether) } EDIT: Yep! Two is enough. Thanks!
- yakshaving_jgt 8y agoAh, I somehow missed that. Thanks!
- sizzle 8y agoDoes this permanently change to a new Mac every time you run it?
- danilocesar 8y agoThere might be an easier workaround for this: Some hotspots only blocks new TCP connections when that time expires. So I used this workaround a few times in the past: You open an SSH connection with -D 1337 so it creates a local SOCKS proxy. You need to keep that connection opened. Then you go to gnome/kde/chrome/whatever and define a global SOCKS proxy to localhost:1337. By doing this, all your new TCP/UDP requests will go through that connection, and the router won't see them as new TCP/UDP connection. It used to work for some airports and those 20-minutes-free wifi hotspots. But honestly I don't remember last time I had to use it. Nowadays I use mainly 3G on Brazilians airports and, when traveling abroad, I don't remember last time the airport didn't provide a unlimited free wifi.
- VBprogrammer 8y agoAnother fun one I discovered that on Virgin trains (UK train company) first class get free WiFi. By sitting in the nearest standard class carriage I could manually associate with the access point in first class. Some hotels have weird setups like free WiFi in the lobby but you have to pay in the room. That trick probably works there, at least for some of the rooms.
- datanut 8y agoIt's also worth trying to login to the free wifi in the lobby and roam to the guest room. Often works a treat!
- russdill 8y agoIt's really rare for a SOCKS5 implemention to support UDP. ssh is included in the does not column.
- danilocesar 8y agoYou're right. UDP connection won't work.
- Scoundreller 8y ago> I don't remember last time the airport didn't provide a unlimited free wifi. I think you’re finally right. The NYC airports finally rolled it out.... 2 months ago
- s_luis 8y agoAlmost 2019 and we still have to fight these abusive charges. Nice, elegant way to work around it!
- crstin 8y agoUnder macOS, you can do as follows: https://www.crstin.com/en/mac-spoofing/ https://www.crstin.com/en/mac-spoofing/
- otobrglez 8y agoI built this little script a few years ago if someone finds it useful. Works for MAC and it changes your MAC address. ~> https://github.com/otobrglez/mac_changer https://github.com/otobrglez/mac_changer
- avaika 8y agoIt's 2000 + 18 and people are still using ifconfig :)
- xfitm3 8y agoIf it’s still available - why not use it?
- dpx 8y agoWill changing MAC work if there is a password for login for internet for 2 hours?
- LadyCailin 8y agoNot if the password is unique for you, and they key it off of use of that password. Then they just deny ANY mac address using that password.
- iMart1n_FR 8y agoWhen I need to access free wifi behind a paywall (get more time, more speed, more features...), I usually go `arp -a` and try to change my MAC address with one already present on the network, no reset needed. Works with hotels, airports, etc... Not very ethical though...
- deanclatworthy 8y agoIf you want to go a step further, you can also use some more nefarious tools to gather mac addresses of clients on the paid network, spoof them and steal their connection. Not that I've ever done that.
- bronco21016 8y agoI’ve always been curious about this. What happens when that other authorized MAC is also attempting to connect?
- russdill 8y agoI've done that many years ago on a college campus that required you to log in via your student ID on a captive page.
- nobody271 8y agoIsn't this a felony? No seriously. I believe the law is phrased like "if you use a network in a way that it was not intended to be used". It's one of those laws that everyone is guilty of, and people even write blog posts bragging about doing it, but it will be used to bring someone down when they have no other charges that will stick.
- berlinstartup 8y agoSounds like a classic urban legend to me.
- tkel 8y agoCFAA wording is unauthorized access of a _computer_, not a network.
- deleted 8y ago[deleted]
- wwweston 8y agoWhat network equipment these days might not reasonably be described as a computer, even a pretty powerful one by the standards of the time the CFAA was written? And even if you don't think that's reasonable, how confident are you that a prosecutor couldn't convince a judge and/or jury it is?
- Doxin 8y agoNetworks are emergent properties of computers on all but the physical level.
- wdroz 8y agoWith a DNS tunnel, you can achieve "free Wifi" almost everywhere. Iodine[0] is easy to setup. [0] https://github.com/yarrick/iodine https://github.com/yarrick/iodine
- IncRnd 8y agoShades of Kaminsky! How usable is the speed on this?
- cyberpunk 8y agoI just did a little test with iperf: Over my 4g connection to the 'server' box I get this: [ 3] 0.0-12.4 sec 1.00 MBytes 676 Kbits/sec Via an iodine tunnel: [ 3] 0.0-10.1 sec 178 KBytes 144 Kbits/sec I did try and hit up fast.com from a ssh -D proxy over the tunnel, but it didn't seem to like that very much.
- IncRnd 8y agoThank you!
- s_y_n_t_a_x 8y agoThe bandwidth is asymmetrical with limited upstream and up to 1 Mbit/s downstream.
- rootsudo 8y agoYou don't even need Python or Selenium anymore, Windows 10 includes a built in MAC changer from Device manager.
- imglorp 8y agoThe macchanger idea also works at other free-ish wifi places like Panera Bread: your session is limited to about a half hour. New MAC, new session...
- cybernoodles 8y agoXFinity does the same MAC address-based validation, and it can be changed relatively easily on Linux or Windows. As for Mac, a simple script like this: https://github.com/chrislgarry/XFinityHotspotSpoofer https://github.com/chrislgarry/XFinityHotspotSpoofer
- driverdan 8y agoIf you encounter paid WiFi that requires a credit card try the Visa test card number 4111111111111111, cvv 123, and any future exp date. I've seen it work at multiple hotels.