作者momo81 (毛毛)
看板ask
標題[請問] Web Server Log
時間Wed Nov 26 00:37:59 2014
想請問 假如 網頁表單是用POST method去提交帳號密碼 跟後端的資料庫系統比對 符合的話登入 不符合則不能登入 這樣子利用POST method方式去提交 會比較安全 但是我自己實作一次 環境是用iis 單純檢查SERVER的LOG 想看自己送出了甚麼 發現連W3C格式的Web server Log裡 也都沒有顯示提交了什麼... 這樣子的話 單純檢查Log 好像也檢查不出來 別人提交了什麼? 是吧? 是的話 這樣子Log檔 在某些情況下...好像就變成沒有用了? --
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 202.5.249.97 ※ 文章網址: http://www.ptt.cc/bbs/ask/M.1416933481.A.518.html ※ 編輯: momo81 (202.5.249.97), 11/26/2014 00:39:14
推 banqhsia: 基本上我不建議你用這種方式檢查登入的合法性,第一 11/26 00:49
→ banqhsia: Log 跟 程式 是獨立運作的,互不相干 11/26 00:49
→ banqhsia: 第二,POST 本來就不會顯示資料 (get還會在log裡面留下 11/26 00:50
→ banqhsia: 網址) 。POST在Log裡面只看的到存取檔名而已 11/26 00:50
→ banqhsia: 要做檢查,我會建議你 1.檢查輸入資料(我不知道asp是 11/26 00:51
→ banqhsia: 什麼語法,但php可以用 preg_match 去比對 regex,過濾 11/26 00:52
→ banqhsia: 輸入的資料,防止SQL Injection對資料庫造成傷害 11/26 00:52
→ banqhsia: 2.程式裡面可以用類似session變數的方式,去存使用者登 11/26 00:53
→ banqhsia: 入時產生的唯一識別碼(比如說timeStamp),登入成功之後 11/26 00:53
→ banqhsia: 只要檢查資料庫裡面有沒有這一筆 timeStamp 就好了 11/26 00:53
→ banqhsia: 如果重覆登入,因為timeStamp不符,舊的就會被踢掉 11/26 00:54
→ banqhsia: 同一時間只允許一個使用者登入。 11/26 00:54
This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.