Solved

UDP Port Scanner

Posted on 2003-11-14
8
1,794 Views
Last Modified: 2012-05-04
Could someone show me how to make a UDP port scanner in delphi.

I've aready made a TCP port scanner, but how would I make a UDP port scanner.

Could someone show me how this is done?
0
Comment
Question by:Shinez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 6

Accepted Solution

by:
GloomyFriar earned 100 total points
ID: 9750481
Just open UDP socket instead TCP socket ;-)
0
 

Author Comment

by:Shinez
ID: 9751204
How Would I do this?
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9753785
Ok, I'll try to explain.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9753825
It's impossible to scan UDP port if it just was opened.
You can determine that UDP port is opened by sending some datagram to the port only.
And if you'll be lucky you'll got an answer from the server.
But server is not obliged to answer to you if you don't know its protocol ;-)

So, if you know what server you are looking for and you know its protocol then try to send some command (according to the protocol) and wait for an answer from the server. ip-by-ip, port-by-port ;-)

Good luck.
0
 

Author Comment

by:Shinez
ID: 9758218
could you show me how this is done, have edit1 for ip and edit2 for port and for label1 to display if port is open/close.

if I wanted to check if the port is open for ut2003.

default game port is 7777, the query port is 7778.

how would I get a responce that the server is up?

please could you give some code with your answer, I don't know that much about UDP.

thxs
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9762835
There is no "open" and "close" terms applying to the UDP protocol.

...
Var buff: array[0..256] of byte;
...
   UDPClient := TNMUDP.Create(self);
   UDPClient.RemoteHost := 'ut2003'; // or something like '192.168.1.15'
   UDPClient.RemotePort := 7778;
   UDPClient.LocalPort := 7777;
   UDPClient.OnDataReceived := UDPClientDataReceived;
   UDPClient.OnStatus := UDPClientStatus;
   UDPClient.OnInvalidHost := UDPClientInvalidHost;
   UDPClient.OnStreamInvalid := UDPClientStreamInvalid;
   UDPClient.OnBufferInvalid := UDPClientBufferInvalid;
...

   StrPCopy(buff, "Hello!");
   try UDPClient.SendBuffer(buff, 7);
   except;
     // Error
   end;

...
procedure TMainForm.UDPClientDataReceived(Sender: TComponent;
  NumberBytes: Integer; FromIP: String);
Var buff: array[0..256] of byte;
begin
  UDPClient.ReadBuffer(buff, NumberBytes);
end;

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses
Course of the Month5 days, 10 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question