ActiveX - Active Exploitation

二维码解码QRCODE & VC & ActiveX 二维码解码QRCODE VC ActiveX decoder_activex_VC 立即下载
 warlord 
warlord@nologin.org
http://www.nologin.org

Share what I know, learn what I don't

1) Foreword

First of all, I'd like to explain what this paper is all about, and
especially, what it is not. A few months ago I got into the technical details
of ActiveX for the first time.  Prior to this point I only had some vague
ideas and a general understanding of what it is and how it works.  What I did
first is probably quite obvious: I googled.  To my surprise though, I could
not find a single paper discussing ActiveX and how to exploit it. My next step
was to contact some generally smart and knowledgable friends to harvest the
required information from them. I was even more surprised to find that some of
the most skilled people out there lacked the same knowledge that I did.
Perhaps it's our common background, coming from the Unix/Linux world, but
whatever the reason, I had to work to collect the information I now possess.
But still, I feel like I'm the one-eyed man explaining what the world looks
like to the blind.

The fact that there are tons of ActiveX exploits on Milw0rm which would
suggest that the knowledge is out there by now. I wonder why no one took the
time to write it all up so the less knowledgable may get into this theater as
well. It's the intention of this paper to fill this gap. If you already know
everything about ActiveX, if you've found your own 0day and exploited it
successfully, I probably can't teach you any new tricks. Everyone else I
invite to read on.

2) Introduction

ActiveX[1] is a Microsoft technology introduced in 1996 and based on
the Component Object Model (COM) and Object Linking and Embedding (OLE)
technologies. The intention of COM has been to create easily reusable pieces of
code by creating objects that offer interfaces which can be called by other
COM objects or programs. This technology is widely used for what
Microsoft calls ActiveX[2] which represents the integration of COM
into Internet Explorer.  This integration offers the ability to interface
with Windows as well as third-party applications with the MS browser. This
allows for the easy extension of functionality in the Internet Explorer by
giving software developers the ability to create complex applications which
can interface with websites through the browser.

There are various ways for an ActiveX control to end up on any given machine.
Besides all the controls which are part of IE or the operating system,
programs may install and register ActiveX controls of their own to offer a
diverse set of functions in IE. Another way of installing a new control is
through web sites themselves. Depending on Internet Explorer security
settings, a website may try to instantiate a control, for example Shockwave
Flash, and failing to do so may prompt the user to install the Shockwave Flash
ActiveX control.

Security issues seems to be a constant problem with ActiveX controls.
In fact, it seems most vulnerabilities in Windows nowadays are actually due to
poorly-written third-party controls which allow malicious websites to exploit
buffer overflows or abuse command injection vulnerabilities.  Quite often
these controls make the impression of their authors not having realized their
code can be instantiated from a remote website. 

The following chapters will describe methods to find, analyze, and exploit
bugs in ActiveX controls will be presented to the reader.

3) Control and functionality enumeration

Any given Windows installation is likely to have a significant number of
registered COM objects.  For the purpose of this paper, however, we are only
interested in controls which may be instantiated from a website.  Quite a
number of the following details are taken out of the excellent "The Art
of Software Security Assessment"[3], a book I strongly recommend to
anyone interested in application security.

ActiveX controls are usually, but not always, instantiated by passing their
CLSID to CoCreateInstance. The respective class identifier (CLSID) is used as
a unique value which is associated with each control in order to distinguish
it from its peers. A list of all the existing CLSIDs on a given Windows
installation can be found in the registry in HKEY_CLASSES_ROOT/CLSID, which
actually is nothing but an alias to HKEY_LOCAL_MACHINE/Software/Classes/CLSID.

Within the CLSID key there are thousands of different class identifiers, all
of them specifying ActiveX controls. However, only a subset of those can be
instantiated by a website.  Controls marked as safe for scripting are granted
this ability. To determine whether a certain control has this ability, it has
to be part of the respective category.  Specifically, the category can be
found in the registry in the form: HKEY_CLASSES_ROOT/CLSID/<control
clsid>/Implemented Categories.  If a control is safe for scripting it may
indicate this by having a subkey with the GUID
7DD95801-9882-11CF-9FA9-00AA006C42C4. Similarly, the 'safe for initialization'
category is listed in the same location, but with a slightly different GUID.
Its value is 7DD95802-9882-11CF-9FA9-00AA006C42C4.

