1 頁 (共 2 頁)

[分享]Invalid_session的解決方法

發表於 : 2003-04-22 04:04
Mac
這是我以前寫的:

我到官網和其他論壇看了一下這方面的文章。基本上,2.0.4版強化了安全性方面的問題,但也因為這樣,再檢查用戶 IP 的時候,浮動 IP 用戶會因為 ISP 那端改變用戶的 IP,使的跟論壇資料庫的資料不同被視為駭客。

有興趣多看看這方面文章的朋友可以參考一下英文版的詳細解說:
Invalid session errors explanation"Invalid_Session" errors


如果你遇到"Invalid_Session",希望下面的方法可以解決這個問題
  • 1: 當遇到 Invalid_Session 後馬上用瀏覽器的 Back 返回編輯視窗

    2: 複製你打入的內容,然後回到論壇版面,再按一次發表主題或回覆文章

    3: 貼上剛剛複製的內容,然後馬上送出文章
其他方法: 複製內容,按下重新整理鍵,然後貼上文章馬上送出\r
其他方法:到 IE 選項裡,清除所有 Cookie

~Mac

發表於 : 2003-04-23 03:24
Mac
移除 Session_ID 檢查:
把受到影響的 php 檔中,找到下面的程式碼,將之移除\r

p.s. 移除這個檢查會帶來的安全上的漏洞,刪除前先三思吧\r

代碼: 選擇全部

// session id check 
if ($sid == '' || $sid != $userdata['session_id']) 
{ 
   message_die(GENERAL_ERROR, 'Invalid_session'); 
} 
~Mac

發表於 : 2003-04-23 22:42
hkiforum
Mac 寫:移除 Session_ID 檢查:
把受到影響的 php 檔中,找到下面的程式碼,將之移除\r

p.s. 移除這個檢查會帶來的安全上的漏洞,刪除前先三思吧\r

代碼: 選擇全部

// session id check 
if ($sid == '' || $sid != $userdata['session_id']) 
{ 
   message_die(GENERAL_ERROR, 'Invalid_session'); 
} 
~Mac
請問那些檔案含有以上的php碼?因為我想將所有Invalid_session剷除。

發表於 : 2003-04-23 23:04
Mac
hkiforum 寫:請問那些檔案含有以上的php碼?因為我想將所有Invalid_session剷除。
以下 php 檔案是 這一篇 裡 coca 找到的
\phpBB2\login.php
\phpBB2\modcp.php
\phpBB2\privmsg.php
\phpBB2\uacp.php
\phpBB2\includes\usercp_email.php
\phpBB2\includes\usercp_register.php
\phpBB2\includes\usercp_sendpasswd.php
\phpBB2\docs\mods\attachment mod\scripts\patches\attachmod235_patch (這個是 attachment 外掛的檔案)
如果有遺漏,可以在發生 Invalid_session 時把問題檔案記下來,再自行移除\r

~Mac

發表於 : 2003-04-24 11:01
流龍馬
會有什麼安全性的問題

發表於 : 2003-04-25 03:49
akimasa
流龍馬 寫:會有什麼安全性的問題
我也想知道說!了解的人能否分享一下。

發表於 : 2003-04-25 06:56
Mac
The problem with using just a session_id is that it becomes very easy to hijack (takeover) a session. All a user need do is obtain the session_id and add it to the url as they browse the board. If the id they grab happens to be a logged in admin or moderator ... well you get the picture.

What we do to help complicate the situation is also tie the session to the users IP. Using this method someone would need to spoof an IP and obtain the session_id in order to hijack a session, not incredibly difficult but certainly harder ... and with this sort of software it's really a case of making everything harder to do, thus disuading all but the most ardent "hackers" from bothering to attempt anything.
取自英文的 Invalid_session 錯誤解說,完整的解說請看第一篇
如果安全檢查只檢查用戶的 session_id,那麼駭客只需要取得您的 session_id,貼在 URL 後,他便可以輕易的"成為那一個人",如果那 session_id 剛好是屬於版主或管理員的話,那後果您就可以想像的到了

phpbb 2.0.4 版所用的安全檢查不僅使用 session_id,而且使用那個 session_id 的用戶得擁有正確的 IP,否則便會發生 Invalid_session 的問題。這樣子將會使駭客較難 Hack 您的論壇

~Mac

發表於 : 2003-04-26 23:35
william91
我已經刪除了Mac說的程式碼...但還有這問題~!

發表於 : 2003-04-30 00:53
paulso
可是我有些帳號, 他們說登錄開帳號時已經invalid_sessions...
開不倒帳號

發表於 : 2003-05-08 23:57
chenghwa
我也碰到相同的問題
可以看文章
但不能貼文章

發表於 : 2003-05-11 10:44
流龍馬
有冇人試過之後功成

發表於 : 2003-05-11 11:54
cony
我的經驗, 不知大家的情形是不是跟我一樣\r

沒有外掛mod好像不會出現Invalid_Session
加了外掛就很容易有這個問題
所以我每加一個外掛就會先試試, 有問題就不安裝

發表於 : 2003-05-11 15:42
chenghwa
是這樣啊

發表於 : 2003-05-11 17:43
godbless
基本上跟你裝了多少個MODS沒關係...初裝就發生過了

發表於 : 2003-05-12 14:35
流龍馬
godbless 寫:基本上跟你裝了多少個MODS沒關係...初裝就發生過了
yes