Sunday, 6 May 2012

Hacking WAG120N firmware - An interesting but rate article

I was researching more on this topic late last evening and found an interesting project work by Mr. Craig.
Since it is worth for many enthusiasts i am publishing as part of my WAG120N collection ofcourse with the permission of Mr. Craig.

Buy Linksys WAG120N from here


In this tutorial, we’ll be examining the firmware update file for the Linksys WAG120N with the intent of finding and extracting the kernel and file system from the firmware image. The firmware image used is for the WAG120N hardware version 1.0, firmware version 1.00.16 (ETSI) Annex B, released on 08/16/2010 and is currently available for download from the Linksys Web site.
The first thing to do with a firmware image is to run the Linux file utility against it to make sure it isn’t a standard archive or compressed file. You don’t want to sit down and start analyzing a firmware image only to realize later that it’s just a ZIP file:
OK, it’s nothing known to the file utility. Next, let’s do a hex dump and run strings on it:
Taking a look at the strings output, we see references to the U-Boot boot loader and the Linux kernel. This is encouraging, as it suggests that this device does in fact run Linux, and U-Boot is a very common and well documented boot loader:
However, taking a quick look at the hexdump doesn’t immediately reveal anything interesting:
So let’s run binwalk against the firmware image to see what it can identify for us. There are a lot of false positive matches (these will be addressed in the up-coming 0.3.0 release!), but there are a few results that stand out:
Binwalk has found two uImage headers (which is the header format used by U-Boot), each of which is immediately followed by an LZMA compressed file.
Binwalk breaks out most of the information contained in these uImage headers, including their descriptions: ‘u-boot image’ and ‘MIPS Linux-2.4.31′. It also shows the reported compression type of ‘lzma’. Since each uImage header is followed by LZMA compressed data, this information appears to be legitimate.
The LZMA files can be extracted with dd and then decompressed with the lzma utility. Don’t worry about specifying a size limit when running dd; any trailing garbage will be ignored by lzma during decompression:
We are now left with the decompressed files ‘uboot’ and ‘kernel’. Running strings against them confirms that they are in fact the U-Boot and Linux kernel images:
We’ve got the kernel and the boot loader images, now all that’s left is finding and extracting the file system. Since binwalk didn’t find any file systems that looked legitimate, we’re going to have to do some digging of our own.
Let’s run strings against the extracted Linux kernel and grep the output for any file system references; this might give us a hint as to what file system(s) we should be looking for:
Ah! SquashFS is a very common embedded file system. Although binwalk has several SquashFS signatures, it is not uncommon to find variations of the ‘sqsh’ magic string (which indicates the beginning of a SquashFS image), so what we may be looking for here is a non-standard SquashFS signature inside the firmware file.
So how do we find an unknown signature inside a 4MB binary file?
Different sections inside of firmware images are often aligned to a certain size. This often means that there will have to be some padding between sections, as the size of each section will almost certainly not fall exactly on this alignment boundary.
An easy way to find these padded sections is to search for lines in our hexdump output that start with an asterisk (‘*’). When hexdump sees the same bytes repeated many times, it simply replaces those bytes with an asterisk to indicate that the last line was repeated many times. A good place to start looking for a file system inside a firmware image is immediately after these padded sections of data, as the start of the file system will likely need to fall on one of these aligned boundaries.
There are a couple interesting sections that contain the string ‘sErCoMm’. This could be something, but given the small size of some of these sections and the fact that they don’t appear to have anything to do with SquashFS, it is unlikely:
There are some other sections as well, but again, these are very small, much too small to be a file system:
Then we come across this section, which has the string ‘sqlz’ :
The standard SquashFS image starts with ‘sqsh’, but we’ve already seen that the firmware developers have used LZMA compression elsewhere in this image. Also, most firmware that uses SquashFS tends to use LZMA compression instead of the standard zlib compression. So this signature could be a modified SquashFS signature that is a concatination of ‘sq’ (SQuashfs) and ‘lz’ (LZma). Let’s extract it with dd and take a look:
Of course, ‘sqlz’ is not a standard signature, so the file utility still doesn’t recognize our extracted data. Let’s try editing the ‘sqlz’ string to read ‘sqsh’:
Running file against our modified SquashFS image gives us much better results:
This definitely looks like a valid SquashFS image! But due to the LZMA compression and the older SquashFS version (2.1),  you won’t be able to extract any files from it using the standard SquashFS tools. However, using the unsquashfs-2.1 utility included in Jeremy Collake’s firmware mod kitworks perfectly:
Now that we know this works, we should go ahead and add this new signature to binwalk so that it will identify the ‘sqlz’ magic string in the future. Adding this new signature is as easy as opening binwalk’s magic file (/etc/binwalk/magic), copy/pasting the ‘sqsh’ signature and changing the ‘sqsh’ to ‘sqlz’:
Re-running binwalk against the original firmware image, we see that it now correctly identifies the SquashFS entry:
And there you have it. We successfully identified and extracted the boot loader, kernel and file system from this firmware image, plus we have a new SquashFS signature to boot!