In the end though, not being part of these categories doesn't necessarily mean
that a control cannot be called from IE. The component may dynamically report
itself as being safe for scripting when it is instantiated through IE. The
only surefire way is to try and instantiate a control and see if it can be
used.  Axman[5] is an ActiveX fuzzer written by HD Moore which can automate this
check for all of the different CLSIDs on a system.  Another tool to enumerate
the controls in question is iDefense's ComRaider[4], another ActiveX fuzzer,
which has the ability to build a database of controls that IE should be able
to instantiate. 

3.1) ProgIDs

Besides the long and rather hard to memorize CLSID there is often a second
way of instantiating a certain control. This can be accomplished through the
use of a control's program ID (progID). Quite similar to IP addresses and the
domain name system(DNS), progIDs can be looked up to determine the matching
CLSID.  Once the right one has been determined, Internet Explorer goes on as
if the CLSID had been provided in the first place.

For this technique to work for a given control, two requirements must be met.
First, a control must have a ProgID subkey under their CLSID key in the
register.  ProgIDs are usually in the form Program.Component.Version such as
SafeWia.Script.1. Second, as there is no point for Windows to walk through up
to 2700 CLSIDs(in my example) to find the specified ProgID, the program ID
itself must have a key in HKEY_CLASSES_ROOT with a subkey named CLSID which
describes makes the association.

3.2) The Kill Bit

In some cases it is desirable to restrict a control from ever being
instantiated in IE.  This can be accomplished through the use of a
kill bit.  The kill bit can be defined by setting the 0x00000400 bit
in the  DWORD associated with a given CLSID:

HKLM/SOFTWARE/Microsoft/Internet Explorer/ActiveX Compatibility/<CLSID>

3.3) User Specific Controls

With Windows XP, Microsoft introduced support for user-specific ActiveX
controls. These do not require Administrator-level access to install because
the controls are specific to a certain user, as the name already implies.
These controls can be found under HKEY_CURRENT_USER/Software/Classes.  While
this functionality exists, most ActiveX controls are installed globally.

3.4) Determining Exported Functions

ActiveX controls implement various COM interfaces in the same manner as any
other COM object. COM interfaces are well-defined definitions of what
functions and properties a COM class must implement and support.  COM provides
the ability to dynamically query a COM class at runtime using QueryInterface
to see what interfaces it implements.  This is how IE determines if a control
supports the safe for scripting interface (which is called IObjectSafety).

4) Examples

4.1) MW6 Technologies QRCode ActiveX 3.0

In this section the previously provided information will be demonstrated with
the help of a recent public ActiveX vulnerability and exploit. The vulnerable
control is from a company called WM6 and comes with their ``QRCode ActiveX''
version 3.0. When I downloaded the software in January 2008, several months
after the exploit was posted on Milw0rm in September, the vulnerable control
was still part of the package.

The control itself has a CLSID of 3BB56637-651D-4D1D-AFA4-C0506F57EAF8. After the
installation of the software, it can be found in the registry in:

HKEY_CLASSES_ROOT/CLSID/{3BB56637-651D-4D1D-AFA4-C0506F57EAF8}

The DLL that implements this control can be found on the harddrive in the file
that is specified in the "InprocServer32" key. In this example it is:

C:/WINDOWS/system32/MW6QRC~1.DLL

There are two interesting things to note here. For one, the ProgID key has a
default value of MW6QRCode.QRCode.1. At the ProgID's corresponding location in
the registry, namely HKCR/MW6QRCode.QRCode.1, the CLSID subkey contains the
CLSID of that control.  This tells us that this control can be instantiated
using both its CLSID and ProgID.  Another point of interest in the screenshot
is the absence of the "Implemented Categories" key.  This means that this
control is neither part of the "safe for scripting" nor the "safe for
initialization" category.  However, it appears that the control must implement
IObjectSafety since it is still possible to instantiate the control from IE.
The following simple HTML code tries to instantiate the control.

<body>
<object classid='clsid:3BB56637-651D-4D1D-AFA4-C0506F57EAF8' id='test'>
</object>
</body>

The result of this snippet of code is the appearance of a little picture in IE.
As this works just fine without Internet Explorer complaining about being
unable to load the control, the next examination step is in order.

