您的位置:首页 > 理论基础 > 计算机网络

破解一个网络验证的.NET程序

2011-02-21 23:49 351 查看
BY 混世魔王。
很久没搞破解了。最近黑了一套.NET的商业程序,给自己用。由于是网络验证。就尝试破解了一下。由于是内部的程序,破解的难度不大。要大了。我也破不了。随笔,写成心的,作为技术交流。高手掠过。先查看壳,可以看到无壳,.NET的程序。



既然是网络验证的程序,那要开启Sniffer 类的程序,来抓取数据包,我这里用的HTTP Analyzer.运行程序,来看看她的验证,输入邮箱和密码,提示“Sorry,wrong username,password or computer ID”



我们看看HTTP Analyzer获取到的数据。



POST /verify_license.php?email=fuck@you.com&password=ST4GBVNE&mid=BFEBFBFF00010676 HTTP/1.1

我们提交了$email,$password,$mid这3个变量到verify_license.php 文件

$email 是我们输入的邮箱号码,$password 是我们输入的密码,$mid 是程序获取你的机器码。

verify_license.php根据计算,我们提交的验证码错误,于是返回值“NOT”。

弱弱的分析了一下验证机制,接下我们来分析一下程序,看他的验证码模块的代码。

用ildasm 载入程序。



选择“FILE”选项的“DUMP”。

她的验证是verify_license.php,那我们就搜索一下“verify_license.php”。可以看到,就一次。



我们来看下代码。

// HEX: 00 00 00 00 17 00 00 00 A4 00 00 00 BB 00 00 00 03 00 00 00 0E 00 00 01

IL_00be: /* 1C | */ ldc.i4.6

IL_00bf: /* 8D | (01)00001F */ newarr [mscorlib/*23000001*/]System.String/*0100001F*/

IL_00c4: /* 13 | 0D */ stloc.s V_13

IL_00c6: /* 11 | 0D */ ldloc.s V_13

IL_00c8: /* 16 | */ ldc.i4.0

IL_00c9: /* 72 | (70)0070A3 */ ldstr http://26836659.blgocn.com/verify_license.php/? //这里是验证的网址,我改成我的BLOG了。

+ "email=" /* 700070A3 */

IL_00ce: /* A2 | */ stelem.ref

IL_00cf: /* 11 | 0D */ ldloc.s V_13

IL_00d1: /* 17 | */ ldc.i4.1

IL_00d2: /* 02 | */ ldarg.0

IL_00d3: /* 7B | (04)00010E */ ldfld class [System.Windows.Forms/*23000002*/]System.Windows.Forms.TextBox/*01000055*/ de/*02000049*/::e /* 0400010E */

IL_00d8: /* 6F | (0A)000076 */ callvirt instance string [System.Windows.Forms/*23000002*/]System.Windows.Forms.Control/*01000039*/::get_Text() /* 0A000076 */ 获取文本内容,应该是我们的邮箱

IL_00dd: /* A2 | */ stelem.ref

IL_00de: /* 11 | 0D */ ldloc.s V_13

IL_00e0: /* 18 | */ ldc.i4.2

IL_00e1: /* 72 | (70)007115 */ ldstr "&password=" /* 70007115 */ 输入的密码

IL_00e6: /* A2 | */ stelem.ref

IL_00e7: /* 11 | 0D */ ldloc.s V_13

IL_00e9: /* 19 | */ ldc.i4.3

IL_00ea: /* 02 | */ ldarg.0

IL_00eb: /* 7B | (04)00010C */ ldfld class [System.Windows.Forms/*23000002*/]System.Windows.Forms.TextBox/*01000055*/ de/*02000049*/::c /* 0400010C */

IL_00f0: /* 6F | (0A)000076 */ callvirt instance string [System.Windows.Forms/*23000002*/]System.Windows.Forms.Control/*01000039*/::get_Text() /* 0A000076 */

IL_00f5: /* A2 | */ stelem.ref

IL_00f6: /* 11 | 0D */ ldloc.s V_13

IL_00f8: /* 1A | */ ldc.i4.4

IL_00f9: /* 72 | (70)00712B */ ldstr "&mid=" /* 7000712B */ 机器码

IL_00fe: /* A2 | */ stelem.ref

IL_00ff: /* 11 | 0D */ ldloc.s V_13

IL_0101: /* 1B | */ ldc.i4.5

IL_0102: /* 06 | */ ldloc.0

IL_0103: /* A2 | */ stelem.ref

IL_0104: /* 11 | 0D */ ldloc.s V_13

IL_0106: /* 28 | (0A)00007D */ call string [mscorlib/*23000001*/]System.String/*0100001F*/::Concat(string[]) /* 0A00007D */

IL_010b: /* 28 | (0A)000026 */ call class [System/*23000003*/]System.Net.WebRequest/*0100002F*/ [System/*23000003*/]System.Net.WebRequest/*0100002F*/::Create(string) /* 0A000026 */

IL_0110: /* 74 | (01)000027 */ castclass [System/*23000003*/]System.Net.HttpWebRequest/*01000027*/

IL_0115: /* 13 | 04 */ stloc.s V_4

