Under xp and winsock 2 I get an error unless bOpt is a dword.

Anyways, without all your code I can't get your snippet to assemble under MASM. Add your source (and header defs) as an attachment and maybe I can help you further.
Posted on 2004-10-24 18:38:19 by The Dude of Dudes

Under xp and winsock 2 I get an error unless bOpt is a dword.

Do you have a code with proper functionality about TCP SYN scanning?
Posted on 2004-10-24 20:32:58 by veria
I do, but it uses the WinPCap API instead of WinSock.
Posted on 2004-10-24 20:43:03 by The Dude of Dudes
I do, but it uses the WinPCap API instead of WinSock.

Your code is written by masm32 or C++?
Posted on 2004-10-24 20:50:15 by veria
The Dude of Dudes,
If you can to attache your code to this froum, please do it.
Posted on 2004-10-25 17:47:38 by veria
My portscanner is actually a Host scanner, it sends a SYN packet to a range of specified ip's and listens for replies. But like I said, it uses the WinPCap API, not Windows Sockets. I've attached an example of using Raw sockets that sends an ICMP request, it should help you get your own code up and running. Make sure you put in the correct IP address dotted strings in the source if you want it to work (actually send a valid ICMP echo request).
Posted on 2004-10-25 19:10:14 by The Dude of Dudes
Thank you for your replies. I will try to write my scanner with ws2_32.lib, instead of wsock32.lib very soon. I hope, I see no problem in this way.
Posted on 2004-10-26 13:43:42 by veria
I think you need to use Winsock 2 if you want to use Raw sockets.
Posted on 2004-10-26 20:01:40 by The Dude of Dudes
I'm late on this thread - but please enlighten me - why are we using raw sockets at all? This is merely a SYN scan - simply sending CONNECT attempts achieves the same aim. What's the big deal?
Are we trying to write a "half-open" scanner? (One that does not reply to the SYN/ACK with an ACK)...
If that's the case you are coming perilously close to breaching the posting rules of this forum, and I expect you can justify the nature of this thread.
I'm sure all the board users would agree that the rules are there for a good reason - to keep the rabble out.
Posted on 2004-10-27 06:46:38 by Homer
No, my ping utility is work without any problem, when I use ws2_32 lib instead of wsock32 lib.

This froum is a good Raw socket programming training. I must be familiar with this area, If I realy want to produce a good and serious net utility, like my firewall.
Posted on 2004-10-27 15:17:56 by veria

Glad ws_2 is working for you.


He said he was working on a tcp portscanner. Portscanning itself is not illegal, and being discussed in the context of writing his own portscanner I didnt think it breached forum policy (my apologies if it does, however).

I agree connect would work, but you would have to create 65535 seperate socket descriptors to do a full portscan. Raw sockets seem simpler, one socket sending, one listening for SYN/ACK's.
Posted on 2004-10-27 20:01:59 by The Dude of Dudes