dradis-nmap 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/issue_template.md +16 -0
- data/.github/pull_request_template.md +36 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +51 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +23 -0
- data/LICENSE +339 -0
- data/README.md +27 -0
- data/Rakefile +1 -0
- data/dradis-nmap.gemspec +34 -0
- data/lib/dradis-nmap.rb +8 -0
- data/lib/dradis/plugins/nmap.rb +11 -0
- data/lib/dradis/plugins/nmap/engine.rb +13 -0
- data/lib/dradis/plugins/nmap/field_processor.rb +78 -0
- data/lib/dradis/plugins/nmap/gem_version.rb +19 -0
- data/lib/dradis/plugins/nmap/importer.rb +80 -0
- data/lib/dradis/plugins/nmap/version.rb +13 -0
- data/lib/tasks/thorfile.rb +23 -0
- data/spec/fixtures/files/invalid.xml +1 -0
- data/spec/fixtures/files/nse-01.xml +127 -0
- data/spec/fixtures/files/sample.xml +72 -0
- data/spec/nmap_upload_spec.rb +71 -0
- data/spec/spec_helper.rb +9 -0
- data/templates/host.fields +4 -0
- data/templates/host.sample +37 -0
- data/templates/host.template +19 -0
- data/templates/port.fields +9 -0
- data/templates/port.sample +15 -0
- data/templates/port.template +14 -0
- metadata +163 -0
@@ -0,0 +1,72 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<?xml-stylesheet href="file:///usr/local/bin/../share/nmap/nmap.xsl" type="text/xsl"?>
|
3
|
+
<!-- Nmap 5.59BETA3 scan initiated Fri Sep 9 18:33:41 2011 as:
|
4
|
+
nmap -T4 -A -p 1-1000 -oX - scanme.nmap.org -->
|
5
|
+
<nmaprun scanner="nmap" args="nmap -T4 -A -p 1-1000 -oX - scanme.nmap.org" start="1315618421"
|
6
|
+
startstr="Fri Sep 9 18:33:41 2011" version="5.59BETA3" xmloutputversion="1.03">
|
7
|
+
<scaninfo type="syn" protocol="tcp" numservices="1000" services="1-1000"/>
|
8
|
+
<verbose level="0"/>
|
9
|
+
<debugging level="0"/>
|
10
|
+
<host starttime="1315618421" endtime="1315618434">
|
11
|
+
<status state="up" reason="echo-reply"/>
|
12
|
+
<address addr="74.207.244.221" addrtype="ipv4"/>
|
13
|
+
<hostnames>
|
14
|
+
<hostname name="scanme.nmap.org" type="user"/>
|
15
|
+
<hostname name="li86-221.members.linode.com" type="PTR"/>
|
16
|
+
</hostnames>
|
17
|
+
<ports>
|
18
|
+
<extraports state="closed" count="997">
|
19
|
+
<extrareasons reason="resets" count="997"/>
|
20
|
+
</extraports>
|
21
|
+
<port protocol="tcp" portid="22">
|
22
|
+
<state state="open" reason="syn-ack" reason_ttl="53"/>
|
23
|
+
<service name="ssh" product="OpenSSH" version="5.3p1 Debian 3ubuntu7"
|
24
|
+
extrainfo="protocol 2.0" ostype="Linux" method="probed" conf="10">
|
25
|
+
<cpe>cpe:/a:openbsd:openssh:5.3p1</cpe>
|
26
|
+
<cpe>cpe:/o:linux:kernel</cpe>
|
27
|
+
</service>
|
28
|
+
<script id="ssh-hostkey"
|
29
|
+
output="1024 8d:60:f1:7c:ca:b7:3d:0a:d6:67:54:9d:69:d9:b9:dd (DSA)

