hello
i am new to Ruby.
i want to make a small program that when you scan the computer with NMAP
it will look like a real program.
some kind of small honeypot.

i am trying to do it with pop3,ssh,smtp,http,ftp,telnet and RDP.

every protocol is a different port of course so i am changing the port
and the header.
i've succeeded only with smtp and ftp.
please help with the other.

the code is :

require 'socket'

server = TCPServer.open(80)
hostname = Socket.gethostbyname(Socket.gethostname).first
header1 = "HTTP/1.1 200 OK"
header2 = "Fri 11 Jan 2013 13:13:13 GMT"
header7 = "Location: www.fuckyou.com/"
header3 = "Server: Microsoft-IIS/6.0"
header4 = "Vary: Accept-Encoding"
header5 = "Connection: close"
header6 = "Content-Type: text/html; charset=iso-8859-1"

loop do
  Thread.start(server.accept) do |client|
  client.write header1
  client.write header2
  client.write header7
  client.write header3
  client.write header4
  client.write header5
  client.write header6
  client.close
end

end

and it still now working.
another thing - can i post all of the headers 1-6 in one header ?
thanks you very much

-- 
Posted via http://www.ruby-forum.com/.