| | |
Port scanner
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
What have you written so far?
try writing some pseudo code first
you will want an IP
and a specific range of ports to check.
you will need a method for sending a ping to them and a method for listening for a response (three part handshake for networking peeps)
you should start by writing something that can ping a local address, or even just something that can connect to a local machine to get the feel for how networking works.
try writing some pseudo code first

you will want an IP
and a specific range of ports to check.
you will need a method for sending a ping to them and a method for listening for a response (three part handshake for networking peeps)
you should start by writing something that can ping a local address, or even just something that can connect to a local machine to get the feel for how networking works.
Dont forget to spread the reputation to those that deserve!
•
•
•
•
Could You give me a little example(C#), so i`ll try to continue
Thanks
in about 30 seconds of google searching i was able to find examples of what you need to do.
hint an IP with a PORT is called a socket
so look up C# and sockets.
Dont forget to spread the reputation to those that deserve!
•
•
Join Date: Jun 2007
Posts: 3
Reputation:
Solved Threads: 0
Ok
I`ll try to ask accurate question:
I need to implement few type of scanning:
- TCP connect()
- TCP SYN scan
- TCP FIN scan
- TCP XMAS scan
- TCP NULL scan
I already did something:
public static void connect1(string host, int startPort, int finishPort)
{
IPAddress[] IPs = Dns.GetHostAddresses(host);
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Console.WriteLine("Establishing Connection to {0}", host);
for (int curPort = startPort; curPort <= finishPort; curPort++)
{
try
{
s.Connect(IPs[0], curPort);
Console.WriteLine("Port {0} : opened", curPort);
}
catch
{
Console.WriteLine("Port {0} : blocked", curPort);
}
}
It`s working, but I don`t know which type is it, and how to continue
with other types
Thanks
I`ll try to ask accurate question:
I need to implement few type of scanning:
- TCP connect()
- TCP SYN scan
- TCP FIN scan
- TCP XMAS scan
- TCP NULL scan
I already did something:
public static void connect1(string host, int startPort, int finishPort)
{
IPAddress[] IPs = Dns.GetHostAddresses(host);
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Console.WriteLine("Establishing Connection to {0}", host);
for (int curPort = startPort; curPort <= finishPort; curPort++)
{
try
{
s.Connect(IPs[0], curPort);
Console.WriteLine("Port {0} : opened", curPort);
}
catch
{
Console.WriteLine("Port {0} : blocked", curPort);
}
}
It`s working, but I don`t know which type is it, and how to continue
with other types
Thanks
![]() |
Similar Threads
- Port Scanner Tutorials (Visual Basic 4 / 5 / 6)
- Port Scanner Reporting Zero Ports Opened. (Networking Hardware Configuration)
- Can't install scanner (Windows NT / 2000 / XP)
- Winsock and looping issues unsure how to resolve (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: Numbers only textbox
- Next Thread: C# IE Toolbar talking to C++ BHO
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





