This module exploits an arbitrary file upload vulnerability on HP Managed Printing Administration 2.6.3 and prior versions. The vulnerability exists in the UploadFiles() function from the MPAUploader.Uploader.1 control, loaded and used by the server. The function can be abused via directory traversal and null byte injection in order to achieve arbitrary file upload. In order to exploit successfully, a few conditions must be met. First, a writable location under the context of Internet Guest Account (IUSR_*) or Everyone is required. By default, this module will attempt to write to /hpmpa/userfiles/, but the WRITEWEBFOLDER option can be used to provide another writable path. Second, the writable path must also be readable by a browser, so this typically means a location under wwwroot. Finally, you cannot overwrite a file with the same name as the payload.
Windows
To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':
Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.
– Jim O’Gorman | President, Offensive Security