Javascript port scanner

I was pretty bored yesterday and I found my work a bit too easy so I thought I’d have a go at something different.

I decided to create a javascript port scanner, the scanner only works on Firefox at the moment (I may change it to work in other browsers) and has three options, option one scans for a local FTP server, option two scans for a local web server and the third option does a NAT router scan and guesses which type of router you have.

It assumes that you haven’t changed the default configurations and supports a few models of routers. Check it out below:-


I’ve added a bunch of default gateway addresses to my scanner and it should now display the host as well on the NAT router scan. The script has been updated to allow router submissions and I have removed the localhost web server scanner and localhost ftp server scanner because I found them less interesting than the NAT scanner.

Technical details

The scanner object takes a list of router objects from the arguments of the function and then performs a scan of each of the routers. It creates a iframe to do this, using the onload handler to check if it was successful.

Javascript NAT router scan demo

9 Responses to “Javascript port scanner”

  1. Gareth Heyes writes:

    To help me improve the tool, please leave a comment if the scanner failed to find any servers. Ideally leave the name of the router and it’s default IP address. e.g. Netgear

    Also if anyone could leave the address to a default graphic on their router with the brand and model I could also add fingerprinting information to the tool.

    If you would rather send it privately, please send to gareth at businessinfo co uk, with the subject “Router info”.

  2. Anonymous User! writes:

    It tries to connect to 192.168.x.x
    What about the 10.0.x.x etc suffixes?

  3. Gareth Heyes writes:

    Some have been included but obviously there would be too many to include them all. I found a list of routers with default IP addresses and added those. If you know of a list of default addresses let me know and I’ll add them.

  4. kingthorin writes:

    There must be a way via JavaScript to get the local IP of the host system that IE (or FF) is running on so would it be possible to check the images etc guessing based within the range of the assigned IP?

    i.e.: I’ve changed my DHCP range on my linksys to be Using JS it should be possible for the browser to ‘tell’ the JS LanScanner that I’m and then check (or whatever assumption you want to make …. or check the whole /25) for the image to fingerprint the router.

  5. Gareth Heyes writes:

    There’s no direct way but it would be possible to guess a few addresses like *.1 or *.254 because most routers are either at the start or end of the address range. Many people don’t change the defaults especially when at home so it’s a lot more likely with home based routers.

    Another possibility is finding the router without the IP address. Many routers have a default dns name which can be used without knowing the IP.

  6. kingthorin writes:

    Not sure if you’re really interested in putting anymore work into this but…

    Check this out:

    It grabs not only my external IP but also my local DHCP’d internal IP. (Firefox 3.0.4)

  7. kingthorin writes:

    Oh and yes I agree with post #5, if you can get their address you’d have to make assumptions about where the router is (or try all … but that might be CPU/time intense for 255 addresses).

  8. Gareth Heyes writes:


    That’s cool! I didn’t think it could work on FF3. Nice one.

  9. router ip writes:

    Really good article, but this won’t appear to work together with my router ip, any hints?