4.1.1) Enumerating Exported Interfaces

By now it has been shown that the example control can be instantiated from IE
just fine. The question now is what kind of interfaces the control provides to
the caller.  By submitting the specific CLSID of the control that is to be
examined to ComRaider, the tool lists all of the controls implemented
functions as well as the kind and number of expected parameters. An
alternative to ComRaider is the so-called OLE-COM object viewer that comes
with the platform SDK and Visual Studio.

4.1.2) Exploitation

After playing around with various functions, it soon becomes obvious that
SaveAsBMP and SaveAsWMF happily accept any path provided to save the
generated graphic in the specified location.  This can make it possible to
overwrite existing files with the picture if the user running IE has
sufficient access.  This is a perfect example of a program using untrusted
data and operating on it without any kind of checks. It is likely that the
control's author did not consider the security implications of what they were
doing.

A sample exploit for this vulnerability, written by shinnai, can be found on
Milw0rm: http://www.milw0rm.com/exploits/4420.

4.2) HP Info Center

On December 12th, 2007, a vulnerability in an ActiveX control which was
shipped by default with multiple series of Hewlett Packard notebooks was
disclosed.  The issue itself was found in a piece of software called the HP
Info Center.  The vulnerability allowed remote read and write access to the
registry as well as the execution of arbitrary commands.  By instantiating
this control in Internet Explorer and calling the vulnerable functions it was
possible to run software with the same level of access as the user running IE.
Porkythepig found and disclosed this serious threat and wrote a detailed
report as well as a sample exploit covering three attack vectors.

The HP control with the CLSID 62DDEB79-15B2-41E3-8834-D3B80493887A was
responsible for the listed vulnerabilities. By default it installs itself into
C:/Program Files/Hewlett-Packard/HP Info Center.   In his advisory, porky
listed three potentially insecure methods as well as the expected parameters:

- VARIANT GetRegValue(String sHKey, String sectionName, String keyName);
- void SetRegValue(String sHKey, String sSectionName, String sKeyName, String sValue);
- void LaunchApp(String appPath, String params, int cmdShow);

While the first and second method allow for remote read and write access to
the registry, the third function runs arbitrary programs.  For example, an
attacker could execute cmd.exe with arbitrary arguments.

In this example the vulnerable control provided remote access to the victims
machine. Sample code to exploit all three functions can once again be found on
Milw0rm: http://www.milw0rm.com/exploits/4720.

4.3) Vantage Linguistics AnswerWorks

The third and last example of various ActiveX vulnerabilities is in the
Vantage Linguistics AnswerWorks. Advisories covering this vulnerability were
released in December, 2007. The awApi4.AnswerWorks.1 control exports several
functions which are prone to stack-based buffer overflows. The functions
GetHistory(), GetSeedQuery(), and SetSeedQuery() fail to properly handle long
strings provided by a malicious website. The resulting stack-based buffer
overflow allows for the execution of arbitrary code, as "e.b." demonstrates
with a proof of concept that binds a shell to port 4444 when the exploit
succeeds. 

When the exploit is loaded from a webserver it instatiates the CLSID and links
the created object to a variable named obj. It then calls the GetHistory()
function with a carefully crafted string which consists of 214 A's to fill the
buffer followed by a return address which overwrites the one saved on the
stack.  After those 4 bytes come 12 NOPs and then finally the shellcode. As
one can easily see, this exploit is based on the same techniques that can be
seen in many other stack-based exploits.

The exploit mentioned in this example can also be found on Milw0rm:
http://www.milw0rm.com/exploits/4825.

5) Summary

This paper has provided a brief introduction to ActiveX.  The focus has been
on discussing some of the underlying technology and security related issues
that can manifest themselves.  This was meant to equip the reader with enough
background knowledge to examine ActiveX controls from a security point of
view. The author hopes he managed to describe the big picture in enough detail
to provide readers with enough information on the matter to base further
research on the aquired knowledge.

5.1) Acknowledgements

wastedimage - For answering the first questions
deft - For providing lots of answers and examples
rjohnson - For filling in details deft forgot to mention
skape - For background knowledge on underlying functions
hdm - For knowing all the rest

References

[1] ActiveX Controls @ Wikipedia
    http://en.wikipedia.org/wiki/ActiveXcontrol

[2] ActiveX Controls
    http://msdn2.microsoft.com/en-us/library/aa751968.aspx

