Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

For places with annoying captive portals that you have to log into every day, is there a way to capture and replay traffic (for the login page) when connected to a specific wifi network?

Edit: I have figured out how to bypass the captive portal that annoys me every day with a greasemonkey script:

// ==UserScript==
// @name        wifi-autologin
// @namespace   lakdsjf-ns
// @description Hopefully autologins to a wifi network
// @include     https://1.1.1.1/*
// @include     http://1.1.1.1/*
// @version     1
// @run-at document-end
// ==/UserScript==

console.log('loaded');
window.addEventListener('load', submitAction);
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

If you're talking about a web-based login screen, there's a good chance it sets a cookie and a corresponding token, which change upon each viewing, in order to protect against Login CSRF. This would also prevent what you are trying to do from working.

Basically, this means that the form sets a unique cookie along with a token in a hidden form element, ensuring that the person submitting the form is the same person that requested the page.

On the off-chance that they don't do this, you could write a script to login via curl, and then place that script into /etc/network/if-up.d/ (as described here).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.