metasploit-framework/modules/auxiliary/scanner/printer/printer_version_info.rb

58 lines
1.2 KiB
Ruby
Raw Normal View History

2013-12-05 03:46:45 +00:00
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require "msf/core"
require "rex/proto/pjl"
class Metasploit4 < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp
2013-12-05 16:25:04 +00:00
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
2013-12-05 03:46:45 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => "Printer Version Information Scanner",
'Description' => %q{
This module scans for printer version information using PJL.
},
2013-12-05 06:28:53 +00:00
'Author' => [
"wvu", # This implementation
"MC", # Independent implementation
"YGN" # Independent implementation
2013-12-05 06:28:53 +00:00
],
2013-12-05 03:46:45 +00:00
'References' => [
["URL", "https://en.wikipedia.org/wiki/Printer_Job_Language"]
],
'License' => MSF_LICENSE
))
register_options([
Opt::RPORT(9100)
], self.class)
end
def run_host(ip)
connect
pjl = Rex::Proto::PJL::Client.new(sock)
pjl.begin_job
id = pjl.info_id
pjl.end_job
2013-12-05 03:46:45 +00:00
disconnect
if id
2013-12-16 17:46:24 +00:00
print_good("#{ip}:#{rport} - #{id}")
2013-12-05 03:46:45 +00:00
report_service({
:host => ip,
:port => rport,
:proto => "tcp",
:name => "jetdirect",
:info => id
})
end
end
end