[3] The art of software security assessment
    http://taossa.com

[4] ComRaider
    http://labs.idefense.com/software/fuzzing.php#morecomraider

[5] Axman ActiveX Fuzzer
    http://www.metasploit.com/users/hdm/tools/axman/
生成二维码的ActiveX控件 立即下载

相关推荐

利用Virtuoso IC 618进行LDO稳定性分析与补偿设计

本文详细介绍了如何利用Virtuoso IC 618进行LDO稳定性分析与补偿设计。通过搭建仿真环境、运行STB分析诊断环路问题,并深入探讨密勒补偿、调零电阻等关键技术,帮助工程师在Virtuoso平台中高效完成LDO的稳定性优化与验证,确保芯片在各种工艺角下的鲁棒性。

weixin_29170327的博客 168

Pond

2072. 【2016.10.6NOIP普及模拟】Pond  (File IO): input:pond.in output:pond.out 时间限制: 1000 ms  空间限制: 262144 KB  具体限制   Goto ProblemSet 题目描述        G最后在规定时间内完成了任务,Alice只能放行。         出

cdy1206473601的博客 5万+

UE5垃圾回收优化实战:定位GC卡顿与内存泄漏

垃圾回收(GC)是Unreal Engine 5中保障UObject内存安全的核心机制,其基于引用图的标记-清除原理决定了性能高度依赖引用结构合理性。当GC频繁触发或单次耗时突增,往往映射出蓝图强引用冗余、C++根对象管理失控或资源生命周期设计缺陷等底层问题。技术价值在于降低主线程阻塞、稳定60帧体验、抑制内存异常增长;典型应用场景包括关卡切换卡顿、UI打开后持续GC、打包后内存不释放等。本文聚焦UE5特有的Full GC模式、UObject生命周期约束及GC触发时机不可见性,提供从蓝图变量规范、TSoft

weixin_31995251的博客 364

UVa1585 Score

《算法竞赛入门经典(第2版)》 作者:刘汝佳  第三章习题3-1 输入O和X组成的串,统计得分 https://uva.onlinejudge.org//index.php?option=com_onlinejudge&Itemid=8&category=827 --------------------------------------------------E3-1.cpp-----

Anntonnia的博客 3万+

飞行器坐标转换

本文定义的是右手直角坐标系,x−y−zx-y-zx−y−z轴分别为北-天-东。从AAA坐标系到BBB坐标系是分别绕y−z−xy-z-xy−z−x轴,即天-东-北旋转ψ−θ−γψ−θ−γ。如果AAA是惯性系,BBB是机体系,则这三个角度分别为偏航角、俯仰角、横滚角。图1 惯性系到机体系。

gongfuyd的博客 1358

ANSYS ACT插件开发实战指南:从IronPython脚本到XML界面设计

本文提供了一份详尽的ANSYS ACT插件开发实战指南,重点讲解如何利用IronPython脚本实现仿真自动化,并通过XML设计用户友好的向导界面。内容涵盖从环境搭建、脚本编写(如自动创建材料)、界面控件绑定到调试打包的全流程,旨在帮助仿真工程师和团队负责人将重复性工作流程标准化,显著提升ANSYS软件的使用效率。

weixin_29310605的博客 459

HNU13383:The Big Painting

Problem description Samuel W. E. R. Craft is an artist with a growing reputation. Unfortunately, the paintings he sells do not provide him enough money for his daily expenses plus the new suppl

ACM!荣耀之路! 1万+

基于Flink的流式数据降维实现方案

理解为何实时场景需要降维(解决维度灾难)掌握Flink流处理与降维算法的结合方式学会用Flink实现一个可落地的流式降维系统覆盖内容包括:Flink流处理基础、降维算法选择(侧重在线算法)、Flink与降维的集成方案、实战代码示例,以及工业级场景的应用经验。本文从“为什么需要流式降维”出发,用“快递分拣”的生活案例引出核心概念;接着拆解Flink流处理、数据降维的底层逻辑;然后重点讲解“在线PCA”这一适合流式场景的降维算法,并用Flink实现一个完整的流式降维管道;

AI 领航者的博客 573

测测你的指纹,很准的……(男左女右吧!) (ZT)

