搜尋
首頁運維安全使用ZoomEye尋找APT攻擊的範例分析

ZoomEye線上的數據是覆蓋更新的模式,也就是說第2次掃描如果沒有掃描到數據就不會覆蓋更新數據,ZoomEye上的數據會保留第1次掃描獲取到的banner數據,這個機制在這種惡意攻擊溯源裡其實有著很好的場景契合點:惡意攻擊比如Botnet、APT等攻擊使用的下載伺服器被發現後一般都是直接停用拋棄,當然也有一些是被駭的目標,也是很暴力的直接下線!所以很多的攻擊現場很可能就被ZoomEye線上緩存。

當然在ZoomEye歷史api裡提供的數據,不管你覆蓋不覆蓋都可以查詢出每次掃描得到的banner數據,但是目前提供的ZoomEye歷史API只能透過IP去查詢,而不能通過關鍵字匹配搜索,所以我們需要結合上面提到的ZoomEye線上快取資料搜尋定位配合使用。

案例一:Darkhotel APT

在前幾天其實我在「黑科技」知識星球裡提到了,只是需要修復一個「bug」:這次Darkhotel使用的IE 0day應該是CVE-2019-1367 而不是CVE-2020-0674(感謝廋肉丁@奇安信),當然這個「bug」不影響本文的主題。

使用ZoomEye尋找APT攻擊的範例分析

從上圖可以看出我們透過ZoomEye線上資料定位到了當時一個Darkhotel水坑攻擊現場IP,我們使用ZoomEye SDK查詢這個IP的歷史記錄:

