SlideShare a Scribd company logo
N m a p S c r ip t in g E n g in e
  R u lin g t h e n e t w o r k w it h N m a p
                 o n s t e r o id s

Hani Benhabiles
President @ OWASP Algeria Student Chapter
Nmap-dev team (gsoc)
Security enthusiast
Student @ ESI




                     Twitter: @kroosec
                     Email: hani.benhabiles@owasp.org
S umma ry

Nmap

Nmap Scripting Engine

Writing Nmap scripts
Nma p

Network scanner

Open Source

1997, by Fyodor

Latest version: 5.51 (stable), 5.61TEST5 (Dev)

THE tool
Nma p
Host discovey (Are there devices on these IPs? )
-PE, -PS, -PA, -PU, -PP, -PR etc...
Nma p
Port scanning
-sS, -sT, -sU, -sA etc...
Nma p
Version detection
-sV
nmap-service-probes
Nma p
OS detection
-O
nmap-os-db
S t ill, n o t f le x ib le
      e no u g h...
N m a p S c r ip t in g E n g in e


2006, by Diman Todorov (GSoC project)

Extends Nmap capabilities

Scripts are written in Lua
N m a p S c r ip t in g E n g in e

365 scripts

/usr/share/nmap/scripts/

95 libraries

/usr/share/nmap/nselib/
N m a p S c r ip t in g E n g in e

Script types: Prerule, Host, Service, Postrule

Script categories: broadcast, brute, default (-A),
discovery, dos, safe, version, vuln...

http://nmap.org/nsedoc/
N m a p S c r ip t in g E n g in e
N m a p S c r ip t in g E n g in e
P ha s e s of a n Nma p
              sc an

Script pre-scanning
Target enumeration
Host discovery
Reverse-DNS resolution
Port scanning
Version detection
OS detection
Traceroute
Script scanning
Output
Script post-scanning
E x e c u t in g S c r ip t s

--script http-enum

--script default,safe

--script http-* --script-args user=foo
N m a p S c r ip t in g E n g in e
D e mo (broa dc a s t
     s c r ip t s )
W r it in g N m a p s c r ip t s

Scripting language

Fast and very light

Used by other security projects
(Wireshark, Snort, ModSecurity...)

Also used in game development: Crysis, WoW...
yes, World of Warcraft :)
W r it in g N m a p s c r ip t s

Meta-information

description, categories, dependencies, author and
license.
W r it in g N m a p s c r ip t s

Rules

Prerule, hostrule, portrule, postrule

May have more than one rule
W r it in g N m a p s c r ip t s

action

Core of the script

Function executed when a rule returns true.
L e s s t a lk . . .
W r it in g N m a p s c r ip t s

Drupal Views module Information Leakage

Permits recovering list of users

admin/views/ajax/autocomplete/user/S returns
usernames that begin with S

Results in JSON format
W r it in g N m a p s c r ip t s

Not patched

Drupal.org is vulnerable :)

For more information:
http://www.madirish.net/node/465
L e t ' s w r it e it
H e lp t h e p r o je c t

Testing scripts

Ideas for new scripts

Contribute scripts

nmap-dev@insecure.org
Th a n k yo u !


   Hani Benhabiles
   Twitter: @kroosec
   Email: hani.benhabiles@owasp.org

More Related Content

PDF
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
PDF
CONFidence 2018: Darknet traffic - what can we learn from nooks and crannies ...
PDF
PDF
Hacking With Nmap - Scanning Techniques
PDF
Статический анализ кода в контексте SSDL
ODP
Perl Usage In Security and Penetration testing
PDF
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
PDF
Nmap scripting engine
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
CONFidence 2018: Darknet traffic - what can we learn from nooks and crannies ...
Hacking With Nmap - Scanning Techniques
Статический анализ кода в контексте SSDL
Perl Usage In Security and Penetration testing
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Nmap scripting engine

What's hot (20)

PDF
Buffer overflow null
PPT
Defending Your Network
PDF
Nmap Hacking Guide
PPTX
Nmap and metasploitable
PPT
securing_syslog_onFreeBSD
PPTX
Recon with Nmap
PDF
Если нашлась одна ошибка — есть и другие. Один способ выявить «наследуемые» у...
PDF
Nmap commands
PPTX
PPTX
NMAP - The Network Scanner
PPTX
Vulnerability, exploit to metasploit
PDF
Assume Compromise
PDF
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
PDF
Penetration Testing Resource Guide
PDF
NMAP by Shrikant Antre & Shobhit Gautam
PPT
Buffer Overflow Attacks
PDF
Violent python
PDF
Introduction GStreamer
PPTX
Introduction to Gstreamer
Buffer overflow null
Defending Your Network
Nmap Hacking Guide
Nmap and metasploitable
securing_syslog_onFreeBSD
Recon with Nmap
Если нашлась одна ошибка — есть и другие. Один способ выявить «наследуемые» у...
Nmap commands
NMAP - The Network Scanner
Vulnerability, exploit to metasploit
Assume Compromise
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
Penetration Testing Resource Guide
NMAP by Shrikant Antre & Shobhit Gautam
Buffer Overflow Attacks
Violent python
Introduction GStreamer
Introduction to Gstreamer
Ad