|
30
|
+
2048 79:f8:09:ac:d4:e2:32:42:10:49:d3:bd:20:82:85:ec (RSA)"/>
|
31
|
+
</port>
|
32
|
+
<port protocol="tcp" portid="80">
|
33
|
+
<state state="open" reason="syn-ack" reason_ttl="53"/>
|
34
|
+
<service name="http" product="Apache httpd" version="2.2.14"
|
35
|
+
extrainfo="(Ubuntu)" method="probed" conf="10">
|
36
|
+
<cpe>cpe:/a:apache:http_server:2.2.14</cpe>
|
37
|
+
</service>
|
38
|
+
<script id="http-title" output="Go ahead and ScanMe!"/>
|
39
|
+
</port>
|
40
|
+
</ports>
|
41
|
+
<os>
|
42
|
+
<portused state="open" proto="tcp" portid="22"/>
|
43
|
+
<portused state="closed" proto="tcp" portid="1"/>
|
44
|
+
<portused state="closed" proto="udp" portid="31289"/>
|
45
|
+
<osclass type="general purpose" vendor="Linux" osfamily="Linux"
|
46
|
+
osgen="2.6.X" accuracy="100">
|
47
|
+
<cpe>cpe:/o:linux:linux_kernel:2.6.39</cpe>
|
48
|
+
</osclass>
|
49
|
+
<osmatch name="Linux 2.6.39" accuracy="100" line="39278"/>
|
50
|
+
</os>
|
51
|
+
<uptime seconds="23450" lastboot="Fri Sep 9 12:03:04 2011"/>
|
52
|
+
<distance value="11"/>
|
53
|
+
<tcpsequence index="199" difficulty="Good luck!"
|
54
|
+
values="49018209,48C3EBED,495A2E7F,493EF30C,48ED43B3,495A9B0C"/>
|
55
|
+
<ipidsequence class="All zeros" values="0,0,0,0,0,0"/>
|
56
|
+
<tcptssequence class="1000HZ"
|
57
|
+
values="165CC09,165CC6E,165CCD2,165CD36,165CD9A,165CE48"/>
|
58
|
+
<trace port="256" proto="tcp">
|
59
|
+
<!-- Several hop elements removed for brevity -->
|
60
|
+
<hop ttl="9" ipaddr="72.52.92.109" rtt="15.69" host="10gigabitethernet1-1.core1.fmt1.he.net"/>
|
61
|
+
<hop ttl="10" ipaddr="64.62.250.6" rtt="12.06" host="linode-llc.10gigabitethernet2-3.core1.fmt1.he.net"/>
|
62
|
+
<hop ttl="11" ipaddr="74.207.244.221" rtt="16.55" host="li86-221.members.linode.com"/>
|
63
|
+
</trace>
|
64
|
+
<times srtt="26517" rttvar="19989" to="106473"/>
|
65
|
+
</host>
|
66
|
+
<runstats>
|
67
|
+
<finished time="1315618434" timestr="Fri Sep 9 18:33:54 2011" elapsed="13.66"
|
68
|
+
summary="Nmap done at Fri Sep 9 18:33:54 2011; 1 IP address (1 host up)
|
69
|
+
scanned in 13.66 seconds" exit="success"/>
|
70
|
+
<hosts up="1" down="0" total="1"/>
|
71
|
+
</runstats>
|
72
|
+
</nmaprun>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Nmap upload plugin' do
|
4
|
+
describe "Importer" do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
# Stub template service
|
8
|
+
templates_dir = File.expand_path('../../templates', __FILE__)
|
9
|
+
expect_any_instance_of(Dradis::Plugins::TemplateService)
|
10
|
+
.to receive(:default_templates_dir).and_return(templates_dir)
|
11
|
+
|
12
|
+
# Init services
|
13
|
+
plugin = Dradis::Plugins::Nmap
|
14
|
+
|
15
|
+
@content_service = Dradis::Plugins::ContentService::Base.new(plugin: plugin)
|
16
|
+
|
17
|
+
@importer = plugin::Importer.new(
|
18
|
+
content_service: @content_service
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "creates an error note when the xml is not valid" do
|
23
|
+
expect(@content_service).to receive(:create_note) do |args|
|
24
|
+
expect(args[:text]).to include("#[Title]#\nInvalid file format")
|
25
|
+
OpenStruct.new(args)
|
26
|
+
end.once
|
27
|
+
|
28
|
+
# Run the import
|
29
|
+
@importer.import(file: 'spec/fixtures/files/invalid.xml')
|
30
|
+
end
|
31
|
+
|
32
|
+
it "creates nodes, issues, notes and an evidences as needed" do
|
33
|
+
expect(@content_service).to receive(:create_node) do |args|
|
34
|
+
puts "create_node: #{ args.inspect }"
|
35
|
+
expect(args[:label]).to eq('74.207.244.221')
|
36
|
+
expect(args[:type]).to eq(:host)
|
37
|
+
obj = OpenStruct.new(args)
|
38
|
+
obj.define_singleton_method(:set_property) { |*| }
|
39
|
+
obj.define_singleton_method(:set_service) { |*| }
|
40
|
+
obj
|
41
|
+
end.once
|
42
|
+
expect(@content_service).to receive(:create_note) do |args|
|
43
|
+
puts "create_note: #{ args.inspect }"
|
44
|
+
expect(args[:text]).to include("#[Title]#\nNmap info: 74.207.244.221")
|
45
|
+
expect(args[:text]).to_not include("not recognized by the plugin")
|
46
|
+
expect(args[:node].label).to eq("74.207.244.221")
|
47
|
+
OpenStruct.new(args)
|
48
|
+
end.once
|
49
|
+
expect(@content_service).to receive(:create_note) do |args|
|
50
|
+
puts "create_note: #{ args.inspect }"
|
51
|
+
expect(args[:text]).to include("#[Title]#\n22/tcp is open (syn-ack)")
|
52
|
+
expect(args[:text]).to_not include("not recognized by the plugin")
|
53
|
+
expect(args[:text]).to include("#[Host]#\n74.207.244.221")
|
54
|
+
expect(args[:node].label).to eq("74.207.244.221")
|
55
|
+
OpenStruct.new(args)
|
56
|
+
end.once
|
57
|
+
expect(@content_service).to receive(:create_note) do |args|
|
58
|
+
puts "create_note: #{ args.inspect }"
|
59
|
+
expect(args[:text]).to include("#[Title]#\n80/tcp is open (syn-ack)")
|
60
|
+
expect(args[:text]).to_not include("not recognized by the plugin")
|
61
|
+
expect(args[:text]).to include("#[Host]#\n74.207.244.221")
|
62
|
+
expect(args[:node].label).to eq("74.207.244.221")
|
63
|
+
OpenStruct.new(args)
|
64
|
+
end.once
|
65
|
+
|
66
|
+
# Run the import
|
67
|
+
@importer.import(file: 'spec/fixtures/files/sample.xml')
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
<host starttime="1378483073" endtime="1378483078">
|
2
|
+
<status state="up" reason="localhost-response" reason_ttl="0"/>
|
3
|
+
<address addr="127.0.0.1" addrtype="ipv4"/>
|
4
|
+
<hostnames>
|
5
|
+
<hostname name="localhost" type="user"/>
|
6
|
+
<hostname name="localhost" type="PTR"/>
|
7
|
+
</hostnames>
|
8
|
+
<ports>
|
9
|
+
<extraports state="closed" count="65529">
|
10
|
+
<extrareasons reason="resets" count="65529"/>
|
11
|
+
</extraports>
|
12
|
+
<port protocol="tcp" portid="25">
|
13
|
+
<state state="open" reason="syn-ack" reason_ttl="64"/>
|
14
|
+
<service name="smtp" method="table" conf="3"/>
|
15
|
+
</port>
|
16
|
+
<port protocol="tcp" portid="80">
|
17
|
+
<state state="open" reason="syn-ack" reason_ttl="64"/>
|
18
|
+
<service name="http" method="table" conf="3"/>
|
19
|
+
</port>
|
20
|
+
<port protocol="tcp" portid="443">
|
21
|
+
<state state="open" reason="syn-ack" reason_ttl="64"/>
|
22
|
+
<service name="https" method="table" conf="3"/>
|
23
|
+
</port>
|
24
|
+
<port protocol="tcp" portid="3000">
|
25
|
+
<state state="open" reason="syn-ack" reason_ttl="64"/>
|
26
|
+
<service name="ppp" method="table" conf="3"/>
|
27
|
+
</port>
|
28
|
+
<port protocol="tcp" portid="3306">
|
29
|
+
<state state="open" reason="syn-ack" reason_ttl="64"/>
|
30
|
+
<service name="mysql" method="table" conf="3"/>
|
31
|
+
</port>
|
32
|
+
<port protocol="tcp" portid="22007">
|
33
|
+
<state state="open" reason="syn-ack" reason_ttl="64"/>
|
34
|
+
</port>
|
35
|
+
</ports>
|
36
|
+
<times srtt="35" rttvar="5" to="100000"/>
|
37
|
+
</host>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#[Title]#
|
2
|
+
Nmap info: %host.ip%
|
3
|
+
|
4
|
+
#[IP]#
|
5
|
+
%host.ip%
|
6
|
+
|
7
|
+
#[Hostnames]#
|
8
|
+
%host.hostnames%
|
9
|
+
|
10
|
+
#[OS]#
|
11
|
+
%host.os%
|
12
|
+
|
13
|
+
#[Services]#
|
14
|
+
|_. Port number |_. Protocol |_. State |_. Service |_. Product |_. Version |
|
15
|
+
%host.service_table%
|
16
|
+
|
17
|
+
|
18
|
+
#[Type]#
|
19
|
+
Properties
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dradis-nmap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.18.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Martin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dradis-plugins
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby-nmap
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.7'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: combustion
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.5.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.5.2
|
97
|
+
description: This add-on allows you to upload and parse output produced from Nmap
|
98
|
+
web server scanner into Dradis.
|
99
|
+
email:
|
100
|
+
- etd@nomejortu.com
|
101
|
+
executables: []
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".github/issue_template.md"
|
106
|
+
- ".github/pull_request_template.md"
|
107
|
+
- ".gitignore"
|
108
|
+
- ".rspec"
|
109
|
+
- CHANGELOG.md
|
110
|
+
- CONTRIBUTING.md
|
111
|
+
- Gemfile
|
112
|
+
- LICENSE
|
113
|
+
- README.md
|
114
|
+
- Rakefile
|
115
|
+
- dradis-nmap.gemspec
|
116
|
+
- lib/dradis-nmap.rb
|
117
|
+
- lib/dradis/plugins/nmap.rb
|
118
|
+
- lib/dradis/plugins/nmap/engine.rb
|
119
|
+
- lib/dradis/plugins/nmap/field_processor.rb
|
120
|
+
- lib/dradis/plugins/nmap/gem_version.rb
|
121
|
+
- lib/dradis/plugins/nmap/importer.rb
|
122
|
+
- lib/dradis/plugins/nmap/version.rb
|
123
|
+
- lib/tasks/thorfile.rb
|
124
|
+
- spec/fixtures/files/invalid.xml
|
125
|
+
- spec/fixtures/files/nse-01.xml
|
126
|
+
- spec/fixtures/files/sample.xml
|
127
|
+
- spec/nmap_upload_spec.rb
|
128
|
+
- spec/spec_helper.rb
|
129
|
+
- templates/host.fields
|
130
|
+
- templates/host.sample
|
131
|
+
- templates/host.template
|
132
|
+
- templates/port.fields
|
133
|
+
- templates/port.sample
|
134
|
+
- templates/port.template
|
135
|
+
homepage: http://dradisframework.org
|
136
|
+
licenses:
|
137
|
+
- GPL-2
|
138
|
+
metadata: {}
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
require_paths:
|
142
|
+
- lib
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
requirements: []
|
154
|
+
rubygems_version: 3.1.2
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
157
|
+
summary: Nmap add-on for the Dradis Framework.
|
158
|
+
test_files:
|
159
|
+
- spec/fixtures/files/invalid.xml
|
160
|
+
- spec/fixtures/files/nse-01.xml
|
161
|
+
- spec/fixtures/files/sample.xml
|
162
|
+
- spec/nmap_upload_spec.rb
|
163
|
+
- spec/spec_helper.rb
|