# ExploitTitle: antMan <=0.9.0c AuthenticationBypass
# Date:02-27-2018
# SoftwareLink: https://www.antsle.com
# Version:<=0.9.0c
# Tested on:0.9.0c
# ExploitAuthor:JoshuaBowser
# Contact: joshua.bowser@codecatoctin.com
# Website: http://www.codecatoctin.com
# Category: web apps
1.Description
antMan versions <=0.9.c contain a critical authentication defect, allowing an unauthenticated attacker toobtain root permissions within the antMan web management console.
http://blog.codecatoctin.com/2018/02/antman-authentication-bypass.html
2.Proof of ConceptThe antMan authentication implementation obtains user-supplied username and password parameters from a POST request issued to/login. Next, antMan utilizes Java’s ProcessBuilderclasstoinvoke, as root, a bash script called antsle-auth.
This script contains two critical defects that allow an attacker tobypass the authentication checks.By changing the username to> and the password toa url-encoded linefeed (%0a), we can force the authentication script toproducereturn values not anticipated by the developer.
To exploit these defects, use a web proxy tointercept the login attempt and modify the POST parameters as follows:
#-------------------------POST/login HTTP/1.1Host:10.1.1.7:3000[snip]
username=>&password=%0a
#-------------------------You will now be successfully authenticated toantMan as the administrative root user.3.Solution:Updatetoversion0.9.1a