天天看点

发现校内网好友买卖的一个小漏洞!并成功实现自动好友买卖!

//有些网站通过网络爬虫转载文章都不写明文章出处,请保留文章原作者:redraiment

公告:因为服务器要转让,我将不再有可使用的服务器。因此挂机站点将于2008年11月6日0时关闭。

最新消息:客户端版autoauto preview 1已发布,详情查看最新日志。

最新消息:我写了一个脚本,免费提供大家在线挂机,目前还在测试阶段,每天最多只能提供60个人同时挂机。欢迎大家前来测试体验。

真是不容易呀!连续好几个不眠的夜晚终于没有白费!我终于实现了自动买卖好友的功能。终于可以在平凡的鼠标操作中解放出来了!起初我在google里搜索好友买卖的漏洞时,结果都是以前的get和post漏洞,现在这些漏洞都已经不能再利用了。

  我用的系统是fodora 6,linux下有个命令:curl,能下载网络上的文件。也可以用来作命令行下的浏览器。于是我就琢磨,既然它是一个浏览器,那也应该能提交让宠物挖煤、卖花的请求吧。

  于是man curl一下(如果不知道curl的用法,就现man一下~^_^),看看curl的用法。然后一步一步来。

一、登入校内网

  先运行$ curl -o index.html http://xiaonei.com/,把首页下载下来,保存到index.html里。

  打开后搜索"form"查看表单,定位到:

<form method="post" id="loginform" class="login-form" action="http://login.xiaonei.com/login.do" >

<p class="top">

<label for="email">登录邮箱:</label>

<input type="text" name="email" rule="blank#email" error="请输入正确的email地址" class="input-text" value="" id="email" tabindex="1" />

</p>

<p>

<label for="password">密码:</label>

<input type="password" id="password" name="password" rule="blank" error="请输入密码" class="input-text" tabindex="2"  />

  看这段代码,就知道,表单是提交把email和password给http://login.xiaonei.com/login.do

  那我们就用命令$ curl -o -d ck/1 -d "email=username@host&password=yourpassword" http://login.xiaonei.com/login.do,来登入。

  参数-d是指定cookie的保存地址;-d是将后面的信息以post方式提交信息。

  打开下载来的login.do,内容:

the url has moved <a href="http://home.xiaonei.com/home.do">here</a>

  页面转到了个人主页上。那就再去看看主页的信息:

  $ curl -b ck/1 -d ck/2 http://home.xiaonei.com/home.do

  参数-b是指定需要以来的cookie文件。

  用相同的方法进入好友买卖的首页:http://friendsell.xiaonei.com/friendsell/home.do

  定位到对好友处理的代码段:

<li id="release_f" onclick="releasepet(222729759,this)"><a

        href="javascript:void(0)">抛弃她</a></li>

<li id="discount_f" onclick="discountpet(222729759,this)"><a

        href="javascript:void(0)">打折处理</a></li>

<li id="torment_f" rel="222729759" onclick="abuse(222729759,this)"><a

        href="javascript:void(0)">折腾她</a></li>

<li id="comfort_f" rel="222729759" onclick="comfortpet(222729759,this)"><a

        href="javascript:void(0)">安抚她</a></li>

<li id="nickname_f" rel="222729759" onclick="nickname(222729759,this)"><a

        href="javascript:void(0)">起昵称</a></li>

  我们要做的,当然是折磨她咯!不过点击后是触发一个js函数,但文件里却找不到abuse这个函数,看来还有另外一个js文件。我在顶部看到了:http://xnimg.cn/xnapp/frs/frs.js?ver=63283这个链接,直接在浏览器里打开看看。就能看到所有的js函数。原来作者还预留了很多功能哈!找到abuse的函数:

function abuse(id, obj) {

    xn.dom.disable(0);

    var myurl = "/friendsell/abuseajax.do";

    var pars = "id=" + id;

    var myajax = new ajax.request(

            myurl,

    {

        method: 'post',

        parameters: pars,

        oncomplete: function(r) {

            xn.dom.enable();

            displayabus(r, xn.element.realleft(obj), xn.element.realtop(obj));

        },

        onfailure: function() {

        }

    });

}

  原来是把id这个信息提交给abuseajax.do来处理。

  运行$ curl -o -b ck/1 -d ck/2 -d "id=friend's id" http://friendsell.xiaonei.com/friendsell/abuseajax.do

  获得以下信息:

