Book Image

Learning Metasploit Exploitation and Development

By : Aditya Balapure
Book Image

Learning Metasploit Exploitation and Development

By: Aditya Balapure

Overview of this book

<p>Metasploit is an open source exploit framework that provides you with heaps of exploits, as well as tools to assist you in creating your own exploits. This includes the ability to generate a large range of shellcodes for different purposes and platforms that can be customized to attack your target. The recent improvements in network security mechanisms have given rise to new trends and techniques of compromising a network. This book deals with these recent trends and attack tips to compromise the weakest to the strongest of networks. Metasploit Exploitation and Development describes actual penetration testing skills and ways to penetrate and assess different types of networks.<br /><br />Metasploit Exploitation and Development is a perfect fit for hackers who want to develop some real exploitation skills. This book has been designed with a practical approach which emphasizes hands-on rather than theoretical reading. It covers all the new exploits for new operating systems and tips from the experience of real hackers. This is a best buy book for learning the art of exploitation and skills of a penetration tester.<br /><br />Metasploit Exploitation and Development is a guide to real network hacking with the best tricks to master the art of exploitation.</p> <p><br />This book has been designed in well-defined stages so the reader learns more effectively. From the actual setup to vulnerability assessment, this book provides an individual with in-depth knowledge of an expert penetration tester. The book deals with vulnerability assessment exercises with some of the industrially-used tools and report-making tips. It covers topics such as client exploitation, backdoors, post exploitation, and also exploitation development with Metasploit.<br />This book has been developed with a practical hands-on approach so that readers can effectively try and test what they actually read.</p> <p><br />Metasploit Exploitation and Development covers the experience of real network hacking with some of the latest operating systems. The readers will go through a journey in which they will learn from basic to advanced levels of the art of exploitation.</p> <p><br />This book covers real hacking and exploitation of the current vulnerabilities in some of the latest operating systems.</p>
Table of Contents (20 chapters)
Learning Metasploit Exploitation and Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Scripting with Metasploit


Now we move on to some concepts of custom Metasploit scripting using Ruby. Let us start off with a very simple program that will print Hello World on the screen. Demonstrated in the following screenshot is how we write our first simple program. We can even simply write down the same program in a text pad and save it in the destination folder.

Since we already have a Meterpreter session, we can simply run our script by typing in run helloworld. We can see that our program has successfully executed and has printed Hello World on the screen. So we have successfully built our own custom script.

Earlier, we used a print_status command; similarly, we can use print_error for displaying a standard error and print_line for displaying a line of text.

We can see that this has been displayed on the screen as shown in the following screenshot:

Now let us move on to having a more structured look for our program by introducing the use of functions, error handling for incorrect input...