Skip to content

Instantly share code, notes, and snippets.

@r0t0shell
Created October 15, 2024 08:58
Show Gist options
  • Select an option

  • Save r0t0shell/b94ea98b8b8dcf95bd2154996ef3019e to your computer and use it in GitHub Desktop.

Select an option

Save r0t0shell/b94ea98b8b8dcf95bd2154996ef3019e to your computer and use it in GitHub Desktop.
Sublime syntax file for colorized Nmap output. Compatible with batcat.
%YAML 1.2
---
name: Nmap
file_extensions:
- nmap
scope: source.nmap
contexts:
main:
- match: '#.*'
scope: comment.line.nmap
- match: '^\|(_?)'
scope: string.nmap
- match: '(?<=^\|(_?).*?:).*'
scope: comment.nmap
- match: "\"[^']*\""
scope: string.quoted.double.nmap
- match: "(?<=(report for)).*"
scope: string.nmap
- match: '^\d+(?=\/)'
scope: constant.numeric.nmap
- match: '(?<=\d+)\/'
scope: punctuation.separator.nmap
- match: '(?<=^\d+\/)(tcp|udp)'
scope: keyword.control.nmap
- match: '(?<=(tcp|udp)\s+)(unknown|filtered)'
scope: comment.nmap
- match: '(?<=(tcp|udp)\s+)open'
scope: string.nmap
- match: '(?<=(tcp|udp)\s+)closed'
scope: keyword.nmap
- match: '(?<=(tcp|udp)\s+(filtered|open|closed)\s+)[^\s]+'
scope: keyword.nmap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment