Versions of Advantech iView software below `5.7.04.6469` are vulnerable to an unauthenticated command injection vulnerability via the `NetworkServlet` endpoint. The database backup functionality passes a user-controlled parameter, `backup_file` to the `mysqldump` command. The sanitization functionality only tests for SQL injection attempts and directory traversal, so leveraging the `-r` and `-w` `mysqldump` flags permits exploitation. The command injection vulnerability is used to write a payload on the target and achieve remote code execution as NT AUTHORITY\SYSTEM.
Windows
x86, x64, cmd
To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':
msf > use exploit/windows/http/advantech_iview_networkservlet_cmd_inject
msf exploit(advantech_iview_networkservlet_cmd_inject) > show targets
...targets...
msf exploit(advantech_iview_networkservlet_cmd_inject) > set TARGET < target-id >
msf exploit(advantech_iview_networkservlet_cmd_inject) > show options
...show and set options...
msf exploit(advantech_iview_networkservlet_cmd_inject) > exploit
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