Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1476

VB6 - Netgear Telnet

$
0
0
I upgraded my Internet connection and discovered that my old Netgear router just didn't have the capacity to keep up with it. I kept that old one around because I had several, and I really appreciated the command mode via Telnet. After some research, I purchased a new Netgear router (WNDR3400). When I checked for open ports, I discovered that port 23 was active on the LAN interface, but when I connected with Telnet, I got nothing. With a little more research, I found that Netgear allows you to enable the Telnet interface by sending it a special packet via a small program called "TelnetEnable.exe". The description given is that it takes the MAC address of the LAN Interface and combines it with the UserID and Password. It then does an MD5 Hash on it along with some byte swapping, and encrypts it all using Blowfish and the key "AMBIT_TELNET_ENABLE+".

I was tempted to try and duplicate the encryption, but Blowfish isn't supported by Microsoft and it is quite an old standard. As well, Telnet is not enabled by default on all modern Microsoft Operating Systems. So I created a small program to duplicate the Telnet Interface called TelNetgear. The TelnetEnable program requires the MAC address of the LAN interface, so the program automatically sends an ARP request to the configured IP address to determine the MAC address residing at that address. This is only good for IPv4, as ARP is not used in IPv6. Instead of a broadcast IP address, IPv6 uses a multicast MAC address (33:33:00:01:00:02).

When TelNetgear attempts to connect with the router, it first uses ShellExecute to call the "TelnetEnable" program. If successful, it will then connect with port 23. The router should respond with the "#" prompt as illustrated below. This Netgear router uses Unix type commands, and is very powerful for it's compact size. You can enter those commands in the lower Textbox, or you can use the commands listed in the yellow Listbox. Those commands are loaded from a text file called "Commands.txt", which can be edited with any standard Text Editor. I have included only a few of the many commands available. My knowledge of the Unix commands is quite limited. The "help" command lists a few, and the "busybox" command lists a few more. But there are more than that (eg. RouterInfo), and viewers are free to offer suggestions.

Some routers require UserID/Password after enabling Telnet, so that logic will have to be added if required. My particular router does not, and that means there is no restriction to access on the local network. If there is any doubt about the security of your local network (for example WiFi access on the same subnet), you should reboot the router after accessing, as this reverts the Telnet interface back to the default condition.

J.A. Coutts
Attached Images
 
Attached Files

Viewing all articles
Browse latest Browse all 1476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>