Matt-J.co.uk : Ramblings

Life, Tech and intravenous caffeine.

Windows local user password reset

Hi all, Just a quick update.

I’m sure we are all farmilliar with the Windows NT Password offline editor? (if not http://home.eunet.no/pnordahl/ntpasswd/ )
It provides a bootable environment based on chntpw to change or blank any 2000/XP/2003/Vista local users password, very useful for lost accounts.
However, while playing around I was wondering how easy it would be to get a copy of the users original hash first, so it can be put back in place after you have reset the password, allowing you to cover your tracks (Not having to hastle users to set a new password is always a good thing!)..

Turns out windows does no checks on the file properties of the ‘SAM’ account manager registry hive, so;

  • boot into some form of linux with NTFS-3G (NTFS Read/Write support), copy SYSDRIVE:/Windows/System32/Config/SAM to SAM.Bak.
  • Go ahead with your chntpw based password reset (may as well use the raw chntpw tool since you are already in linux, however nothing wrong with shutting down and booting into the NTPWRS bootable cd (as the SAM.Bak file was saved on the actual drive).
  • Reset the users password of your choice and do whatever needs to be done…
  • When finished, boot back into Linux with NTFS R/W support and move SAM.Bak back to SAM, overwriting the current ‘SAM’ file.

Thats it, passwords for all users back to what they were.

This isn’t anything new, or actually that exciting, but it’s something not really mentioned around the NTPWRS/chntpw pages and I thaught it could come in useful to know it works :)

Right, onto the real point of my messing around, I want to be able to do the same for active directory;
So far it looks like I have hit a deadend trying to access the AD DB itself while the system is live, user passwords are stored in a ‘UnicodePWD’ class inside the users object which is a ‘write only’ field. I have a few more idea’s on how to get this, and then putting the hash back whenever required is very easy indeed :)

More later.

//Matt

No comments

DSSS in 802.11b/g networks

The other day I cleared up something that has been confusing my brain for ages! (whether anyone else cares is another matter but anyway :P)

I could not understand why WIFI sniffing tools such as kismet were able to collect all data from clients on a given channel when the underlying multiplexing technology was direct sequence spread spectrum. DSSS (Basic overview: http://en.wikipedia.org/wiki/Direct-sequence_spread_spectrum) allows multiple clients to transmit simultaneously on the same frequency by multiplying a pseudorandom ‘chipping code’ of 1’s 0’s and -1’s to the data before transmission. The receiver can then use the code for that client to pick out the clients data from the other noise on that frequency range. The data can even be received if the clients signal is at a lower power than the noise floor.

It is this technology that is used in 3G UMTS systems to allow multiple mobile phones within the same cell area to all upload data (and download, because downloads still require ACK’s) at much faster speeds to GSM (GSM uses traditional frequency and time division multiplexing techniques to ’slice’ up the available bandwidth and hand it out to clients (as without DSSS only one client can transmit on a certain frequency at a certain time))

So that’s the overview, this was my puzzle, if DSSS is being used on a wireless network, each client has a chipping code in line with how DSSS works. This would mean that traffic from laptop A would be sent to the access point multiplied by a pseudo-random number that only itself and the access point knew. Making it impossible for me, laptop B to sniff laptop A’s data, as I do not have the same chipping code and would therefore not decode laptop A’s transmission properly, therefore, DSSS would provide some rudimentary encryption just because of how it operates.

However, from sniffing wireless LAN’s with kismet, I KNOW this not to be the case, I can recover another wireless clients data very easily and from the collected data I can resemble full TCP streams, so I am definitely receiving all the traffic to/from that client.

The reason?
The IEEE’s use of DSSS for 802.11b/g is not how DSSS is ‘usually’ used. They have used DSSS for some of it’s other properties and not for it’s simultaneous client transmit ability (probably due to power/cost issues in full on DSSS decoding requirements and that broadcast traffic would have to be encoded with each clients chipping code).
Therefore, the 802.11b standard (I believe, I am trying to find it) actually specifies the chipping code to be used by all 802.11b compatible kit. This standard means that WIFI is still a ‘One person transmitting at a time’ medium (as everyone is using the same code so it offers no way to differentiate between simultaneous transmissions) and because of this CSMA/CA (carrier sense multiple access with collision avoidance) is used along with RTS/CTS (request to send/clear to send) management frames to ensure that only one client is transmitting at a time.
This single hardcoded chipping code also explains why kismet is able to sniff all traffic on a WIFI network, even though DSSS is in use!

Hope this helps someone else’s brain take a few hours off too :) or at least got someone interested in low level network tech :)

