1

I have a friend's HDD which has crashed due to a virus, at least he thinks.

The HDD's C:\ partition shows up as unformatted/raw, D:\ is fine and has no problems. The HDD is from a Windows 7 machine and is currently sitting in a USB docking station, it is a WD Caviar Blue SATA drive.

Using Partition Find and Mount I can mount the drive and browse all directories not protected by the User Profile. The User Profile is set so that the file it contains cannot be accessed.

What can I do to fix this problem? I'd prefer fixing the partition so that the HDD can be reinserted into its machine and run as it should. However, if this is not possible, is there a way to bypass this encryption and access the data?

4
  • User partition is using EFS encryption? Or is it just a permissions issue? This is a really important distinction because it controls what you must do. The most likely cause of your issue is simple permissions. You can work around these by simply mounting the drive under Linux. If the User subfolders have been actually encrypted by EFS then you'll need to do quite a bit more difficult work. Jun 23, 2012 at 7:34
  • I can't answer that question, I'm not familiar with how encryption works and the owner hasn't a clue at all about anything. All I can tell you is that it is Win7 on an NTFS partition and that the user profile was protected so that files can't be viewed by other users. Jun 23, 2012 at 11:16
  • 1
    If that's all then you just need to bypass the permissions, easiest way to do this is by mounting the partition under Linux. Jun 24, 2012 at 2:33
  • True, that would probably give me access to the files, if the drive can be mounted. I tried mounting it a my Mac and it wouldn't work. It's only the Partition Find and Mount that has given any kind of access. I'm using GetDataBack for NTFS to do a recovery of the data, it's been running for over 24 hours now and still hasn't finished the scan. What I really want is to be able to fix the drive so that it will work and windows will boot. Jun 24, 2012 at 14:22

1 Answer 1

0

Ok, it sounds like you have a corrupted MFT. On most hard drives the first NTFS partition begins on either sector 63 or sector 2048. Because you have a problem with a virus, I can't promise that the data at these offsets will look exactly like this, though.

What you're looking for is the plain string "NTFS" located on the 4th bytes at the start of a sector.

Issue the following from a root shell under linux:

hexdump -C /dev/sd{your drive letter} | less

next directly type in the following:

/NTFS<Enter>

where <Enter> is pressing the Enter key literally.

You should find yourself jumped to the first instance of NTFS, which should look something like the following:

