r/badBIOS • u/badbiosvictim2 • Nov 12 '14
Dding in Linux does not clone hidden partitions. What can clone hidden partitions?
Typical forensics procedure is to clone the hard drive or removable media and to perform analysis on the clone. For example, page 28 of Purdue University's forensics hand out gives misinformation: make two copies, don't work from the original, working from a duplicate preserves the original evidence, etc. Purdue University admits "a file copy does not recover all data areas of the device for examination." Yet, does not specify which data areas and how to perform forensics on these data areas. Misinformation on page 29: "Digital evidence can be duplicated with no degradation from copy to copy." Misinformation on page 31: " Bit for Bit copying captures all the data on the media including hidden and residue data (e.g., slack space, swap, residue, unused space, deleted files, etc)....Remember avoid working on the original" www.cs.purdue.edu/.../handouts/CS426_forensics.ppt
How strange hidden partitions are omitted. Are universities behind the times? Or is there a reason for omitting hidden partitions? Purdue University encourages their graduates to work for the NSA. "Careers at the National Security Agency" https://www.cs.purdue.edu/corporate/employment/nsa.html
NSA sponsors 'cyber' programs at several universities to teach the specific skills the NSA requires. http://www.cerias.purdue.edu/site/education/post_secondary_education/past_offerings/faculty_development/info_assurance_education/overview_nsa.php
NSA gave a grant to Perdue University for a GenCyber program during summer camp: "Some of the schools to participate where the University of Arizona, Mississippi State, University of New Orleans, Purdue, Towson, and Dakota State." http://science.dodlive.mil/2014/08/28/the-nsas-school-of-cyber/
I wonder if NSA is unduly influencing universities to keep hidden partitions concealed from their students. Why? Because NSA hackers create hidden partitions such as a HPA. If graduates don't go to work for the NSA and become self employed or work for a corporation, they will lack skills to discover hidden partitions, including NSA's hidden partitions.
Like many firmware rootkits developed by NSA, BadBIOS is a partition virus.
I posted snippets of active@disk editor's dumps of hidden partitions in Sansa Clip+ MP3 players, Palm Pre2 phone, flashblu flashdrives #1 and #2, SD cards and Asus 1005HA hard drive.
Thanks to /u/sloshnmosh for volunteering to perform forensics on flashblu flashdrive #1 and Asus 1005HA netbook
I had wanted to clone before shipping but didn't. In July 2013, I shipped an infected flashdrive to a forensics volunteer. Flashdrive and print out of my forensics got "lost in the mail." I shipped an infected SD card and print out of my forensics via FedEx to the same forensics volunteer. SD card "went missing" after delivery.
Last March, I shipped Toshiba Portege R100, two infected flashdrives, tampered Fedora CDs, etc. to a volunteer on reddit.com. He confirmed delivery and never responded to my inquiries for a forensics report.
Last August, I shipped via FedEx Toshiba Portege R205, infected flashdrive, etc. to a forensics volunteer. Package was interdicted, opened and contents 'cleaned.'
Though I realized the need to clone before shipping to /u/sloshnmosh, I didn't have the time nor the expertise to try various cloning software for linux and windows and test whether they copied the hidden partitions. Especially the GPT protective partitions.
After /u/sloshnmosh informed me that he used linux to dd my hard drive and flashblu flashdrive, I asked him to test using active@disk editor whether dding cloned the hidden partitions. /u/sloshnmosh reported: "cloning will not transfer any "hidden" partitions." http://www.reddit.com/r/badBIOS/comments/2lckvl/buffer_overflows_abound_a_quick_scan_with_process/
Much of the evidence resides in hidden partitions. How many forensic experts clone without using a disk hex editor to check whether cloning actually clones the entire hard drive or removable media or device? How many forensics experts are schooled or self trained to even use a disk hex editor? I conducted ample research on hidden partitions. Yet, disk hex editors didn't come up in search results on forensics on hidden partitions.
Could redditors please use a disk hex editor to check for hidden partitions, share instructions on how to save entire dumps and experiment with cloning software? Comparison of disk hex editors is at http://en.wikipedia.org/wiki/Comparison_of_hex_editors. I wish there was a comparison of cloning software. If cloning cannot clone hidden partitions, forensic experts should cease the practice of cloning unless what they want to clone has no hidden partitions.
Can active@disk image clone hidden partitions? Their description does not include cloning hidden partitions but active@disk image was developed by the same developer who developed active@disk editor. Download is at http://www.disk-image.com/
I cannot test active@disk image with active@disk editor. On November 13, 2014, I purchased an Asus 900HA netbook with an older Intel GMA 915 chipset. Using a hostel's computer I paid to use, I downloaded active@disk editor four times onto my Sandisk 16 GB micro SD card. Same error message when attempting to install active@disk editor on Asus. "Unable to execute file. CreateProcess failed; code 14001. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
Any volunteers to test active@disk image, clonezilla, or other cloning software?
3
u/sloshnmosh Nov 26 '14
Sorry for the long delay, I moved to a new residence and have not fully set up all my devices. I just got cable internet a few days ago and now have access to internet. I will gladly ship the ASUS and FLASHBLU to whatever location you wish however I will explain again that the ASUS was infected, but with the SASSER virus with the isass.exe (not lsass.exe) executable plainly visible in the Windows System32 folder. My antivirus program picked it up right away. I had no physical access to the ASUS harddrive due to the screws on the ASUS being glued. it was the FLASHBLU that I performed a DD on NOT the ASUS. I used Clonezilla to copy the ASUS harddrive and it is my understanding that Clonezilla does not transfer any sectors with zeros to allow faster copying and easier compression. However, on the copy made by Clonezilla the SASSER worm was discovered in plain sight in the System32 folder so I did not feel any further "investigation" was needed or a more "forensically sound" method such as dd if=/dev/sda. And because I could not boot Windows XP from USB I had no way to test HARDWARE or BIOS on the ASUS without installing a working O.S. (the original Windows XP O.S. on the ASUS was not bootable) I performed a security enhanced erase on the ASUS drive and installed Windows 7 so that the ASUS could function to see if any oddities from the installed BIOS occured. I let it run overnight with no ill affects. I believe the only problem the ASUS had was the SASSER worm as no problems were found running a clean Windows install once the harddrive was sanitized. If you wish I can ship out the harddrive with the Clonezilla copy of the original Windows XP minus the SASSER worm that my AV removed.
1
u/chupitulpa Nov 24 '14
There is a fair deal of nonsense going on in this discussion.
This refers to clicking into the drive and dragging out all the files, using xcopy, robocopy, cp, tar, etc. Copying the files fails to copy remnants of deleted files that reside in free space, along with anything that might be stored in unpartitioned space. Using dd on a whole device (dd if=/dev/sdb ...) copies everything except any Host Protected Area (HPA) or something the device firmware might be hiding. I'll get to those later.
This is also very true and not misinformation. If you've made a complete, forensically sound copy of a disk and copy that copy onto another disk, again with forensically sound methods, you have the same exact data. This statement refers to the loss of data you might get if you just copy files out using Explorer, or the loss in quality you see if you make a copy of a copy on analog media like VHS tapes.
Time to take off the timfoil hat. There are a few ways you can have a "hidden partition". A tool like fdisk or some bootloaders can mark a partition as "hidden" to prevent an OS on a second partition from seeing the first partition. You might also have data or an entire filesystem residing in "free" space on the disk. Using dd to copy the entire device will copy all this data. Then there's HPAs and stuff the device firmware is hiding, which is harder to get at.
Viruses that embed themselves into the MBR (Master Boot Record) or store data in space that isn't allocated in the partition table are nothing new. We had those back in the days of MS-DOS. Any antivirus worth its salt will detect stuff like this and can usually clean it by replacing it with the standard MBR for the OS you have.
Let's take a second here to look at how a BIOS-based computer boots up. First, BIOS code stored in a flash memory chip executes. It initializes hardware and executes boot code stored in some components like network adapters, RAID cards, etc. to allow booting from these devices. BIOS then scans for hard disks, USB disks, CDs, floppies, and so forth. It reads the first 512 bytes of the first boot device, and checks whether the last two bytes of it are the signature bytes 0x55 0xAA. If they aren't, it goes on to the next device. If it finds one in the boot order, it executes whatever is stored in this -- this is the MBR, the first thing outside of BIOS and boot ROM that is run. This code typically parses the partition table. For DOS/Windows it then loads the first sector of the partition (PBR, Partition Boot Record) and executes that, which starts up bootmgr, ntldr, or command.com depending on the DOS or Windows version. For Linux it loads a kernel and initrd (initial RAMdisk) image and starts the kernel.
UEFI does something similar, but the stuff stored in flash is much more capable. After initializing everything, it looks for a FAT/FAT32 partition containing EFI applications it can run, and optionally shows a menu to let you choose which one to run. The Windows Boot Manager is one EFI application; there are various other ones like diagnostic utilities, more advanced boot menus, Linux loaders, etc.
The new worry, and what BadBIOS is supposed to be, is a virus that infects the BIOS, UEFI or boot code stored on some internal component or a peripheral. This means the virus is already loaded into memory before the hard disk or any other boot device is touched. Imaging the hard disk won't copy this boot code. Replacing the hard disk won't get rid of it. It will still be loaded if you boot from an uninfected CD. Even if you use a utility to read out the BIOS flash chip, the virus is already loaded so it could theoretically trap the attempt to read it and return a pristine copy of the BIOS instead to hide its existence. The only surefire way to read it out is to remove the BIOS chip from the motherboard and put it into a chip programmer device.
No. GPT protective partitions in and of themselves are not a place to stick hidden data. GPT is the new partition table format, and what is used with UEFI though you can use GPT on a BIOS computer. MBR is the old way to store partitions that has been more or less the same since partitioning was introduced in PC DOS. When you have a GPT disk, there's also an MBR as well; otherwise an old OS like DOS or Windows XP would think it's an uninitialized disk and offer to partition it for you. The GPT protective partition is (usually) the only entry in the MBR of a GPT disk. It has a start sector of 1 and an extends to either the size of the disk or 2 TB, the max address an MBR can handle. It overlaps with the partitions in the GPT and only exists as a protective measure so that MBR partitioning tools will see all that space as in use and not try to make new partitions there, which would overwrite your data.
This is a Windows error, not something weird going on with your device. The most common cause of this error is not having the version of the MS C++ runtime that the software requires.
Hex editors
You aren't going to see much variation in what parts of a disk a disk hex editor can see. If it can open the full unpartitioned device and deal with things over 2 TB, it will see everything the OS can access on the disk. This is also the same set of things that dd will clone and that Active@ Disk Editor can see. That said, Active@ Disk Editor is a great choice because it can help you parse the various structures stored on the disk.
Host Protected Area
There are two different commands to ask an ATA hard disk its size. IDENTIFY DEVICE returns the size minus any HPA. READ NATIVE MAX ADDRESS returns the full size of the device including the HPA. An HPA can only exist at the end of the disk, because it's merely the difference between the IDENTIFY DEVICE reported size and the actual size. Certain diagnostic utilities and malware including some NSA stuff uses this space to store data. An HPA can be created, adjusted or removed using the ATA command SET MAX ADDRESS. Once an HPA is removed, whatever data is in that area can be read normally using dd on your now larger device.
To detect an HPA in Linux, use the command
sudo hdparm -N /dev/sda(where sda is the disk you want to detect an HPA on). You'll see an output line likemax sectors = 3907029168/3907029168, HPA is disabled. The first number is the size from IDENTIFY DEVICE, and the second is READ NATIVE MAX ADDRESS. To remove the HPA,hdparm -N 3907029168 /dev/sda(where that number is the second number -N gave before). You should then be able to read the whole drive, though a soft reboot might be needed first.1
u/[deleted] Nov 24 '14 edited Jun 05 '15
iatromechanical kerflap cyclospermous furtherance rhinocerotoid Hasidim interdetermine Cestida squamoepithelial trochometer glyceroxide averter grillroom Candolleaceae denumerant aortomalaxis myophysical splitsaw preferredly Chamaeleo alcoholemia pirr raper hygrometry Isiac playwright evolution boud diaclasis hyperpencil tonsillary strepsitene focal osculable crappie numskulled pencilling laborious endorsingly overdust ghastliness rada bacula zymology hemorrhea Hebrician ordain tweel aesthetical accultural pigsticker assassinator pronubial cigaresque statist templarlike tachyphrasia overflower circuiteer irrigationist mashie frache sulphofy barful confused Phyllophaga parachromophoric corpulently Cris adenofibrosis Hydrocharitaceae uncinated mimic poliadic slither voicefulness catholical ascertainment relent coralberry Tryparsamide accrue Hedychium ensete Iberia risibly Centrechinoida infantine recompliance ym cottierism resalvage suberic abhorrer nondemobilization asymbolical Sminthian rhinolophid bort weariless overrealistic unpelagic plumbiferous ungrowing chakazi quercin edaphology seave xanthide probationship starnel Hazara infinitival bloodcurdling Urgonian Tingidae aurotellurite Chinook burtonization inotropic Bitulithic pseudotuberculosis palster musicodramatic trilithic productress moyo hypercathartic benzdioxdiazine algebraization nonextrication jinja unperforate sutleress sisterin viraginous quassative humeral optime faitour cubicalness boomboat Cineraria bey inguinal counterthwarting
0
u/[deleted] Nov 14 '14
[deleted] — view deleted comment