[{content:"<div class=/"dialog_summary/"><div style=/"margin: 10px auto; width: 300px; text-align: center;/"><img width=/"100/" src=/"http://hd34.xiaonei.com/photos/hd34/20080510/12/43/head_2695h107.jpg/"/><div class=/"m10_0/"><table><tbody><tr><td class=/"graytext w100/">你要让***做什么呢?</td></tr></tbody></table></div><hr size=/"1/" class=/"mb10/"/><div class=/"cmplist mb10/"><ul><form id='abuse_form' method='post' action='/friendsell/abuse.do'><li><input type=/"radio/" name=/"paintype/" checked=/"check/" id=/"paintype/" value=/"1/"/>在冰冷小黑屋关一天  <font color=/"#666666/">(消费¥1000)</font></li><li><input type=/"radio/" name=/"paintype/" id=/"paintype/" value=/"2/"/>痛扁她一顿  <font color=/"#666666/">(消费¥100)</font></li><li><input type=/"radio/" name=/"paintype/" id=/"paintype/" value=/"3/"/>饿一天不给饭吃</li><li><input type=/"radio/" name=/"paintype/" id=/"paintype/" value=/"11/"/>去看芙蓉姐姐演唱会</li><li><input type=/"radio/" name=/"paintype/" id=/"paintype/" value=/"8/"/>去卖花</li><li><input type=/"radio/" name=/"paintype/" id=/"paintype/" value=/"9/"/>跳草裙舞</li><li><input type=/"radio/" name=/"paintype/" id=/"paintype/" value=/"10/"/>半夜闹铃</li><input type='hidden' name='id' value='friend's id'></form></ul></div></div></div>",id:"friend's id",name:"***"}]

  内容很明显,是弹出的窗口信息。把paintype和好友的id以post形式提交给abuse.do。

  起初到了这里,我卡住了。我还是依然提交:

  $ curl -o -b ck/1 -d ck/2 -d "paintype=8&id=***" http://friendsell.xiaonei.com/friendsell/abuse.do

  但却没有返回成功的信息。我直接在firefox里提交url:

    http://friendsell.xiaonei.com/friendsell/abuse.do?paintype=8&id=***

  结果弹出一个窗口,说“不要修改链接哦^_^”。看来是作者在修补以前的漏洞时做的修改。

  这让我感觉有点奇怪,莫非还有什么隐藏的信息要提交吗?

  为了验证自己的想法,我用winsock来抓包,看看firefox提交和手工get提交的区别。结果,出了提交方式,貌似看不出其他的区别!

  正当我绝望的时候,突然灵光一闪,是不是abuse.do对前面的页面abuseajax.do有依赖?

  于是我运行:

  $ curl -o -b ck/1 -d ck/2 -d "paintype=8&id=***" -e http://friendsell.xiaonei.com/friendsell/abuseajax.do http://friendsell.xiaonei.com/friendsell/abuse.do

  成功了!

  然后我写了个shell。对我所有的宠物进行提交,结果全部成功!也因此发现一个小漏洞!

  起初,我在想,男生下面没有买花的选项,不晓得行不行。但我想,反正不行也无所谓,先提交看看。结果,却成功了!如下图,其中红色圈的是男生,却也能买花~同样,女生也能挖媒咯~哈哈!

发现校内网好友买卖的一个小漏洞!并成功实现自动好友买卖!

  这不算是什么大漏洞,但却方便我写脚本了,不用去判断宠物的性别,统一去挖媒就搞定,哈哈~

  来总结一下过程:

    1)登入校内,保存cookie

    2)下载好友买卖首页到本地

    3)提取自己的宠物的id

    4)逐一安排宠物去打工

  我这些过程写成一个shell脚本来运行。代码如下:

#!/bin/bash

# filename: pet

if [ $# = 2 ]

then

    email=$1

    password=$2

else

    echo "usage: $0 email password"

    exit 1

fi

# save cookie.

curl -o -d cookie -d "email=${email}&password=${password}" http://login.xiaonei.com/login.do

# get pet list.

curl -o -b cookie http://friendsell.xiaonei.com/friendsell/home.do

url='http:////friendsell.xiaonei.com//friendsell//'

get_line="egrep ' {20}<a class=/"bold/"' home.do"

get_id="sed -e 's/[^0-9]//g'"

insert_head="sed -e 's/^/curl -o -b cookie -d /"paintype=5/&id=/'"

append_tail="sed -e 's/$//" -e ${url}abuseajax.do ${url}abuse.do/'"

# comfort tt and abuse pet.

filename="/tmp/abuse"

echo "#!/bin/bash" > $filename

echo "" >> $filename

eval "$get_line | $get_id | $insert_head | $append_tail >> $filename"

chmod u+x $filename

/tmp/abuse

# clean.

rm -rf $filename *.do cookie

  然后用crontab来指定每一小时自动运行一次。^_^

  $ crontab -e

  0 */1 * * * ~/friendsell/pet email password

后记:

  同样的方法,成功实现自动补充好友!保证自己的好友总数一直持续在12只。^_^