|
|||||||
| BackTrack3 Howtos Add your howto articles / tutorials here. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
This tutorial covers how to enable a telnet session on certain Netgear routers. The program that we will use is called telnetenable. For more information on this program then use the links below.
Useful Links http://wiki.openwrt.org/OpenWrtDocs/.../TelnetConsole http://www.seattlewireless.net/Netge...e8790b0722e370 http://blog.ktdreyer.com/2008/01/hacking-wgr614.html OK, so lets get onto the fun part. Testing Before we can actually run this program we need to make sure that we have a viable candidate. To do this we will run the program Nmap. There are many different variables that you could use with nmap but for our purposes we will just do a quick scan to get some basic information. I will show you two different nmap scans on two different Netgear routers. One router has the telnet port open and the other doesn't have telnet enabled at all. Viable Candidate Code:
bt ~ # nmap -A -T4 192.168.1.1 Interesting ports on 192.168.1.1: Not shown: 1713 closed ports PORT STATE SERVICE VERSION 23/tcp open telnet? 80/tcp open tcpwrapped | HTTP Auth: HTTP Service requires authentication |_ Auth type: Basic, realm = WGR614v7 MAC Address: AA:AA:AA:AA:AA:AA (Netgear) Device type: WAP Running: Netgear embedded OS details: Netgear WGR614v7 or WPN824v2 wireless broadband router Uptime: 5.153 days (since Sat Jul 19 12:19:33 2008) Network Distance: 1 hop Code:
bt telnet # telnet 192.168.1.1 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'. Connection closed by foreign host. Not a viable candidate Code:
bt ~ # nmap -A -T4 192.168.0.1 Interesting ports on 192.168.0.1: Not shown: 1710 closed ports PORT STATE SERVICE VERSION 80/tcp open http Netgear MR814v2 wireless router http config (IP_SHARER WEB httpd 1.0) |_ HTML title: Site doesn't have a title. | HTTP Auth: HTTP Service requires authentication |_ Auth type: Basic, realm = MR814v2 MAC Address: XX:XX:XX:XX:XX:XX (Netgear) Device type: WAP|firewall Running (JUST GUESSING) : TRENDnet embedded (96%), Netgear embedded (93%) Aggressive OS guesses: TRENDnet TEW-431BRP wireless broadband router (96%), Netgear FR114P ProSafe VPN firewall (93%) No exact OS matches for host (test conditions non-ideal). Network Distance: 1 hop Service Info: Device: router Obtaining the software There are probably many ways to obtain this software if you do a quick google search. So I'm providing links to the files needed to compile the program that worked for me. Code:
bt ~ # mkdir telnet bt ~ # cd telnet bt telnet # wget http://ktdreyer.googlepages.com/telnetenable.c bt telnet # wget http://ktdreyer.googlepages.com/md5.h bt telnet # wget http://ktdreyer.googlepages.com/md5.c bt telnet # wget http://ktdreyer.googlepages.com/blowfish.h bt telnet # wget http://ktdreyer.googlepages.com/blowfish.c We will use the gcc compiler to compile the telnetenable program. Make sure that you are running as root or that you compile it with root priviledges. Code:
bt telnet # gcc -o telnetenable md5.c blowfish.c telnetenable.c md5.c: In function 'MD5Update': md5.c:74: warning: incompatible implicit declaration of built-in function 'memmove' md5.c:77: warning: incompatible implicit declaration of built-in function 'memmove' md5.c:85: warning: incompatible implicit declaration of built-in function 'memmove' md5.c:92: warning: incompatible implicit declaration of built-in function 'memmove' md5.c: In function 'MD5Final': md5.c:112: warning: incompatible implicit declaration of built-in function 'memset' md5.c:118: warning: incompatible implicit declaration of built-in function 'memset' md5.c:128: warning: incompatible implicit declaration of built-in function 'memmove' md5.c:129: warning: incompatible implicit declaration of built-in function 'memset' telnetenable.c: In function 'usage': telnetenable.c:66: warning: incompatible implicit declaration of built-in function 'exit' telnetenable.c: In function 'EncodeString': telnetenable.c:94: warning: passing argument 2 of 'Blowfish_Encrypt' from incompatible pointer type telnetenable.c:94: warning: passing argument 3 of 'Blowfish_Encrypt' from incompatible pointer type When you look in the directory then you will find the new program called telnetenable. Code:
bt telnet # ls blowfish.c blowfish.h md5.c md5.h telnetenable* telnetenable.c Opening the connection The telnetenable program doesn't actually open up and communicate with the router by itself but instead makes a packet that is sent to the router via the netcat program. You can run the program with no variables with it so it will tell us what information we need to provide. Code:
bt telnet # ./telnetenable Version:0.1, 2006/06/22 Usage: ./telnetenable <host ip> <host mac> <user name> <password> Code:
bt telnet # ./telnetenable 192.168.1.1 AAAAAAAAAAAA Gearguy Geardog > modpkt.pkt bt telnet # nc 192.168.1.1 23 < modpkt.pkt So now that we have sent the packet to the router lets see if it worked. From here just telnet into the router. Code:
bt telnet # telnet 192.168.1.1 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'. Login: Gearguy Password: ******* U12H06400> Code:
U12H06400> help Commands are: bridge ddns exit ftpc ip lan nat passwd pot reboot save show sntp time uptime version wan web wla '..' return to previous directory U12H06400> exit Connection closed by foreign host. Caveats 1) Every time the router is rebooted or a setting is changed then the telnet session is open but not enabled. 2) If, for some reason, the telnetenable program doesn't work then the telnet port is completely disabled. You need to reboot the router to open the port and then try the telnetenable process again. This is what you will see if you try to telnet into the router after a failed netcat attempt. Code:
bt ~ # telnet 192.168.1.1 Trying 192.168.1.1... telnet: connect to address 192.168.1.1: Connection refused 4) If all fails then try using the windows version called "telnetEnable.exe" Last edited by larryhaja; 08-09-2008 at 01:24 PM. |
|
|||
|
hi...
How to telnet bt3? I mean from other pc to bt3. If using ubuntu i just installed telnetd, xinetd from command line apt-get install (XXXXX). But how about on bt3? what i need install to my bt3 and configuration? Can you help me and guide i be able telnet to bt3? Note: using telnet from bt3 to other pc it's working fine. I just want to know how do i telnet from other pc to bt3? Thanks. |
|
|||
|
Quote:
|
|
|||
|
Thanks for reply... so i need to use putty to connect bt3? how about other way? If using putty connect from local IP it's no problem, but how to connect if from WAN? I have been setting my router (Dynamic DNS) in D-link. Anything i need configure out to my bt3? I hope you can help me on this.
|
|
|||
|
Quote:
|
|
|||
|
I actually flashed both of my Linksys routers with dd-wrt which allows me to do all kind funky stuff with them (including telnet, ssh...) You should check their site and see if your router is supported...
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|