00012000  eb 52 90 4e 54 46 53 20  20 20 20 00 02 08 00 00  |.R.NTFS    .....|
00012010  00 00 00 00 00 f8 00 00  3f 00 ff 00 3f 00 00 00  |........?...?...|
00012020  00 00 00 00 80 00 80 00  d8 a6 3f 01 00 00 00 00  |..........?.....|
00012030  00 00 0c 00 00 00 00 00  6d fa 13 00 00 00 00 00  |........m.......|
00012040  f6 00 00 00 01 00 00 00  ad 86 66 60 c8 66 60 7e  |..........f`.f`~|
00012050  00 00 00 00 fa 33 c0 8e  d0 bc 00 7c fb b8 c0 07  |.....3.....|....|
00012060  8e d8 e8 16 00 b8 00 0d  8e c0 33 db c6 06 0e 00  |..........3.....|
00012070  10 e8 53 00 68 00 0d 68  6a 02 cb 8a 16 24 00 b4  |..S.h..hj....$..|
00012080  08 cd 13 73 05 b9 ff ff  8a f1 66 0f b6 c6 40 66  |...s......f...@f|
00012090  0f b6 d1 80 e2 3f f7 e2  86 cd c0 ed 06 41 66 0f  |.....?.......Af.|
000120a0  b7 c9 66 f7 e1 66 a3 20  00 c3 b4 41 bb aa 55 8a  |..f..f. ...A..U.| 
000120b0  16 24 00 cd 13 72 0f 81  fb 55 aa 75 09 f6 c1 01  |.$...r...U.u....|
000120c0  74 04 fe 06 14 00 c3 66  60 1e 06 66 a1 10 00 66  |t......f`..f...f|
000120d0  03 06 1c 00 66 3b 06 20  00 0f 82 3a 00 1e 66 6a  |....f;. ...:..fj| 
000120e0  00 66 50 06 53 66 68 10  00 01 00 80 3e 14 00 00  |.fP.Sfh.....>...|
000120f0  0f 85 0c 00 e8 b3 ff 80  3e 14 00 00 0f 84 61 00  |........>.....a.|
00012100  b4 42 8a 16 24 00 16 1f  8b f4 cd 13 66 58 5b 07  |.B..$.......fX[.|
00012110  66 58 66 58 1f eb 2d 66  33 d2 66 0f b7 0e 18 00  |fXfX..-f3.f.....|
00012120  66 f7 f1 fe c2 8a ca 66  8b d0 66 c1 ea 10 f7 36  |f......f..f....6|
00012130  1a 00 86 d6 8a 16 24 00  8a e8 c0 e4 06 0a cc b8  |......$.........|
00012140  01 02 cd 13 0f 82 19 00  8c c0 05 20 00 8e c0 66  |........... ...f|
00012150  ff 06 10 00 ff 0e 0e 00  0f 85 6f ff 07 1f 66 61  |..........o...fa|
00012160  c3 a0 f8 01 e8 09 00 a0  fb 01 e8 03 00 fb eb fe  |................|
00012170  b4 01 8b f0 ac 3c 00 74  09 b4 0e bb 07 00 cd 10  |.....<.t........|
00012180  eb f2 c3 0d 0a 41 20 64  69 73 6b 20 72 65 61 64  |.....A disk read|
00012190  20 65 72 72 6f 72 20 6f  63 63 75 72 72 65 64 00  | error occurred.|
000121a0  0d 0a 4e 54 4c 44 52 20  69 73 20 6d 69 73 73 69  |..NTLDR is missi|
000121b0  6e 67 00 0d 0a 4e 54 4c  44 52 20 69 73 20 63 6f  |ng...NTLDR is co|
000121c0  6d 70 72 65 73 73 65 64  00 0d 0a 50 72 65 73 73  |mpressed...Press|
000121d0  20 43 74 72 6c 2b 41 6c  74 2b 44 65 6c 20 74 6f  | Ctrl+Alt+Del to|
000121e0  20 72 65 73 74 61 72 74  0d 0a 00 00 00 00 00 00  | restart........|
000121f0  00 00 00 00 00 00 00 00  83 a0 b3 c9 00 00 55 aa  |..............U.|

The only things that are guaranteed by spec to be the same are the end mark 55 aa at the end of the sector, and the NTFS ID String "NTFS" followed by 4 spaces

The first 3 bytes are normally specified to be an x86 jump instruction so they'll normally start with eb 52 in the hex bytes. The rest of this sector is partition information (near the beginning) and code (near the end, if your computer has a virus, this was probably changed.)

What you need to do is convert the hex offset that less gives you (in this case 12000) to decimal and then divide by 512 to get sector number.

Again, the most normal values for the sector where NTFS starts is 63 and 2048. This corresponds to 00007e00 and 00100000 for the byte offsets.

Once you find your sector offset you can mount the partition loopback via linux by issuing the following from a root shell:

mount -o loop,offset=$[512*63] /dev/sd{whatever drive it is} /mnt/point

Where 63 is the actual sector number and /mnt/point is a directory that exists (/mnt/point exists by default in some distributions.)

If you don't know which drive is which, you can find out by doing fdisk -l as root.

If your directory doesn't exist you can create it using mkdir -p /full/path/to/directory

Alternatively, you can use testdisk to rebuild your MFT or just copy files off of an NTFS partition. It's located here and it's a free download, and it's already in the package manager of some of the more popular Linux distributions.

http://www.cgsecurity.org/wiki/TestDisk

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .