Top Banner
I'LL SEE YOUR MISSLE AND RAISE YOU A MIRV: DEFCON 26
49

DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

Jun 14, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

I'LL SEE YOUR MISSLE AND RAISE YOU A MIRV:

DEFCON 26

Page 2: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

01

02

04

03

AGENDA

Page 3: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

PRESENTERS

Page 4: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

STAGERS, CCDC, & HISTORY

Page 5: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

Trampoline

Malware(s)

Exploit Payload

Dropper

Page 6: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

Empire PupyMeterpreter

Page 7: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

Professional offensive engagements (CCDC)

Context aware implant solutions

As a form of “packing”3rd party crimeware.

Page 8: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA
Page 9: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

Now we're ready to release a re-written, shiny

new V1.0 version to you today!

Genesis Scripting Engine development

started in late 2017 to prepare for the 2018

CCDC season. We ended up using the BETA

version at WRCCDC and NCCDC in 2018.

Moved our tool chain to a golang, known as

Gooby. This included a golang dropper

experiment to abstract dropping from the

other cluster bomb tools, known as Genesis.

Page 10: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

PRESENTING THE GENESIS SCRIPTING ENGINE

Page 11: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

GSCRIPT

Page 12: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

STANDARD LIBRARY

COMMAND LINE TOOL (CLI)

DEBUGGER

ENGINE

COMPILER

OBFUSCATOR

Page 13: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

BASIC EXAMPLE:EMBED A PAYLOAD AND

WRITE TO A FILE

Page 14: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1) Write a gscript

01:00 – 02:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

OUR PORTFOLIO

10:00 – 11:00 AM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

WELCOME MESSAGE

11:00 – 12:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

ABOUT US

12:00 – 01:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

MEET THE TEAM

Page 15: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1) Write a gscript

01:00 – 02:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

OUR PORTFOLIO

10:00 – 11:00 AM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

WELCOME MESSAGE

11:00 – 12:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

ABOUT US

12:00 – 01:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

MEET THE TEAM

Page 16: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1) Write a gscript

2) Write another

01:00 – 02:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

OUR PORTFOLIO

10:00 – 11:00 AM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

WELCOME MESSAGE

11:00 – 12:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

ABOUT US

12:00 – 01:00 PM

Investment generally results in acquiring an asset, also called an investment. If the asset is available at a price worth investing,

normally expected either to generate income, or to appreciate in value

MEET THE TEAM

Page 17: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1) Write a gscript

2) Write another

3) Compile using CLI

gscript compile --output-file /tmp/opt/ex1/dropper.bin *.gs

Page 18: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1) Write a gscript

2) Write another

3) Compile using CLI

4) That's it!!! Run it!!!

Page 19: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1) Write a gscript

2) Write another

3) Compile using CLI

4) That's it!!! Run it!!!

Page 20: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

WAIT, WUT? PLEASE EXPLAIN.

Page 21: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

01

02

main()03

04

Page 22: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

GSCRIPT

Page 23: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA
Page 24: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

main()

Finally, the script's "entry point" is called. In

GSCRIPT, this is the Deploy() function defined in

your script.

Call Entry Point In VM

The first thing the engine does is create the V8 virtual

machine and prepare it for injection.

Initialize JS Virtual Machine

Native function interfaces are injected into mock JS

objects. Asset table mapped, and script loaded.

Inject Bundle (Script/Assets/Libs)

Page 25: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

GSCRIPT COMPILER INTERNALS

Page 26: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA
Page 27: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA
Page 28: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

The GSCRIPT compiler takes care of the rest. #WINNING

You can now use most exported, non-receiver functions. We've implemented a

return array for any multiple assignment Go functions so you never miss data or

errors.

The GSCRIPT compiler is smart enough to resolve your imports and ensure you're

calling functions for that package correctly.

//go_import

"This seems safe."

Page 29: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

DEBUGGING

Page 30: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

gscript shell

Page 31: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

--macro/-m

gscript shell

Page 32: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

--macro/-m

gscript shell

Page 33: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

TypeOf(obj)

--macro/-m

gscript shell

Page 34: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

--macro/-m

gscript shell

TypeOf(obj)SymbolTable()

Page 35: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

CURRENT LIMITATIONS

Page 36: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

The Javascript VM only supports ES5 at this time.

ES5 Support Only

Because of embedding all it's dependencies and

payloads, the binaries tend to be on the larger side.

(At least 2MB)

Large Binaries

There are several declaration types in Golang which

are not linkable yet. This includes const and var, as

well as any exported type that isn't returnable by a

function.

Go Types Lack Flexibility

There is no async() primitives in Javascript currently. If

you want to run async code, build a Go package that

manages the concurrency.

No Concurrency Primitives in JS

Golang's RE2 has some corner case incompatibilities

with Javascript regular expressions, preventing lots of

JS code from being runnable out of the box.

Limited Regex Support

Currently, GSCRIPT can only target a subset of Golang

target OSes and architectures.

No FreeBSD Support

Page 37: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

GSCRIPTSTANDARD LIBRARY

Page 38: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

crypto

encoding

exec

file

net

Name Current Uses

os

rand

requests

time

Various hashing algorithms & RSA key generation

Encoding & decoding base64

Blocking and non-blocking command execution

File operations - write, read, append, copy, replace

Functions to help determine if the machine is listening on tcp/udp ports

Genesis process control (terminate self, etc.)

Basic rand generators - int, strings, bools, etc.

Basic HTTP client for GET & POST of multiple content types

Retrieving system time in unix epoch

Page 39: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

REAL WORLD APPLICATIONS

Page 40: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

Lower Overhead

Infinite Expansion

Consistency

Self Documenting

Low Barrier to Entry

Cross-platformFeatures

Page 41: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

1

2

3

4

Page 42: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA
Page 43: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

GSCRIPT

Page 44: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

TBDTBD

TBDTBD

Page 45: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

DEMO TIME

Page 46: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

#1: DAN'S EXAMPLE ORDINANCE

Page 47: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

#1: PRESENTER'S PAYLOAD D'JOUR

Page 48: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

#3: THE PEOPLE'S BINARY

Page 49: DEF CON 26 Hacking Conference - DEF CON Media Server CON 26/DEF CON 26 presentations/DEF… · started in late 2017 to prepare for the 2018 CCDC season. We ended up using the BETA

https://github.com/gen0cide/gscript

GET CONNECTED

TWITTER: @1njectionGITHUB: github.com/ahhhBLOG: lockboxx.blogspot.com

TWITTER: @vyrusGITHUB: github.com/vyrus001EMAIL: [email protected]

TWITTER: @alexlevinsonGITHUB: github.com/gen0cideEMAIL: [email protected]