Path: blob/master/modules/auxiliary/vsploit/pii/web_pii.rb
19813 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary67#8# This module acts as an compromised webserver distributing PII Data9#10include Msf::Exploit::Remote::HttpServer::HTML11include Msf::Auxiliary::PII1213def initialize(info = {})14super(15update_info(16info,17'Name' => 'VSploit Web PII',18'Description' => 'This module emulates a webserver leaking PII data',19'License' => MSF_LICENSE,20'Author' => 'MJC',21'References' => [22[ 'URL', 'https://www.rapid7.com/blog/post/2011/06/02/vsploit--virtualizing-exploitation-attributes-with-metasploit-framework']23],24'DefaultOptions' => { 'HTTP::server_name' => 'IIS' },25'Notes' => {26'Stability' => [CRASH_SAFE],27'SideEffects' => [IOC_IN_LOGS],28'Reliability' => []29}30)31)32register_options(33[34OptBool.new('META_REFRESH', [ false, 'Set page to auto refresh.', false]),35OptInt.new('REFRESH_TIME', [ false, 'Set page refresh interval.', 15]),36OptInt.new('ENTRIES', [ false, 'PII Entry Count', 1000])37]38)39end4041def create_page42# Webpage Title43title = 'vSploit PII Webserver'44sheep = <<~EOS45__________46< baaaaah! >47---------48\\49\\50,@;@,51;@;@( \\@;@;@;@;@;@,52/x @\\_|@;@;@;@;@;@;,53/ )@:@;@;@;@;@;@;@|)54*---;@;@;@;@;@;@;@;@;55';@;\;@;\;@;@56|| | \\ (57|| | // /58// ( // /59~~~~~ ~~~~6061EOS62page = ''63page << "<html>\n<head>\n"6465if datastore['META_REFRESH']66page << "<meta http-equiv=\"refresh\" content=\"#{datastore['REFRESH_TIME']}\">\n"67end6869page << "<title>#{title}</title>\n</head>\n<body>\n"70page << "<pre>\n"71page << sheep72page << "Data Creation by: #{title}\n"73page << "Entries Per Page: #{datastore['ENTRIES']}\n"7475if datastore['META_REFRESH']76page << "Refresh Interval: #{datastore['REFRESH_TIME']} Seconds\n"77end7879# Start creating PII data80pii = create_pii81page << "\n"82page << pii83page << "</pre>\n</body>\n</html>"84page85end8687def on_request_uri(cli, _request)88# Transmit the response to the client89res = create_page90print_status('Leaking PII...')91send_response(cli, res, { 'Content-Type' => 'text/html' })92end9394def run95exploit96end97end9899100