dovs36921 2019-03-13 19:30
浏览 87

绕过会话验证php

Can Anyone bypass my Login page if they can bypass it how they well do it

<?php
session_start();

if(isset($_SESSION['login']) == "Owner" or isset($_SESSION['login']) == "admin"){
echo 'login In';
}
?>
  • 写回答

1条回答 默认 最新

  • douci4026 2019-03-13 20:05
    关注

    Storing the login status in the session variable is certainly a decently secure thing to do, however, it's not sufficient all by itself. If someone was able to access the session tables, (which is apparently doable in a shared hosting environment) and find the session ID of someone who is logged in, they could hijack the session. So more security is needed. (Google "Session Hijacking" for more information on what it is and how it's done)

    I'm no security expert, but a few things I've done include recording their IP address and Client data, and checking those on each page load. If they're suddenly coming from a different IP address or using a different browser, then I log them out right away. However, as @Barmar noted, mobile devices can change IP addresses during a session, so this is probably not a good practice.

    It would also be important to be using a secure connection (https) over TLS. If not, a man-in-the-middle could simply watch the packets going back and forth, pick up the username and password, and log in for themselves.

    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题