How to Secure your wireless connection of Linksys WAG120N


We have seen that you can setup your wireless network by installing WAG120N in our previous post.

Now the important thing is to secure the network by following some simple but important steps.


Buy Linksys WAG120N from here


Wireless networks are convenient and easy to install, so homes with high-speed Internet access are adopting them at a rapid pace. Because wireless networking operates by sending information over radio waves, it can be more vulnerable to intruders than a traditional wired network. Like signals from your cellular or cordless phones, signals from your wireless network can also be intercepted. Since you cannot physically prevent someone from connecting to your wireless network, you need to take some additional steps to keep your network secure.

Wireless Secuirty mode: WEP


    Firmware Version:V1.00.11
WirelessWireless-N ADSL2+ Modem RouterWAG120N
Wireless
Basic Wireless Settings|Wireless Security  |Wireless MAC Filter|Advanced Wireless Settings
Wireless Security    Help...
Security Mode:

Encryption:
Passphrase:     
Key 1:
Key 2:
Key 3:
Key 4:
TX Key:
Cisco Logo


Wireless Security - WPA Personal

    Firmware Version:V1.00.11
WirelessWireless-N ADSL2+ Modem RouterWAG120N
Wireless
Basic Wireless Settings|Wireless Security  |Wireless MAC Filter|Advanced Wireless Settings
Wireless Security    Help...
Security Mode:

Encryption:
Pre-Shared Key:
Key Renewal: seconds
Cisco Logo





    Firmware Version:V1.00.11
SecurityWireless-N ADSL2+ Modem RouterWAG120N
Security
Firewall  |VPN Passthrough
Firewall   Help...
SPI Firewall Protection:EnableDisable
Cisco Logo

Filters
Filter Proxy Filter Cookies 
Filter Java Applets Filter ActiveX 

Block WAN Requests
Block Anonymous Internet Requests 

Saturday, 5 May 2012

Setup Linksys WAG 120N Modem Router from Cisco

This wireless-N router gives decent speed and performance for light internet usage. This is being rated as a good wireless router, though there are a few issues reported by some users with wi-fi connectivity getting lost, but is recoverable. Here we try to cover the WAG120N installation procedure, configuration and troubleshooting tips. We will keep updating this post with more information as and when available.



You can purchase the Linksys WAG120N from our online store at best price. Visit the following link for the latest price and more details of WAG120N in India:
Linksys WAG120N Installation
The Linksys WAG120N is very easy to install and use actually. You could get it working with most of the Internet Service providers – BSNL, Airtel,MTNL etc in a few steps within minutes. The easiest way to install this router is through the setup installation CD comes along with the package. However, you can install and configure this router without the installation CD as well. Installation of WAG120N using the CD is quite self explanatory. All you need to do is to place the Setup CD on to your deskopt/laptop and follow the simple step by step instructions (with pictures)  and it will be done in a few minutes, even for a novice user. Please be careful to follow the instructions exactly the same, else might get into some troubles.
To install the WAG120N without a CD, follow the steps below:
[NOTES: Before you start doing this - 1) Get a splitter if you want to connect your phone and pc at same time 2) Contact your service provider and get user name and password for your broadband subscription]
1) Remove existing ethernet connection of your computer to the modem [if you have one already]
2) Power down your computer [and modem if there is one]
3) Remove the dsl connection to your existing modem [if there is one] and connect it to the DSL port of WAG120N router. [NOTE: If you dont have a normal ADSL modem from the provider, mostly you will not have a splitter too. In that case, you need to get a splitter if you want to have your phone and PC connected at the same time. A splitter can be bought from the market within 200 INR approximately. We (NetNLap) would get you a splitter if you need one along with your WAG120N purchase]
4) Connect the Ethernet cable comes with the WAG120N to first Ethernet port on the router and the other end to your computer/laptop
5) Connect one end of the power adapter (of WAG120N router) to the router and other end to wall power socket
6) Power on your computer and the WAG120N router
7) Now check the the LEDs of WAG120N for Power, Wireless, and Ethernet. All should be lighted up. If not, make sure the Modem Router is powered on and the cables are securely connected.
8 If all the LEDs above mentioned are on, time to start the configuration :-) . Now open your web browser. Enter
http://192.168.1.1 in the web browser’s Address field and press Enter.
9) If the connections are right, you will get a login page asking for user name and password. Enter “admin” in both the User name and Password fields. Click OK.
10) Now the Basic Setup screen should appear. If not, you might have probably entered wrong user name and password or they are set incorrectly in the router somehow.  You may go ahead and do a hard reset of the router to get the user name password set to default – admin
11) Now you need to configure the settings required for your Internet Service Provider (Airtel,BSNL,MTNL etc) for the Encapsulation, Multiplexing, and Virtual Circuit (VPI and VCI) fields. These fields are essentially the configuration parameters required for the router to work properly. You could call the customer care of your Interet Service Provider to get these values. [However, we would provide you the most commonly used values by different Internet Service Providers in India as a reference.]. Following table lists the parameters for the various ISPs in India. Basically you need to se these values accordingly in different configuration places.
Source: Netnlap

