dongliang1223 2015-11-06 07:21
浏览 195
已采纳

HTTPS登录HTTP站点

Just wondering is there a security advantage to creating a HTTPS log-in enviroment for a HTTP site ?

For various reasons making the entire site HTTP isn't really an option I was just wondering is it worth taking the effort to provide a HTTPS log-in even though users will be operating the rest of their logged in time within a non HTTPS enviroment ?

I did some googling and found that logging http into https isn't very secure but haven't been able to find a solid answer for the reverse scenario.

Would this sort of setup require two types of session data a secure data that contains more private information and a more basic session that contained simply who the user is and that they are logged in, or could this be done safely with just the one piece of session data ?

  • 写回答

2条回答 默认 最新

  • duanmeng1950 2015-11-06 07:53
    关注

    I have tried to explain the reason why HTTPS on the entire site would be best below:

    Let's say you set up two pages on your site to be available through HTTPS:

    /login.php
    /loginhandler.php
    

    login.php contains the login form, where the user inputs their username / password, and this form will submit to loginhandler.php.

    This way, no one on your clients' network can modify this form when the user requests login.php, as it is served through HTTPS.

    Your loginhandler.php is also served through HTTPS, so no one on any clients' network will be able to see the username / password they sent to the server when logging in.

    HOWEVER:

    If the rest of the "logged-in" content of the site is not in HTTPS, an attacker will be able to inject anything he wants (and see all the content the logged-in user requests).

    For instance, he may inject a "You have been logged out, please provide your login details: (form)" message onto any page, where the form would submit to his own server instead of yours. Then the users' password will be compromised.

    An attacker will also be able to inject malicious to the index of the site before the user has even gotten to /login.php, redirecting them to different sites, or even changing the address of the login button on your site.

    Edit / A note om MitM attacks:

    Man-in-the-middle attacks only work if the attacker has control of the network. This can include (but is not limited to): your ISP, your employer at work, your neighbor if you connect to his network, etc.

    Lastly, if an attacker wants to INJECT (change) content on a website, he will need to be targeting a specific website (this can of course be automated, usually for bigger volume sites). Listening for data is much easier than modifying it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值