IL_0117: /* 11 | 04 */ ldloc.s V_4

IL_0119: /* 72 | (70)0000E3 */ ldstr "POST" /* 700000E3 */ POST 提交

IL_011e: /* 6F | (0A)000029 */ callvirt instance void [System/*23000003*/]System.Net.WebRequest/*0100002F*/::set_Method(string) /* 0A000029 */

IL_0123: /* 11 | 04 */ ldloc.s V_4

IL_0125: /* 16 | */ ldc.i4.0

IL_0126: /* 6A | */ conv.i8

IL_0127: /* 6F | (0A)000039 */ callvirt instance void [System/*23000003*/]System.Net.WebRequest/*0100002F*/::set_ContentLength(int64) /* 0A000039 */

IL_012c: /* 11 | 04 */ ldloc.s V_4

IL_012e: /* 6F | (0A)00003E */ callvirt instance class [System/*23000003*/]System.Net.WebResponse/*01000028*/ [System/*23000003*/]System.Net.WebRequest/*0100002F*/::GetResponse() /* 0A00003E */

IL_0133: /* 13 | 05 */ stloc.s V_5

IL_0135: /* 11 | 05 */ ldloc.s V_5

IL_0137: /* 6F | (0A)00003F */ callvirt instance class [mscorlib/*23000001*/]System.IO.Stream/*01000025*/ [System/*23000003*/]System.Net.WebResponse/*01000028*/::GetResponseStream() /* 0A00003F */

IL_013c: /* 13 | 06 */ stloc.s V_6

IL_013e: /* 11 | 06 */ ldloc.s V_6

IL_0140: /* 73 | (0A)000040 */ newobj instance void [mscorlib/*23000001*/]System.IO.StreamReader/*01000029*/::.ctor(class [mscorlib/*23000001*/]System.IO.Stream/*01000025*/) /* 0A000040 */

IL_0145: /* 13 | 07 */ stloc.s V_7

IL_0147: /* 11 | 07 */ ldloc.s V_7

IL_0149: /* 6F | (0A)000041 */ callvirt instance string [mscorlib/*23000001*/]System.IO.TextReader/*0100001C*/::ReadToEnd() /* 0A000041 */

IL_014e: /* 13 | 08 */ stloc.s V_8

IL_0150: /* 11 | 08 */ ldloc.s V_8

IL_0152: /* 72 | (70)007137 */ ldstr "NEW USER" /* 70007137 */

从new user开始了

IL_0157: /* 28 | (0A)000083 */ call bool [mscorlib/*23000001*/]System.String/*0100001F*/::op_Equality(string, string) /* 0A000083 */

这里用到一个

op_equality函数,.NET我是不清楚,不过,在VB中,op_equality 里面见过,是比较两个串是否相等

IL_015c: /* 2D | 0E */ brtrue.s IL_016c

他先比较是不是new user,然后,后面跟着一句,是brture.s,就是如果相等的话就跳

IL_015e: /* 11 | 08 */ ldloc.s V_8

IL_0160: /* 72 | (70)007149 */ ldstr "VALID" /* 70007149 */

然后,就比较是不是VALID,如果不相等就跳。VALID后面跟着的是brfalse了,这是推测的。来测试下看看。

IL_0165: /* 28 | (0A)000083 */ call bool [mscorlib/*23000001*/]System.String/*0100001F*/::op_Equality(string,

string) /* 0A000083 */

IL_016a: /* 2C | 0F */ brfalse.s IL_017b

IL_016c: /* 02 | */ ldarg.0

IL_016d: /* 17 | */ ldc.i4.1

IL_016e: /* 7D | (04)000111 */ stfld bool de/*02000049*/::h /* 04000111 */

IL_0173: /* 02 | */ ldarg.0

IL_0174: /* 28 | (0A)0000EB */ call instance void [System.Windows.Forms/*23000002*/]System.Windows.Forms.Form/*01000011*/::Close() /* 0A0000EB */

IL_0179: /* 2B | 13 */ br.s IL_018e

IL_017b: /* 72 | (70)007155 */ ldstr "Sorry, wrong username, password or computer ID" /* 70007155 */ 如果错误的话,跳转到我们开始的错误提示。

IL_0180: /* 72 | (70)006FE9 */ ldstr "Login" /* 70006FE9 */

IL_0185: /* 16 | */ ldc.i4.0

IL_0186: /* 1F | 10 */ ldc.i4.s 16

IL_0188: /* 28 | (0A)0000DD */ call valuetype [System.Windows.Forms/*23000002*/]System.Windows.Forms.DialogResult/*0100003C*/ [System.Windows.Forms/*23000002*/]System.Windows.Forms.MessageBox/*01000086*/::Show(string,

修改本地的 c:/windows/system32/drivers/etc/hosts

127.0.0.1 26836659.blogcn.com //这里是验证的网址,我改成我的BLOG了。

本地架设一个APM环境,在跟目录下建立一个“verify_license.php”文件,里面的内容改为VALID ,测试成功。

我们输入任何用户名。都可以成功登陆了。测试了下程序,注册使用。

OK。结束。

FORM: http://www.7747.net/Article/201101/81499.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