Skip to main content

Python code to login to Mikrotik WebClient without GUI

Project description

Python Mikrotik WebClient WiFi Login

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 unique keys or salts generated randomly at some time interval, this program is made to find that unique keys or salts and combine it with username and password to make final login request.

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 function where the login action is fired:

    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:

    \340
    and
    \043\242\062\374\062\365\062\266\201\323\145\251\200\303\025\315

where:

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

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.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-mikrotik-login-2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c1b78f8638d570b67c2e3862d19540419778b467e42b59831b2c2cbe267d520c
MD5 85dffa9034076900f5699eeda4dedb09
BLAKE2b-256 5b7bf633788ea8f3ef9e69f60f83a7a39e50887cd7ce5049cb337efa19c72ddd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_mikrotik_login-2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a95c60b9cf21d87c2007db763d4cab89b853f484a5b0f391c5a806edcb6d0fe
MD5 a8a75fbc7e2bbfccd4979e7974c8be88
BLAKE2b-256 0b7833d879445fa23dbf2f3b674e22b37df6c5638b3b3237d401fc98494ddb16

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