Scripting and Extending Nmap and Wireshark with Lua by Gerald Combs - - PowerPoint PPT Presentation

scripting and extending nmap and wireshark with lua
SMART_READER_LITE
LIVE PREVIEW

Scripting and Extending Nmap and Wireshark with Lua by Gerald Combs - - PowerPoint PPT Presentation

Insecure.Org Insecure.Org Scripting and Extending Nmap and Wireshark with Lua by Gerald Combs & Gordon Fyodor Lyon Sharkfest 2010 June 16, 1:15 PM http://insecure.org/presentations/Sharkfest10/ Insecure.Org Insecure.Org Nmap


slide-1
SLIDE 1

Insecure.Org Insecure.Org

Scripting and Extending Nmap and Wireshark with Lua

by Gerald Combs & Gordon “Fyodor” Lyon Sharkfest 2010 – June 16, 1:15 PM http://insecure.org/presentations/Sharkfest10/

slide-2
SLIDE 2

Insecure.Org Insecure.Org

Nmap Security Scanner

Nmap – a cross-platform, open source tool for network exploration or security auditing. Many systems and network administrators also find it useful for tasks such as network inventory and monitoring host or service

  • uptime. Nmap uses raw IP packets in novel

ways to determine what hosts are available

  • n the network, what services (application

name and version) those hosts are offering, what operating systems they are running, and more. Nmap <3 Wireshark

slide-3
SLIDE 3

Insecure.Org Insecure.Org

Presentation Overview

  • Intro to Lua (15 minutes)
  • Lua in Nmap (30 minutes)
  • Lua in Wireshark (30 minutes)
  • Questions
slide-4
SLIDE 4

Insecure.Org Insecure.Org

Introduction to Lua

  • Lightweight embeddable scripting language
  • Created in Brazil in 1993, still actively

developed.

  • Best known for its use in the game industry:

World of Warcraft, Crysis, etc.

  • Security tools: Nmap, Wireshark, Snort IDS
  • Simple
slide-5
SLIDE 5

Insecure.Org Insecure.Org

Why Lua?

  • Tiny - “Complete distribution (source code,

manual, plus binaries for some platforms) fits comfortably on a floppy disk”.

  • Widely used, known, and debugged.
  • Extensible
  • Safe and Secure
  • Portable
  • Interpreted
slide-6
SLIDE 6

Insecure.Org Insecure.Org

More on Lua

  • http://lua.org
  • Programming in Lua - 2nd Edition
slide-7
SLIDE 7

Insecure.Org Insecure.Org

Questions about Lua?

slide-8
SLIDE 8

Insecure.Org Insecure.Org

Lua in Action – Nmap Scripting Engine http://nmap.org/nsedoc/

# nmap -T4 -A scanme.nmap.org Starting Nmap 5.30BETA1 ( http://nmap.org ) Nmap scan report for scanme.nmap.org (64.13.134.52) Host is up (0.022s latency). Not shown: 995 filtered ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) | ssh-hostkey: 1024 60:ac:4d:51:b1:cd:85:09:12:16:92:76:1d:5d:27:6e (DSA) |_2048 2c:22:75:60:4b:c3:3b:18:a2:97:2c:96:7e:28:dc:dd (RSA) 53/tcp open domain 80/tcp open http Apache httpd 2.2.3 ((CentOS)) |_html-title: Go ahead and ScanMe! | http-methods: Potentially risky methods: TRACE |_See http://nmap.org/nsedoc/scripts/http-methods.html 113/tcp closed auth 31337/tcp closed Elite OS details: Linux 2.6.18 (CentOS 5.4) Nmap done: 1 IP address (1 host up) scanned in 25.76 seconds

slide-9
SLIDE 9

Insecure.Org Insecure.Org

NSE Demonstration

  • nmap -v -sV -F -O -T4 wireshark.org
  • nmap -v -sV -F -O -T4 –script=safe

wireshark.org

slide-10
SLIDE 10

Insecure.Org Insecure.Org

NSE Script Source

  • A closer look at some scripts

– daytime.nse – http-date.nse

slide-11
SLIDE 11

Insecure.Org Insecure.Org

An Unusual Example

  • http-california-plates.nse
slide-12
SLIDE 12

Insecure.Org Insecure.Org

Lua In Action – Large Scale Scanning

slide-13
SLIDE 13

Insecure.Org Insecure.Org

SMB/MSRPC Scripts

Ron Bowes spent months researching SMB/MSRPC protocols and wrote a suite of 13 scripts. Informational: smb-os-discovery, smb- server-stats, smb-system-info, smb-security- mode Detailed Enumeration: smb-enum-users, smb-enum-domains, smb-enum-groups, smb-enum-processes, smb-enum-sessions, smb-enum-shares More intrusive: smb-brute, smb-check- vulns, smb-pwdump

slide-14
SLIDE 14

Insecure.Org Insecure.Org

Who to test them out on?

slide-15
SLIDE 15

Insecure.Org Insecure.Org

Large Scale Scanning - Favicon.nse

  • Initial Submission
  • Improving the DB
  • Going overboard
slide-16
SLIDE 16

Insecure.Org Insecure.Org

Questions and Resources

Download Nmap from http://nmap.org Learn about NSE: http://nmap.org/nsedoc/ Slides are posted at: http://insecure.org/presentations/Sharkfest10/