Giter VIP home page Giter VIP logo

nmap-scripts's Introduction

Nmap NSE Scripts

The following scripts are available in official Nmap repositories:

  • ip-https-discover.nse
  • knx-gateway-discover.nse
  • knx-gateway-info.nse
  • sstp-discover.nse

knx-gateway-info.nse

This script establishes a unicast connection to a specific device in order to retrieve information. This can be used to e.g. retrieve gateways information over the Internet.

Usage

# nmap -sU -p3671 --script ./knx-gateway-info.nse 192.168.178.11

Note: Increase verbosity/debug to see full message contents:

# nmap -sU -p3671 -d --script ./knx-gateway-info.nse 192.168.178.11

Sample Output

# nmap -sU -p3671 --script ./knx-gateway-info.nse 192.168.178.11

Starting Nmap 6.49SVN ( https://nmap.org ) at 2015-08-12 20:21 CEST
Nmap scan report for 192.168.178.11
Host is up (0.00042s latency).
PORT     STATE         SERVICE
3671/udp open|filtered efcp
| knx-gateway-info:
|   Body:
|     DIB_DEV_INFO:
|       KNX address: 15.15.255
|       Decive serial: 00ef2650065c
|       Multicast address: 0.0.0.0
|       Device friendly name: IP-Viewer
|     DIB_SUPP_SVC_FAMILIES:
|       KNXnet/IP Core version 1
|       KNXnet/IP Device Management version 1
|       KNXnet/IP Tunnelling version 1
|_      KNXnet/IP Object Server version 1

knx-gateway-discover.nse

This script uses a multicast packet to discover all local gateways. According to the KNX specification every device must support this. This script can only be used to discover local KNX gateways.

Usage

# nmap -e eth0 --script ./knx-gateway-discover.nse

Note: Increase verbosity/debug to see full message contents:

# nmap -e eth0 -v -d --script ./knx-gateway-discover.nse

The script supports the following script-args:

  • timeout: Defines how long the script waits for responses
  • newtargets: Add found gateways to target list

Sample Output

Default

# nmap -e eth0 --script ./knx-gateway-discover.nse

Starting Nmap 6.49SVN ( https://nmap.org ) at 2015-08-12 20:19 CEST
Pre-scan script results:
| knx-gateway-discover:
|   192.168.178.11:
|     Body:
|       HPAI:
|         Port: 3671
|       DIB_DEV_INFO:
|         KNX address: 15.15.255
|         Decive serial: 00ef2650065c
|         Multicast address: 0.0.0.0
|         Device MAC address: 00:05:26:50:06:5c
|         Device friendly name: IP-Viewer
|       DIB_SUPP_SVC_FAMILIES:
|         KNXnet/IP Core version 1
|         KNXnet/IP Device Management version 1
|         KNXnet/IP Tunnelling version 1
|_        KNXnet/IP Object Server version 1

Debug

# nmap -d -e eth0 --script ./knx-gateway-discover.nse

Starting Nmap 6.49SVN ( https://nmap.org ) at 2015-08-12 20:20 CEST
PORTS: Using top 1000 ports found open (TCP:1000, UDP:0, SCTP:0)
--------------- Timing report ---------------
  hostgroups: min 1, max 100000
  rtt-timeouts: init 1000, min 100, max 10000
  max-scan-delay: TCP 1000, UDP 1000, SCTP 1000
  parallelism: min 0, max 0
  max-retries: 10, host-timeout: 0
  min-rate: 0, max-rate: 0
---------------------------------------------
NSE: Using Lua 5.2.
NSE: Arguments from CLI:
NSE: Loaded 1 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 1) scan.
Initiating NSE at 20:20
NSE: Starting knx-gateway-discover.
NSE: Finished knx-gateway-discover.
NSE: Finished knx-gateway-discover.
NSE: Finished knx-gateway-discover.
Completed NSE at 20:20, 3.08s elapsed
Pre-scan script results:
| knx-gateway-discover:
|   192.168.178.11:
|     Header:
|       Header length: 6
|       Protocol version: 16
|       Service type: SEARCH_RESPONSE (0x0202)
|       Total length: 78
|     Body:
|       HPAI:
|         Protocol code: 01
|         IP address: 192.168.178.11
|         Port: 3671
|       DIB_DEV_INFO:
|         Description type: Device Information
|         KNX medium: KNX TP1
|         Device status: 00
|         KNX address: 15.15.255
|         Project installation identifier: 0000
|         Decive serial: 00ef2650065c
|         Multicast address: 0.0.0.0
|         Device MAC address: 00:05:26:50:06:5c
|         Device friendly name: IP-Viewer
|       DIB_SUPP_SVC_FAMILIES:
|         KNXnet/IP Core version 1
|         KNXnet/IP Device Management version 1
|         KNXnet/IP Tunnelling version 1
|_        KNXnet/IP Object Server version 1

mop-discover.nse

Check if the Maintenance Operation Protocol (MOP) is enabled on Cisco devices. Please refer to this post for further information.

Checking if a device supports MOP is as easy as this:

nmap --script mop-discover.nse 192.168.1.1

In case there is just layer 2 connectivity, the MAC address can be specified as follows:

nmap --script mop-discover.nse --script-args target=01:02:03:04:05:06 -e eth0

Note: This might requires to set an IP address on the defined interface or else Nmap won't be able to use it. However, any IP will do.

ssl-heartbleed-dump.nse

Discovers/Exploits Heartbleed (CVE-2014-0160). This script is basically like the Heartbleed detection script included in official Nmap repositories with the ability to dump the leaked memory to an outfile or print a hexdump by increasing Nmap's debug output.

Check if a host is vulnerable to Heartbleed (checks every SSL-enabled HTTP, FTP, SMTP and/or XMPP port):

$ nmap --script ./ssl-heartbleed-dump.nse 192.168.1.1

Print out a hexdump of leaked memory by increasing Nmap's debug level with the -d flag:

$ nmap -d --script=./ssl-heartbleed-dump.nse 192.168.1.1

Dump leaked memory into an outfile:

$ nmap --script ./ssl-heartbleed-dump.nse --script-args 'ssl-heartbleed-dump.dumpfile=/tmp/heartbleed.dump' 192.168.1.1

Run ssl-heartbleed-dump.nse against every open port, regardless if the servie was detected or not:

$ nmap --script +./ssl-heartbleed-dump.nse 192.168.1.1

nmap-scripts's People

Contributors

takeshixx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmap-scripts's Issues

knx-gateway-info.nse can't detect remote gateway

knx-gateway-info.nse works well when I scan KNX gateway locally. But when I try to scan KNX gateway using remote IP address it can't detect gateway. Please see attached screenshot. First attempt - internal IP, second - external IP (of the same KNX gateway). ETS software can connect to remote IP address but I should use "using NAT" option (please see attached screenshot).

2

ets

knx-gateway-info.nse scans default port 3671 only

knx-gateway-info.nse script scans default port 3671 only. For example, if I use "nmap -sU -p8888 --script ./knx-gateway-info.nse 8.8.8.8" it scans 8.8.8.8:3671 (not 8.8.8.8:8888). Is it possible to pass port (or port range) to script? For example, It will be very useful to make "nmap -sU -p1-65535 --script ./knx-gateway-info.nse 8.8.8.8" and get whole port range for 8.8.8.8 scanned.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.