//Matt

1 comment

Acer aspire one with ubuntu 8.10

Hi all,

Very long time without a post, but hopefully that will now change as I have much technical bodgery planned.
Anyway, without going to current life goings-ons too much, I am currently in the middle of my first semester of the final year computer networks BsC, My final year project submission has been approved (more on that kettle of fish in another post) and I am working two days a week for a local outsourced IT firm.

Onto the main reason of the post.. Toys! I am now the proud owner of an acer aspire one ‘netbook’. Tiny little laptop powered by an Intel atom processor. It ships with it’s own small linux distribution, however this did not even get a chance before it got ripped off and replaced with ubuntu 8.10 (first boot :) )

Acer Aspire One: http://www.acer.com/aspireone/
Intel Atom: http://www.intel.com/technology/atom/index.htm
Ubuntu 8.10: http://www.ubuntu.com/
Performance Improvement for ubuntu on Aspire One: https://help.ubuntu.com/community/AspireOne

Anyway, this combination is awsome! The ease of use of ubuntu for day to day use, combined with the fact it’s still Linux for advanced hacking when needed, all in a tiny laptop package which makes it portable enough to throw in your bag and have it with you anywhere.

The default 802.11a/b/g card is an internal atheros miniPCI card as well, which means using the madwifi drivers the laptop supports wireless packet injection out of the box :)

There is however one issue I have had, and that is that wifi was broken after a suspend/resume (suspend/resume is damn fast). After a little playing around I have managed to fix this, my solution is below:

The solution is to unload the madwifi drivers on suspend, and reload them on resume.
you can do this manually after resuming by running the following commands as root:

/usr/local/bin/madwifi-unload
/sbin/modprobe ath_pci

This unloads all madwifi kernel modules, and then loads them again. The wifi should spring back into life.
However, this is nasty, so the following script will run these commands for you on suspend/resume:

Create a new file in /usr/lib/pm-utils/sleep.d called ‘06acerwifi’.
Chmod this to 755, and place the following into it:


#!/bin/sh
#

. "${PM_FUNCTIONS}"

unload_madwifi()
{
/usr/local/bin/madwifi-unload > /dev/null
}

load_madwifi()
{
/sbin/modprobe ath_pci > /dev/null
}

case "$1" in
hibernate|suspend)
unload_madwifi
;;
thaw|resume)
load_madwifi
;;
*) exit $NA
;;
esac

Hope this helps someone!
//Matt

2 comments

Zero to ‘Giving IT guys a bad name’ in one commercial

*Rant Warning*

Since moving into my new house last week, I have been spending a fair amount of time in the lounge, on the questionably comfy sofa’s in front of the TV with my laptop, and today, between the countless (but enjoyable nevertheless) reruns of Top Gear on Dave, something irritated me.

The same thing then irritated me on another channel, same irritation, different company. Then again, on the same channel, but again a different company!

And this irritation is:
‘Come train to be an IT/Networking expert and make lots of money, you don’t need any previous experience and you could be trained and working as a system admin/network admin/IT consultant within months’

If you have seen these adverts, you will probably know what I mean, but if not allow me to explain my annoyance:
It’s not really the fact they are herding people by the masses into an already crowded industry (although that is quite annoying)…

It’s the people they are bringing in ‘No previous experience required’, ‘Qualified within a few months’. Some of the Jobs they are suggesting these people move into would make me question weather I knew enough to fulfill the role and yet, I have had a real interest in IT since as long as I can remember, have spend countless days researching and tinkering with technologies just because I wanted to understand them and better my knowledge in my chosen field;

Yet these people are expected to gain knowledge amounting to years of reading and practice, countless weeks of late nights trying to get something to work not to mention years spent honeing linux and networking skills, and be unleashed onto some poor company as their computing saviour within months??

No wonder the ‘IT Department’ has such a globally bad and unappreciated reputation.
So thanks, overadvertised ‘We’ll Take anyone’ IT training companies, thanks for lowering the worth and reputation of IT roles accross the industry.. Tossers.

</Rant>

3 comments

Life updates and blog directions

Evening all,

Over a month since my last post, and a lot has happened; however, There is a simple reason why I have not posted for so long;

This was always meant to be a technical blog, covering cool stuff I have been working with or pondering, or a place to write down reminders of how to config something, more of a random splattering of technical know-how more than anything. I don’t want it to become an oh-so common blurb of personal life crap, where I am, why I am there, what I ate for breakfast, with little or no juicy tech.

