├── .gitignore
├── .travis.yml
├── Rakefile
├── NOTICE.TXT
├── .github
├── PULL_REQUEST_TEMPLATE.md
├── ISSUE_TEMPLATE.md
└── CONTRIBUTING.md
├── examples
├── ping-to-stdout
│ └── logstash.conf
└── elasticsearch
│ ├── logstash_nmap.conf
│ └── elasticsearch_nmap_template.json
├── Gemfile
├── spec
├── fixtures
│ ├── ip_down.xml
│ ├── nothingup.xml
│ ├── pingsweep.xml
│ ├── scanme.nmap.org
│ ├── traceroutes.xml
│ ├── scanme_traceroute.xml
│ ├── ipv6_all.xml
│ ├── scanme_A.xml
│ ├── full_scan.xml
│ └── localscan.xml
└── codecs
│ └── nmap_spec.rb
├── CHANGELOG.md
├── logstash-codec-nmap.gemspec
├── docs
└── index.asciidoc
├── README.md
├── lib
└── logstash
│ └── codecs
│ └── nmap.rb
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | *.gem
2 | Gemfile.lock
3 | .bundle
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | import:
2 | - logstash-plugins/.ci:travis/travis.yml@1.x
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | @files=[]
2 |
3 | task :default do
4 | system("rake -T")
5 | end
6 |
7 | require "logstash/devutils/rake"
8 |
--------------------------------------------------------------------------------
/NOTICE.TXT:
--------------------------------------------------------------------------------
1 | Elasticsearch
2 | Copyright 2012-2015 Elasticsearch
3 |
4 | This product includes software developed by The Apache Software
5 | Foundation (http://www.apache.org/).
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/
2 |
--------------------------------------------------------------------------------
/examples/ping-to-stdout/logstash.conf:
--------------------------------------------------------------------------------
1 | input {
2 | http {
3 | host => "127.0.0.1"
4 | port => 8000
5 | codec => nmap
6 | }
7 | }
8 |
9 | output {
10 | stdout {
11 | codec => rubydebug
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gemspec
4 |
5 | logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6 | use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7 |
8 | if Dir.exist?(logstash_path) && use_logstash_source
9 | gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10 | gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11 | end
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Please post all product and debugging questions on our [forum](https://discuss.elastic.co/c/logstash). Your questions will reach our wider community members there, and if we confirm that there is a bug, then we can open a new issue here.
2 |
3 | For all general issues, please provide the following details for fast resolution:
4 |
5 | - Version:
6 | - Operating System:
7 | - Config File (if you have sensitive info, please remove it):
8 | - Sample Data:
9 | - Steps to Reproduce:
10 |
--------------------------------------------------------------------------------
/spec/fixtures/ip_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/spec/fixtures/nothingup.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 0.0.22
2 | - [DOC] Fixed typo: changed `namp` to `nmap` [#32](https://github.com/logstash-plugins/logstash-codec-nmap/pull/32)
3 |
4 | ## 0.0.21
5 | - Update gemspec summary
6 |
7 | ## 0.0.20
8 | - Fix some documentation issues
9 |
10 | # 0.0.18
11 | - Fix bug in 0.0.17 that prevented this from working with LS 5.x
12 | # 0.0.17
13 | - Expand logstash-core-api constraints to allow for 5.2 functionality
14 | # 0.0.16
15 | - Pin ruby-nmap version to 0.8.0 to avoid needing ruby 2.0+
16 | # 0.0.15
17 | - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
18 | # 0.0.14
19 | - New dependency requirements for logstash-core for the 5.0 release
20 | ## 0.0.13
21 | - Actually include 'times' element
22 | ## 0.0.12
23 | - Improve mapping examples
24 | - Fix IDs for nmap_scan_metadata
25 | ## 0.0.11
26 | - Add start/end times for nmap_scan_metadata documents
27 | ## 0.0.10
28 | - Add top level metadata object
29 | - Improve examples
30 |
--------------------------------------------------------------------------------
/examples/elasticsearch/logstash_nmap.conf:
--------------------------------------------------------------------------------
1 | input {
2 | http {
3 | port => 8000
4 | codec => nmap
5 | tags => [nmap]
6 | }
7 | }
8 |
9 | filter {
10 | if "nmap" in [tags] {
11 | # Don't emit documents for 'down' hosts
12 | if [status][state] == "down" {
13 | drop {}
14 | }
15 |
16 | mutate {
17 | # Drop HTTP headers and logstash server hostname
18 | remove_field => ["headers", "hostname"]
19 | }
20 |
21 | if "nmap_traceroute_link" == [type] {
22 | geoip {
23 | source => "[to][address]"
24 | target => "[to][geoip]"
25 | }
26 |
27 | geoip {
28 | source => "[from][address]"
29 | target => "[from][geoip]"
30 | }
31 | }
32 |
33 | if [ipv4] {
34 | geoip {
35 | source => ipv4
36 | target => geoip
37 | }
38 | }
39 |
40 | }
41 | }
42 |
43 | output {
44 | if "nmap" in [tags] {
45 | elasticsearch {
46 | document_type => "%{[type]}"
47 | document_id => "%{[id]}"
48 | # Nmap data usually isn't too bad, so monthly rotation should be fine
49 | index => "nmap-logstash-%{+YYYY.MM}"
50 | template => "./elasticsearch_nmap_template.json"
51 | template_name => "logstash_nmap"
52 | }
53 |
54 | stdout {
55 | codec => json_lines
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/logstash-codec-nmap.gemspec:
--------------------------------------------------------------------------------
1 | Gem::Specification.new do |s|
2 |
3 | s.name = 'logstash-codec-nmap'
4 | s.version = '0.0.22'
5 | s.licenses = ['Apache License (2.0)']
6 | s.summary = "Reads Nmap data in XML format"
7 | s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
8 | s.authors = ["Elastic"]
9 | s.email = 'info@elastic.co'
10 | s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
11 | s.require_paths = ["lib"]
12 |
13 | # Files
14 | s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
15 |
16 | # Tests
17 | s.test_files = s.files.grep(%r{^(test|spec|features)/})
18 |
19 | # Special flag to let us know this is actually a logstash plugin
20 | s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" }
21 |
22 | # Gem dependencies
23 | s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24 | s.add_runtime_dependency 'ruby-nmap', "~> 0.8.0"
25 |
26 | s.add_development_dependency 'logstash-devutils'
27 | s.add_development_dependency 'insist'
28 | end
29 |
--------------------------------------------------------------------------------
/spec/fixtures/pingsweep.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spec/codecs/nmap_spec.rb:
--------------------------------------------------------------------------------
1 | require "logstash/devutils/rspec/spec_helper"
2 | require "logstash/codecs/nmap"
3 | require "logstash/event"
4 | require "insist"
5 |
6 | describe LogStash::Codecs::Nmap do
7 | context "#decode" do
8 | subject do
9 | events = []
10 | LogStash::Codecs::Nmap.new.decode(xml_string) do |event|
11 | events << event
12 | end
13 | events
14 | end
15 |
16 | shared_examples_for "a valid parse" do
17 | it "should decode without error" do
18 | expect(subject).to be_a(Array)
19 | end
20 |
21 | it "should encode at least one thing" do
22 | expect(subject.length > 0).to eql(true)
23 | end
24 |
25 | it "should encode the output as LogStash::Event objects" do
26 | subject.each do |event|
27 | expect(event).to be_a(LogStash::Event)
28 | end
29 | end
30 |
31 | let(:ids) { subject.map {|e| e.get("id") } }
32 | it "should add a unique id field to all events" do
33 | expect(ids).to eql(ids.uniq)
34 | end
35 |
36 | it "should not have any null id fields" do
37 | expect(ids.include?(nil)).to be_falsey
38 | end
39 | end
40 |
41 | describe "parsing traceroutes" do
42 | let(:xml_string) { File.open("spec/fixtures/traceroutes.xml").read }
43 | it_should_behave_like "a valid parse"
44 | end
45 |
46 | # This is broken until https://github.com/sophsec/ruby-nmap/pull/40 is accepted
47 | # describe "parsing ipv6" do
48 | # let(:xml_string) { File.open("spec/fixtures/ipv6_all.xml").read }
49 |
50 | # it_should_behave_like "a valid parse"
51 | # end
52 |
53 | describe "parsing pingsweeps" do
54 | let(:xml_string) { File.open("spec/fixtures/pingsweep.xml").read }
55 | it_should_behave_like "a valid parse"
56 | end
57 |
58 | describe "localscan.xml" do
59 | let(:xml_string) { File.open("spec/fixtures/localscan.xml").read }
60 | it_should_behave_like "a valid parse"
61 | end
62 |
63 | describe "scanme_A.xml" do
64 | let(:xml_string) { File.open("spec/fixtures/scanme_A.xml").read }
65 | it_should_behave_like "a valid parse"
66 | end
67 |
68 | describe "full_scan.xml" do
69 | let(:xml_string) { File.open("spec/fixtures/full_scan.xml").read }
70 | it_should_behave_like "a valid parse"
71 | end
72 |
73 | describe "nothingup.xml" do
74 | let(:xml_string) { File.open("spec/fixtures/nothingup.xml").read }
75 | it_should_behave_like "a valid parse"
76 | end
77 |
78 | describe "ip_down.xml" do
79 | let(:xml_string) { File.open("spec/fixtures/ip_down.xml").read }
80 | it_should_behave_like "a valid parse"
81 | end
82 |
83 | end
84 |
85 | end
86 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Logstash
2 |
3 | All contributions are welcome: ideas, patches, documentation, bug reports,
4 | complaints, etc!
5 |
6 | Programming is not a required skill, and there are many ways to help out!
7 | It is more important to us that you are able to contribute.
8 |
9 | That said, some basic guidelines, which you are free to ignore :)
10 |
11 | ## Want to learn?
12 |
13 | Want to lurk about and see what others are doing with Logstash?
14 |
15 | * The irc channel (#logstash on irc.freenode.org) is a good place for this
16 | * The [forum](https://discuss.elastic.co/c/logstash) is also
17 | great for learning from others.
18 |
19 | ## Got Questions?
20 |
21 | Have a problem you want Logstash to solve for you?
22 |
23 | * You can ask a question in the [forum](https://discuss.elastic.co/c/logstash)
24 | * Alternately, you are welcome to join the IRC channel #logstash on
25 | irc.freenode.org and ask for help there!
26 |
27 | ## Have an Idea or Feature Request?
28 |
29 | * File a ticket on [GitHub](https://github.com/elastic/logstash/issues). Please remember that GitHub is used only for issues and feature requests. If you have a general question, the [forum](https://discuss.elastic.co/c/logstash) or IRC would be the best place to ask.
30 |
31 | ## Something Not Working? Found a Bug?
32 |
33 | If you think you found a bug, it probably is a bug.
34 |
35 | * If it is a general Logstash or a pipeline issue, file it in [Logstash GitHub](https://github.com/elasticsearch/logstash/issues)
36 | * If it is specific to a plugin, please file it in the respective repository under [logstash-plugins](https://github.com/logstash-plugins)
37 | * or ask the [forum](https://discuss.elastic.co/c/logstash).
38 |
39 | # Contributing Documentation and Code Changes
40 |
41 | If you have a bugfix or new feature that you would like to contribute to
42 | logstash, and you think it will take more than a few minutes to produce the fix
43 | (ie; write code), it is worth discussing the change with the Logstash users and developers first! You can reach us via [GitHub](https://github.com/elastic/logstash/issues), the [forum](https://discuss.elastic.co/c/logstash), or via IRC (#logstash on freenode irc)
44 | Please note that Pull Requests without tests will not be merged. If you would like to contribute but do not have experience with writing tests, please ping us on IRC/forum or create a PR and ask our help.
45 |
46 | ## Contributing to plugins
47 |
48 | Check our [documentation](https://www.elastic.co/guide/en/logstash/current/contributing-to-logstash.html) on how to contribute to plugins or write your own! It is super easy!
49 |
50 | ## Contribution Steps
51 |
52 | 1. Test your changes! [Run](https://github.com/elastic/logstash#testing) the test suite
53 | 2. Please make sure you have signed our [Contributor License
54 | Agreement](https://www.elastic.co/contributor-agreement/). We are not
55 | asking you to assign copyright to us, but to give us the right to distribute
56 | your code without restriction. We ask this of all contributors in order to
57 | assure our users of the origin and continuing existence of the code. You
58 | only need to sign the CLA once.
59 | 3. Send a pull request! Push your changes to your fork of the repository and
60 | [submit a pull
61 | request](https://help.github.com/articles/using-pull-requests). In the pull
62 | request, describe what your changes do and mention any bugs/issues related
63 | to the pull request.
64 |
65 |
66 |
--------------------------------------------------------------------------------
/docs/index.asciidoc:
--------------------------------------------------------------------------------
1 | :plugin: nmap
2 | :type: codec
3 |
4 | ///////////////////////////////////////////
5 | START - GENERATED VARIABLES, DO NOT EDIT!
6 | ///////////////////////////////////////////
7 | :version: %VERSION%
8 | :release_date: %RELEASE_DATE%
9 | :changelog_url: %CHANGELOG_URL%
10 | :include_path: ../../../../logstash/docs/include
11 | ///////////////////////////////////////////
12 | END - GENERATED VARIABLES, DO NOT EDIT!
13 | ///////////////////////////////////////////
14 |
15 | [id="plugins-{type}s-{plugin}"]
16 |
17 | === Nmap codec plugin
18 |
19 | include::{include_path}/plugin_header.asciidoc[]
20 |
21 | ==== Description
22 |
23 | This codec is used to parse https://nmap.org/[nmap] output data which is serialized in XML format. Nmap ("Network Mapper") is a free and open source utility for network discovery and security auditing.
24 | For more information on nmap, see https://nmap.org/.
25 |
26 | This codec can only be used for decoding data.
27 |
28 | Event types are listed below
29 |
30 | `nmap_scan_metadata`: An object containing top level information about the scan, including how many hosts were up, and how many were down. Useful for the case where you need to check if a DNS based hostname does not resolve, where both those numbers will be zero.
31 | `nmap_host`: One event is created per host. The full data covering an individual host, including open ports and traceroute information as a nested structure.
32 | `nmap_port`: One event is created per host/port. This duplicates data already in `nmap_host`: This was put in for the case where you want to model ports as separate documents in Elasticsearch (which Kibana prefers).
33 | `nmap_traceroute_link`: One of these is output per traceroute 'connection', with a `from` and a `to` object describing each hop. Note that traceroute hop data is not always correct due to the fact that each tracing ICMP packet may take a different route. Also very useful for Kibana visualizations.
34 |
35 | [id="plugins-{type}s-{plugin}-options"]
36 | ==== Nmap Codec Configuration Options
37 |
38 | [cols="<,<,<",options="header",]
39 | |=======================================================================
40 | |Setting |Input type|Required
41 | | <> |<>|No
42 | | <> |<>|No
43 | | <> |<>|No
44 | | <> |<>|No
45 | |=======================================================================
46 |
47 |
48 |
49 | [id="plugins-{type}s-{plugin}-emit_hosts"]
50 | ===== `emit_hosts`
51 |
52 | * Value type is <>
53 | * Default value is `true`
54 |
55 | Emit all host data as a nested document (including ports + traceroutes) with the type 'nmap_fullscan'
56 |
57 | [id="plugins-{type}s-{plugin}-emit_ports"]
58 | ===== `emit_ports`
59 |
60 | * Value type is <>
61 | * Default value is `true`
62 |
63 | Emit each port as a separate document with type 'nmap_port'
64 |
65 | [id="plugins-{type}s-{plugin}-emit_scan_metadata"]
66 | ===== `emit_scan_metadata`
67 |
68 | * Value type is <>
69 | * Default value is `true`
70 |
71 | Emit scan metadata
72 |
73 | [id="plugins-{type}s-{plugin}-emit_traceroute_links"]
74 | ===== `emit_traceroute_links`
75 |
76 | * Value type is <>
77 | * Default value is `true`
78 |
79 | Emit each hop_tuple of the traceroute with type 'nmap_traceroute_link'
80 |
81 |
82 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Logstash Plugin
2 |
3 | [](https://travis-ci.com/logstash-plugins/logstash-codec-nmap)
4 |
5 | This is a plugin for [Logstash](https://github.com/elastic/logstash).
6 |
7 | It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
8 |
9 | ## Documentation
10 |
11 | Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
12 |
13 | - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
14 | - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
15 |
16 | ## Need Help?
17 |
18 | Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
19 |
20 | ## Developing
21 |
22 | ### 1. Plugin Developement and Testing
23 |
24 | #### Code
25 | - To get started, you'll need JRuby with the Bundler gem installed.
26 |
27 | - Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
28 |
29 | - Install dependencies
30 | ```sh
31 | bundle install
32 | ```
33 |
34 | #### Test
35 |
36 | - Update your dependencies
37 |
38 | ```sh
39 | bundle install
40 | ```
41 |
42 | - Run tests
43 |
44 | ```sh
45 | bundle exec rspec
46 | ```
47 |
48 | ### 2. Running your unpublished Plugin in Logstash
49 |
50 | #### 2.1 Run in a local Logstash clone
51 |
52 | - Edit Logstash `Gemfile` and add the local plugin path, for example:
53 | ```ruby
54 | gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
55 | ```
56 | - Install plugin
57 | ```sh
58 | # Logstash 2.3 and higher
59 | bin/logstash-plugin install --no-verify
60 |
61 | # Prior to Logstash 2.3
62 | bin/plugin install --no-verify
63 |
64 | ```
65 | - Run Logstash with your plugin
66 | ```sh
67 | bin/logstash -e 'filter {awesome {}}'
68 | ```
69 | At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
70 |
71 | #### 2.2 Run in an installed Logstash
72 |
73 | You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
74 |
75 | - Build your plugin gem
76 | ```sh
77 | gem build logstash-filter-awesome.gemspec
78 | ```
79 | - Install the plugin from the Logstash home
80 | ```sh
81 | # Logstash 2.3 and higher
82 | bin/logstash-plugin install --no-verify
83 |
84 | # Prior to Logstash 2.3
85 | bin/plugin install --no-verify
86 |
87 | ```
88 | - Start Logstash and proceed to test the plugin
89 |
90 | ## Contributing
91 |
92 | All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
93 |
94 | Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
95 |
96 | It is more important to the community that you are able to contribute.
97 |
98 | For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
99 |
--------------------------------------------------------------------------------
/spec/fixtures/scanme.nmap.org:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spec/fixtures/traceroutes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/spec/fixtures/scanme_traceroute.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/spec/fixtures/ipv6_all.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
120 |
121 |
122 | cpe:/a:apple:itunes:12.3.2.35
123 |
124 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/spec/fixtures/scanme_A.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | cpe:/a:openbsd:openssh:6.6.1p1cpe:/o:linux:linux_kernel
37 |
38 | cpe:/a:apache:http_server:2.4.7
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | cpe:/o:linux:linux_kernel:3
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/lib/logstash/codecs/nmap.rb:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | require "logstash/codecs/base"
3 | require "nmap/xml"
4 | require 'securerandom'
5 |
6 | # This codec is used to parse https://nmap.org/[namp] output data which is serialized in XML format. Nmap ("Network Mapper") is a free and open source utility for network discovery and security auditing.
7 | # For more information on nmap, see https://nmap.org/.
8 | #
9 | # This codec can only be used for decoding data.
10 | #
11 | # Event types are listed below
12 | #
13 | # `nmap_scan_metadata`: An object containing top level information about the scan, including how many hosts were up, and how many were down. Useful for the case where you need to check if a DNS based hostname does not resolve, where both those numbers will be zero.
14 | # `nmap_host`: One event is created per host. The full data covering an individual host, including open ports and traceroute information as a nested structure.
15 | # `nmap_port`: One event is created per host/port. This duplicates data already in `nmap_host`: This was put in for the case where you want to model ports as separate documents in Elasticsearch (which Kibana prefers).
16 | # `nmap_traceroute_link`: One of these is output per traceroute 'connection', with a `from` and a `to` object describing each hop. Note that traceroute hop data is not always correct due to the fact that each tracing ICMP packet may take a different route. Also very useful for Kibana visualizations.
17 |
18 | class LogStash::Codecs::Nmap < LogStash::Codecs::Base
19 | config_name "nmap"
20 |
21 | # Emit scan metadata
22 | config :emit_scan_metadata, :validate => :boolean, :default => true
23 | # Emit all host data as a nested document (including ports + traceroutes) with the type 'nmap_fullscan'
24 | config :emit_hosts, :validate => :boolean, :default => true
25 | # Emit each port as a separate document with type 'nmap_port'
26 | config :emit_ports, :validate => :boolean, :default => true
27 | # Emit each hop_tuple of the traceroute with type 'nmap_traceroute_link'
28 | config :emit_traceroute_links, :validate => :boolean, :default => true
29 |
30 | public
31 | def register
32 | end
33 |
34 | public
35 | def decode(data)
36 | xml = Nmap::XML.parse(data)
37 | scan_id = SecureRandom.uuid
38 |
39 | base = {}
40 | base['arguments'] = xml.scanner.arguments
41 | base['version'] = xml.scanner.version
42 | base['scan_id'] = scan_id
43 |
44 | # This really needs to be put into ruby-nmap
45 | scan_host_stats = Hash[xml.instance_variable_get(:@doc).xpath('/nmaprun[@scanner="nmap"]/runstats/hosts').first.attributes.map {|k,v| [k,v.value.to_i]}]
46 |
47 | finished_info = Hash[xml.instance_variable_get(:@doc).xpath('/nmaprun[@scanner="nmap"]/runstats/finished').first.attributes.map {|k,v| [k,v.value] }]
48 | finished_info["elapsed"] = finished_info["elapsed"].to_f
49 | finished_info["time"] = timeify(Time.at(finished_info["time"].to_i))
50 |
51 | run_stats = hashify_struct(xml.run_stats.first)
52 | run_stats["finished"] = finished_info
53 |
54 | if @emit_scan_metadata
55 | yield LogStash::Event.new(base.merge({
56 | 'id' => scan_id,
57 | 'type' => 'nmap_scan_metadata',
58 | 'host_stats' => scan_host_stats,
59 | 'start_time' => timeify(xml.scanner.start_time),
60 | 'end_time' => run_stats["finished"]["time"],
61 | 'run_stats' => hashify_run_stats(xml.run_stats.first)
62 | }))
63 | end
64 |
65 | xml.hosts.each_with_index do |host,idx|
66 | # Convert the host to a 'host_base' host event
67 | # This will be used for the later port/hop types
68 | host_base = hashify_host(host, xml).merge(base)
69 |
70 |
71 | # Pull out the detail
72 | ports = host.ports.map {|p| hashify_port(p)}
73 | traceroute = hashify_traceroute(host.traceroute)
74 | scan_host_id = scan_id + "-h#{idx}"
75 |
76 | if @emit_ports && ports
77 | ports.each.with_index do |port,idx|
78 | yield LogStash::Event.new(host_base.merge(
79 | 'type' => 'nmap_port',
80 | 'port' => port,
81 | 'scan_host_id' => scan_host_id,
82 | 'id' => scan_host_id+"-p#{idx}"
83 | ))
84 | end
85 | end
86 |
87 | if @emit_traceroute_links && traceroute && (hops = traceroute['hops'])
88 | hops.each_with_index do |hop,idx|
89 | next_hop = hops[idx+1]
90 | yield LogStash::Event.new(host_base.merge(
91 | 'type' =>'nmap_traceroute_link',
92 | 'from' => hop,
93 | 'to' => next_hop,
94 | 'rtt_diff' => (next_hop ? next_hop['rtt'] - hop['rtt'] : nil),
95 | 'scan_host_id' => scan_host_id,
96 | 'id' => scan_host_id+"-tl#{idx}"
97 | ))
98 | end
99 | end
100 |
101 | if @emit_hosts
102 | yield LogStash::Event.new(host_base.merge(
103 | 'type' => 'nmap_host',
104 | 'ports' => ports,
105 | 'traceroute' => traceroute,
106 | 'id' => scan_host_id
107 | ))
108 | end
109 | end
110 | rescue StandardError => e
111 | raise e
112 | @logger.warn("An unexpected error occurred parsing nmap XML",
113 | :input => data,
114 | :message => e.message,
115 | :class => e.class.name,
116 | :backtrace => e.backtrace)
117 | end
118 |
119 | def hashify_host(host, xml)
120 | scan_start = timeify(xml.scanner.start_time)
121 |
122 | h = {}
123 | h['start_time'] = timeify(host.start_time, scan_start)
124 | h['end_time'] = timeify(host.end_time, scan_start)
125 |
126 | # Needs to be pached in ruby-nmap
127 | times = host.instance_variable_get(:@node).xpath("times").first
128 | h['times'] = Hash[times.first.map {|k,v| [k,v.to_i]}] if times
129 |
130 | # These two are actually different.
131 | # Address may contain a MAC, addresses will not AFAICT
132 | h['addresses'] = hashify_structs(host.addresses)
133 | h['address'] = host.address # str
134 |
135 | h['ip'] = host.ip # str
136 | h['ipv4'] = host.ipv4 # str
137 | h['ipv6'] = host.ipv6 # str
138 | h['mac'] = host.mac # str
139 | h['status'] = hashify_status(host.status)
140 | h['hostname'] = hashify_hostname(host.hostname)
141 | h['uptime'] = hashify_uptime(host.uptime)
142 | h['os'] = hashify_os(host.os)
143 |
144 | h
145 | end
146 |
147 | def hashify_run_stats(run_stats)
148 | h = hashify_struct(run_stats)
149 | h["elapsed"] = h["elapsed"].to_f
150 | h
151 | end
152 |
153 | def hashify_status(status)
154 | return unless status
155 |
156 | {
157 | 'state' => status.state.to_s, # str
158 | 'reason' => status.reason # str
159 | }
160 | end
161 |
162 | def hashify_hostname(hostname)
163 | return unless hostname
164 |
165 | {
166 | 'name' => hostname.name, # str
167 | 'type' => hostname.type, # str
168 | }
169 | end
170 |
171 | def hashify_os(os)
172 | return unless os
173 |
174 | # we need this nil guard here till https://github.com/sophsec/ruby-nmap/pull/41 is accepted
175 | fingerprint = os.fingerprint rescue nil
176 | {
177 | 'ports_used' => os.ports_used,
178 | 'fingerprint' => fingerprint,
179 | 'classes' => hashify_os_classes(os.classes),
180 | 'matches' => hashify_structs(os.matches)
181 | }
182 | end
183 |
184 | def hashify_os_classes(classes)
185 | return if !classes || classes.empty?
186 |
187 | classes.map do |klass|
188 | {
189 | 'type' => klass.type.to_s, # returned as sym originally
190 | 'vendor' => klass.vendor.to_s,
191 | 'family' => klass.family.to_s,
192 | 'gen' => klass.gen.to_s,
193 | 'accuracy' => klass.accuracy # int
194 | }
195 | end
196 | end
197 |
198 | def hashify_uptime(uptime)
199 | return unless uptime
200 |
201 | {
202 | 'seconds' => uptime.seconds,
203 | 'last_boot' => timeify(uptime.last_boot)
204 | }
205 | end
206 |
207 | def hashify_service(service)
208 | return unless service
209 |
210 | protocol = service.protocol rescue nil
211 | {
212 | 'name' => service.name,
213 | 'ssl' => service.ssl?,
214 | 'protocol' => protocol,
215 | 'product' => service.product,
216 | 'version' => service.version,
217 | 'hostname' => service.hostname, # This is just a string
218 | 'device_type' => service.device_type,
219 | 'fingerprint_method' => service.fingerprint_method.to_s,
220 | 'fingerprint' => service.fingerprint,
221 | 'confidence' => service.confidence
222 | }
223 | end
224 |
225 | def hashify_port(port)
226 | return unless port
227 |
228 | {
229 | 'number' => port.number,
230 | 'reason' => port.reason,
231 | 'protocol' => port.protocol.to_s,
232 | 'service' => hashify_service(port.service),
233 | 'state' => port.state.to_s
234 | }
235 | end
236 |
237 | def hashify_traceroute(traceroute)
238 | return unless traceroute
239 |
240 | protocol = traceroute.protocol rescue nil
241 | {
242 | 'port' => traceroute.port, # int
243 | 'protocol' => protocol,
244 | 'hops' => traceroute.map.with_index do |hop, idx|
245 | {
246 | 'address' => hop.addr, # str
247 | 'hostname' => hop.host, # str
248 | 'ttl' => hop.ttl.to_i, # int
249 | 'rtt' => hop.rtt.to_i, # int
250 | 'index' => idx # int (for searching by distance)
251 | }
252 | end
253 | }
254 | end
255 |
256 | def hashify_structs(structs)
257 | structs.map {|s| hashify_struct(s)}
258 | end
259 |
260 | def hashify_struct(struct)
261 | Hash[struct.each_pair.map {|k,v| [de_keyword(k), de_keyword(v)]}]
262 | end
263 |
264 | def de_keyword(value)
265 | value.is_a?(Symbol) ? value.to_s : value
266 | end
267 |
268 | EPOCH = LogStash::Timestamp.new(Time.at(0))
269 | def timeify(time, default=nil)
270 | timestamp = time ? LogStash::Timestamp.new(time) : nil
271 | # Sometimes the nmap parser returns the epoch when there's no time...
272 | if (!timestamp || timestamp <= EPOCH)
273 | default
274 | else
275 | timestamp
276 | end
277 | end
278 |
279 | # Some strings have quoted values, we may want to remove leading/trailing quotes
280 | def dequote(str)
281 | return nil unless str
282 | str.gsub(/\A"|"\Z/, '')
283 | end
284 |
285 | end
286 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright 2020 Elastic and contributors
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/spec/fixtures/full_scan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | cpe:/a:thekelleys:dnsmasq:2.72test3
18 |
19 |
20 |
21 |
22 |
23 |
24 | cpe:/o:linux:kernel:2.6
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | cpe:/o:apple:iphone_os:4
57 | cpe:/o:apple:iphone_os:4
58 | cpe:/o:apple:iphone_os:5
59 | cpe:/o:apple:iphone_os:5
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 | cpe:/o:apple:iphone_os:4
96 | cpe:/o:apple:iphone_os:4
97 | cpe:/o:apple:iphone_os:5
98 | cpe:/o:apple:iphone_os:5
99 |
100 |
101 | cpe:/o:apple:mac_os_x:10.7.0
102 |
103 |
104 | cpe:/o:apple:mac_os_x:10.7
105 | cpe:/o:apple:iphone_os:4
106 | cpe:/o:apple:iphone_os:4
107 |
108 |
109 | cpe:/o:apple:iphone_os:4
110 |
111 |
112 | cpe:/o:apple:iphone_os:5
113 | cpe:/o:apple:iphone_os:5
114 |
115 |
116 | cpe:/o:apple:mac_os_x:10.7
117 |
118 |
119 | cpe:/o:apple:iphone_os:4
120 | cpe:/o:apple:iphone_os:4
121 |
122 |
123 | cpe:/o:apple:iphone_os:4
124 | cpe:/o:apple:iphone_os:4
125 |
126 |
127 | cpe:/o:apple:iphone_os:4
128 |
129 |
130 | cpe:/o:apple:iphone_os:4
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | cpe:/a:openbsd:openssh:6.0p1cpe:/o:linux:kernel
152 | cpe:/o:microsoft:windows
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 | cpe:/o:axis:linux:2.6
163 |
164 |
165 |
166 |
167 |
168 | cpe:/o:crestron:2_series
169 |
170 |
171 | cpe:/o:linux:kernel:2.4.26
172 |
173 |
174 | cpe:/o:linux:kernel:2.6.24
175 |
176 |
177 | cpe:/o:linux:kernel:2.4
178 |
179 |
180 | cpe:/h:linksys:wrv54g
181 |
182 |
183 |
184 |
185 |
186 | cpe:/o:checkpoint:linux:2.4
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 | cpe:/o:apple:mac_os_x
210 |
211 |
212 |
213 |
214 |
215 | cpe:/o:apple:iphone_os:4
216 | cpe:/o:apple:iphone_os:4
217 | cpe:/o:apple:iphone_os:5
218 | cpe:/o:apple:iphone_os:5
219 |
220 |
221 | cpe:/o:apple:mac_os_x:10.7.0
222 |
223 |
224 | cpe:/o:apple:mac_os_x:10.7
225 | cpe:/o:apple:iphone_os:4
226 | cpe:/o:apple:iphone_os:4
227 |
228 |
229 | cpe:/o:apple:iphone_os:4
230 |
231 |
232 | cpe:/o:apple:iphone_os:5
233 | cpe:/o:apple:iphone_os:5
234 |
235 |
236 | cpe:/o:apple:mac_os_x:10.7
237 |
238 |
239 | cpe:/o:apple:iphone_os:4
240 | cpe:/o:apple:iphone_os:4
241 |
242 |
243 | cpe:/o:apple:iphone_os:4
244 |
245 |
246 | cpe:/o:apple:iphone_os:4
247 |
248 |
249 | cpe:/o:apple:iphone_os:4
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
--------------------------------------------------------------------------------
/examples/elasticsearch/elasticsearch_nmap_template.json:
--------------------------------------------------------------------------------
1 | {
2 | "template": "nmap-logstash-*",
3 | "mappings": {
4 | "nmap_scan_metadata" : {
5 | "properties" : {
6 | "@timestamp" : {
7 | "type" : "date",
8 | "format" : "strict_date_optional_time||epoch_millis"
9 | },
10 | "@version" : {
11 | "type" : "string",
12 | "index" : "not_analyzed"
13 | },
14 | "arguments" : {
15 | "type" : "string",
16 | "analyzer" : "whitespace"
17 | },
18 | "host" : {
19 | "type" : "string",
20 | "index" : "not_analyzed"
21 | },
22 | "host_stats" : {
23 | "properties" : {
24 | "down" : {
25 | "type" : "long"
26 | },
27 | "total" : {
28 | "type" : "long"
29 | },
30 | "up" : {
31 | "type" : "long"
32 | }
33 | }
34 | },
35 | "id" : {
36 | "type" : "string",
37 | "index" : "not_analyzed"
38 | },
39 | "run_stats" : {
40 | "properties" : {
41 | "elapsed" : {
42 | "type" : "double"
43 | },
44 | "end_time" : {
45 | "type" : "string",
46 | "index" : "not_analyzed"
47 | },
48 | "exit_status" : {
49 | "type" : "string",
50 | "index" : "not_analyzed"
51 | },
52 | "summary" : {
53 | "type" : "string",
54 | "index" : "not_analyzed"
55 | }
56 | }
57 | },
58 | "scan_id" : {
59 | "type" : "string",
60 | "index" : "not_analyzed"
61 | },
62 | "tags" : {
63 | "type" : "string",
64 | "index" : "not_analyzed"
65 | },
66 | "type" : {
67 | "type" : "string",
68 | "index" : "not_analyzed"
69 | },
70 | "version" : {
71 | "type" : "string",
72 | "index" : "not_analyzed"
73 | }
74 | }
75 | },
76 | "nmap_port": {
77 | "properties": {
78 | "@timestamp": {
79 | "type": "date",
80 | "format": "strict_date_optional_time||epoch_millis"
81 | },
82 | "@version": {
83 | "type": "string",
84 | "index": "not_analyzed"
85 | },
86 | "address": {
87 | "type": "string",
88 | "index": "not_analyzed"
89 | },
90 | "addresses": {
91 | "properties": {
92 | "addr": {
93 | "type": "string",
94 | "index": "not_analyzed"
95 | },
96 | "type": {
97 | "type": "string",
98 | "index": "not_analyzed"
99 | }
100 | }
101 | },
102 | "arguments": {
103 | "type": "string",
104 | "analyzer": "whitespace",
105 | "fields": {
106 | "raw": {
107 | "type": "string",
108 | "index": "not_analyzed"
109 | }
110 | }
111 | },
112 | "end_time": {
113 | "type": "date",
114 | "format": "strict_date_optional_time||epoch_millis"
115 | },
116 | "geoip": {
117 | "properties": {
118 | "area_code": {
119 | "type": "string",
120 | "index": "not_analyzed"
121 | },
122 | "city_name": {
123 | "type": "string"
124 | },
125 | "continent_code": {
126 | "type": "string",
127 | "index": "not_analyzed"
128 | },
129 | "country_code2": {
130 | "type": "string",
131 | "index": "not_analyzed"
132 | },
133 | "country_code3": {
134 | "type": "string",
135 | "index": "not_analyzed"
136 | },
137 | "country_name": {
138 | "type": "string",
139 | "index": "not_analyzed"
140 | },
141 | "dma_code": {
142 | "type": "integer"
143 | },
144 | "ip": {
145 | "type": "ip"
146 | },
147 | "latitude": {
148 | "type": "double"
149 | },
150 | "location": {
151 | "type": "geo_point"
152 | },
153 | "longitude": {
154 | "type": "double"
155 | },
156 | "postal_code": {
157 | "type": "string",
158 | "index": "not_analyzed"
159 | },
160 | "real_region_name": {
161 | "type": "string",
162 | "index": "not_analyzed"
163 | },
164 | "region_name": {
165 | "type": "string",
166 | "index": "not_analyzed"
167 | },
168 | "timezone": {
169 | "type": "string",
170 | "index": "not_analyzed"
171 | }
172 | }
173 | },
174 | "host": {
175 | "type": "string",
176 | "index": "not_analyzed"
177 | },
178 | "id": {
179 | "type": "string",
180 | "index": "not_analyzed"
181 | },
182 | "ip": {
183 | "type": "string",
184 | "index": "not_analyzed"
185 | },
186 | "ipv4": {
187 | "type": "ip"
188 | },
189 | "os": {
190 | "properties": {
191 | "classes": {
192 | "properties": {
193 | "accuracy": {
194 | "type": "integer"
195 | },
196 | "family": {
197 | "type": "string",
198 | "index": "not_analyzed"
199 | },
200 | "gen": {
201 | "type": "string",
202 | "index": "not_analyzed"
203 | },
204 | "type": {
205 | "type": "string",
206 | "index": "not_analyzed"
207 | },
208 | "vendor": {
209 | "type": "string",
210 | "index": "not_analyzed"
211 | }
212 | }
213 | },
214 | "matches": {
215 | "properties": {
216 | "accuracy": {
217 | "type": "long"
218 | },
219 | "name": {
220 | "type": "string",
221 | "index": "not_analyzed"
222 | }
223 | }
224 | },
225 | "ports_used": {
226 | "type": "long"
227 | }
228 | }
229 | },
230 | "port": {
231 | "properties": {
232 | "number": {
233 | "type": "integer"
234 | },
235 | "protocol": {
236 | "type": "string"
237 | },
238 | "reason": {
239 | "type": "string"
240 | },
241 | "service": {
242 | "properties": {
243 | "confidence": {
244 | "type": "integer"
245 | },
246 | "fingerprint_method": {
247 | "type": "string"
248 | },
249 | "name": {
250 | "type": "string"
251 | },
252 | "product": {
253 | "type": "string"
254 | },
255 | "ssl": {
256 | "type": "boolean"
257 | }
258 | }
259 | },
260 | "state": {
261 | "type": "string"
262 | }
263 | }
264 | },
265 | "scan_host_id": {
266 | "type": "string",
267 | "index": "not_analyzed"
268 | },
269 | "scan_id": {
270 | "type": "string",
271 | "index": "not_analyzed"
272 | },
273 | "start_time": {
274 | "type": "date",
275 | "format": "strict_date_optional_time||epoch_millis"
276 | },
277 | "status": {
278 | "properties": {
279 | "reason": {
280 | "type": "string",
281 | "index": "not_analyzed"
282 | },
283 | "state": {
284 | "type": "string",
285 | "index": "not_analyzed"
286 | }
287 | }
288 | },
289 | "tags": {
290 | "type": "string",
291 | "index": "not_analyzed"
292 | },
293 | "type": {
294 | "type": "string",
295 | "index": "not_analyzed"
296 | },
297 | "uptime": {
298 | "properties": {
299 | "last_boot": {
300 | "type": "date",
301 | "format": "strict_date_optional_time||epoch_millis"
302 | },
303 | "seconds": {
304 | "type": "long"
305 | }
306 | }
307 | },
308 | "version": {
309 | "type": "string",
310 | "index": "not_analyzed"
311 | }
312 | }
313 | },
314 | "nmap_traceroute_link": {
315 | "properties": {
316 | "@timestamp": {
317 | "type": "date",
318 | "format": "strict_date_optional_time||epoch_millis"
319 | },
320 | "@version": {
321 | "type": "string",
322 | "index": "not_analyzed"
323 | },
324 | "address": {
325 | "type": "string",
326 | "index": "not_analyzed"
327 | },
328 | "addresses": {
329 | "properties": {
330 | "addr": {
331 | "type": "string",
332 | "index": "not_analyzed"
333 | },
334 | "type": {
335 | "type": "string",
336 | "index": "not_analyzed"
337 | }
338 | }
339 | },
340 | "arguments": {
341 | "type": "string",
342 | "analyzer": "whitespace",
343 | "fields": {
344 | "raw": {
345 | "type": "string",
346 | "index": "not_analyzed"
347 | }
348 | }
349 | },
350 | "end_time": {
351 | "type": "date",
352 | "format": "strict_date_optional_time||epoch_millis"
353 | },
354 | "from": {
355 | "properties": {
356 | "address": {
357 | "type": "string",
358 | "index": "not_analyzed",
359 | "fields": {
360 | "address_ipv4": {
361 | "type": "ip"
362 | }
363 | }
364 | },
365 | "geoip": {
366 | "properties": {
367 | "area_code": {
368 | "type": "string",
369 | "index": "not_analyzed"
370 | },
371 | "city_name": {
372 | "type": "string"
373 | },
374 | "continent_code": {
375 | "type": "string",
376 | "index": "not_analyzed"
377 | },
378 | "country_code2": {
379 | "type": "string",
380 | "index": "not_analyzed"
381 | },
382 | "country_code3": {
383 | "type": "string",
384 | "index": "not_analyzed"
385 | },
386 | "country_name": {
387 | "type": "string",
388 | "index": "not_analyzed"
389 | },
390 | "dma_code": {
391 | "type": "integer"
392 | },
393 | "ip": {
394 | "type": "ip"
395 | },
396 | "latitude": {
397 | "type": "double"
398 | },
399 | "location": {
400 | "type": "geo_point"
401 | },
402 | "longitude": {
403 | "type": "double"
404 | },
405 | "postal_code": {
406 | "type": "string",
407 | "index": "not_analyzed"
408 | },
409 | "real_region_name": {
410 | "type": "string",
411 | "index": "not_analyzed"
412 | },
413 | "region_name": {
414 | "type": "string",
415 | "index": "not_analyzed"
416 | },
417 | "timezone": {
418 | "type": "string",
419 | "index": "not_analyzed"
420 | }
421 | }
422 | },
423 | "hostname": {
424 | "type": "string",
425 | "index": "not_analyzed"
426 | },
427 | "index": {
428 | "type": "integer"
429 | },
430 | "rtt": {
431 | "type": "long"
432 | },
433 | "ttl": {
434 | "type": "integer"
435 | }
436 | }
437 | },
438 | "geoip": {
439 | "properties": {
440 | "area_code": {
441 | "type": "string",
442 | "index": "not_analyzed"
443 | },
444 | "city_name": {
445 | "type": "string"
446 | },
447 | "continent_code": {
448 | "type": "string",
449 | "index": "not_analyzed"
450 | },
451 | "country_code2": {
452 | "type": "string",
453 | "index": "not_analyzed"
454 | },
455 | "country_code3": {
456 | "type": "string",
457 | "index": "not_analyzed"
458 | },
459 | "country_name": {
460 | "type": "string",
461 | "index": "not_analyzed"
462 | },
463 | "dma_code": {
464 | "type": "integer"
465 | },
466 | "ip": {
467 | "type": "ip"
468 | },
469 | "latitude": {
470 | "type": "double"
471 | },
472 | "location": {
473 | "type": "geo_point"
474 | },
475 | "longitude": {
476 | "type": "double"
477 | },
478 | "postal_code": {
479 | "type": "string",
480 | "index": "not_analyzed"
481 | },
482 | "real_region_name": {
483 | "type": "string",
484 | "index": "not_analyzed"
485 | },
486 | "region_name": {
487 | "type": "string",
488 | "index": "not_analyzed"
489 | },
490 | "timezone": {
491 | "type": "string",
492 | "index": "not_analyzed"
493 | }
494 | }
495 | },
496 | "host": {
497 | "type": "string",
498 | "index": "not_analyzed"
499 | },
500 | "id": {
501 | "type": "string",
502 | "index": "not_analyzed"
503 | },
504 | "ip": {
505 | "type": "string",
506 | "index": "not_analyzed"
507 | },
508 | "ipv4": {
509 | "type": "ip"
510 | },
511 | "os": {
512 | "properties": {
513 | "classes": {
514 | "properties": {
515 | "accuracy": {
516 | "type": "integer"
517 | },
518 | "family": {
519 | "type": "string",
520 | "index": "not_analyzed"
521 | },
522 | "gen": {
523 | "type": "string",
524 | "index": "not_analyzed"
525 | },
526 | "type": {
527 | "type": "string",
528 | "index": "not_analyzed"
529 | },
530 | "vendor": {
531 | "type": "string",
532 | "index": "not_analyzed"
533 | }
534 | }
535 | },
536 | "matches": {
537 | "properties": {
538 | "accuracy": {
539 | "type": "long"
540 | },
541 | "name": {
542 | "type": "string",
543 | "index": "not_analyzed"
544 | }
545 | }
546 | },
547 | "ports_used": {
548 | "type": "long"
549 | }
550 | }
551 | },
552 | "rtt_diff": {
553 | "type": "integer"
554 | },
555 | "scan_host_id": {
556 | "type": "string",
557 | "index": "not_analyzed"
558 | },
559 | "scan_id": {
560 | "type": "string",
561 | "index": "not_analyzed"
562 | },
563 | "start_time": {
564 | "type": "date",
565 | "format": "strict_date_optional_time||epoch_millis"
566 | },
567 | "status": {
568 | "properties": {
569 | "reason": {
570 | "type": "string",
571 | "index": "not_analyzed"
572 | },
573 | "state": {
574 | "type": "string",
575 | "index": "not_analyzed"
576 | }
577 | }
578 | },
579 | "tags": {
580 | "type": "string",
581 | "index": "not_analyzed"
582 | },
583 | "to": {
584 | "properties": {
585 | "address": {
586 | "type": "string",
587 | "index": "not_analyzed",
588 | "fields": {
589 | "address_ipv4": {
590 | "type": "ip"
591 | }
592 | }
593 | },
594 | "geoip": {
595 | "properties": {
596 | "area_code": {
597 | "type": "string",
598 | "index": "not_analyzed"
599 | },
600 | "city_name": {
601 | "type": "string"
602 | },
603 | "continent_code": {
604 | "type": "string",
605 | "index": "not_analyzed"
606 | },
607 | "country_code2": {
608 | "type": "string",
609 | "index": "not_analyzed"
610 | },
611 | "country_code3": {
612 | "type": "string",
613 | "index": "not_analyzed"
614 | },
615 | "country_name": {
616 | "type": "string",
617 | "index": "not_analyzed"
618 | },
619 | "dma_code": {
620 | "type": "integer"
621 | },
622 | "ip": {
623 | "type": "ip"
624 | },
625 | "latitude": {
626 | "type": "double"
627 | },
628 | "location": {
629 | "type": "geo_point"
630 | },
631 | "longitude": {
632 | "type": "double"
633 | },
634 | "postal_code": {
635 | "type": "string"
636 | },
637 | "real_region_name": {
638 | "type": "string"
639 | },
640 | "region_name": {
641 | "type": "string"
642 | },
643 | "timezone": {
644 | "type": "string",
645 | "index": "not_analyzed"
646 | }
647 | }
648 | },
649 | "hostname": {
650 | "type": "string",
651 | "index": "not_analyzed"
652 | },
653 | "index": {
654 | "type": "integer"
655 | },
656 | "rtt": {
657 | "type": "long"
658 | },
659 | "ttl": {
660 | "type": "integer"
661 | }
662 | }
663 | },
664 | "type": {
665 | "type": "string",
666 | "index": "not_analyzed"
667 | },
668 | "uptime": {
669 | "properties": {
670 | "last_boot": {
671 | "type": "date",
672 | "format": "strict_date_optional_time||epoch_millis"
673 | },
674 | "seconds": {
675 | "type": "long"
676 | }
677 | }
678 | },
679 | "version": {
680 | "type": "string",
681 | "index": "not_analyzed"
682 | }
683 | }
684 | },
685 | "nmap_host": {
686 | "properties": {
687 | "@timestamp": {
688 | "type": "date",
689 | "format": "strict_date_optional_time||epoch_millis"
690 | },
691 | "@version": {
692 | "type": "string",
693 | "index": "not_analyzed"
694 | },
695 | "address": {
696 | "type": "string",
697 | "index": "not_analyzed"
698 | },
699 | "addresses": {
700 | "properties": {
701 | "addr": {
702 | "type": "string",
703 | "index": "not_analyzed"
704 | },
705 | "type": {
706 | "type": "string",
707 | "index": "not_analyzed"
708 | }
709 | }
710 | },
711 | "arguments": {
712 | "type": "string",
713 | "analyzer": "whitespace",
714 | "fields": {
715 | "raw": {
716 | "type": "string",
717 | "index": "not_analyzed"
718 | }
719 | }
720 | },
721 | "end_time": {
722 | "type": "date",
723 | "format": "strict_date_optional_time||epoch_millis"
724 | },
725 | "geoip": {
726 | "properties": {
727 | "area_code": {
728 | "type": "string",
729 | "index": "not_analyzed"
730 | },
731 | "city_name": {
732 | "type": "string"
733 | },
734 | "continent_code": {
735 | "type": "string",
736 | "index": "not_analyzed"
737 | },
738 | "country_code2": {
739 | "type": "string",
740 | "index": "not_analyzed"
741 | },
742 | "country_code3": {
743 | "type": "string",
744 | "index": "not_analyzed"
745 | },
746 | "country_name": {
747 | "type": "string",
748 | "index": "not_analyzed"
749 | },
750 | "dma_code": {
751 | "type": "integer"
752 | },
753 | "ip": {
754 | "type": "ip"
755 | },
756 | "latitude": {
757 | "type": "double"
758 | },
759 | "location": {
760 | "type": "geo_point"
761 | },
762 | "longitude": {
763 | "type": "double"
764 | },
765 | "postal_code": {
766 | "type": "string",
767 | "index": "not_analyzed"
768 | },
769 | "real_region_name": {
770 | "type": "string",
771 | "index": "not_analyzed"
772 | },
773 | "region_name": {
774 | "type": "string",
775 | "index": "not_analyzed"
776 | },
777 | "timezone": {
778 | "type": "string",
779 | "index": "not_analyzed"
780 | }
781 | }
782 | },
783 | "host": {
784 | "type": "string",
785 | "index": "not_analyzed"
786 | },
787 | "hostname": {
788 | "properties": {
789 | "name": {
790 | "type": "string",
791 | "index": "not_analyzed"
792 | },
793 | "type": {
794 | "type": "string",
795 | "index": "not_analyzed"
796 | }
797 | }
798 | },
799 | "id": {
800 | "type": "string",
801 | "index": "not_analyzed"
802 | },
803 | "ip": {
804 | "type": "string",
805 | "index": "not_analyzed"
806 | },
807 | "ipv4": {
808 | "type": "ip"
809 | },
810 | "mac": {
811 | "type": "string",
812 | "index": "not_analyzed"
813 | },
814 | "os": {
815 | "properties": {
816 | "classes": {
817 | "properties": {
818 | "accuracy": {
819 | "type": "integer"
820 | },
821 | "family": {
822 | "type": "string",
823 | "index": "not_analyzed"
824 | },
825 | "gen": {
826 | "type": "string",
827 | "index": "not_analyzed"
828 | },
829 | "type": {
830 | "type": "string",
831 | "index": "not_analyzed"
832 | },
833 | "vendor": {
834 | "type": "string",
835 | "index": "not_analyzed"
836 | }
837 | }
838 | },
839 | "matches": {
840 | "properties": {
841 | "accuracy": {
842 | "type": "long"
843 | },
844 | "name": {
845 | "type": "string",
846 | "index": "not_analyzed"
847 | }
848 | }
849 | },
850 | "ports_used": {
851 | "type": "long"
852 | }
853 | }
854 | },
855 | "ports": {
856 | "properties": {
857 | "number": {
858 | "type": "integer"
859 | },
860 | "protocol": {
861 | "type": "string",
862 | "index": "not_analyzed"
863 | },
864 | "reason": {
865 | "type": "string",
866 | "index": "not_analyzed"
867 | },
868 | "service": {
869 | "properties": {
870 | "confidence": {
871 | "type": "long"
872 | },
873 | "fingerprint_method": {
874 | "type": "string",
875 | "index": "not_analyzed"
876 | },
877 | "name": {
878 | "type": "string",
879 | "index": "not_analyzed"
880 | },
881 | "product": {
882 | "type": "string",
883 | "index": "not_analyzed"
884 | },
885 | "ssl": {
886 | "type": "boolean"
887 | }
888 | }
889 | },
890 | "state": {
891 | "type": "string",
892 | "index": "not_analyzed"
893 | }
894 | }
895 | },
896 | "scan_id": {
897 | "type": "string",
898 | "index": "not_analyzed"
899 | },
900 | "start_time": {
901 | "type": "date",
902 | "format": "strict_date_optional_time||epoch_millis"
903 | },
904 | "status": {
905 | "properties": {
906 | "reason": {
907 | "type": "string",
908 | "index": "not_analyzed"
909 | },
910 | "state": {
911 | "type": "string",
912 | "index": "not_analyzed"
913 | }
914 | }
915 | },
916 | "tags": {
917 | "type": "string",
918 | "index": "not_analyzed"
919 | },
920 | "traceroute": {
921 | "properties": {
922 | "hops": {
923 | "properties": {
924 | "address": {
925 | "type": "string",
926 | "index": "not_analyzed"
927 | },
928 | "geoip": {
929 | "properties": {
930 | "area_code": {
931 | "type": "string",
932 | "index": "not_analyzed"
933 | },
934 | "city_name": {
935 | "type": "string"
936 | },
937 | "continent_code": {
938 | "type": "string",
939 | "index": "not_analyzed"
940 | },
941 | "country_code2": {
942 | "type": "string",
943 | "index": "not_analyzed"
944 | },
945 | "country_code3": {
946 | "type": "string",
947 | "index": "not_analyzed"
948 | },
949 | "country_name": {
950 | "type": "string",
951 | "index": "not_analyzed"
952 | },
953 | "dma_code": {
954 | "type": "integer"
955 | },
956 | "ip": {
957 | "type": "ip"
958 | },
959 | "latitude": {
960 | "type": "double"
961 | },
962 | "location": {
963 | "type": "geo_point"
964 | },
965 | "longitude": {
966 | "type": "double"
967 | },
968 | "postal_code": {
969 | "type": "string",
970 | "index": "not_analyzed"
971 | },
972 | "real_region_name": {
973 | "type": "string",
974 | "index": "not_analyzed"
975 | },
976 | "region_name": {
977 | "type": "string",
978 | "index": "not_analyzed"
979 | },
980 | "timezone": {
981 | "type": "string",
982 | "index": "not_analyzed"
983 | }
984 | }
985 | },
986 | "hostname": {
987 | "type": "string",
988 | "index": "not_analyzed"
989 | },
990 | "index": {
991 | "type": "integer"
992 | },
993 | "rtt": {
994 | "type": "long"
995 | },
996 | "ttl": {
997 | "type": "integer"
998 | }
999 | }
1000 | },
1001 | "port": {
1002 | "type": "integer"
1003 | },
1004 | "protocol": {
1005 | "type": "string",
1006 | "index": "not_analyzed"
1007 | }
1008 | }
1009 | },
1010 | "type": {
1011 | "type": "string",
1012 | "index": "not_analyzed"
1013 | },
1014 | "uptime": {
1015 | "properties": {
1016 | "last_boot": {
1017 | "type": "date",
1018 | "format": "strict_date_optional_time||epoch_millis"
1019 | },
1020 | "seconds": {
1021 | "type": "long"
1022 | },
1023 | "uptime": {
1024 | "type": "integer"
1025 | }
1026 | }
1027 | },
1028 | "version": {
1029 | "type": "string",
1030 | "index": "not_analyzed"
1031 | }
1032 | }
1033 | }
1034 | }
1035 | }
1036 |
--------------------------------------------------------------------------------
/spec/fixtures/localscan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
--------------------------------------------------------------------------------