Viewers also liked (20)

PPTX
Cryptography basics
PDF
[NCTU] [CCCA] Network Security I
PDF
Ch 09 -- ARP & IP Analysis
PDF
Ch 07 -- The Expert System
PDF
Wireshark course, Ch 05: Advanced statistics tools
PDF
Wireshark course, Ch 03: Capture and display filters
PPT
SSL basics and SSL packet analysis using wireshark
PDF
Ch 08 -- Ethernet & LAN Switching Troubleshooting
PPTX
Reconnaissance - For pentesting and user awareness
PPT
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
PDF
Wireshark course, Ch 02: Introduction to wireshark
PDF
Ch 06 -- Bandwidth Delay and Jitter Issues
PDF
Network Forensics: Packet Analysis Using Wireshark
PPTX
Wireshark
PDF
Footprinting tools for security auditors
PPTX
Wireshark
PPTX
Packet analysis using wireshark
PPTX
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
PPT
Wireshark
PPTX
DC612 Day - Hands on Penetration Testing 101
Cryptography basics
[NCTU] [CCCA] Network Security I
Ch 09 -- ARP & IP Analysis
Ch 07 -- The Expert System
Wireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 03: Capture and display filters
SSL basics and SSL packet analysis using wireshark
Ch 08 -- Ethernet & LAN Switching Troubleshooting
Reconnaissance - For pentesting and user awareness
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
Wireshark course, Ch 02: Introduction to wireshark
Ch 06 -- Bandwidth Delay and Jitter Issues
Network Forensics: Packet Analysis Using Wireshark
Wireshark
Footprinting tools for security auditors
Wireshark
Packet analysis using wireshark
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Wireshark
DC612 Day - Hands on Penetration Testing 101
Ad

Similar to BSides Algiers - Nmap Scripting Engine - Hani Benhabiles (20)

PDF
Nmap | Network Mapping | Null Bhopal Chapter
PPTX
Nmap_Scripting_Engine_Presentations.pptx
ODP
Nmap Scripting Engine and http-enumeration
PPTX
PDF
Nmap Basics
PDF
Nmap basics-1198948509608024-3
PDF
Nmap basics
PDF
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
PDF
A COMPREHENSIVE ANALYSIS OF NETWORK SCANNING AND SECURITY ASSESSMENT TOOL
PDF
Nmap is a network scanner created by Gordon Lyon
PPTX
PPTX
Nmap(network mapping)
PPT
NMAP1.ppt
PPTX
Null Delhi chapter - Feb 2019
DOCX
This Assignment consists of Amazon Web services
DOCX
Contents namp
DOCX
Contents namp
PDF
NMap 101 offline meetup by CyberForge Academy
PPTX
Using metasploit
DOCX
Backtrack Manual Part3
Nmap | Network Mapping | Null Bhopal Chapter
Nmap_Scripting_Engine_Presentations.pptx
Nmap Scripting Engine and http-enumeration
Nmap Basics
Nmap basics-1198948509608024-3
Nmap basics
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
A COMPREHENSIVE ANALYSIS OF NETWORK SCANNING AND SECURITY ASSESSMENT TOOL
Nmap is a network scanner created by Gordon Lyon
Nmap(network mapping)
NMAP1.ppt
Null Delhi chapter - Feb 2019
This Assignment consists of Amazon Web services
Contents namp
Contents namp
NMap 101 offline meetup by CyberForge Academy
Using metasploit
Backtrack Manual Part3

More from Shellmates (14)

