From: Joel VanderWerf Date: 2007-04-17T01:43:50+09:00 Subject: Re: simple but fast port scanner mrpink wrote: > yes thanks but I don't wanna use nmap ;) I want to write it by my own... > > the only problem I have is: "You send a SYN packet, as if you are going > to open a real connection and then wait for a response[..]" but how can > I send a SYN packet with ruby? I also know how to use telnet and sockets > and how I could simply connect with tcp to a certain port but how can I > send such a SYN packet ?!? > > Is this at all possible with ruby or is this too low level? As Brian said, read up on raw sockets.... If you want some code to help construct raw IP packets, take a look at some of the examples in bit-struct[1], which is sort of a wrapper over #pack/#unpack. Particularly, look at examples/raw.rb. You'll have to find out elsewhere what goes into a SYN packet, though. [1] http://redshift.sourceforge.net/bit-struct -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407