├── exampleimage.png ├── README.md └── nmap.sublime-syntax /exampleimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tehstoni/Sublime-Nmap-Syntax/HEAD/exampleimage.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
46 |
--------------------------------------------------------------------------------
/nmap.sublime-syntax:
--------------------------------------------------------------------------------
1 | %YAML 1.2
2 | ---
3 | name: Nmap
4 | file_extensions:
5 | - nmap
6 | scope: source.nmap
7 |
8 | contexts:
9 | main:
10 | # Comment lines
11 | - match: ^#.*
12 | scope: comment.line.number-sign.nmap
13 |
14 | # Host information with IP addresses
15 | - match: (Nmap scan report for )([^\s]+)\s\((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\)
16 | captures:
17 | 1: entity.name.section.nmap
18 | 2: constant.other.hostname.nmap
19 | 3: constant.numeric.ip-address.nmap
20 |
21 | # Host status
22 | - match: (Host is up \()(.*?)(\))
23 | captures:
24 | 1: keyword.other.nmap
25 | 2: constant.numeric.time.nmap
26 | 3: punctuation.definition.comment.nmap
27 |
28 | # Port information
29 | - match: ^(\d+)/(tcp|udp)\s+(open|closed|filtered)\s+([^\s]+)\s+(.*)$
30 | captures:
31 | 1: constant.numeric.port.nmap
32 | 2: storage.type.nmap
33 | 3: keyword.other.state.nmap
34 | 4: storage.type.service.nmap
35 | 5: string.unquoted.version.nmap
36 |
37 | # Service information
38 | - match: ^([^\s]+)\s+(open|closed|filtered)\s+(.*)$
39 | captures:
40 | 1: storage.type.service.nmap
41 | 2: keyword.other.state.nmap
42 | 3: string.unquoted.nmap
43 |
44 | # IP addresses
45 | - match: \b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b
46 | scope: constant.numeric.ip-address.nmap
47 |
48 | # Finished time
49 | - match: (Nmap done at )(.*)
50 | captures:
51 | 1: keyword.other.nmap
52 | 2: constant.numeric.time.nmap
53 |
54 | # HTTP Responses
55 | - match: (HTTP/\d+\.\d+ \d+ .*)
56 | scope: keyword.control.http.nmap
57 |
58 | # Headers
59 | - match: ^([A-Za-z-]+:)(\s+.*)
60 | captures:
61 | 1: entity.name.tag.http.nmap
62 | 2: string.unquoted.nmap
63 |
64 | # HTML and XML content
65 | - match: (<[^>]+>)
66 | scope: string.unquoted.html.nmap
67 |
68 | # SF lines
69 | - match: ^SF.*.+$
70 | scope: string.unquoted.sf-response.nmap
71 |
72 | # Next Service Fingerprint header
73 | - match: ^={14,}NEXT SERVICE FINGERPRINT \(SUBMIT INDIVIDUALLY\)={14,}$
74 | scope: entity.name.section.next-service.nmap
75 |
76 | # Generic lines with equals at the start and end
77 | - match: ^=.*=$
78 | scope: entity.name.tag.http.nmap
79 |
80 | # HTTP header lines with pipe
81 | - match: ^(\|\s+)([A-Za-z-]+)(:)(.*)$
82 | captures:
83 | 1: punctuation.separator.pipe.nmap
84 | 2: entity.name.tag.header-name.nmap
85 | 3: punctuation.separator.colon.nmap
86 | 4: string.unquoted.header-value.nmap
87 |
--------------------------------------------------------------------------------