PPTX
HTML basics
PDF
Malware Analysis par Mohamed Ali FATHI - BSides Algiers 2k15
PDF
Atelier Python 2eme partie par Achraf Kacimi El Hassani
PPTX
JavaScript 1.0 by Zakaria Smahi
PDF
Introduction à Python - Achraf Kacimi El Hassani
PPTX
BSides Algiers - Stuxnet - Sofiane Talmat
PDF
BSides Algiers - Linux Kernel and Recent Security Protections - Djallal Harouni
PPTX
BSides Algiers - Layer7 DoS Attacks - Oussama Elhamer
PPTX
BSides Algiers - Reversing Win32 applications - Yacine Hebbal
PDF
BSides Algiers - Normes ISO 2700x - Badis Remli
PPTX
BSides Algiers - Metasploit framework - Oussama Elhamer
PDF
BSides Algiers - PHP Static Code Analysis - Abdeldjalil Belakhdar
PDF
BSides Algiers - Certification Electronique - Lilia Ounini
PPTX
BSides algiers - Malware History - Sofiane Talmat
HTML basics
Malware Analysis par Mohamed Ali FATHI - BSides Algiers 2k15
Atelier Python 2eme partie par Achraf Kacimi El Hassani
JavaScript 1.0 by Zakaria Smahi
Introduction à Python - Achraf Kacimi El Hassani
BSides Algiers - Stuxnet - Sofiane Talmat
BSides Algiers - Linux Kernel and Recent Security Protections - Djallal Harouni
BSides Algiers - Layer7 DoS Attacks - Oussama Elhamer
BSides Algiers - Reversing Win32 applications - Yacine Hebbal
BSides Algiers - Normes ISO 2700x - Badis Remli
BSides Algiers - Metasploit framework - Oussama Elhamer
BSides Algiers - PHP Static Code Analysis - Abdeldjalil Belakhdar
BSides Algiers - Certification Electronique - Lilia Ounini
BSides algiers - Malware History - Sofiane Talmat

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
KodekX | Application Modernization Development
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
KodekX | Application Modernization Development
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
cuic standard and advanced reporting.pdf
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Understanding_Digital_Forensics_Presentation.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”

BSides Algiers - Nmap Scripting Engine - Hani Benhabiles

  • 1. N m a p S c r ip t in g E n g in e R u lin g t h e n e t w o r k w it h N m a p o n s t e r o id s Hani Benhabiles President @ OWASP Algeria Student Chapter Nmap-dev team (gsoc) Security enthusiast Student @ ESI Twitter: @kroosec Email: hani.benhabiles@owasp.org
  • 2. S umma ry Nmap Nmap Scripting Engine Writing Nmap scripts
  • 3. Nma p Network scanner Open Source 1997, by Fyodor Latest version: 5.51 (stable), 5.61TEST5 (Dev) THE tool
  • 4. Nma p Host discovey (Are there devices on these IPs? ) -PE, -PS, -PA, -PU, -PP, -PR etc...
  • 5. Nma p Port scanning -sS, -sT, -sU, -sA etc...
  • 8. S t ill, n o t f le x ib le e no u g h...
  • 9. N m a p S c r ip t in g E n g in e 2006, by Diman Todorov (GSoC project) Extends Nmap capabilities Scripts are written in Lua
  • 10. N m a p S c r ip t in g E n g in e 365 scripts /usr/share/nmap/scripts/ 95 libraries /usr/share/nmap/nselib/
  • 11. N m a p S c r ip t in g E n g in e Script types: Prerule, Host, Service, Postrule Script categories: broadcast, brute, default (-A), discovery, dos, safe, version, vuln... http://nmap.org/nsedoc/
  • 12. N m a p S c r ip t in g E n g in e
  • 13. N m a p S c r ip t in g E n g in e
  • 14. P ha s e s of a n Nma p sc an Script pre-scanning Target enumeration Host discovery Reverse-DNS resolution Port scanning Version detection OS detection Traceroute Script scanning Output Script post-scanning
  • 15. E x e c u t in g S c r ip t s --script http-enum --script default,safe --script http-* --script-args user=foo
  • 16. N m a p S c r ip t in g E n g in e
  • 17. D e mo (broa dc a s t s c r ip t s )
  • 18. W r it in g N m a p s c r ip t s Scripting language Fast and very light Used by other security projects (Wireshark, Snort, ModSecurity...) Also used in game development: Crysis, WoW... yes, World of Warcraft :)
  • 19. W r it in g N m a p s c r ip t s Meta-information description, categories, dependencies, author and license.
  • 20. W r it in g N m a p s c r ip t s Rules Prerule, hostrule, portrule, postrule May have more than one rule
  • 21. W r it in g N m a p s c r ip t s action Core of the script Function executed when a rule returns true.
  • 22. L e s s t a lk . . .
  • 23. W r it in g N m a p s c r ip t s Drupal Views module Information Leakage Permits recovering list of users admin/views/ajax/autocomplete/user/S returns usernames that begin with S Results in JSON format
  • 24. W r it in g N m a p s c r ip t s Not patched Drupal.org is vulnerable :) For more information: http://www.madirish.net/node/465
  • 25. L e t ' s w r it e it
  • 26. H e lp t h e p r o je c t Testing scripts Ideas for new scripts Contribute scripts nmap-dev@insecure.org
  • 27. Th a n k yo u ! Hani Benhabiles Twitter: @kroosec Email: hani.benhabiles@owasp.org