• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Network Tools

There's three potential reasons for this:
1) There are no other computers at 10.10.10.#

All of the computers and network capable devices on our subnet are in the range of 10.10.10.xxx

2) There are other computers but they aren't named.

All computers are named. however, it still would be nice to see an IP that is in use even if it is not a named computer or other network capable device (eg. Printer, CNC, etc.)

3) Your computer is IPv4 and the rest are IPv6.

All computers and network capable devices here are IPv4.
 
Did it work before version 1.4.5?
 
1.4.5 is the first version I pulled here at work. IF you post a previous version I can test that (if you still have the zips).

Both TR and TR(Advanced) work fine. :toast:
 
Maybe your router, switch, or hub is blocking the scan? It could see it as a DOS attack potentially.


The reason why I don't list unnamed sources is because, even if a device doesn't respond, the router/host still does. That is, it would list the whole range that was scanned if that check wasn't there.


I made it so it would show the ip range it is scanning before it starts (e.g. Scanning intranet addresses from 192.168.0.1 to 192.168.0.255...). That's not a significant enough reason to release it though...
 
What is your software doing to detect machines when it does the intranet scan ?
 
Just Dns.GetHostEntry(ip). I imagine if the DNS doesn't have a list, it will only find itself.
 
Fun with Dick and Jane ... and Ping and WMI and ...

This works pretty well for intranet scanning.
Code:
using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Management;
using System.Windows.Forms;

namespace DNSTest
{
    public partial class Form1 : Form
    {
        PingReply _Reply;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string _ipaddr;

            for (int i = 1; i < 255; i++)
            {
                textBox2.Update();
                _ipaddr = "10.10.10." + i.ToString();

                textBox2.Text += _ipaddr + " - ";

                Ping _Ping = new Ping();
                _Reply = _Ping.Send(_ipaddr, 100);
                if (_Reply.Status == IPStatus.Success)
                {
                    // Ping returned good, try to get the hostname

                    ManagementScope _scope = new ManagementScope(@"\\" + _ipaddr + @"\root\cimv2");
                    ObjectQuery _oj = new ObjectQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled='True'");
                    ManagementObjectSearcher _mos = new ManagementObjectSearcher(_scope, _oj);
                    ManagementObjectCollection _moc;

                    try
                    {
                        _moc = _mos.Get();
                    }
                    catch (Exception)
                    {
                        // Timeout on Get command, not a WMI supported device.
                        textBox2.Text += "Unknown Device" + Environment.NewLine;
                        continue;
                    }

                    foreach (ManagementObject _obj in _moc)
                    {
                        textBox2.Text += _obj["DNSHostName"].ToString() + Environment.NewLine;
                    }
                    _Ping.Dispose();
                }
                else
                {
                    // Ping did not return success
                    textBox2.Text += Environment.NewLine;
                    _Ping.Dispose();
                }
            }
        }
    }
}

It does a ping to an address and if it returns good (it got a reply) it uses the System.Management APIs to try to get a hostname.

It has a button to start the loop (which would not be static in the real program) and a TextBox for output. It's resonably quick, but needs work as it does not update and respond (to the mouse) correctly while the loop is running.

You don't need to use it if you don't want, I'm just tired of app programming and figured I play with network stuff to relax. lol
 
I tried your code and it only got the Host Name of my computer. On the rest, it returns:

Windows 2003 Server: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Router, Printers: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Code:
Scanning intranet addresses from 192.168.0.1 to 192.168.0.255...
192.168.0.191    by-2009
192.168.0.128    Unknown Device
192.168.0.111    Unknown Device
192.168.0.199    Unknown Device
192.168.0.1      Unknown Device
Scan Complete (18 seconds)
I could just use Dns.GetHostEntry on those IPs...

I wonder why Ping class works but my ICMP class doesn't.