1、oooox  有点能力,思想波动,见异思迁,讲信用   2 、ooxoo 朋友多,工作有成绩,感情深,性格开朗。   3 、ooooo 有信心,办事积极,有领导能力,身体健康,易挫折。   4 、oooxx 信用心强,心地善良。   5、 xxxxx  温顺有耐力,性格朴实,正直。   6 、oxxxo 花言巧语,诡计多端,以自己为主。   7、 xxxxo 机智,狡猾。   8 、xxxoo

blueseasand的专栏 6087

【WorkBuddy专栏19】技能的创造与迁移——从零开始打造你的AI工作流

【WorkBuddy专栏19】技能的创造与迁移——从零开始打造你的AI工作流

AI人人懂 390

DeerFlow 系列教程 第十四篇 | IM 渠道集成——让 DeerFlow 接入飞书、企微、Slack、Telegram

DeerFlow 系列教程 第十四篇本篇教程继续,全面剖析 DeerFlow 的 IM 渠道集成方案。我们将深入理解 Channel 抽象层设计、MessageBus 消息总线机制、ChannelManager 调度循环、四大 IM 平台(飞书、企业微信、Slack、Telegram)的适配实现,以及从 IM 消息到 Agent 响应再到 IM 回复的完整消息流转过程。

weixin_43674738的博客 421

hackableII靶机渗透记录

【代码】hackableII靶机渗透记录。

althumi的博客 3331

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

中国xo宝典(china xo)

今天你Q了没有? 新人类见面说 今天你O了没有? IT精英见面说 为什么那么大的人了也要o来o去呢?因为这个o实在是个好词,cxo是首席**官,首就是首领,再加上官字,听起来很过瘾的。其实国人官本位思想还是很浓厚的,再加上这是舶来品,真是土洋结合,天造地设了。 于是乎,忽如一夜东风来,经理们叫首席**官。CEO、CFO、CTO,等等叫开了,本来以为就这几个就可以了,挺酷的。谁知最近又冒出许多cxo

彼家有兔,狡兔三窟。 6万+

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

蓝桥杯-翻硬币

翻硬币 小明正在玩一个“翻硬币”的游戏。 桌上放着排成一排的若干硬币。我们用 * 表示正面,用 o 表示反面(是小写字母,不是零)。 比如,可能情形是:oo*oooo 如果同时翻转左边的两个硬币,则变为:oooo***oooo 现在小明的问题是:如果已知了初始状态和要达到的目标状态,每次只能同时翻转相邻的两个硬币,那么对特定的局面,最少要翻动多少次呢? 我们约定:把翻动相邻的两个硬币叫做一步操作,...

lz970704的博客 6701

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

hihocode #1313 : Treasure Boxes

贪心模拟

大咸鱼。。。 4227

xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Get Authorization code:Request: https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&prompt=consent&response_type=code&client_id=...

weixin_34273481的博客 73万+

如果解决"XXXXXXXXXXXXXX", referenced from:

1,查看cpp文件,没有加上。 2,有cpp文件,查看方法有没有实现。 3,如果都不是以上两种情况,把cpp文件删除,重新添加。我就遇到这种情况。

xieyuxiang41的专栏 3万+

Could not set property 'xxxxxx' of 'xxxxxx' with value 'xxxxx'

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property ‘id’ of ‘class com.hrms.entity.Family’ with value ‘1216317686162...

Lonely programmer 4689

contest19 CF342 div2 oooxx oooox oooox

DE 转载于:https://www.cnblogs.com/ikihsiguoyr/p/10541697.html

weixin_30772261的博客 5253

LeetCode(130) Surrounded Regions

题目 Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For exam

指尖飞舞 1976

xxxxxxxxxxxxxxxxxxx

<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=ed...

weixin_34259559的博客 9万+

Java使用ucanaccess连接Access数据库,报错:UCAExc:::4.0.0 user lacks privilege or object not found: XXXXXX

代码如下:package com.accord; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class Testes { public static void main(String[] args...

u013456370的专栏 1万+

iOS编译报错: "_OBJC_CLASS_$_QQApiInterface", referenced from: XXXXXX.o

"_OBJC_CLASS_$_QQApiInterface", referenced from: XXXXXX.o

跳舞的芒果 6147
上一篇: CreateProcessAsUser Function
下一篇: Improving Software Security Analysis using Exploitation Properties
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址