Commit a2e50a0c authored by Lauren N. Liberda's avatar Lauren N. Liberda
Browse files

netiawifi (costa coffee pl) fxcker

parent 465f8ed5
Pipeline #41 passed with stage
in 41 seconds
......@@ -4,6 +4,7 @@ from .ledatel import LedatelFxcker
from .ipartners import IPartnersFxcker
from .kfchotspot import KFCHotspotFxcker
from .justwifi import JustWifiFxcker
from .netiawifi import NetiaWifiFxcker
fxckers_map = [
([r"re:MZK Opole \d{3}(?: (?:2.4|5)GHz)?"], DummyFxcker),
......@@ -15,4 +16,5 @@ fxckers_map = [
], JustWifiFxcker),
(["COSTA COFFEE"], NetiaWifiFxcker),
from ._common import BaseFxcker
from ..utils import regex_search_string, dump_qs
import re
from urllib.parse import unquote
class NetiaWifiFxcker(BaseFxcker):
def unfxck(self, location=None):
start = self.request("GET", location)
initial_redir_url = regex_search_string(
r'<form [^>]*action="([^"]+)"', start.text)
start_form = {}
for param in ["mac", "ip", "apname", "essid", "url", "switch_url"]:
start_form[param] = regex_search_string(
r'<input [^>]*name="%s" value="([^"]+)"' % (re.escape(param)),
initial_redir = self.request(
"POST", initial_redir_url, data=dump_qs(start_form), headers={
"Content-Type": "application/x-www-form-urlencoded",
splash_url = regex_search_string(
r'<form [^>]*action="([^"]+)"', initial_redir.text)
splash = self.request("POST", splash_url, data=dump_qs({
"initialRedirect": True,
accept_url = regex_search_string(
r"form\.setAttribute\('action', '([^']+)'\)", splash.text)
accept_page = self.request("POST", accept_url, data=dump_qs({
"ie11postFix": "sendPost",
}), headers={
"Content-Type": "application/x-www-form-urlencoded",
# what the fuck is that, Netia?
for match in regex_search_string(
# flake8: noqa: E501
accept_page.text, multiple=True, whole_match=True):
1) + unquote( +
for match in regex_search_string(
# flake8: noqa: E501
accept_page.text, multiple=True, whole_match=True):
1) + +
for match in regex_search_string(
# flake8: noqa: E501
accept_page.text, multiple=True, whole_match=True):
login_url = regex_search_string(
r'<form [^>]*action="([^"]+)"', accept_page.text)
login_form = {}
for match in regex_search_string(
r'<input [^>]*name="([^"]+)" value="([^"]*)"',
accept_page.text, multiple=True, whole_match=True):
login_form[] =
login_page = self.request("GET", login_url + "?" + dump_qs(login_form))
welcome_url = unquote(regex_search_string(
r'<meta http-equiv="refresh" content="\d+; url=([^"]+)"',
welcome_page = self.request("GET", welcome_url)
return True
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment