{"id":637,"date":"2014-12-14T12:56:19","date_gmt":"2014-12-14T11:56:19","guid":{"rendered":""},"modified":"2018-11-22T22:36:03","modified_gmt":"2018-11-22T21:36:03","slug":"finding-forgotten-mikrotik-password-using-mkbrutus-kali-linux","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/finding-forgotten-mikrotik-password-using-mkbrutus-kali-linux\/","title":{"rendered":"Finding forgotten MikroTIK password using MKBrutus (on Kali Linux)"},"content":{"rendered":"<p>Be able to login into an our MikroTIK device we have to memorize or at least remember our password, what could be sometimes (usually after a years of correct work) problem. Gaining access back to our device we may use\u00a0tools used for pen testing (think ethical). One of such tools is MKBRUTUS, which have been developed mainly as\u00a0a password bruteforcer for MikroTik devices or boxes running RouterOS. The\u00a0tool is developed in Python 3 and it performs bruteforce attacks (dictionary-based) against RouterOS (ver. 3.x or newer). Our mikrotik device must of course have opened the 8728\/TCP port.<\/p>\n<h2>Prerequisities<\/h2>\n<h3>1) Mikrotik must have enabled the API service<\/h3>\n<p>The tool is sucessfull only if our mikrotik device have opened required 8728\/TCP port.<\/p>\n<p>We may test it running nmap targetinng on an IP address of the box<\/p>\n<pre>nmap -v MIKROTIK_IP<\/pre>\n<p>in my case<\/p>\n<pre>root@kali:~\/MKBRUTUS# nmap -v 192.168.1.2\r\n\r\nStarting Nmap 6.47 ( http:\/\/nmap.org ) at 2014-12-14 17:57 CET\r\nInitiating ARP Ping Scan at 17:57\r\nScanning 192.168.1.2 [1 port]\r\nCompleted ARP Ping Scan at 17:57, 0.01s elapsed (1 total hosts)\r\nInitiating Parallel DNS resolution of 1 host. at 17:57\r\nCompleted Parallel DNS resolution of 1 host. at 17:57, 0.02s elapsed\r\nInitiating SYN Stealth Scan at 17:57\r\nScanning 192.168.1.2 [1000 ports]\r\nDiscovered open port 23\/tcp on 192.168.1.2\r\nDiscovered open port 22\/tcp on 192.168.1.2\r\nDiscovered open port 443\/tcp on 192.168.1.2\r\nDiscovered open port 80\/tcp on 192.168.1.2\r\nDiscovered open port 21\/tcp on 192.168.1.2\r\nDiscovered open port 8291\/tcp on 192.168.1.2\r\nDiscovered open port 2000\/tcp on 192.168.1.2\r\nD<span style=\"background-color: #ffff00;\">iscovered open port 8728\/tcp on 192.168.1.<\/span>\r\nCompleted SYN Stealth Scan at 17:57, 0.12s elapsed (1000 total ports)\r\nNmap scan report for 192.168.1.2\r\nHost is up (0.00023s latency).\r\nNot shown: 993 closed ports\r\nPORT     STATE SERVICE\r\n21\/tcp   open  ftp\r\n22\/tcp   open  ssh\r\n23\/tcp   open  telnet\r\n80\/tcp   open  http\r\n443\/tcp  open  https\r\n2000\/tcp open  cisco-sccp\r\n8291\/tcp open  unknown\r\n<span style=\"background-color: #ffff00;\">8728\/tcp open\u00a0 unknown<\/span>\r\nMAC Address: AB:11:66:DD:C9:E1 (Routerboard.com)\r\n\r\nRead data files from: \/usr\/bin\/..\/share\/nmap\r\nNmap done: 1 IP address (1 host up) scanned in 0.20 seconds\r\n           Raw packets sent: 1001 (44.028KB) | Rcvd: 1001 (40.056KB)<\/pre>\n<p>or shortly scan just the port<\/p>\n<pre>root@kali:~\/mkbrutus\/MKBRUTUS# <span style=\"background-color: #ffff00;\">nmap 192.168.1.2 -p 8728<\/span>\r\n\r\nStarting Nmap 6.47 ( http:\/\/nmap.org ) at 2014-12-14 18:02 CET\r\nNmap scan report for 192.168.1.2\r\nHost is up (0.00044s latency).\r\nPORT\u00a0\u00a0\u00a0\u00a0 STATE SERVICE\r\n8728\/tcp open\u00a0 unknown\r\nMAC Address: AB:11:66:DD:C9:E1 (Routerboard.com)\r\n\r\nNmap done: 1 IP address (1 host up) scanned in 0.08 seconds\r\n<\/pre>\n<p>Eventually when we install our box for first time we will open the port (menu IP -&gt; services).<\/p>\n<p><img decoding=\"async\" style=\"width: 650px; height: 413px;\" src=\"\/wp-content\/uploads\/files\/image\/linux\/mkbrutus-mikrotik.png\" alt=\"mkbrutus-mikrotik\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>but of course we are opening the security risk, (the port is usually disabled on higher versions of RouterOS).<\/p>\n<p>&nbsp;<\/p>\n<h3>2)\u00a0Python3<\/h3>\n<p>The mkbrutus tool is written in Python, so be able to run it we need a system with installed python 3. Inside of debian\/ubuntu based linux we will simply install python using<\/p>\n<pre>apt-get install pyhton3<\/pre>\n<h3>3) Dictionaries<\/h3>\n<p>The tool performs a brute-force dictionary attack, so we have to have a dictionary with the list of vocabularies. If we have an idea which our passwords we had set up on the box, but we do not know precisely which one is correct we may create a text file with the list of possible passwords. Otherwise we may use some preprepared dictionaries, as for example thoose at:<\/p>\n<ul>\n<li><a href=\"https:\/\/wiki.skullsecurity.org\/Passwords\">https:\/\/wiki.skullsecurity.org\/Passwords<\/a><\/li>\n<li><a href=\"http:\/\/wordlist.aspell.net\/\">http:\/\/wordlist.aspell.net\/<\/a><\/li>\n<\/ul>\n<h3>4) Installing the tool<\/h3>\n<p>MKBrutus home site is available at:\u00a0<a href=\"http:\/\/mkbrutusproject.github.io\/MKBRUTUS\/\">http:\/\/mkbrutusproject.github.io\/MKBRUTUS\/<\/a><\/p>\n<p>Installing the tool within the linux we will just make a clone of the site:<\/p>\n<pre>git clone https:\/\/github.com\/mkbrutusproject\/MKBRUTUS.git<\/pre>\n<p>command will create a local folder named MKBRUTUS, so go in:<\/p>\n<pre>cd MKBRUTUS<\/pre>\n<p>and we may see the list of files<\/p>\n<pre>root@kali:~\/MKBRUTUS# ls -al\r\ntotal 144200\r\ndrwxr-xr-x 3 root root      4096 Dec 14 17:09 .\r\ndrwxr-xr-x 3 root root      4096 Dec 14 12:48 ..\r\n-rwxr-xr-x 1 root root     34520 Dec 14 12:49 agpl.txt\r\n-rwxr-xr-x 1 root root       461 Dec 14 12:49 CHANGELOG\r\ndrwxr-xr-x 8 root root      4096 Dec 14 12:49 .git\r\n-rwxr-xr-x 1 root root       735 Dec 14 12:49 LICENSE\r\n-rwxr-xr-x 1 root root     11811 Dec 14 12:49 mkbrutus.py\r\n-rwxr-xr-x 1 root root      1045 Dec 14 12:49 README.md\r\n-rwxr-xr-x 1 root root 139921562 Dec 14 13:05 our_dictionary<\/pre>\n<p>&nbsp;<\/p>\n<h2>Using the tool<\/h2>\n<p>Printing help:<\/p>\n<pre>root@kali:~\/MKBRUTUS# <span style=\"background-color: #ffff00;\">python3 .\/mkbrutus.py -h<\/span>\r\n          _   _   _   _  _____  ____ _   _  ____ _   _ _____\r\n         |  \\\/  || | \/ \/| ___ \\ ___ \\ | | |_   _| | | \/  ___|\r\n         | .  . || |\/ \/ | |_\/ \/ |_\/ \/ | | | | | | | | \\ `--.\r\n         | |\\\/| ||    \\ | ___ \\    \/| | | | | | | | | |`--. \\\r\n         | |  | || |\\  \\| |_\/ \/ |\\ \\| |_| | | | | |_| \/\\__\/ \/\r\n         \\_|  |_\/\\_| \\_\/\\____\/\\_| \\_|\\___\/  \\_\/  \\___\/\\____\/\r\n\r\n                      Mikrotik RouterOS Bruteforce Tool 1.0.2\r\n           Ramiro Caire (@rcaire) &amp; Federico Massa (@fgmassa)\r\n                    http:\/\/mkbrutusproject.github.io\/MKBRUTUS\r\n      \r\n\r\n    NAME\r\n      MKBRUTUS.py - Password bruteforcer for MikroTik devices or boxes running RouterOS\r\n\r\n    USAGE\r\n      python mkbrutus.py [-t] [-p] [-u] [-d] [-s] [-q]\r\n\r\n    OPTIONS\r\n      -t, --target    RouterOS target\r\n      -p, --port    RouterOS port (default 8728)\r\n      -u, --user    User name (default admin)\r\n      -h, --help    This help\r\n      -d, --dictionary   Password dictionary\r\n      -s, --seconds    Delay seconds between retry attempts (default 1)\r\n      -q, --quiet    Quiet mode<\/pre>\n<p>&nbsp;<\/p>\n<p>and finally we start the tool with -t option specifying the IP address of our box, -d specifying the file with passwords. The port number is by default 8728 and the user name is admin.<\/p>\n<pre>root@kali:~\/MKBRUTUS# <strong><span style=\"background-color: #ffff00;\">python3 .\/mkbrutus.py -t 192.168.1.2 -d our_dictionary<\/span><\/strong>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _\u00a0\u00a0 _\u00a0\u00a0 _\u00a0\u00a0 _\u00a0 _____\u00a0 ____ _\u00a0\u00a0 _\u00a0 ____ _\u00a0\u00a0 _ _____\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\u00a0 \\\/\u00a0 || | \/ \/| ___ \\ ___ \\ | | |_\u00a0\u00a0 _| | | \/\u00a0 ___|\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | .\u00a0 . || |\/ \/ | |_\/ \/ |_\/ \/ | | | | | | | | \\ `--.\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | |\\\/| ||\u00a0\u00a0\u00a0 \\ | ___ \\\u00a0\u00a0\u00a0 \/| | | | | | | | | |`--. \\\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | |\u00a0 | || |\\\u00a0 \\| |_\/ \/ |\\ \\| |_| | | | | |_| \/\\__\/ \/\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \\_|\u00a0 |_\/\\_| \\_\/\\____\/\\_| \\_|\\___\/\u00a0 \\_\/\u00a0 \\___\/\\____\/\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Mikrotik RouterOS Bruteforce Tool 1.0.2\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Ramiro Caire (@rcaire) &amp; Federico Massa (@fgmassa)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 http:\/\/mkbrutusproject.github.io\/MKBRUTUS\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n[*] Starting bruteforce attack...\r\n---------------------------------\r\n[-] Trying with default credentials on RouterOS...\r\n\r\n[-] Default RouterOS credentials were unsuccessful, trying with XY passwords in list...\r\n\r\n[-] Trying 1 of 8 Paswords - Current: Password1\r\n[-] Trying 2 of 8 Paswords - Current: password2\r\n[-] Trying 3 of 8 Paswords - Current: PASSword3\r\n[-] Trying 4 of 8 Paswords - Current: passWORD4\r\n[+] <strong><span style=\"background-color: #ffff00;\">Login successful!!! User: admin Password: passWORD4<\/span><\/strong>\r\n\r\n__________________________________________\r\n\r\nElapsed Time: 4.3 sec | Passwords Tried: 4<\/pre>\n<p>&nbsp;<\/p>\n<p>done! Look simply but usually we have to reserve some time going through the whole dictionary.<\/p>","protected":false},"excerpt":{"rendered":"<p>","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[711,685,715],"tags":[959,961,957],"class_list":["post-637","post","type-post","status-publish","format-standard","hentry","category-network-security-attacks","category-linux_-_howto-en","category-network-security-tools","tag-brutus","tag-hacking","tag-mikrotik"],"taxonomy_info":{"category":[{"value":711,"label":"Attacks"},{"value":685,"label":"Linux - HOWTO"},{"value":715,"label":"Tools"}],"post_tag":[{"value":959,"label":"brutus"},{"value":961,"label":"hacking"},{"value":957,"label":"mikrotik"}]},"featured_image_src_large":false,"author_info":{"display_name":"admin","author_link":"https:\/\/nil.uniza.sk\/en\/author\/admin\/"},"comment_info":10,"category_info":[{"term_id":711,"name":"Attacks","slug":"network-security-attacks","term_group":0,"term_taxonomy_id":709,"taxonomy":"category","description":"","parent":707,"count":2,"filter":"raw","cat_ID":711,"category_count":2,"category_description":"","cat_name":"Attacks","category_nicename":"network-security-attacks","category_parent":707},{"term_id":685,"name":"Linux - HOWTO","slug":"linux_-_howto-en","term_group":0,"term_taxonomy_id":683,"taxonomy":"category","description":"","parent":0,"count":71,"filter":"raw","cat_ID":685,"category_count":71,"category_description":"","cat_name":"Linux - HOWTO","category_nicename":"linux_-_howto-en","category_parent":0},{"term_id":715,"name":"Tools","slug":"network-security-tools","term_group":0,"term_taxonomy_id":713,"taxonomy":"category","description":"","parent":707,"count":8,"filter":"raw","cat_ID":715,"category_count":8,"category_description":"","cat_name":"Tools","category_nicename":"network-security-tools","category_parent":707}],"tag_info":[{"term_id":959,"name":"brutus","slug":"brutus","term_group":0,"term_taxonomy_id":957,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":961,"name":"hacking","slug":"hacking","term_group":0,"term_taxonomy_id":959,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":957,"name":"mikrotik","slug":"mikrotik","term_group":0,"term_taxonomy_id":955,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=637"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/637\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}