会话劫持实践

发布于 2024-08-13 06:47:33 字数 201 浏览 8 评论 0原文

我最近一直在阅读有关会话修复/劫持的内容,并了解其理论。

我不明白的是,这在实践中将如何利用。您是否需要篡改您的浏览器才能使用被盗的 cookie?将其附加到 URL 并将其传递给 Web 应用程序?

或者您会编写某种自定义脚本来利用它,如果是的话它会做什么?

我并不是想寻求有关此问题或示例的帮助,但我想了解更多并理解。任何帮助表示赞赏。

I have been reading up on session fixing/hijacking recently, and understand the theory.

What I don't understand is how this would be exploited in practice. Would you have to tamper with your browser to make use of the stolen cookies? Append it to the URL and pass it to the web application?

Or would you write some sort of custom script to make use of this, and if so what would it do?

I'm not trying to ask for help with this or examples, but I am trying to learn more and understand. Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

念三年u 2024-08-20 06:47:33

伪造 cookie 是微不足道的。正如 Klaus 所提到的,您可以直接在浏览器中完成此操作。

下面是一个如何利用此漏洞的实际示例:

  • 您登录到银行站点
  • 银行站点将会话 ID 放入 cookie 中,例如 123456
  • 您的浏览器在每次请求时都会将会话 ID 发送到服务器。服务器查看他的会话存储并将您识别为不久前登录的用户
  • 我以某种方式访问​​您的cookie,或者我嗅探您的HTTP请求之一(使用SSL不可能),并找出您的会话ID:123456
  • 我为你的银行网站伪造了一个cookie,其中包含会话ID
  • 银行网站将我识别为你,仍然登录
  • 我将你所有的资金转移到我在瑞士的秘密账户并购买了一艘大得离谱的船

当然,在实践中会有更多的安全性在知名网站上(例如,可以检查会话 ID 是否永远不会传输到另一个客户端 IP 地址),但这就是会话劫持工作原理的要点。

Forging a cookie is trivial. As mentioned by Klaus, you can do it right out of your browser.

Here's a practical example of how this could be exploited:

  • You login to your banking site
  • Banking site puts a session ID into a cookie, say 123456
  • Your browser sends the session ID to the server on every request. The server looks at his session store and recognizes you as the user who logged in a little while ago
  • I somehow gain access to your cookies, or I sniff one of your HTTP requests (impossible with SSL), and find out your session id: 123456
  • I forge a cookie for your banking site, containing the session ID
  • Banking site recognizes ME as you, still logged in
  • I transfer all your funds to my secret account in Switzerland and buy a ridiculously large boat

Of course, in practice there will be more security on high profile sites (for instance, one could check that a session ID never transfers to another client IP address), but this is the gist of how session hijacking works.

丘比特射中我 2024-08-20 06:47:33

如果您使用 Firefox,则有一个名为 TamperData 的插件,可让您更改发送到服务器的所有内容的值。因此,如果我可以读取您的会话 cookie,我基本上可以使用我的 firefox 访问该站点并使用 tamperdata 向其发送您的会话 cookie 值而不是我自己的值,从而劫持您的会话。

/克劳斯

If you use firefox there is a plugin called TamperData that lets you change the values of everything that is sent to a server. So if I could read your session cookie, I could basically just go to that site with my firefox and use tamperdata to send it your session cookie value instead of my own, thus hijacking your session.

/Klaus

得不到的就毁灭 2024-08-20 06:47:33

互联网并不是一个神奇的黑匣子,浏览器只能按照网站希望的方式使用它。

您可以编辑 cookie 或 POST 数据或 GET 会话变量,或者编写一个简单的脚本来执行此操作。最后,您要做的就是发送 HTTP 请求并用您想要的任何内容替换会话数据。

The internet isn't a magical black box that can only be utilized by browsers in the way the site wants you to.

You can edit your cookies or POST data or GET session variables, or write a simple script to do it. In the end all you're doing is sending HTTP requests and substituting your session data with whatever you want.

久伴你 2024-08-20 06:47:33

您是否需要篡改您的浏览器才能使用被盗的 cookie?

您可以,但在查看目标站点的页面时,在地址栏中键入 javascript:document.cookie='stolencookie=somevalue' 可能会更容易。

Would you have to tamper with your browser to make use of the stolen cookies?

You could, but it would probably be easier just to type javascript:document.cookie='stolencookie=somevalue' in the address bar whilst viewing a page from the target site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文