Rapid7 Vulnerability & Exploit Database

Mercurial Custom hg-ssh Wrapper Remote Code Exec

Back to Search

Mercurial Custom hg-ssh Wrapper Remote Code Exec

Disclosed
04/18/2017
Created
05/30/2018

Description

This module takes advantage of custom hg-ssh wrapper implementations that don't adequately validate parameters passed to the hg binary, allowing users to trigger a Python Debugger session, which allows arbitrary Python code execution.

Author(s)

  • claudijd

Platform

Python

Architectures

python

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/ssh/mercurial_ssh_exec
msf exploit(mercurial_ssh_exec) > show targets
    ...targets...
msf exploit(mercurial_ssh_exec) > set TARGET < target-id >
msf exploit(mercurial_ssh_exec) > show options
    ...show and set options...
msf exploit(mercurial_ssh_exec) > 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

;