Skip to content

Commit

Permalink
user other input file
Browse files Browse the repository at this point in the history
  • Loading branch information
moozzi committed Feb 15, 2024
1 parent 14d5bf6 commit 037b535
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

RSpec.describe Ronin::Masscan::Converter do
let(:fixtures_path) { File.expand_path(File.join(__dir__, '..', 'spec', 'fixtures')) }
let(:masscan_path) { File.join(fixtures_path, 'converter', 'masscan.json') }
let(:masscan_path) { File.join(fixtures_path, 'converters', 'input.json') }
let(:timestamp) { JSON.parse(File.read(masscan_path))[0]["timestamp"].to_i }
let(:masscan_file) { Masscan::OutputFile.new(masscan_path) }
let(:expected_json) do
Expand All @@ -18,6 +18,14 @@
ttl: 54,
ip: '93.184.216.34',
timestamp: Time.at(timestamp)
},
{
protocol: :tcp,
port: 80,
ip: '93.184.216.34',
timestamp: Time.at(timestamp),
app_protocol: 'html_title',
payload: '404 - Not Found'
}
].to_json
end
Expand All @@ -31,6 +39,9 @@
],
[
"status", "open", "tcp", "80", "syn,ack", "54", "93.184.216.34", Time.at(timestamp)
],
[
"banner", nil , nil, nil, nil, nil, nil, nil, "tcp", "80", "93.184.216.34",Time.at(timestamp), "html_title", "404 - Not Found"
]
]
end
Expand Down

0 comments on commit 037b535

Please sign in to comment.