Wednesday, November 30, 2011

putty + screen = meant to be

I am getting used to the screen command for my Linux development environment and I find it to be a great tool for detaching and reattaching sessions - but that's just scratching the surface from what I see on the net. As there are many useful posts out there explaining why screen is something that you've been missing if you are working via putty, I will let them do the talking.

Introduction

A redhat magazine post

I am a newbie to screen and this is all that I have been doing:
  1. Open multiple putty sessions via Putty connection manager
  2. Foreach tabbed session I do a: $ screen -S session_name
  3. Code
  4. While leaving for the day, disconnect all sessions - I don't "exit"
  5. When I want to come back again - I open the tabs once again and reattach to previous session - I normally name my sessions "tab1", "tab2", etc. so reattaching is equivalent to: $screen -d -r tab1
All this is good enough. I had just one rant while using screen - I did not know how to scroll back. Say I run a find command and the output spews out to more than 80 lines - the size of my terminal window. If I am running in screen mode - by default I can scroll back only upto 100 lines. And then, this post came to my rescue:

Saturday, June 4, 2011

Stray thought

The difference between an average programmer and a good one is the same as the difference between an optometrist and an ophthalmologist.

Friday, June 3, 2011

The easiest way to recover admin password of BSNL ZTE DSL modem

In my previous post, I had described how to recover the admin password of your BSNL ZTE DSL modem, provided you have the modem configuration backed up.

But if you don't have the config file backed up - recovering the admin password is all the more easier. Read on to know more.

Model: BSNL Dataone ATE ZXDSL 531B modem.

This post shows how you can get the admin password of the modem without any backed up configuration. You just need to know the modem IP. Let me know if the link is broken - I will write a new post describing those steps.

If your modem/router's basic security is flawed to this extent, then deploying its in-built security measures is like trusting a visually impaired lame duck, one suffering from suicidal tendencies, arming it with banana skins, and telling yourself: "That ought to keep me safe from fire-breathing dragons and the 15 feet tall goblins who ride them!" (a justified exaggeration the "sitting duck" analogy).

Sunday, May 29, 2011

Recovering admin password of your modem from backed up configuration file

Model: BSNL Dataone ATE ZXDSL 531B modem. (Below points worth a shot for any other modem also)

Assumption: You have saved your modem settings locally on your machine. If not, don't be disheartened (Do slap yourself thrice though), this post will help you out.

If you don't know how to upload/save your modem/router's configuration file, read this.

I had forgotten the admin password and I didn't want to reset my modem. Just wanted to see if I could get any info from the configuration that I backed up.

I opened up the file and searched for the keyword "admin" and I came across this block:
<sysusername value="admin">
<syspassword value="YWRtaW5fcGFzc3dk">
Took a blind shot to see if it is a base64 encoding and <insert your jumping-with-surprise word here> it was base64 encoded!

Securing my DSL modem

I had a BSNL modem installed at my home quite some time ago. The guy who installed it did the minimal configuration - just enough to connect to the internet. He did nothing on the front of basic security - hiding the wireless network, changing the default password, etc.

As with all standard modems, this one had a web interface at http://192.168.1.1 The interface was easy to navigate and through it I hardened a few of the settings. I am going to share them in this post.

The security measures that I describe will be available on any standard DSL/ADSL modem. The UI navigation will vary across different models. But the ideas - like changing your modem's IP from 192.168.1.1 to some non-standard value e.g. 10.2.3.44 will stay the same.

The changes are limited by my own experience and I'd appreciate if you could share any other security measures that you took. If you are happy with the way things are going on - your wireless network is not hidden, your modem's IP is 192.168.1.1, default password is "admin" - stay happy and go back to watching that skating cat video on youtube, while I download the entire LOTR trilogy on your connection :). If you want to get your hands dirty and learn a few things in the process, read on.

The author is not responsible for temporary/permanent loss of internet connectivity or inadvertent establishment of communication with alien life forms resulting from the changes described in this post.

Modem: BSNL Dataone - ZTE - ZXDSL 531B

Before moving on to the changes, I'd recommend that if you are going to do them as you read this post, please read the whole post first. And the changes don't come into effect until you save them or in some other cases restart the modem (changing the modem IP for instance). So if you want to experiment with the changes, do them one at a time - change the config, save it, check it and move on. Doing multiple changes and not knowing what went wrong is not worth the debugging time. You can also keep on saving changes as you move through the post, creating snapshots of the configuration file.

The first thing to do before messing around with any settings is to insure yourself against the destructive streak of the geek in you - the one which prods you with the "Go on, try it out, let's see if it blows anything up" thought. Hence I backed up the minimal configuration that was done by the BSNL guy.