All Projects → taviso → Avscript

taviso / Avscript

Licence: gpl-3.0
Avast JavaScript Interactive Shell

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Avscript

Xanalyzer
xAnalyzer plugin for x64dbg
Stars: ✭ 553 (-14%)
Mutual labels:  reverse-engineering
Canalyzat0r
Security analysis toolkit for proprietary car protocols
Stars: ✭ 586 (-8.86%)
Mutual labels:  reverse-engineering
Jbytemod Beta
Java bytecode editor
Stars: ✭ 602 (-6.38%)
Mutual labels:  reverse-engineering
Entityframework Reverse Poco Code First Generator
EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
Stars: ✭ 562 (-12.6%)
Mutual labels:  reverse-engineering
Instagram
The first Instagram website and lightweight API HTTP client
Stars: ✭ 581 (-9.64%)
Mutual labels:  reverse-engineering
Anti Emulator
Android Anti-Emulator
Stars: ✭ 587 (-8.71%)
Mutual labels:  reverse-engineering
Bleak
A Windows native DLL injection library that supports several methods of injection.
Stars: ✭ 547 (-14.93%)
Mutual labels:  reverse-engineering
Mjcript
【越狱-逆向】基于Cycript实现的一些实用函数
Stars: ✭ 608 (-5.44%)
Mutual labels:  reverse-engineering
Netzob
Netzob: Protocol Reverse Engineering, Modeling and Fuzzing
Stars: ✭ 584 (-9.18%)
Mutual labels:  reverse-engineering
Ios Debug Hacks
🎯 Advanced debugging skills used in the iOS project development process, involves the dynamic debugging, static analysis and decompile of third-party libraries. iOS 项目开发过程中用到的高级调试技巧,涉及三方库动态调试、静态分析和反编译等领域
Stars: ✭ 595 (-7.47%)
Mutual labels:  reverse-engineering
Monkeydev
CaptainHook Tweak、Logos Tweak and Command-line Tool、Patch iOS Apps, Without Jailbreak.
Stars: ✭ 5,492 (+754.12%)
Mutual labels:  reverse-engineering
Awesome Radare2
A curated list of awesome projects, articles and the other materials powered by Radare2
Stars: ✭ 580 (-9.8%)
Mutual labels:  reverse-engineering
Idarling
Collaborative Reverse Engineering plugin for IDA Pro & Hex-Rays
Stars: ✭ 588 (-8.55%)
Mutual labels:  reverse-engineering
Whatsapp Web Reveng
Reverse engineering WhatsApp Web.
Stars: ✭ 5,320 (+727.37%)
Mutual labels:  reverse-engineering
Openwifipass
An open source implementation of Apple's Wi-Fi Password Sharing protocol in Python.
Stars: ✭ 607 (-5.6%)
Mutual labels:  reverse-engineering
Tigress protection
Playing with the Tigress binary protection. Break some of its protections and solve some of its challenges. Automatic deobfuscation using symbolic execution, taint analysis and LLVM.
Stars: ✭ 550 (-14.46%)
Mutual labels:  reverse-engineering
Binexport
Export disassemblies into Protocol Buffers
Stars: ✭ 586 (-8.86%)
Mutual labels:  reverse-engineering
Andromeda
Andromeda - Interactive Reverse Engineering Tool for Android Applications
Stars: ✭ 627 (-2.49%)
Mutual labels:  reverse-engineering
Reverse Engineering Reference Manual
collage of reverse engineering topics that I find interesting
Stars: ✭ 607 (-5.6%)
Mutual labels:  reverse-engineering
Goblin
An impish, cross-platform binary parsing crate, written in Rust
Stars: ✭ 591 (-8.09%)
Mutual labels:  reverse-engineering

Avast Antivirus JavaScript Interpreter

NOTE: On 03/11/2020 Avast announced they had decided to disable this interpreter globally!

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

AvastSvc.exe

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....???? 🙃

screenshot

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).

screenshot

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 install the gdbserver package first:

$ gdbserver 0.0.0.0:23946 ./avscript

This works surprisingly well, even pseudocode breakpoints work.

IDA screenshot

Vulnerabilities

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

🔥 Please report it urgently. 🔥

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].