I don’t have time to be keeping that kind of blog and so, If I have nothing particularly blog worthy, I won’t just be posting for the hell of it to keep my post count up.
There will always be a couple of life related posts that slip through, and so I will be tagging all past and future posts with (at least) ‘tech’ or ‘life’ to allow readers to filter out what they do not want :)

So now, to a very short update to bring us into the present.

Well, I have left Sun Microsystems, my placement ended and I moved out of our amazing house and back to the more livley north :) Once again a big thanks to everyone at Sun, truly amazing people to work with and I have gained so much hands on experience with more cool equipment than you could shake a reasonable sized datacenter at.

I spent two weeks back living back home with my parents, catching up was nice (so was not cooking my own meals every night or doing all my washing :) ). Saw a few freinds from home and enjoyed a few visits to the pub.

Then another move, this time to my new house share in salford, for the final year of my degree. So after two house moves in two weeks, I have now been in my new uni house for a week, finally got everything unpacked, set up and the house is looking pretty good. I’m living with Martin Dave and Sam from uni, so it will be good to chill out with those guys again over a good few beers.

This year promises much more technical bloggery I feel, you should see the house networking config already!

Anyway, so right now, I’m in my new house, and currently trying to find a new job for the year, if anyone know’s of an ISP that needs someone to play with BGP4+ for a year (for a decent wage ;P) let me know ;)

Thanks for still reading after such a drought of input ;P

//Matt

No comments

GM Bugs create crude oil

Through the miracles of Slashdot I noticed this today:

http://www.timesonline.co.uk/tol/news/environment/article4133668.ece

If it works (and it looks like it does) this could be such good news longterm for our stupid petrol prices…
..Or maybe that’s just me being a temporary idealist, and the government will use this as an excuse to up the duty ;)

//Matt

4 comments

RHCE Certification

RHCE

Hello hello,
Long time since my last real post, but things have been busy.
Coming to my last few weeks at Sun now and hoping that I can continue my employment with them while at university next year through the campus ambassador scheme.

In more current news, for my final training course with Sun, I was allowed to take the fasttrack red hat certified engineer course (RH300) which was taking place on King William St. in London (Between monument and bank tube stations)

The week was very fast paced, offering more of a quick overview of things we should already know and a brief recap of the more advanced topics rather than an in depth course. This was understandable, as we had to cram everything from redhat network installs, user management, to advanced services and security into four days and on the fifth, we sat the 5 1/2 hr practical RHCE exam.

Commuting was tiring, I was up at 6.00am to get the train for 7 into waterloo, then the tube to bank (or to Westminster then the district line to monument). Strange as it seems I actually enjoyed getting up early and heading into London, it’s just an excellent atmosphere to work in, much more going on than where I usually am.

Met some cool people on the course, all from businesses around the city so it was good to find out what kind of jobs are available and what skill sets are actually in use / in demand (It seems RHCE is right up there).

On the Wednesday night a few of us (including our instructor Joe) went for a pint or six after the course which was a nice break from the constant routine of the rest of the week, a really good night seemed to be had by all and some damn good london pride was consumed (We actually drank them out of the stuff, and moved on to deuchars IPA which was quite nice)



The exam was intense to say the least, Five and a half hours in total. I can’t say much about the exam itself as we had to sign an NDA before taking the exam. I can now see why it is such a highly regarded cert.

The good news, I passed! Got my results e-mailed to me last night at 12.30AM (Marked over in America) and so I am now a verified RHCE:

http://www.redhat.com/training/certification/verify/?rhce_cert_display:certno=805008937032235&rhce_cert_display:verify_cb=Verify

Overall, an excellent week, I have learn’t a lot, had fun, met some cool people and really enjoyed working in the center of London.

Good luck to all those who are going to retake the exam, and well done to those who passed :)

//Matt

1 comment

Website Downtime

Hello there!

Some interesting news, this website is being dDoS’d by some internet tosspot somewhere and has been up and down like a yoyo for the past few days. As it is not a continuous attack, it is a little harder to track and work out an exact pattern/root cause, that we could thenĀ  use to work at trying to reduce the affect on the website.

Mail services are also down/slow due to the load averages on the server during an attack (Great excuse if I have not got round to replying to anyones e-mails :P)

In the meantime, A read only copy of the website will be appearing at www3.matt-j.co.uk.

