Book Image

Mastering the Nmap Scripting Engine

By : Paulino Calderon
Book Image

Mastering the Nmap Scripting Engine

By: Paulino Calderon

Overview of this book

Table of Contents (23 chapters)
Mastering the Nmap Scripting Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Scan Phases
Script Categories
Nmap Options Mind Map
References
Index

Chapter 7. Formatting the Script Output

Formatting our Nmap Scripting Engine (NSE) scripts' output correctly is important because it provides greater flexibility to anyone working with them, specifically when reading or parsing results. This chapter covers the usage of the supported output mode and attempts to outline good practices regarding reporting data back to the users.

In version 6.20BETA1, a new feature was introduced to provide greater flexibility by allowing NSE scripts to return structured data in XML format. Before that, users needed to parse the results from a string stored in the file, while the new system allows users to navigate through a well-organized XML file. We will explore the different ways of producing this structured output.

Besides the new structured output scheme, this chapter will talk about the role of the Nmap API and stdnse library when formatting our scripts' output and printing debugging calls or verbose messages. In this chapter, we will cover the following...