{"id":5247,"date":"2023-07-01T12:06:23","date_gmt":"2023-07-01T17:06:23","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=5247"},"modified":"2023-11-22T14:52:49","modified_gmt":"2023-11-22T20:52:49","slug":"airgateway-random-users-in-config","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/airgateway-random-users-in-config\/","title":{"rendered":"AirGateway Random Users in Config!"},"content":{"rendered":"\n<p>Recently ran across some AirGateway configs that had an extra user account on them.  Typically on most Ubiquiti AirMax and AirGateway equipment, there are two user accounts that show up in the config.  <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>users.1.* which is the admin user. <\/li>\n\n\n\n<li>users.2.* which is the read only user.  Disabled by default<\/li>\n<\/ul>\n\n\n\n<p>A cool trick we can do is add users in the config i.e. (users.3, users.4 etc.)<\/p>\n\n\n\n<p>So what do you do when you see a third user showing up that you didn&#8217;t put there?!<\/p>\n\n\n\n<p>The user account looked like the following.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">users.3.name=112233AABBCC\nusers.3.password=Gczz8EBQEdAIg   \nusers.3.status=enabled<\/pre>\n\n\n\n<p>The username was the MAC address of the device and the password field is a DES(Unix) hash of what appears to be an 8 character randomly generated upper and lower case password.  <\/p>\n\n\n\n<p>Older AirOS versions only let a user select a password up to 8 characters long.  You could create a longer one and log in via SSH, but you wouldn&#8217;t be able to log into the web interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Identifying Access<\/h2>\n\n\n\n<p>So how did these get on here in the first place?<\/p>\n\n\n\n<p>I am guessing that the users were created at some point while trying to adopt them to UNMS\/UISP before there was firmware that supported it.  The user name is the actual MAC address of the device and the passwords do seem to be randomly generated.  There do not appear to be any major differences between the support files from a normal AirGateway and a suspicious AirGateway.<\/p>\n\n\n\n<p>Also appears to only affects AirGateways which were the only devices that had issues in the past connecting to UNMS\/UISP.  The rest of the AirMax equipment uses very similar firmware so if there was a security issue, it should have affected all the devices.<\/p>\n\n\n\n<p>The hashing type &#8220;DES(Unix)&#8221; does not appear to be used anymore, being replaced with MD5 Crypt.  So this does appear to have happened awhile ago.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cracking the Hash<\/h2>\n\n\n\n<p>You&#8217;ll need hashcat installed and setup to crack the hash.  Kali Linux has hashcat included (you will just want to have the<a href=\"https:\/\/www.incredigeek.com\/home\/how-to-install-nvidia-proprietary-drivers-on-kali-linux-2\/\" data-type=\"post\" data-id=\"1230\"> NVIDIA drivers installed<\/a> for optimal performance).  You can also check out <a href=\"https:\/\/www.incredigeek.com\/home\/install-hashcat-on-fedora\/\" data-type=\"post\" data-id=\"1910\">installing hashcat on Fedora<\/a>, or check out the hashcat website for other systems. <a href=\"https:\/\/hashcat.net\/hashcat\/\">https:\/\/hashcat.net\/hashcat\/<\/a><\/p>\n\n\n\n<p>Put the hashes of interest into a text file called hash.txt<\/p>\n\n\n\n<p>Command to crack the passwords <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> .\/hashcat.bin -a 3 -m 1500 .\/hash.txt -1?l?u ?1?1?1?1?1?1?1?1 -w 3 --session airgateway<\/pre>\n\n\n\n<p>the -1?l?u let&#8217;s us specify a custom character list made up of -l and -u.  Lower and Upper case letters.  &#8211;session airgateway will record a checkpoint ever so often.  So if our run gets interrupted, we can restore the session with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/hashcat.bin --session airgateway --restore<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Remediation<\/h2>\n\n\n\n<p>Fortunately, remediation is fairly simple.<\/p>\n\n\n\n<p>SSH into the affected device and open up the config file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/tmp\/system.cfg<\/pre>\n\n\n\n<p>Find the lines that start with &#8220;users.3.&#8221;, delete them, and save the file<\/p>\n\n\n\n<p>Run the following command to save the changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/usr\/etc\/rc.d\/rc.softrestart save <\/pre>\n\n\n\n<p><em>If you are not comfortable with the command line, then you can, through the web gui, download a backup, edit the backup file in a text editor, then upload\/restore the backup.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other notes<\/h2>\n\n\n\n<p>Something else you may run across is a mcuser that shows up in \/etc\/passwd.  This is typically a user used for AirControl, so if you have used AirControl in the past that is most likely why it is there.  Check out the following article to remove the user.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-incredigeek wp-block-embed-incredigeek\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"7wYs1pOeEP\"><a href=\"https:\/\/www.incredigeek.com\/home\/remove-aircontrol-provisioning-from-ubiquiti-radio-via-ssh\/\">Remove AirControl provisioning from Ubiquiti radio via SSH<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Remove AirControl provisioning from Ubiquiti radio via SSH&#8221; &#8212; Incredigeek\" src=\"https:\/\/www.incredigeek.com\/home\/remove-aircontrol-provisioning-from-ubiquiti-radio-via-ssh\/embed\/#?secret=A6QGbCJwLn#?secret=7wYs1pOeEP\" data-secret=\"7wYs1pOeEP\" width=\"584\" height=\"329\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently ran across some AirGateway configs that had an extra user account on them. Typically on most Ubiquiti AirMax and AirGateway equipment, there are two user accounts that show up in the config. A cool trick we can do is &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/airgateway-random-users-in-config\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[573,129,1144],"tags":[1524,687,414,131,132,974,1523],"class_list":["post-5247","post","type-post","status-publish","format-standard","hentry","category-security","category-ubiquiti","category-ubiquiti-command-line","tag-airgateway","tag-hash","tag-hashcat","tag-ubiquiti-2","tag-ubnt","tag-ui","tag-users-3"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=5247"}],"version-history":[{"count":5,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5247\/revisions"}],"predecessor-version":[{"id":5537,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5247\/revisions\/5537"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=5247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=5247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=5247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}