╭─heige@404Team ~╰─$python                                                                                                                                    Python 2.7.16 (default, Mar 15 2019, 21:13:51)[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwinType "help", "copyright", "credits" or "license" for more information.
 import zoomeye
 zm = zoomeye.ZoomEye(username="xxxxx", password="xxxx")
 zm.login()
 u'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX...'
 data = zm.history_ip("202.x.x.x")
 22

列舉ZoomEye歷史資料裡收錄這個IP資料的時間節點及對應埠服務

 ...
 >>>for i in data['data']:
 ...     print(i['timestamp'],i['portinfo']['port'])
 ...
 (u'2020-01-28T10:58:02', 80)
 (u'2020-01-05T18:33:17', 80)
 (u'2019-11-25T05:27:58', 80)
 (u'2019-11-02T16:10:40', 80)
 (u'2019-10-31T11:39:02', 80)
 (u'2019-10-06T05:24:44', 80)
 (u'2019-08-02T09:52:27', 80)
 (u'2019-07-27T19:22:11', 80)
 (u'2019-05-18T10:38:59', 8181)
 (u'2019-05-02T19:37:20', 8181)
 (u'2019-05-01T00:48:05', 8009)
 (u'2019-04-09T16:29:58', 8181)
 (u'2019-03-24T20:46:31', 8181)
 (u'2018-05-18T18:22:21', 137)
 (u'2018-02-22T20:50:01', 8181)
 (u'2017-03-13T03:11:39', 8181)
 (u'2017-03-12T16:43:54', 8181)
 (u'2017-02-25T09:56:28', 137)
 (u'2016-11-01T00:22:30', 137)
 (u'2015-12-30T22:53:17', 8181)
 (u'2015-03-13T20:17:45', 8080)
 (u'2015-03-13T19:33:15', 21)

我們再看看被植入IE 0day的進行水坑攻擊的時間節點及連接埠:

>>> for i in data['data']:
 ...     if "164.js" in i['raw_data']:
 ...             print(i['timestamp'],i['portinfo']['port'])
 ...
 (u'2020-01-28T10:58:02', 80)
 (u'2020-01-05T18:33:17', 80)
 (u'2019-11-25T05:27:58', 80)
 (u'2019-11-02T16:10:40', 80)
 (u'2019-10-31T11:39:02', 80)
 (u'2019-10-06T05:24:44', 80)

很顯然這個水坑攻擊的大致時間區間是從2019-10-06 05:24:44到2020-01-28 10:58:02,另外這個IP很顯然不是攻擊者購買的VPS之類,而是直接攻擊了某個特定的網站來作為「水坑」進行攻擊,可以確定的是這個IP網站早在2019-10-06之前就已經被入侵了!從這個水坑的網站性質可以基本推斷Darkhotel這次攻擊的主要目標就是訪問這個網站的用戶!

我們繼續列舉下在2019年這個IP開了哪些連接埠服務,從而幫助我們分析可能的入侵點:

>>> for i in data['data']:
 ...     if "2019" in i['timestamp']:
 ...             print(i['timestamp'],i['portinfo']['port'],i['portinfo']['service'],i['portinfo']['product'])
 ...
 (u'2019-11-25T05:27:58', 80, u'http', u'nginx')
 (u'2019-11-02T16:10:40', 80, u'http', u'nginx')
 (u'2019-10-31T11:39:02', 80, u'http', u'nginx')
 (u'2019-10-06T05:24:44', 80, u'http', u'nginx')
 (u'2019-08-02T09:52:27', 80, u'http', u'nginx')
 (u'2019-07-27T19:22:11', 80, u'http', u'nginx')
 (u'2019-05-18T10:38:59', 8181, u'http', u'Apache Tomcat/Coyote JSP engine')
 (u'2019-05-02T19:37:20', 8181, u'http', u'Apache Tomcat/Coyote JSP engine')
 (u'2019-05-01T00:48:05', 8009, u'ajp13', u'Apache Jserv')
 (u'2019-04-09T16:29:58', 8181, u'http', u'Apache httpd')
 (u'2019-03-24T20:46:31', 8181, u'http', u'Apache Tomcat/Coyote JSP engine')

很典型的JSP運作環境,在2019年5月的時候開了8009端口,Tomcat後台管理弱口令等問題一直都是滲透常用手段~~

#順帶提一句,其實這次的攻擊還涉及了另外一個IP,因為這個IP相關端口banner因為更新被覆蓋了,所以直接透過ZoomEye線上搜尋是搜尋不到的,不過如果你知道這個IP也可以利用ZoomEye歷史資料API來查詢這個IP的歷史數據,這裡就不詳細展開了。

案例二:毒雲藤(APT-C-01)

關於毒雲藤(APT-C-01)的詳細報告可以參考 https://ti.qianxin.com/uploads/2018/09/20/6f8ad451646c9eda1f75c5d31f39f668.pdf我們直接把關注點放在

#「毒雲藤組織使用的一個用於控制和分發攻擊的載荷控制域名  http://updateinfo.servegame.org”

「然後從 

hxxp://updateinfo.servegame.org/tiny1detvghrt.tmp

下載payload」

URL上,我們先試著找下這個網域對應的IP,顯然到現在這個時候還沒有太大收穫:

╭─heige@404Team ~╰─$ping updateinfo.servegame.orgping: cannot resolve updateinfo.servegame.org: Unknown host

在奇安信的報告裡我們可以看到使用的下載伺服器WEB服務目錄可以遍歷

使用ZoomEye尋找APT攻擊的範例分析

所以我們應該可以直接嘗試搜尋那個檔案名稱“tiny1detvghrt.tmp”,果然被我們找到了

使用ZoomEye尋找APT攻擊的範例分析

這裡我們可以基本確定了updateinfo. servegame.org對應的IP為165.227.220.223 那麼我們開始老套路查詢歷史資料:

  >>> data = zm.history_ip("165.227.220.223")
    >>> 9
    >>> for i in data['data']:
     ...     print(i['timestamp'],i['portinfo']['port'])
     ...
     (u'2019-06-18T19:02:22', 22)
     (u'2018-09-02T08:13:58', 22)
     (u'2018-07-31T05:58:44', 22)
     (u'2018-05-20T00:55:48', 80)
     (u'2018-05-16T20:42:35', 22)
     (u'2018-04-08T07:53:00', 80)
     (u'2018-02-22T19:04:29', 22)
     (u'2017-11-21T19:09:14', 80)
     (u'2017-10-04T05:17:38', 80)

繼續看看這個tiny1detvghrt.tmp部署的時間區間:

>>> for i in data['data']:
 ...     if "tiny1detvghrt.tmp" in i['raw_data']:
 ...             print(i['timestamp'],i['portinfo']['port'])
 ...
 (u'2018-05-20T00:55:48', 80)
 (u'2018-04-08T07:53:00', 80)
 (u'2017-11-21T19:09:14', 80)

最起碼可以確定從2017年11月底就已經開始部署攻擊了,那麼在這個時間節點之前還有一個時間節點2017-10-04 05:17:38,我們看看他的banner資料:

>>> for i in data['data']:
 ...     if "2017-10-04" in i['timestamp']:
 ...             print(i['raw_data'])
 ...
 HTTP/1.1 200 OK
 Date: Tue, 03 Oct 2017 21:17:37 GMT
 Server: Apache
 Vary: Accept-Encoding
 Content-Length: 1757
 Connection: close
 Content-Type: text/html;charset=UTF-8nbsp;HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 
  <title>Index of /</title>
 
 <h2 id="Index-of">Index of /</h2>
  
           
Name a> Last modified a> Size a> Description a>

doajksdlfsadk.tmp a> 2017-09-15 08:21   4.9K  
doajksdlfsadk.tmp.1 a> 2017-09-15 08:21   4.9K  
doajksdlrfadk.tmp a> 2017-09-27 06:36   4.9K  
dvhrksdlfsadk.tmp a> 2017-09-27 06:38   4.9K  
vfajksdlfsadk.tmp a> 2017-09-27 06:37   4.9K  
wget-log a> 2017-09-20 07:24   572   

從這個banner資料裡可以得出結論,這個跟第一個案例裡目標明確的入侵後植入水坑不一樣的是,這個應該是攻擊者自主可控的伺服器,從doajksdlfsadk.tmp這些文件命名方式及文件大小(都為4.9k)基本上可以推斷這個時間節點應該是攻擊者進行攻擊之前的實戰演練!所以這個IP伺服器一開始就是為了APT攻擊做準備的,到被發現後就直接拋棄!

以上是使用ZoomEye尋找APT攻擊的範例分析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文轉載於:亿速云。如有侵權,請聯絡admin@php.cn刪除

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

SecLists

SecLists

SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

將Eclipse與SAP NetWeaver應用伺服器整合。

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)