{"id":24552344,"url":"https://github.com/haakonnessjoen/mac-telnet","last_synced_at":"2025-04-04T05:09:16.984Z","repository":{"id":1088571,"uuid":"940803","full_name":"haakonnessjoen/MAC-Telnet","owner":"haakonnessjoen","description":"Open source MAC Telnet client and server for connecting to Mikrotik RouterOS routers and Posix devices using MAC addresses","archived":false,"fork":false,"pushed_at":"2024-09-24T13:16:55.000Z","size":637,"stargazers_count":422,"open_issues_count":7,"forks_count":128,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-03-27T10:10:07.277Z","etag":null,"topics":["c","layer2","mikrotik","routeros","telnet"],"latest_commit_sha":null,"homepage":"http://lunatic.no/2010/10/routeros-mac-telnet-application-for-linux-users/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haakonnessjoen.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-09-26T18:42:20.000Z","updated_at":"2025-03-19T19:19:49.000Z","dependencies_parsed_at":"2024-04-04T08:29:27.107Z","dependency_job_id":"cda0b999-9cde-4448-b922-fc5260ddedff","html_url":"https://github.com/haakonnessjoen/MAC-Telnet","commit_stats":{"total_commits":273,"total_committers":19,"mean_commits":"14.368421052631579","dds":"0.41025641025641024","last_synced_commit":"c3dc4515b1aff09372cdb04aef393437dc2d8f60"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haakonnessjoen%2FMAC-Telnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haakonnessjoen%2FMAC-Telnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haakonnessjoen%2FMAC-Telnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haakonnessjoen%2FMAC-Telnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haakonnessjoen","download_url":"https://codeload.github.com/haakonnessjoen/MAC-Telnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123107,"owners_count":20887261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","layer2","mikrotik","routeros","telnet"],"created_at":"2025-01-23T01:31:16.288Z","updated_at":"2025-04-04T05:09:16.964Z","avatar_url":"https://github.com/haakonnessjoen.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/haakonnessjoen/MAC-Telnet/actions/workflows/build.yaml/badge.svg?branch=master)](https://github.com/haakonnessjoen/MAC-Telnet/actions/workflows/build.yaml)\n[![Docker release](https://github.com/haakonnessjoen/MAC-Telnet/actions/workflows/docker.yaml/badge.svg)](https://github.com/haakonnessjoen/MAC-Telnet/actions/workflows/docker.yaml)\n[![License: GPL v2+](https://img.shields.io/badge/License-GPL_v2%2b-blue)](https://github.com/haakonnessjoen/MAC-Telnet/blob/master/LICENSE)\n\n# MAC-Telnet for Posix systems\n\nThis project contains a set of console tools for connecting to and serving devices using the MikroTik RouterOS MAC-Telnet protocol. This is a proprietary network protocol used by MikroTik RouterOS devices to provide shell access to their devices even if the device is not configured with an ip address.\n\nThe protocol is based on sending and receiving udp broadcast packets, so it is **not secure** in any means. It should only be used as a last resort for configuring a device lacking an ip address, or in a secure network environment.\n\nIn addition to a client and server, this project also includes a ping tool, that can be used to ping RouterOS devices using their MAC address, and a MNDP tool, that can be used to discover RouterOS and MAC-Telnet devices on the local network.\n\n## New EC-SRP key sharing and authentication support (RouterOS \u003e= v6.43)\n\nThe MAC-Telnet client and server now supports the new EC-SRP authentication that is mandatory after Mikrotik removed support for MD5 authentication in RouterOS v6.43 and forward. Support for using the old MD5 authentication is still possible via command line flags for backwards comatibility.\n\n## Support for password hashing on the server side\n\nWith the new EC-SRP authentication, the MAC-Telnet server now supports password hashing for the user file. This means that the server can store hashed passwords in a file, instead of plaintext passwords. To add/update users with the new hashed password support, use the `-a` flag with the `mactelnetd` command. You can also list users with the `-l` flag, or delete users from the user file with `-d`. \n\n**Note:** These commands can be used while the server is running to update the user database without restarting the server.\n\n## Installation\n\n\u003e [!TIP]\n\u003e If you only want the `mactelnet` client tools, and not the `mactelnetd` server when compiling from source, you can add the `--without-mactelnetd` flag to the `./configure` command before compiling.\n\n### Docker\n\n[`ghcr.io/haakonnessjoen/mac-telnet`](https://github.com/haakonnessjoen/MAC-Telnet/pkgs/container/mac-telnet) contains the latest release of all four programs:\n\n    docker run -it --rm --net=host haakonn/mactelnet mactelnet …\n    docker run -it --rm --net=host haakonn/mactelnet macping …\n    docker run -it --rm --net=host haakonn/mactelnet mndp …\n    docker run -it --rm --net=host haakonn/mactelnet mactelnetd …\n\nNote that Docker runs containers on isolated internal networks by default. [`--net=host`](https://docs.docker.com/network/host/) instructs Docker to provide `mactelnet` direct access to the host machine's network interfaces.\n\nSee [Usage](#usage) for more.\n\n### CentOS 7\n\nTo install dependencies:\n\n    yum -y install wget automake gettext gettext-devel libbsd-devel gcc make\n\nDownload source tarball, extract, compile and install:\n\n    wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz\n    tar zxvf mactelnet.tar.gz\n    cd haakonness*/\n    ./autogen.sh\n    make all install\n\n### Linux (Debian/Ubuntu)\n\nThe latest releases are usually available in the lastest versions of Debian and Ubuntu. You can install them with `apt install mactelnet-client` or `apt install mactelnet-server`.\n\nTo install the lastest `master` branch *from source*, use the following instructions:\n\n    apt-get install build-essential autopoint automake autoconf libbsd-dev libssl-dev gettext\n\nDownload source tarball, extract, compile and install:\n\n    wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz\n    tar zxvf mactelnet.tar.gz\n    cd haakonness*/\n    ./autogen.sh\n    make all install\n\n### FreeBSD\n\nDependencies: clang (gcc or similar), automake, autoconf\n\nTo install dependencies on FreeBSD:\n\n    pkg install automake autoconf gettext-tools\n\nDownload source tarball, extract, compile and install:\n\n    wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz\n    tar zxvf mactelnet.tar.gz\n    cd haakonness*/\n    ./autogen.sh\n    ./configure LDFLAGS=\" -L/usr/local/lib\"\n    gmake all install\n\n### Mac OS X\n\nDownload source tarball and extract:\n\n    wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz\n    tar zxvf mactelnet.tar.gz\n    cd haakonness*/\n\nInstall dependencies\n\n    brew install gettext autoconf automake libtool openssl pkg-config\n\nSet up build environment, compile and install:\n\n    export GETTEXT_PATH=$(brew --prefix gettext)\n    export OPENSSL_PATH=$(brew --prefix openssl)\n    export PATH=\"${GETTEXT_PATH}/bin:${OPENSSL_PATH}/bin:$PATH\"\n    export LDFLAGS=\"-L${GETTEXT_PATH}/lib\"\n    export CPPFLAGS=\"-I${GETTEXT_PATH}/include -I${OPENSSL_PATH}/include\"\n    export CRYPTO_CFLAGS=\"-I${OPENSSL_PATH}/include\"\n    export CRYPTO_LIBS=\"-L${OPENSSL_PATH}/lib ${OPENSSL_PATH}/lib/libcrypto.3.dylib\"\n    ./autogen.sh\n    make all install\n\n## Usage\n\n    # mactelnet -h\n    Usage: mactelnet \u003cMAC|identity\u003e [-h] [-n] [-a \u003cpath\u003e] [-A] [-t \u003ctimeout\u003e] [-u \u003cuser\u003e] [-p \u003cpassword\u003e] [-U \u003cuser\u003e] | -l [-B] [-t \u003ctimeout\u003e]\n\n    Parameters:\n      MAC            MAC-Address of the RouterOS/mactelnetd device. Use mndp to\n                     discover it.\n      identity       The identity/name of your destination device. Uses\n                     MNDP protocol to find it.\n      -l             List/Search for routers nearby (MNDP). You may use -t to set timeout.\n      -B             Batch mode. Use computer readable output (CSV), for use with -l.\n      -n             Do not use broadcast packets. Less insecure but requires\n                     root privileges.\n      -a \u003cpath\u003e      Use specified path instead of the default: ~/.mactelnet for autologin config file.\n      -A             Disable autologin feature.\n      -t \u003ctimeout\u003e   Amount of seconds to wait for a response on each interface.\n      -u \u003cuser\u003e      Specify username on command line.\n      -p \u003cpassword\u003e  Specify password on command line.\n      -U \u003cuser\u003e      Drop privileges to this user. Used in conjunction with -n\n                     for security.\n      -q             Quiet mode.\n      -o             Force old MD5 authentication method.\n      -h             This help.\n\nExample using identity:\n\n    $ mactelnet main-router\n    Searching for 'main-router'...found\n    Login: admin\n    Password:\n    Connecting to d4:ca:6d:12:47:13...done\n\nExample using mac address:\n\n    $ mactelnet 0:c:42:43:58:a5\n    Login: admin\n    Password:\n    Connecting to 0:c:42:43:58:a5...done\n\n\n      MMM      MMM       KKK                          TTTTTTTTTTT      KKK\n      MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK\n      MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK\n      MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK\n      MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK\n      MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK\n\n      MikroTik RouterOS 6.49 (c) 1999-2021       http://www.mikrotik.com/\n\n\n     [admin@Mikrotik] \u003e\n\n### Tips\n\nYou can use the well known \"expect\" tool to automate/script dialogues via mactelnet!\n\n### List available hosts using MNDP Discovery\n\n    # mactelnet -l\n\n## MAC-Ping usage\n\n    # macping -h\n    Usage: macping \u003cMAC\u003e [-h] [-c \u003ccount\u003e] [-s \u003cpacket size\u003e]\n\n    Parameters:\n      MAC       MAC-Address of the RouterOS/mactelnetd device.\n      -s        Specify size of ping packet.\n      -c        Number of packets to send. (0 = for ever)\n      -h        This help.\n\nExample:\n\n    # macping 0:c:42:43:58:a5\n    0:c:42:43:58:a5 56 byte, ping time 1.17 ms\n    0:c:42:43:58:a5 56 byte, ping time 1.07 ms\n    0:c:42:43:58:a5 56 byte, ping time 1.20 ms\n    0:c:42:43:58:a5 56 byte, ping time 0.65 ms\n    0:c:42:43:58:a5 56 byte, ping time 1.19 ms\n\n    5 packets transmitted, 5 packets received, 0% packet loss\n    round-trip min/avg/max = 0.65/1.06/1.20 ms\n\nOr for use in bash-scripting:\n\n    # macping 0:c:42:43:58:a5 -c 2 \u003e/dev/null 2\u003e\u00261 || ( echo \"No answer for 2 pings\" | mail -s \"router down\" my.email@address.com )\n\n## Huge thanks\n\n- Thanks to [@comed-ian](https://github.com/comed-ian) for creating a working proof of concept python script that successfully authenticated using the new authentication method in RouterOS 4.43+, and [@kmeaw](https://github.com/kmeaw) for porting the code to C, and implementing it in mactelnet and mactelnetd.\n- Thanks to Omni Flux for doing [the initial reverse engineering](https://omniflux.com/devel/mikrotik/Mikrotik_MAC_Telnet_Procotol.txt) of the MAC Telnet protocol, that inspired me to write these programs, as well as the mactelnet Wireshark plugin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaakonnessjoen%2Fmac-telnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaakonnessjoen%2Fmac-telnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaakonnessjoen%2Fmac-telnet/lists"}