A night out with a couple of friends.

Mid-terms are finally over. I would rather you not ask how the last paper went, ’cause what you’ll hear coming out of my mouth won’t be anything short of a nice expletive. Heh.

A whole week for an insignificant mid-term is stretching it too bloody far. A couple of friends have decided to have dinner at some eatery of their choosing tonight. They offered me to come and join them, and, feeling frustrated myself, I accepted their offer. Besides, I will get a chance that way to see the city during night time, a scene I so enjoy observing and yet rarely if ever get the chance to savour.

See you tonight!

Perl quickie!

Junjun, this Perl quickie is for you! Enjoy!

#!/usr/bin/perl
# tr.pl: Implements encryption and decryption using the lame 1-letter forward
# substitution technique.
#
# Copyrights (C) 2005 Ayaz Ahmed Khan
#
# usage: perl tr.pl -e "plain-text"
# perl tr.pl "cipher"
#

## __CODE STARTS __
sub decrypt {
$_ = shift;
$_ =~ tr/a-zA-Z/b-zaB-ZA/;

print "$_ \n";
}

sub encrypt {
$_ = shift;
$_ =~ tr/a-zA-Z/za-yZA-Y/;

print "$_ \n";
}

sub usage {
print qq{Copyrights (C) 2005 Ayaz Ahmed Khan.
This is free software with ABSOLUTELY NO WARRANTY.

usage: $0 [OPTIONS] "PLAIN-TEXT/CIPHER"
-e Enable encryption mode.
-h Display help menu.

};
exit 0;
}

sub main {
if ($ARGV[0] eq "-h") {
usage;
}
elsif ($ARGV[0] eq "-e" || $ARGV[0] eq "-E") {
$_ = shift @ARGV;
decrypt @ARGV;
}
else {
encrypt @ARGV;
}
}

usage unless defined @ARGV;
main;

Dumped Xfce in favour of KDE.

Um, one last post before I disappear. ;-)

Xfce crapped out on me, again. As much as I like using it, I had to dump it. And, dump I did. After what has been a decade, I am back to using KDE. It is still v3.1 on my laptop, but it will do.

Disappearing for a brief period of time!

Mid-terms start from Monday and will last till Friday of the same week. Unlike other mid-terms, where I would prepare for the papers while sitting next to the laptop connected to the Internet, I have decided this time I will stay away from the Internet throughout the whole mid-terms.

My next blog, then, will most probably come next Friday. Until then, bah-bye!

No studies?

I have decided to drop my job. I hadn’t realised, but in hindsight, it seems a part-time job will severely affect my studies, leaving me with no time to do my personal research and book reading and stuff. Farheen and a couple of other folks did advise me the same thing. I guess I should’ve listened. Oh, well!

Money is good, no doubt, but, then again, money has never been on top of my priority list.

Mid-terms are starting from Monday, next week, so I’d better start studying for them.

Mom and Dad’s wedding anniversary.

18 September was mom and dad’s wedding anniversary. I got to know in the morning when dad mentioned it over the breakfast table.

Farheen insisted I give them a wedding anniversary present. I didn’t really know what. The day passed on and it was decided that everyone will go out for dinner that night to some nice restaurant. Mom wanted to try Chinese, as it had been ages since we last had it. Dad picked a decent Chinese eatery situated in Tariq Road. As I was getting ready to leave, I remembered what Farheen had been nudging me to do in the morning. Quickly, I made up a quick plan, got ready and jumped into the car.

The food was good and quite heavy. When the bill came in, and before dad could take out his wallet, I instantly took out mine and put the money on the bill. “Mom, dad, that’s my wedding anniversary gift for you guys. Happy wedding anniversary.” Dad wouldn’t let me pay, but, well, I made him accept it. Heh.

It was a nice night out. It had really been ages since we last went out together.

Work, at last!

Contracted a part-time job today. I trust a job will keep me busy with and my mind focused at things I love doing the most.

Sadly, University life is getting lonelier day after another. Everything, except for the things I love doing, just seems pointless these days.

Python!

I started reading the book Dive Into Python yesterday. I figured I already know Perl and a little bit of PHP, why not give Python a try.

So far, my impressions of it are along the lines of a very carefully designed and clean language.

‘nother boring day at the campus.

University sucked twice as ever today. I nearly dosed off in two lectures. ;P

Coincidentally, the system in the computer laboratory in the engineering block in front of which I sat had only RedHat Linux installed. On top of that, it had a CD-ROM too, seeing as no other system in the whole laboratory has any. On top top of that, I had my handy Whoppix CD with me, and, on top top top of that, the system booted Whoppix fine (except for the humongous resolution), seeing as most other systems in other computer laboratories flat-out refuse to boot any Live-CD. :) Consequently, the next half an hour I spent in the laboratory using Whoppix on that system went exceptionally great. As for what I did, that is a secret.

Did I mention University sucked today?

Bunk, again?

And, oh, yea! I bunked University today. And, trust me, I don’t feel even a bit of remorse for it. I only wish University wasn’t this boring. Oh, well!

Running an NIDS on the box: Snort

Snort is an open source Network Intrusion Detection System (NIDS).

Knowing well how to use snort as both a straight packet sniffer and packet logger, I had always desired to learn to use it as a network intrusion detection system. Today, I learned how to do that too.

I modified the /etc/rc.d/rc.snortd file to include a simple BASH construct

if [ "`/sbin/ifconfig ppp0 2> /dev/null`" ]; then
IFACE=ppp0
else
IFACE=eth0
fi

to automate choosing of which interface to listen to, depending on the availability of a Point-to-Point link, as I use a dial-up link only to get online.

Now, all I have to do is to execute /etc/rc.d/rc.snortd with the “start” or “restart” argument, and snort goes up automatically, listening as an NIDS.

It is actually kinda’ cool, seeing as snort has already flagged some 20+ various intrustion attempts. ;-p

Bunk, bunk! Hot, hot!

Heh. I bunked nearly two lectures today to complete an assignment which I ought to have done the day before.

It was miserably hot today. I was literally soaking in sweat in the point-bus on way to the University in the morning. It got worse on reaching the campus — no electricity. Although we have got back-up generators, someone forgot to put fans in the entire engineering block when it was being built. Silly, I know, but it is true. Rooms in the engineering block have air conditioners only — no fans. When the electricity goes out and the generators come up, only the tube-lights work. :(

Who 0wn3d my b0x? Capture the Flag Contest at GameHack 2005.

Jahanzaib and I had designed a game-plan for the Capture the Flag (CtF) contest to be held at GameHack 2005. It had taken us 6+ hours to hack out a somewhat ingenious plan on paper. We both spent an evening, a complete night, morning and some part of an afternoon without an iota of rest and sleep to implement it.

CtF started around about half past two yesterday in Pearl Continental’s Neelum Hall. Seven teams participated in the contest, most of which brought along their own equipment.

The game kicked off at around 2:45 and lasted some 6+ hours. We had a winner by the end of the night, but the contest, per se, was a rattler.

While some of the teams, admittedly, had what we would call the brains and employed really ingenious tricks to work around different levels, without the various hints given and ad hoc changes made in between the game, I doubt they would have got to the end.

Our servers were running on two HP laptops over VMware. Except for a mere 15 minutes a couple of times, neither Jahanziab nor I had to oversee and attend to any of the two servers.

All in all, we had a great game. It had password cracking in it, packet sniffing, remote root buffer overflow exploting, local user privilege escalation exploiting, very basic cipher cracking, etc.

Both the teams and the admins had a wonderful time.