First of all, only test this stuff on spare, unimportant partitions. I warned you!!!

Perl's not really suited to low-level stuff, except maybe for the regexing of the binary data you pump out. I know an old trick to read a bios is to use dd (on linux)

dd if=/dev/mem bs=32k skip=31 count=1 | strings -n 10 | grep -i bios
You probably can use this same technique on raw disks, like
dd if=/dev/hdb0 | strings -n 10 | grep -i secretkey
To put it in Perl, you probably can run it thru a piped open, and regex the output
my $pid = open(FH, " dd if=/dev/hdb0 | ") or die "$!\n"; while( my $rrv = sysread( FH, my $buf, 1012 ) ){ #regex your $buf here for whatever #of course you will have to worry about missing full strings #on your chunk boundaries, so you may need to save a few #hunderd bytes of each $buf to add to the next one }

I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re: disk image forensics by zentara
in thread disk image forensics by cutlass2006

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.