Skip to main content

Python code to login to Mikrotik WebClient without GUI

Project description

PythonWebclientWifiLogin

This is a python code to login to wifi Mikrotik Webclient for devices that has no access to GUI (such as headless Raspberry Pi, or Linux Terminal). Mikrotik Webclient is using an encription key generated randomly at some time interval, so the first thing you want to do is to search the index of the encription key.

Installing the package

    pip install python-mikrotik-login

Using the program

First import the module

    from python_mikrotik_login import mikrotikLogin

    mikrotikLogin("username","password","http://url") #you can leave the unique key index empty or set it manually

Arguments

    mikrotikLogin(username_string, password_string, url_string, minkey1_integer_optional, maxkey1_integer_optional, minkey2_integer_optional, maxkey2_integer_optional)

How this works

This code works by finding the unique key from the Mikrotik Web Client and then combine it with username and password then send back the post request to the Mikrotik Web Client.

Finding the unique key

For the example this is the encription key of Mikrotik webclient:

    function doLogin() {
    document.sendin.username.value = document.login.username.value;
    document.sendin.password.value = hexMD5('\340' + document.login.password.value + '\043\242\062\374\062\365\062\266\201\323\145\251\200\303\025\315');
    document.sendin.submit();
    return false;
    }

In this case you should find the index of:

    document.sendin.password.value = hexMD5('\340' + document.login.password.value + '\043\242\062\374\062\365\062\266\201\323\145\251\200\303\025\315');

especially:

    '\340' + document.login.password.value + '\043\242\062\374\062\365\062\266\201\323\145\251\200\303\025\315'

where:

    '\340' is the first unique key
    '\043\242\062\374\062\365\062\266\201\323\145\251\200\303\025\315' is the second unique key

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-mikrotik-login-2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

python_mikrotik_login-2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file python-mikrotik-login-2.tar.gz.

File metadata

  • Download URL: python-mikrotik-login-2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.7.3

File hashes

Hashes for python-mikrotik-login-2.tar.gz
Algorithm Hash digest
SHA256 2ae4f2190adfd45d8028155002d8187eb2ba23b627912aca5099993f292ed55f
MD5 f16e8d6224d3e5189fbb5191630ebb8d
BLAKE2b-256 a2498f7b113c46bc50994b2548642b1db5afe2dd98873bacaf00f1f7494359b9

See more details on using hashes here.

File details

Details for the file python_mikrotik_login-2-py3-none-any.whl.

File metadata

  • Download URL: python_mikrotik_login-2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.7.3

File hashes

Hashes for python_mikrotik_login-2-py3-none-any.whl
Algorithm Hash digest
SHA256 be544d57b9ba380505c1059457d135fdaf417fb45a369935fe10d72a66f42d5d
MD5 05c0995bbb578150f197cb888ec19f50
BLAKE2b-256 c13db939efe5665b27df0b84ee2e5846eaef71ad24096ebecb441adf13e2e392

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page