Edit:
Code:
Scanning intranet addresses from 192.168.0.1 to 192.168.0.255...
192.168.0.191    by-2009
192.168.0.111    PTR-LASER
192.168.0.128    SERVER
192.168.0.199    PTR-MFC
192.168.0.1      192.168.0.1
Scan Complete (16 seconds)
Dns.GetHostEntry() appears to be a little bit faster even. :D
 
Last edited:
Yes, but the DNS class doesn't seem to work for crap if you are not running from the DNS server (as far as I can tell).

I got a simlilar error from HRESULT (but not access denied) when I first wrote it, but it was a timeout (which is why I added the try-catch clause). I'm not sure why you are getting that exception running from the server.

Are you runnning a firewall on the client machines?
 
The only firewall running is in the router. I am debugging on BY-2009. The server is a domain name server but its only member is itself.

Edit: This seems to be working well so I think I'll upload 1.4.7 soon:
Code:
        private void Looper(object param)
        {
            try
            {
                IPAddress ip = (IPAddress)param;
                Ping ping = new Ping();
                if (ping.Send(ip, StaticMethods.PingTimeOut).Status == IPStatus.Success)
                {
                    IntranetScanHandler e = IntranetScans;
                    if (e != null)
                        e(IntranetScanResult.Responded, ip.ToString(), Dns.GetHostEntry(ip).HostName);
                    ping.Dispose();
                }
                else
                {
                    IntranetScanHandler e = IntranetScans;
                    if (e != null)
                        e(IntranetScanResult.TimedOut, ip.ToString());
                    ping.Dispose();
                }
            }
            catch (ExtendedException ex)
            {
                Program.MainForm.ExceptionCaught(ex);
            }
        }
 
Looks good, I'll be happy to test 1.4.7 here at work.

Ever seen this little freeware gem? http://www.spiceworks.com/

... and we're just trying to get text output. lol
 
1.4.7 is uploaded.


I've never heard of Spice Works.
 
damn iv come to the conclusion its hit or miss with me as too when this works. im now failing intranet scan on all builds including the new 1.47 its like ti works when it wants to iv tried computability mode etc as well.
 
Intranet scan from 1.4.7 when run on my workstation (the only one that shows a name) ...
Scanning intranet addresses from 10.10.10.1 to 10.10.10.255...
10.10.10.4 10.10.10.4
10.10.10.5 10.10.10.5
10.10.10.3 10.10.10.3
10.10.10.8 10.10.10.8
10.10.10.6 10.10.10.6
10.10.10.7 10.10.10.7
10.10.10.12 10.10.10.12
10.10.10.13 10.10.10.13
10.10.10.21 10.10.10.21
10.10.10.16 10.10.10.16
10.10.10.23 10.10.10.23
10.10.10.24 10.10.10.24
10.10.10.26 10.10.10.26
10.10.10.40 10.10.10.40
10.10.10.41 10.10.10.41
10.10.10.67 10.10.10.67
10.10.10.76 10.10.10.76
10.10.10.77 10.10.10.77
10.10.10.99 10.10.10.99
10.10.10.110 10.10.10.110
10.10.10.111 10.10.10.111
10.10.10.108 10.10.10.108
10.10.10.109 10.10.10.109
10.10.10.141 10.10.10.141
10.10.10.120 10.10.10.120
10.10.10.150 10.10.10.150
10.10.10.152 10.10.10.152
10.10.10.198 10.10.10.198
10.10.10.200 10.10.10.200
10.10.10.205 10.10.10.205
10.10.10.204 10.10.10.204
10.10.10.206 10.10.10.206
10.10.10.209 10.10.10.209
10.10.10.208 10.10.10.208
10.10.10.215 10.10.10.215
10.10.10.220 10.10.10.220
10.10.10.222 10.10.10.222
10.10.10.223 10.10.10.223
10.10.10.229 10.10.10.229
10.10.10.230 10.10.10.230
10.10.10.233 10.10.10.233
10.10.10.234 10.10.10.234
10.10.10.235 10.10.10.235
10.10.10.236 10.10.10.236
10.10.10.250 epl-infotech.apexepl.com
10.10.10.251 10.10.10.251
10.10.10.252 10.10.10.252
10.10.10.255 10.10.10.255
10.10.10.207 10.10.10.207
10.10.10.254 10.10.10.254
Scan Complete (3 seconds)