When this is sorted, I may get round to a real post :P

Ps, I’ma get you!

//Matt

No comments

PulseAudio and Ubuntu 8.04

Evening people!

I have been running ubuntu 8.04 on my main system since the alpha releases (And what a stable alpha it was to be fair). It was quite fun to watch your OS develop around you day by day, with sometimes hundreds of package updates from one day to the next..

Anyway, today is the day, Ubuntu 8.04 has been released, and since I had no new packages to install (Running on the dev update repository had already updated me last night :P) I decided to have a quick look into one feature I really like in 8.04, PulseAudio.

PulseAudio is a new sound management layer For linux, It sits above the physical sound card and alsa driver, but below the high end codec stacks such as gstreamer, it replaces (in the case of a gnome system) the englightened sound daemon (ESD) and so any app that uses ESD (most) will automatically get routed through PulseAudio without knowing.

Pulse audio then allows some very cool new features, which has been holding the audio side of linux back for a long time.

For example, you can: (and I must mention, VERY easily)

  • Control each program’s sound output (volume / route) individually
  • Move audio to a different output card without having to stop / re-open the application.
  • Duplicate audio out of numerous soundcards
  • Even send a particular audio stream to another machine running pulse audio on your network with two clicks of a mouse.

All in all, very impressive. Ubuntu uses PulseAudio as default in 8.04, so not much to do on the setup side, you will however, want to apt-get ‘paman’ ‘paprefs’ ‘pavucontrol’ and ‘pavumeter’:

sudo apt-get install paman paprefs pavucontrol pavumeter

This will give you some decent gui’s to control these pulseaudio advance features (like re-routing audio streams and controlling volume levels per application).

(Before the ‘ewww… GUI’s’ argument starts.. this is meant to be a DESKTOP system remember!)

Anyway.. does it work… Damn right it does, here is a screenshot of pulseaudio instantly detecting three different audio streams and what applications they are from, and letting me control the volumes of each independently.

PulseAudio rocks!

(click for larger image)

Next task on the list is moving audio streams from one desktop to another on the same network, the pulseaudio servers can be setup to detect each other in paprefs.. I doubt this is going to take very long or be very hard! Rock on!

//Matt

EDIT: plugged USB headset in, right-clicked an audio stream in pavucontrol, and clicked the USB soundcard. Instantly audio came to my headphone and not a bean to the speakers. Then I tried ’simultanious output’ and this worked perfectly too, allowing volume control over the master streams and each substream (one too each output device)

EDIT2: Installed paprefs and pavucontrol on laptop (also running ubuntu 8.04) (Still one of the beta builds… and it’s fixed my laptops suspend to RAM too!!) and ticked ‘make devices network descoverable’ in paprefs…. I now have a movie on my desktop playing through my laptop speakers… and a IP radio station on my laptop playing through my desktop..

No Typing ip addresses, no specifying soundcard port numbers for the sound daemon.. just works!
I’m a *little* paranoid when it comes to net security, so I have my own subnet.. so in this case i’m happy for the sound server to be open.. but looks like it supports auth too!

This is seriously good stuff!

//Matt

2 comments

Sun Spots!

A while ago, our boss Paul ordered some ‘Sun Spots’, Tiny little programmable devices running java off a 180Mhz ARM Processor with 4M of flash memory.

They arrived today! and are damn cool! None of us have had a real play with them yet, but it seems you get two full sun spots in one pack, with one ‘base station’ which is basically a sunspot without the top layer of sensors (just the USB port, processor, memory and radio equipment) and can be used to wirelessly control / interact with the other two.

They use IEEE 802.15.4 (2.4Ghz Unlicensed band) as the radio comms link.

The default sunspot’s come built with:

* 2G/6G 3-axis accelerometer
* Temperature sensor
* Light sensor
* 8 tri-color LEDs
* 6 analog inputs
* 2 momentary switches
* 5 general purpose I/O pins
* 4 high current output pins

I have been looking for a way to control the server’s I am going to have to put into the universities data center for my final project next year (As I pretty much need to simulate a whole enterprise network using VM’s) and so these will be perfect!
As I can:
Monitor the server temperature
Have some basic tamper detection via the accelerometer
Use the general purpose IO pins for power on/off/reset of the servers

I also wonder whether I could use the I/O pins to create a serial port via the sunspot for console…

And hopefully all wirelessly with the ‘base station’ on a management host on the other side of the room!

Coding java suddenly became fun :P

//Matt

2 comments

Next Page »

Mexico