nmap2json 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: be986a8ed84e44aad63227a047a04bef41c0d8b2
4
+ data.tar.gz: cf6effc9a0a3994fc431a80da9ba58a6a64371f1
5
+ SHA512:
6
+ metadata.gz: 2a289de0823f49a2f7fb5019529bdf0fcef53151cff4453e69fecffb3e04fb3d488f72c0014d751c11d24effd8af7183b24b3fd120cb6a58892577e20d972a50
7
+ data.tar.gz: 7c37d1580d70433d0ed679e1fb4d643b07f6ffa482604a646cc86ba1e2bccf3a71c2b265430cad808bf2070ce3c9f451a8b1d4fb223bc47038f81f144faca30d
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "nmap2json"
4
+ require 'command_lion'
5
+
6
+ CommandLion::App.run do
7
+
8
+ name "nmap2json"
9
+ description "convert your nmap XML output to beatiful JSON"
10
+ version Nmap2json::VERSION
11
+
12
+ command :convert do
13
+ flag "convert"
14
+ description "convert nmap xml output to json"
15
+ type :string
16
+ action do
17
+ unless File.file?(argument)
18
+ puts "#{argument} isn't a file!"
19
+ exit 1
20
+ end
21
+ puts Nmap2json.parse(argument, save: options[:save] || false)
22
+ end
23
+
24
+ option :save do
25
+ flag "--save"
26
+ type :string
27
+ description "save output to a given file"
28
+ end
29
+ end
30
+
31
+ end
@@ -0,0 +1,11 @@
1
+ require "json"
2
+ require "active_support/all"
3
+ require "nmap2json/version"
4
+
5
+ module Nmap2json
6
+ def self.parse_xml(file, save: false)
7
+ j = Hash.from_xml(IO.binread(file)).to_json
8
+ IO.binwrite(save, j) if save
9
+ return j
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module Nmap2json
2
+ VERSION = "1.0.0"
3
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nmap2json
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Kent Gruber
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: command_lion
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.16'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.16'
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
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ description:
84
+ email:
85
+ - kgruber1@emich.edu
86
+ executables:
87
+ - nmap2json
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - bin/nmap2json
92
+ - lib/nmap2json.rb
93
+ - lib/nmap2json/version.rb
94
+ homepage: https://github.com/picatz/nmap2json
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.6.12
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Convert's nmap's XML output to JSON. Or pretty much any XML input as JSON
118
+ output.
119
+ test_files: []