check this
http://www.insecure.org/nm
Main Topics
Browse All TopicsHi,
I would like to study the C code of a quick console port scanner for windows.
This scanner must check if several ports are opened in a range of machines.
Would be neccesary to use non-blocking sockets and checks if boxes are running without pinging them.
i.e:
scan 172.16.0.1 172.16.1.255 21 23 80
scan ip range from 172.16.0.1 to 172.16.1.255 checking if ports 21,23 and 80 are oppened
Thx
Kar10s
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
check this
http://www.insecure.org/nm
port scanning .. i would suggest .. nmap.. look for this one on www.insecure.org....
nessus is also great stuff.. i suggested this just as an alternative to nessus.. and it supports console and gui based interfaces.. both..
and very easy to use...
hope this is of some help
akshay
Hi ,
First of all, sorry for my poor english. It is difficult for me to explain in english.
Kdo,
There are a lot of quick ports scanners with the functionality that I am requesting , so If I should need it, I would have downloaded.
Nessus is remote security scanner, and I am looking for "the code of a port Scanner".
akshayxx,sunnycoder,Kdo
I am looking for the code of a C scanner (no C++) for use with console interface with the characteristic explained on question, because I am studying winsock programming under C , and I am interested in seeing like resolving several problems that I have
for example: how is made the call to connect() function. I suppose that it is necessary to use select() function due to if a box is not conected to network, the program stop during a lot of time until time out it reached.
I am trying to find a "clean C code" (I suppose that must be Multi thread) without use of "steath techniques" nor any other things. I am looking for a code easy to understand due to I am a begginer on winsock programming.
I regret again my bad englsih.
Best Regards
kar10s
both of them are open source and u can download the source codes from the respective websites..
is that what u want ..
"clean C code".. both of them will be not so clean to be understood easily..
if u just want to get hang of network programming .. then probably these are not the best things to start with .. u better take some books ( unix network programming by "richard stevens").. or for windows stuff .. it shud be all there in MSDN examples..
sunny: i didnt intend to duplicate the comment.. but somehow .. when i was posting .. i couldnt see ur comment..
kar10s,
It seems that you are looking for a neat C code port scanner ... Well none of the popular ones will be that kind ... port scanners need to be efficient and not neat :o)
again as akshay said, port scanner is NOT the kind of thing you should be looking into if you are still trying to learn the system calls ...
There are number of good tutorials out there, I am posting links to some of them ... go through them carefully and you should be able to grasp socket programming better ...
http://www.district86.k12.
http://www.hal-pc.org/~joh
Here is link to another tutorial ... It uses linux socket programming for examples, but basic calls are the same at both (socket,connect, bind etc) ... It descibes them very very well ... take time to go through it
http://www.ecst.csuchico.e
Thanks for your help and your time, but this is not the information that I need.
When I say that I am a beginner, I do not want to say an "absolute begginer" . I have review ed all information that I have found but generally this one is very simple one ( it is not used non-blocking socket, nor multhi-thread, elementary client-server applications). Other are so much complicated and generally they are programmed ussing C++. I want to learn now the basic of multhithread and non-blocking winsock programing, and a scanner is a good example of this type of applications.
I have found some multhi thread scanners in C ( not C++ ) , but they can not scan several IPs, and I am very interested in seeing how is made the call to connect function in this circunstances and any other things.
So it is important for me in order to solve my doubts, to find a C code of these characteristics.
Regards
kar10s
see if you can find something here
http://www.thefreecountry.
http://www.codeproject.com
some basic things here ::::
from the faq
http://tangentsoft.net/wsk
some information
http://support.microsoft.c
more info
http://www.developerfusion
Business Accounts
Answer for Membership
by: KdoPosted on 2004-02-02 at 12:41:39ID: 10255577
Hi kar10s,
In general, I'm unwilling to post replies that could be used to build nuisance tools.
But if you're looking to test your own network/systems, go to www.nessus.org and check out their port scanning tool.
Good Luck,
Kent