AvastSvc.exe contains a full, unsandboxed JavaScript/DOM implementation

栏目: IT技术 · 发布时间: 4年前

内容简介:The main Avast antivirus process is called AvastSvc.exe, which runs as SYSTEM.That service loads the low level antivirus engine, and analyzes untrusted data received from sources like the filesystem minifilter or intercepted network traffic.

Avast Antivirus JavaScript Interpreter

The main Avast antivirus process is called AvastSvc.exe, which runs as SYSTEM.

AvastSvc.exe contains a full, unsandboxed JavaScript/DOM implementation

That service loads the low level antivirus engine, and analyzes untrusted data received from sources like the filesystem minifilter or intercepted network traffic.

Despite being highly privileged and processing untrusted input by design, it is unsandboxed and has poor mitigation coverage. Any vulnerabilities in this process are critical, and easily accessible to remote attackers.

So.. maybe not great that it includes a custom JavaScript interpreter....????

AvastSvc.exe contains a full, unsandboxed JavaScript/DOM implementation

This repository contains an interactive shell that lets you test the interpreter on Linux for vulnerability research.

Building

Here's how to try it out, first install the dependencies.

Ubuntu

$ sudo apt install libreadline-dev:i386 libc6-dev-i386 gcc-multilib

Fedora

$ sudo yum install readline-devel.i686 glibc-devel.i686 libgcc.i686

Now you can clone this repository.

$ git clone https://github.com/taviso/avscript.git
$ cd avscript
$ git submodule update --init --recursive

If everything looks good, build it and avscript should be ready.

$ make

Notes

Reproducing Vulnerabilities on Windows

For performance reasons, Avast do not interpret every JavaScript file they encounter, they use a heuristic to determine if it's necessary. I've found that appending the file javascript.txt included in this repository is enough to always trigger the heuristic.

For example, if you have found a vulnerability and want to reproduce it on Windows, you would first do this:

$ cat yourtestcase.js javascript.txt > ReproForWindows.js

Now verify that it still does what you expect, e.g.

$ ./avscript ReproForWindows.js
main(): File ReproForWindows.js` loaded, about to initialize interpreter...
Segmentation fault (core dumped)

Then verify the crash reproduced on Windows.

Protected Process

The Avast service is a protected process, which means debugging it from userspace is tricky. If you have kd configured, you can simply undo this and then debugging in userspace works fine.

A quick and easy solution that works on 32-bit is to do this (note that PatchGuard won't permit this on x64, but you can do something similar with breakpoint commands ).

AvastSvc.exe contains a full, unsandboxed JavaScript/DOM implementation

There is also a setting under "Troubleshooting" called "Enable Self-Defense" that should be disabled. I believe this setting disables hooking OpenProcess() in the SSDT, where they normally blacklist their own process.

You may need to temporarily disable "shields" in the Avast UI while you attach so that filesystem operations don't deadlock while the service is suspended.

Debugging

Avast does not publish any symbols for their engine, but debugging with IDA or gdb is still possible. There are some notes on debugging Windows code from Linux in the loadlibrary documentation .

If you want to use IDA, I would recommend using the gdbserver backend.

Simply use something like this, you might need to intall the gdbserver package first:

$ gdbserver 0.0.0.0:23946 ./avscript

This works surprisingly well, even pseudocode breakpoints work.

AvastSvc.exe contains a full, unsandboxed JavaScript/DOM implementation

Vulnerabilities

If you find a vulnerability, it is likely critical and wormable .

:fire: Please report it urgently. :fire:


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

论因特网

论因特网

[美] 休伯特·L.德雷福斯 / 喻向午、陈硕 / 河南大学出版社 / 2015-5 / 32.00

本书是与日俱增的关于因特网利弊之文献的重要补充。 ——《哲学评论》 关于因特网种种承诺的一次清晰辨析……以哲学家的眼光审视一个影响我们所有人的问题。 ——《普遍存在》杂志 ……一场精心设计的论战……我们需要更多德雷福斯这样的老师,将网络融入依 然具有深邃人性的课程。 ——亚当•莫顿(出自《泰晤士报文学增刊》) 在互联网世界,不管你是菜鸟,还是浸淫其中已久—......一起来看看 《论因特网》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具