If you need more detailed step follow the details and screen shots below

  1. Open a browser (Internet Exploreror, Mozilla Firefox etc.) and type http://192.168.1.1 in the address bar


  2. The browser should ask you for username and password, use username: admin and password: admin (these are the default for Linksys routers, refer to your manual if they don't work)

login screen screenshot

STEP 2: Configure the basic settings

  1. You should now see a interface that shows "Setup" at the top on the left Basic Setup.
  2. Fill in the following settings:
    • Encapsulation: RFC 2516 PPPoE
    • Multiplexing: LLC
    • Autodetect: Disabled
      • VPI: select from the table wrt to service provider
      • VCI: select from the table wrt to service provider
    • Username: Enter the username you've received from us.
    • Password: Enter the password you've received from us
    • Time Zone: (GMT+02:00) Harare, Pretoria
    • --Leave all other settings as per default--
  3. Click Save Settings to save all the settings.

settings screenshot

STEP 3: Configure Wireless settings

To disable wireless conectivity (do this if you will not be using wireless)
  1. Click on Wireless.
  2. Configure the following under Basic Wireless Settings
    • Wireless Network Mode: Disabled
  3. Click Save Settings to save the settings.

wireless disabled screenshot
To setup wireless connectivity
  1. Click on Wireless.
  2. Configure the following under Basic Wireless Settings
    • Name (SSID): Enter what you want to name your wireless network
    • --Leave the other settings are per default--
  3. Click Save Settings to save all the settings.

  4. securying wireless screenshot
  5. Click on Wireless Security.
  6. Under "Security Mode" select WAP2-Personal and the WPA2 menu will open up.
  7. Select 'TKIP or AES".
  8. Enter in a pre-shared key that you will remember so that you can put it in to any computers you wish to have connected wirelessly.
  9. Click Save Settings to save the settings.

wireless security settings screenshot

STEP 4: Check to see if you're connected

  1. On the top menu, click on "Status"
  2. 3 quick checks to see if you're successfully connected:
    • The internet light on the modem will be green.
    • It will read Connected next to Interface.
    • The connect button will be greyed out. (ie, You will be unable to click on it)
  3. If the disconnect button greyed out is click on connect. You may have to be patient, it will turn red if there is a problem.

step four screenshot

Friday, 4 May 2012

How to configure Linksys WAG120N updated

Cisco Linksys WAG120N is easily configured by the following steps


Buy Linksys WAG120N from here


BSNL internet. Here is the simple steps to do it:

1. Conect your LinkSys Router with a LAN cable to your system
2. Give static IP to your sytem in range of 192.168.1.x
3. Open IE and type 192.168.1.1
4. Username : admin, Password: admin(Default)
5. Goto Basic setup page




6. Select Encapsulation : RFC 2516 PPPoE
7. Multiplexing : LLC
8. Leave PCR and SCR as blank
9. Make Autodetect as disable
10. Under Virtual Circuit
        VPI: 0
        VCI:35
11.Under PPPoE settings
      User Name: your bsnl user id
      Password: your bsnl password
      Service Name: Dataone



Buy Linksys WAG120N from here