corna / me_cleaner

Tool for partial deblobbing of Intel ME/TXE firmware images
GNU General Public License v3.0
4.43k stars 275 forks source link

[Tutorial] ME cleaner still working for newer platforms #340

Open c0d3z3r0 opened 3 years ago

c0d3z3r0 commented 3 years ago

I've been experimenting hours on IFWI image cleaning and finally found out, that IFWI support is not required for me_cleaner to work (#213, #242). The trick is to apply me_cleaner to just the ME subregion of the IFWI image. That can be achieved in this way:

This was tested with CSME 14.0.11.1205, FIT 14.0.11.1205.

Note: Most modules seem to be mandatory on newer ME versions and the system will reset instantly when one of those gets cleaned (for me at least fpf,maestro,pm,crypto,heci,policy,storage,...). At least I could clean touch_fw,fwupdate,ptt. So, there is not much left to be cleaned and thus, this is not yet a real alternative to #282.

Note 2: you will need the modules whitelist patch from #160

mv "ME Sub Partition.bin" "ME Sub Partition.bin.orig"
me_cleaner.py -O "ME Sub Partition.bin" "ME Sub Partition.bin.orig" -w PSVN,UEP,IVBP,MFS,UTOK,HVMP,RSTR,FLOG,IMDP,RBEP,FTPR,NFTP,DLMP -R touch_fw,ptt,fwupdate
Yannik commented 3 years ago

Hi @c0d3z3r0, thanks for the guide.

Where can I get this "FIT" tool?

steelpuxnastik commented 2 years ago

Hi @c0d3z3r0, thanks for the guide.

Where can I get this "FIT" tool?

FIT - Flash image tool. Find the one that compitable with your processor.

Nephiel commented 2 years ago

FWIW, this is what worked for me on a Comet Lake with Intel ME 14.x. Do this at your own risk.

With this information, we can modify me_cleaner.py, editing the fspba offset on the gen 4 (or 5) branches to replace PCHSTRP32 with PCHSTRP28 and fspba offset 0x80 with 28x4 = 112 = 0x70. In my case, as the fipped bit was still the 5th most significant one, the mask was still 16, no need to change that.

c0d3z3r0 commented 10 months ago

@Nephiel sorry for the late response :D Well, what you describe is actually the soft-disable strap. What I described initially was actual cleaning/wiping of modules to prevent their code to run, even if HAP would had a backdoor. That's what clean(er) in me_cleaner stands for.

So, this feature of me_cleaner could be implemented for platforms >= 9th Gen by extracting the CSME partition from the IFWI image, apply the cleaning stuff just like on < 9th Gen platforms and repackage the cleaned partition into the IFWI image.

Nephiel commented 10 months ago

Right, I only flipped the soft-disable bit, so the rest of the ME code is still in there, and there is no guarantee it can't be invoked some other way.

But, IIRC, I tried more complete cleaning and ran into issues during boot. May have cleaned some module that turned out to be mandatory on that machine... So I had to settle for soft-disabling.