Saturday, October 3, 2009

Windows NT/2000 password recovery


I've found two options for cracking Windows 2000 passwords (this probably still works for XP and maybe even Vista).

The first is to buy LockSmith and NTRecover from Wininternal, these cost a hell of a lot (about 200quid I think). They will however almost definitely work as the people who write them really know their stuff.

The second (cheaper option) is to use a free program that's available on the web (http://home.eunet.no/~pnordahl/ntpasswd/). I've saved many systems using this but comes with no guarantees.

The required files are available on the above website, with local copies below. Download them into a directory on your computer and then from the commandline do the following:

C:
CD C:\
rawrite2

When prompted for the disk image source file name enter "bd010114.bin" the target drive will of course be A:. Insert a disc and the program should create you a bootable floppy which is able to reset the Administrator password.

When you boot from this disc on the workstation you are cracking you should be able to accept the defaults for most of the options. You probably won't need to probe for SCSI devices, and you need to answer yes when prompted to write the SAM.
bd010114.bin
rawrite2.exe

Internet Explorer and Acrobat print incorrectly. But Word and notepad do.

Symptoms

You can print from Microsoft Word and notepad correctly, but when you try printing from Internet explorer you get an error message similar to:

Line: 539
Char: 2
Error: Invalid argument.
Code: 0 URL: res://C:\WINDOWS\SYSTEM\SHDOCLC.DLL/preview.dlg

You may also (or possibly only) find that documents in Adobe Acrobat don't print correctly (words run into each other etc). The printer you're trying to print to is an HP printer.

Solution
These errors most commonly occur with HP printers, usually they are down to the PCL 6 driver that is supplied with the printer. Your best option is to download a PCL 5e, or PS driver from the HP website.

Appariently the Internet Explorer problem can also be caused by a faultly DLL (although I haven't come across this), details are available at: http://support.microsoft.com/support/kb/articles/Q293/1/76.ASP

Network configuration for older brother (1260/1660) printers/Emulex configuration

I just rediscovered the internet archive backup of a website I had back in the 2000 odd. Most of the stuff from there is old and no longer relevant but may just be of some use to someone.

Network configuration for older brother (1260/1660) printers/Emulex configuration

Step 0 resets the card, you can probably skip this for a new card.

0. Remove the Emulex NetJet card from the printer.
0.1 Set Jumper JX1 to the 1-2 position (nearest the connector).
0.2 Put the card back in the printer and switch it on for 30 seconds.
0.3 Switch the printer off and remove the card.
0.4 Set JX1 to 2-3 and put the card back in the printer.
0.5 Switch the printer on.
1. Make a note of the MAC address of the printer (writen on the back of the NetJet card).
2. At a cmd prompt on the workstation type:
"arp -s ipaddress mac" for example: "arp -s 192.168.3.50 00-00-c9-09-22-67". Telnet to the printer
4. Enter the default password which is "access"
5. Type "su", when prompted for a password type "system"
6. You should now have a "Server>>" prompt.
7. Type "define subnet yoursubnet" to set the subnet.
8. Type "define node ip your_ip" to set the ip address. for example "define node ip 192.168.3.50"
9. Type "logout".
10. You should now be able to ping the printer from any workstation on the network.
11. You'll need to setup an LPR port on the server to connect to the printer, under Windows NT4/2000 use generic LPR.
12. The queue name will be "PASSTHRU", and protocol should be LPR not RAW.

A short script to move files out of the way retaining full path

Find all files named *.fast4 under the current directory. Create replicate the path under ./obsolete and copy the file to the associated location. This script creates the required commands in a file called "moveobsolete" which you can then check over and execute.

find . -name "*.fast4" > obsoletefiles
awk '{print "mkdir -p ./obsolete/`dirname "$1"`; mv " $0 " ./obsolete/" $0}' obsoletefiles > moveobsolete
chmod 777 moveobsolete

Sunday, September 27, 2009

Rename files matching given spec to incrementing filenames

This one liner renames all files starting with shred_ to shred_0.tif, shred_1.tif etc.

ls shred_* | awk 'BEGIN{n=0;}{print "mv " $0 " shred_" n ".tif"; n++;}' | sh

Wednesday, September 23, 2009

My .mailcap

Used with mutt to view gifs and jpegs as ascii graphics!!!! requires aview package on ubuntu/debian:

image/gif; asciiview '%s'
image/png; asciiview '%s'
image/jpg; asciiview '%s'
image/jpeg; asciiview '%s'



Robbed off some random place on the internets.

Tuesday, September 22, 2009

Simple pysam example

This python code uses pysam to parse a bam file and print out all the alignment contained therein.

import pysam

# Open our sam file
samfile = pysam.Samfile()
samfile.open( "sim.bam", "rb" )

# Grab an alignment from the sam file

def m_fetch_callback( alignment ):
print str(alignment)

num_targets = samfile.getNumTargets()

for n in xrange(num_targets):
samfile.fetch(samfile.getTarget(n),m_fetch_callback)