UDP Port Scanner

Posted on 2003-11-14
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?
Question by:Shinez
  • 4
  • 2

Accepted Solution

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

Author Comment

ID: 9751204
How Would I do this?

Expert Comment

ID: 9753785
Ok, I'll try to explain.
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.


Expert Comment

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.

Author Comment

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.


Expert Comment

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 ''
   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);
     // Error

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


Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now