iT邦幫忙

2024 iThome 鐵人賽

DAY 11
0
Security

資安日誌分析系列 第 11

11. Windows 網站入侵分析(WordPress)-1

  • 分享至 

  • xImage
  •  

說明

放在外部Internet的服務總是遭受各總刺探及攻擊,這章來看一下Windows IIS Log

作法

IIS環境建立

Windows Server IIS 如何安裝 PHP 網頁伺服器
https://ithelp.ithome.com.tw/articles/10259359
同一個邦友把Wordpress架起來
https://ithelp.ithome.com.tw/articles/10260063

日誌設定

預設路徑在 %SystemDrive%\inetpub\logs\LogFiles
https://ithelp.ithome.com.tw/upload/images/20240925/20077752h5EMB8q6rl.png

日誌欄位

原始用戶端 IP預設不會開啟,參考微軟文章添加
[使用進階記錄設計自定義 IIS 記錄檔功能變數名稱]
https://learn.microsoft.com/zh-tw/troubleshoot/developer/webapps/iis/general/customize-iis-log-file-field-names
https://ithelp.ithome.com.tw/upload/images/20240925/20077752vKDdaUXJeT.png

欄位說明參考
https://learn.microsoft.com/zh-tw/iis/manage/provisioning-and-managing-iis/configure-logging-in-iis

日期(日期):要求發生的日期。
時間(時間):要求發生時間的時間,以國際標準時間(UTC) 為單位。
用戶端 IP 位址 (c-ip):提出要求的用戶端 IP 位址。
用戶名稱 (cs-username):存取伺服器之已驗證用戶的名稱。 匿名使用者會以連字號表示。
服務名稱 (s-sitename):滿足要求的月臺實例編號。
伺服器名稱 (s-computername):產生記錄檔專案之伺服器的名稱。
伺服器 IP 位址 (s-ip):產生記錄檔專案之伺服器的 IP 位址。
伺服器埠 (s-port):為服務設定的伺服器埠號碼。
方法 (cs-method):要求的動作,例如 GET 方法。
URI Stem (cs-uri-stem):動作的通用資源標識符或目標。
URI 查詢 (cs-uri-query):客戶端嘗試執行的查詢,如果有的話。 只有針對動態頁面才需要執行通用資源識別元 (URI) 查詢。
通訊協議狀態 (sc-status):HTTP 或 FTP 狀態代碼。
通訊協議子狀態 (sc-substatus):HTTP 或 FTP 子狀態代碼。
Win32 狀態 (sc-win32-status):Windows 狀態代碼。
Bytes Sent (sc-bytes):伺服器傳送的位元元組數目。
Bytes Received (cs-bytes):伺服器接收的位元元組數目。
所花費的時間(時間):動作以毫秒為單位所花費的時間長度。
通訊協定版本 (cs-version):用戶端使用的通訊協定版本。
主機 (cs-host):如果有的話,主機名。
使用者代理程式(cs(UserAgent):用戶端所使用的瀏覽器類型。
Cookie(cs(Cookie):如果有任何內容,則為所傳送或接收的 Cookie 內容。
查閱者 (cs(Referrer):使用者上次瀏覽的網站。 這個網站提供了目前網站的連結。

攻擊

Wordpress常被駭客用wpscan掃有哪些弱點,看一下這個產生什麼Log

$ wpscan --url http://192.168.171.11/wordpress
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

         WordPress Security Scanner by the WPScan Team
                         Version 3.8.18
       Sponsored by Automattic - https://automattic.com/
       @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart

分析被WPSCAN網站的IIS Log,可以看到使用很多不常見Method(1),會去爬robots.txt及xmlrpc.php這些人為不會連到的頁面,最後user-agent是WPSCAN,一般正常會是Firefox或Chrome(雖然還是可以假造)
https://ithelp.ithome.com.tw/upload/images/20240925/20077752ZV3qg5TE1m.png

REF

Microsoft文章 安裝 IIS
https://learn.microsoft.com/zh-hk/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules

Configure Logging in IIS
https://learn.microsoft.com/en-us/iis/manage/provisioning-and-managing-iis/configure-logging-in-iis

https://www.npartner.com/download/document/tech-documentation/N-Partner_Windows_IIS_Log-TW.pdf


上一篇
10. 環境建立-LogServer(Elastic Security)
下一篇
12. Windows 網站入侵分析(WordPress)-2
系列文
資安日誌分析30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言