Skip to content

Latest commit

 

History

History

Gootkit

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Gootkit

Gootkit is a fileless malware that has been heavily targeting Germany in 2020. Gootkit stores its DLLs inside the Windows Registry from which they can be extracted.

Recipe input

This recipe takes as input a Registry Key from an infected system as exported by, e.g., regedit. In the following example that would be the file acfbbcbefecadce.reg (available for download above) which looks something like:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\acfbbcbefecadce]
@=""
"0"="$Command =[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String(\"JABF[...]
"1"="XAHoAUgBRAE8ANwBNAHYAUABDADAAbQBwAHIAVQArAEQANAA1A[...]
"2"="VAE4AUgBCADkAWABYADAAZAA4AHkALwBYADAAOQAvAGIAMwBJA[...]
"3"="wADIARQA2AFAAZwB6AEUAMABrADYALwBxADIASgBIAEIAMwAvA[...]
[...]
"168"="vAGsAWgArAC8ASQBPAC8AUwBpAFAAUABuAFQAUAArAFoAaAB[...]
"169"="rAFMAUABFADAAdAAvAHYAYQBXADQAbQBlAHEAagBYAG0ARwB[...]
"171"="vAC8AMAB2AGEAYQBxAEIAOQ[...]A0ACgA=\")); Invoke-Expression $Command;Start-Sleep -s 22222;"

Stage 1

Use CyberChef's Open file as input button to load the file acfbbcbefecadce.reg (you may want to disable Auto Bake beforehand).

Copy the following recipe to Load Recipe and press BAKE!

[{"op":"Decode text","args":["UTF-16LE (1200)"]},{"op":"Regular expression","args":["User defined","[a-zA-Z0-9+/=]{30,}",true,true,false,false,false,false,"List matches"]},{"op":"From Base64","args":["A-Za-z0-9+/=",true]},{"op":"Decode text","args":["UTF-16LE (1200)"]},{"op":"Regular expression","args":["User defined","[a-zA-Z0-9+/=]{30,}",true,true,false,false,false,false,"List matches"]},{"op":"From Base64","args":["A-Za-z0-9+/=",true]},{"op":"Raw Inflate","args":[0,0,"Adaptive",false,false]}]

The Output panel will show the extracted DLL (which contains another obfuscated DLL and which will act as input for Stage 2):

Stage 2

Use the DLL as input for Stage 2 (Note: if CyberChef's Replace input with output doesn't work simply Save output to file at the end of the previous step, then use Open file as input again).

Use another recipe:

[{"op":"Strings","args":["16-bit littleendian",4,"All printable chars (A)",false]},{"op":"Decode text","args":["UTF-16LE (1200)"]},{"op":"Regular expression","args":["User defined","[a-zA-Z0-9+/=]{30,}",true,true,false,false,false,false,"List matches"]},{"op":"From Base64","args":["A-Za-z0-9+/=",true]}]

Again, baking will lead to a DLL:

References

Kudos

Thanks a lot to mattnotmax for the inspiration!