29 March 2013

374. Briefly: Evolution Mail on Debian Testing/Wheezy seems to have been improved

I switched to thunderbird about 6-12 months ago since I got fed up with certain issues, chief among which were:
* issues with syncing between google calendar and evolution calendar
* non-persistent calendar view -- back in the days you had the default calendar view, and that was that. You could change it temporarily, but it wouldn't persist between switching between mail and calendar.

Otherwise I've always found evolution 'prettier' than thunderbird, which gives me Eudora flashbacks, and works more seamlessly with PGP (thunderbird requires enigmail which works fine -- but it's still a plugin).

The only issue I've found so far was that I had to close and restart Evolution after adding my google calendar details before it would prompt me for the password and actually sync.

What I've noticed now:
* Calendar view (i.e. day/week/month) is persistent and remembers your preferences
* Sync between google and your local calendar works fine -- I had the appointment on my phone within a minute of entering it in Evolution
* The interface is cleaner, prettier (not sure whether anything has suffered from the deprecation syndrome most gnome-related software has been subject to recently)
* PGP required no set-up whatsoever -- an encrypted email was automatically decrypted without any set up at all. I'm not actually completely happy about that -- I'd prefer that to have been prompted for the password to unlock my key (I'd unlocked it for gajim a few hours earlier, and I guess it remained unlocked)

So while thunderbird has stood me well, I've historically been using Evolution since I switched to Linux (before that I used thunderbird on windows, and before that Pegasus Mail and Eudora) so I'm likely to switch back now that most of the things I were hung up on last time seem to have been fixed.

On the other hand, I'm noticing that I have to close and restart evolution any time I change account settings, which doesn't seem right, and which is fairly annoying.

28 March 2013

373. Cracking Windows passwords if you are a Linux user

Cracking windows passwords is no more difficult than any other set of passwords that need to be cracked via brute force/rainbow table lookup -- it's all about getting your hands on the right files to begin with.

Note that Vista and Windows 7 are the same in terms of how the passwords are stored. XP is different. You'll need to appropriate hash tables when cracking using Ophcrack-- you can't use XP hashes to crack Vista/7 and vice versa.

Why?
I actually have a fairly legit reason for this, other than pure curiosity: the professors and lecturers who have Win 7 at this Uni aren't given administrator access, so that they need to make an appointment with IT staff everytime they want to install or upgrade something. In my opinion, that's taking things way, way too far, especially in light of OSX user and Linux users don't face the same restrictions (I requested my computer to be delivered blank, so not even the IT staff can gain access without physically accessing my hdd).

I've also twice been in situations where a lab computer was set up by a PhD student who had since left, but without telling anyone the BIOS password in one case (remove CMOS battery, drain the power by shorting) and NT 4 password in another case (boot using linux, replace the screensaver file with cmd, boot, then wait and you've got admin access). Adding a few more techniques to your arsenal makes you a more well rounded human being. Plus you might gain a bit more respect from the students. Maybe.


Windows files that you need

You'll need to copy two files from your Windows harddrive (most likely o C:\). Since you can't access those files from within windows, the easiest way to do that is to make a bootable USB with linux on it, boot, then mount the windows partition and copy the files. It does require that you know how to mount devices from the command line in linux (hint: read up on mount) but it's really quite easy.

See here for how to make a linux usb install:
Arch: http://verahill.blogspot.com.au/2013/02/331-full-linux-install-on-usb-stick.html
Debian: http://verahill.blogspot.com.au/2013/03/361-installing-debian-on-usb-stick-from.html

On Windows Vista and Windows 7 you need to copy
/Windows/System32/config/SAM
/Windows/System32/config/SYSTEM.

On Windows XP you need to copy
/WINDOWS/system32/config/system
/WINDOWS/system32/config/SAM.


Generating input
First set up your linux system and install bkhive and samdump2. On Arch you can get these from the AUR (here and here), and on Debian you can install it from the repos by doing
sudo apt-get install bkhive samdump2

Once you have bkhive and samdump, do
bkhive system sys.out
samdump2 SAM sys.out > crack.list



Cracking
I prefer John the Ripper, but ophcrack is in the repos.

Ophcrack
Ophcrack is one alternative for which you can download rainbow tables, while John the Ripper can do it via password lists and brute force. You can get Ophcrack from the Debian repos as well as AUR in ARch.

To crack with Ophcrack you'll need tables -- you can get them from here: http://ophcrack.sourceforge.net/tables.php

Start with Xp Free Small or Vista Free, depending on whether you're going after XP or Vista/Windows 7 passwords. If your passwords still won't break, you can always get a bigger table. Put your tables in e.g. /tmp/crack/xp and /tmp/crack/vista

Do (for xp -- point towards /tmp/crack/vista for vista/windows 7)
ophcrack -n 6 -g -t /tmp/crack/xp -f crack.list

where -n 6 means to use 6 threads (use as many as you have cores). You can also launch ophcrack with a graphical user interface by simply typing ophcrack.

John the Ripper
On Arch you can get John the Ripper via the standard repos, and on Debian you can easily compile it.

You should get a good password list to guide your cracking -- rockyou is probably one of the best:
wget http://runamux.net/search/download/file/95wr2RdM/rockyoutxt.bz2
bunzip2 rockyoutxt.bz2

To crack XP passwords, run
john --wordlist=rockyoutxt --format=lm crack.list

To crack Vista or Windows 7 passwords, run
 john --wordlist=rockyoutxt --format=nt crack.list

If you have compiled john the ripper with mpi support, just launch it along the lines of
mpirun -n 6 john --wordlist=rockyoutxt --format=nt crack.list

There's no guarantee that you'll successfully crack all passwords -- it simply depends on 1) how common the passwords are or 2) whether they are short enough to brute force. I've used the methods above to crack passwords on a couple of machines (even virtual ones).

If you're really lazy and want a fully automated cracking experience, just use the ophcrack live cd. The downside is that you'll be occupying the machine which holds the windows installation until you're done cracking. With the method here you can crack at your leisure on your own windows machine.

372. Leadtek DTV1000S on Arch linux

While this DVB-T card seems to work fine out of the box on Arch linux (using kaffeine, gnome-dvb-setup, me-tv, w_scan etc.) it is quite unstable --  you often get 'failed to lock channel' errors, and the picture gets corrupted after watching the same channel too long (1 hour). . In contrast, I've been using it for over a year on Debian without issues, so I decided to have a quick look at what I did back in the days to get it working, and realised I'd been a bit lazy setting things up (i.e. I had treated it like PnP).


To improve the stabilit of Leadtek DTV 1000S on Arch linux, do the following:

1. Edit /etc/modprobe.d/modprobe.conf
options saa7134 tuner=48 card=175
2. Install the proper firmware driver
If you've noticed errors in dmesg/during boot-up relating to missing tda10048 firmware, install the dvb-fe-tda10048-1.0.fw firmware from AUR

wget https://aur.archlinux.org/packages/dv/dvb-fe-tda10048-1.0.fw/dvb-fe-tda10048-1.0.fw.tar.gz
tar xvf dvb-fe-tda10048-1.0.fw.tar.gz
cd dvb-fe-tda10048-1.0.fw
makepkg -s
sudo pacman -U dvb-fe-tda10048-1.0.fw-1-2-any.pkg.tar.xz