It found all of the IPs in use, but they are out of order and don't show names.
It is darn fast though !!! :toast:
 
damn iv come to the conclusion its hit or miss with me as too when this works. im now failing intranet scan on all builds including the new 1.47 its like ti works when it wants to iv tried computability mode etc as well.
Are you getting errors?


It found all of the IPs in use, but they are out of order and don't show names.
If it didn't have a name, it would take 15 seconds for it to get it (Dns.GetHostEntry has a very long timeout). That is the case with my router (192.168.0.1). Because you got your results in well under 15 seconds, I'd guess the IPs are the established names of those machines. Kind of odd, but possible.

The only way I could sort it is if I wait to output until all responses are gathered (like Trace Route Advanced). If that is an important feature, I could add Intranet Scan (Sorted). Should it be sorted by name or IP though?


It is darn fast though !!! :toast:
Heh, it better be. It uses 255 threads. :roll:
 
The System.Management APIs take forever also, if the IP is not in use (that's why I did the ping first in my little code test). It does, however, return the name fairly quickly if the IP is in use (and is a windows machine).

Sort by IP Address.
 
no errors other than its stopped responding
 
The System.Management APIs take forever also, if the IP is not in use (that's why I did the ping first in my little code test). It does, however, return the name fairly quickly if the IP is in use (and is a windows machine).

Sort by IP Address.
The router and printers are not Windows. Dns.GetHostEntry appears to work better for this purpose. I wish I could recode it with a shorter timeout though.

Alright. 1.5 will feature Intranet Scan (Sorted) which sorts by IP.


no errors other than its stopped responding
Does it ever snap out of it (it should in a under a minute)?

I wonder if the 255 threads it starts is stressing your overclock.
 
1.5 uploaded. Details on the original post.
 
The router and printers are not Windows. Dns.GetHostEntry appears to work better for this purpose. I wish I could recode it with a shorter timeout though.

Alright. 1.5 will feature Intranet Scan (Sorted) which sorts by IP.



Does it ever snap out of it (it should in a under a minute)?

I wonder if the 255 threads it starts is stressing your overclock.

it does this with all builds and it wont come out of it. I play crysis on this machine and run wprime benches and she runs fine and as far as i know the other builds didnt have 255 threads?
 
All Intranet Scan builds had/have ~257 threads (255 scans, 1 monitor, 1 form). Crysis, wPrime, etc. won't even come close to that number but the threads they run are much heavier.

Intranet Scan and Intranet Scan (Sorted) are the only two actions to run 100+ thread concurrently. Trace Route (Advanced) could if you had 99+ hops.
 
Last edited:
Ran IS at home. Both IS and IS(Sorted) take about 4 seconds with only 3 devices on the lan.
Local machine spits out name, Linksys router and Unix based NAS do not (only IPs as expected).
 
Wow, the best I can do is 16 seconds with my D-Link router always being last. :(
 
TR at home on satellite connection for both techpowerup.com and www.techpowerup.com
Tracing route to www.techpowerup.com [74.86.91.2]
over a maximum of 30 hops:
Timed out.
Timed out.
Timed out.
Timed out.
Timed out.
Trace Complete

Both for TR(Advanced)
Tracing route to techpowerup.com [74.86.91.2]
over a maximum of 30 hops...
Target (74.86.91.2) is unreachable.

Hostnames obtained. Results:
Hop Latency IP Address Hostname

Version 1.5.0
 
GAH !!! Ford you Slacker !!!

You're not even checking for well formed domain names before running the tests?

Bad coder !! Now off to your room with no dinner. :roll:
 
Back
Top