analyzing of malicious javascript[en]

29
Analyzing Malicious JavaScript 2016.10.22 AV TOKYO 2016 Kazuki Takada

Upload: kazuki-takada

Post on 14-Feb-2017

88 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Analyzing of Malicious JavaScript[en]

Analyzing Malicious JavaScript

2016.10.22AV TOKYO 2016Kazuki Takada

Page 2: Analyzing of Malicious JavaScript[en]

Who am I ?Kazuki TakadaSecureBrain Corporation

Software engineer and Researcher. Originally, programmer of the Embedded Software.

I like Python and drinking modestly.I dislike JavaScript and CUDA programming.

Page 3: Analyzing of Malicious JavaScript[en]

Contents• About Banking malware• About malicious JavaScript

3

Page 4: Analyzing of Malicious JavaScript[en]

Banking malware

4

Page 5: Analyzing of Malicious JavaScript[en]

Banking malware• It is called Banking Trojan.• It falsifies banking credential information and does

fraudulent money transfer.

5

Page 6: Analyzing of Malicious JavaScript[en]

ROVNIX• It started to appear in Japan at end of 2015.• Alias name : Cidox• Rewrites MITB communication content

6

Page 7: Analyzing of Malicious JavaScript[en]

MITB by ROVNIX

7

Malware

BankWeb server

Request of JavaScript from inserted <script>

Malicious JavaScript

<html><head>

<title>Internet Banking</title><script src=“….”>

Manipulation server

RequestOriginal content

Insert <script> to origin content in target URL.

Injection

C&C Server

Victim PC

Command and configurationEx) target URL

Page 8: Analyzing of Malicious JavaScript[en]

Major Banking malware in 2016• ROVNIX

• URLZONE

• VAWTRAK (New)

• URSNIF

8

Other name Shiotob, Beblohbd

Other name Snifula

Other name Gozi

The two malware have something in common.

Page 9: Analyzing of Malicious JavaScript[en]

9

Malicious JavaScript is same

Page 10: Analyzing of Malicious JavaScript[en]

10

CENSORED

Page 11: Analyzing of Malicious JavaScript[en]

Function of malicious JavaScript

11

Page 12: Analyzing of Malicious JavaScript[en]

Malicious JavaScript• It has about 40,000 lines of code.

• It includes jQuery. But it is enormous even without jQuery.

• It has a common base and is customized for each bank site.

• It injects fraudulent web content screens for various security software introduction and information fraud.

• Its usage has been traced back to many countries. For example, Japanese, English, Hangul and Arabic.

12

Page 13: Analyzing of Malicious JavaScript[en]

13

CENSORED

Page 14: Analyzing of Malicious JavaScript[en]

Behind fraudulent web content...

14

Victim PC

Login

Bank Manipulation server

Login credential info.

Login process

Login Screen

Remittance process

Request of Settlement info.

Dum

my screen of

security software

Settlement info

Display some input screen an necessary

Page 15: Analyzing of Malicious JavaScript[en]

Record of the fight

15

Page 16: Analyzing of Malicious JavaScript[en]

Pre-conditionSecureBrain Corporation• To find out what JavaScript manipulates, I traverse

the DOM information after the content has been read

Criminal• Malware will inject <SCRIPT> just after <HEAD>.

Malicious JavaScript is read than anyone else earlier.

• Of course, there are no holds barred.

16

Page 17: Analyzing of Malicious JavaScript[en]

Before hiding• Manipulation by added <DIV>

17

I can find it only when I traverse DOM information.

Page 18: Analyzing of Malicious JavaScript[en]

Round 1• Override of alert

18

It can find by alert.toString. Because it shows content of the function.

Page 19: Analyzing of Malicious JavaScript[en]

Round 2• Override of toString

ex)

19

window.alert.toString = function() {

return “[native code]”;}

It can find alert.toString.toString

Page 20: Analyzing of Malicious JavaScript[en]

20

CENSORED

Page 21: Analyzing of Malicious JavaScript[en]

Round 3• Nest of toString...

21

It can find difference inObject.prototype.toString

Page 22: Analyzing of Malicious JavaScript[en]

Round 4• Override of Object.prototype.toStringResult of Object.prototype.toString is changed freely by following function.

22

It can find the true in

Function.prototype.toString.

Page 23: Analyzing of Malicious JavaScript[en]

Round 5• Of course, Function.prototype.toString is overrided.

23

It can find difference of Property by getOwnPropertyDescriptor.

Page 24: Analyzing of Malicious JavaScript[en]

Round 6• Override of getOwnPropertyDescriptor

24

We have been chasing in getOwnPropertyDescriptor now.

Page 25: Analyzing of Malicious JavaScript[en]

The fight continues...

25

Page 26: Analyzing of Malicious JavaScript[en]

26

CENSORED

Page 27: Analyzing of Malicious JavaScript[en]

Conclusion• After understanding the specification of JavaScript,

the criminal would keep attacking persistently.

• The specification of JavaScript which can override every object is a double-edged sword.

• The sharing of threat information is too important.

27

Page 28: Analyzing of Malicious JavaScript[en]

28

CENSORED

Page 29: Analyzing of Malicious JavaScript[en]

Thank you!!

29