Hackers of India

Building custom scans for real world enterprise network

By  Sanoop Thomas  on 06 Feb 2015 @ Nullcon


Presentation Material

Abstract

Pentesters largely uses Nmap. Some uses it very smartly way beyond than a port scanner. The rich set of scripts called as NSEs made this scanner an inevitable tool in a pentesters box. This allows you to use Nmap for vulnerability discovery, exploitation and a lot more other things as well. This research is a tool to develop Nmap script more effectively. It makes necessary environment for the Nmap script development based on the underlying OS. The current challenges in developing Nmap Script are following:

Most of the cases, development happens in generic console editor which don’t understand LUA and Nmap library in one code window The syntax needs to be referred in respective wiki of Nmap NSE and LUA Debugging custom NSE code needs to be specified with a lot more nmap options Halcyon gives following features to overcome above-mentioned challenges and beyond.

It can understand both LUA and Nmap library Allows code completion Easily builder as it supports LUA and NSE syntax highlighting One click debug and run. Lot of debugging switches can be set through it’s GUI. Easy navigation to scripts and related libraries. This allows a script writer to modify existing libraries, data files, wordlist etc. Talk outline:

Introduction to Nmap Script Scans Some Smart usage of NSE to real world scanning Anatomy of NSE Existing challenges Halcyon features Live demo on a working NSE

AI Generated Summarymay contain errors

Here is a summary of the content:

The speaker is discussing how to create an Nmap script to identify and exploit Shellshock vulnerabilities in CGI-based applications. They demonstrate how to write a script using the Nmap scripting engine, which involves declaring variables, creating a header file, and crafting an HTTP request with a malicious user agent string.

The script takes arguments such as the path to the CGI script, host IP address, port number, and user agent string. The speaker shows how to use autocomplete options in the ID to automatically list out the syntax for the script.

Once the script is written, it can be run against a target machine to inject the Shellshock attack vector through an HTTP header. The output of the script will display the status code and response from the target machine.

The speaker also highlights the benefits of using Nmap scripting engine, such as ease of debugging and syntax completion options, which make it easier for developers to write scripts and contribute to the Nmap community.