40
DDoS Attacks & Countermeasures Duong Ngoc Thai <thaidn AT gmail DOT com> http://vnhacker.blogspot.com

DDoS Attacks and Countermeasures

  • Upload
    thaidn

  • View
    8.467

  • Download
    3

Embed Size (px)

DESCRIPTION

DDoS Attacks and Countermeasures

Citation preview

Page 1: DDoS Attacks and Countermeasures

DDoS Attacks & Countermeasures

Duong Ngoc Thai<thaidn AT gmail DOT com>

http://vnhacker.blogspot.com

Page 2: DDoS Attacks and Countermeasures

Hello!

Page 3: DDoS Attacks and Countermeasures

OverviewOverview

DDoS Attacks What's new?

DDoS Countermeasures What NOT to do? What to do?

Q & A

Page 4: DDoS Attacks and Countermeasures

Part IPart I

DDoS Attacks – What's new? Botnet Attacks

DRDoS Distributed Reflected DNS Attacks

xFlash Attacks HTTP-based applications Welcome to the brave new world of Flash 9 Socket

Page 5: DDoS Attacks and Countermeasures

What is botnet?

Page 6: DDoS Attacks and Countermeasures

DDoS Attacks through Botnet Traditional DDoS Attacks

DRDoS

Page 7: DDoS Attacks and Countermeasures

DDoS Attacks through Botnet Distributed Reflected DNS Attacks

Page 8: DDoS Attacks and Countermeasures

Okay, botnet is scary.

But wait, there's no botnet in VN,YET!

Page 9: DDoS Attacks and Countermeasures

Bad news: building a botnet is easy!

bot source code is available for free! some even released under GPL!

Page 10: DDoS Attacks and Countermeasures

Bad news: building a botnet is easy!

Gái đẹp online đây bà con ơi!!!! Remember

gaixinh or xRobot?

Page 11: DDoS Attacks and Countermeasures

Bad news: building a botnet is easy!I don't want to pay for software! ever wonder what those keygen.exe or crack.exe

actually do? no license --> no update --> hack me please!

(hint: use Linux)

Page 12: DDoS Attacks and Countermeasures

Bad news: building a botnet is easy!

can't build yourself? buy one online!

Page 13: DDoS Attacks and Countermeasures

Vietnam Botnet Factbook

Page 14: DDoS Attacks and Countermeasures

What's xFlash?

ActionScript in Flash can send HTTP requests to 3rd party sites through the browser which

invoked it.

Page 15: DDoS Attacks and Countermeasures

What's xFlash?

The main DDoS attack mechanism used to attack many websites in VN: hvaonline.net, vietco.com, ddth.com, <insert your sites here>, etc...

Page 16: DDoS Attacks and Countermeasures

xFlash to attack HTTP-based applications

<insert x-flash source code here>

Page 17: DDoS Attacks and Countermeasures

xFlash to attack HTTP-based applications

forging HTTP request headersvar req:LoadVars=new LoadVars();

req.addRequestHeader("Foo","Bar");

req.send("http://www.site.com/index.php","_blank","GET");

Page 18: DDoS Attacks and Countermeasures

xFlash to attack HTTP-based applications

forging HTTP request headersvar req:LoadVars=new LoadVars();

req.addRequestHeader("Foo","Bar");

req.decode("a=b&c=d");

req.send("http://www.site.com/index.php","_blank","POST");

Page 19: DDoS Attacks and Countermeasures

Welcome to The Brave New World of Flash 9 Socket

Quote from Flash 9 documentation “The Socket class enables ActionScript code to make socket connections and

to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.”

Page 20: DDoS Attacks and Countermeasures

Welcome to The Brave New World of Flash 9 Socket

Quote from Flash 9 documentation “The Socket class enables ActionScript code to make socket connections and

to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.”

Let's port nmap to ActionScript!

Page 21: DDoS Attacks and Countermeasures

Welcome to The Brave New World of Flash 9 Socket

Quote from Flash 9 documentation “The Socket class enables ActionScript code to make socket connections and

to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.”

Let's port nmap to ActionScript!

Err wait, how about same origin policy?

Page 22: DDoS Attacks and Countermeasures

Part IIPart II

DDoS Countermeasures DON'T

.htaccess referer checking PHP anti-DDoS script

DOs performance tuning - killing the bottlenecks

start small, think big defense in depth

Page 23: DDoS Attacks and Countermeasures

First thing first:

SHOW ME THE MONEY

Page 24: DDoS Attacks and Countermeasures

Security is always a trade-off

Page 25: DDoS Attacks and Countermeasures

The Art Of Performance Tuning

What is performance?

Page 26: DDoS Attacks and Countermeasures

The Art Of Performance Tuning

What is performance?

rps = requests per second

cu = concurrent users

Page 27: DDoS Attacks and Countermeasures

Howto Find The Bottlenecks

code profiling – xdebugsystem profiling – oprofiledatabase query profiling

Page 28: DDoS Attacks and Countermeasures

Caching's Your Good Friend, Always

opcode caching – APC, Zend Platformobject caching – memcachedhttp request caching - squid

Page 29: DDoS Attacks and Countermeasures

Start Small Think BIG what is scalability?

Page 30: DDoS Attacks and Countermeasures

Start Small Think BIG what is scalability?

readily enlarged what is scalable system?

able to accommodate increased usageable to accommodate an increased dataset

maintainable

Page 31: DDoS Attacks and Countermeasures

Hello, world! Is Very Scalable

<?php

sleep(1);echo “Hello, world!”;

?>

Page 32: DDoS Attacks and Countermeasures

Verizontal vs Horizontal Scaling

Page 33: DDoS Attacks and Countermeasures

Share Nothing Architecture

Page 34: DDoS Attacks and Countermeasures

Scaling The Database With SNA

Page 35: DDoS Attacks and Countermeasures

Scaling The Storage

Amazon S3 anybody?

Page 36: DDoS Attacks and Countermeasures

Wikipedia: a scalable system

Page 37: DDoS Attacks and Countermeasures

The Blueprint of Defense In Depth

Page 38: DDoS Attacks and Countermeasures

The case for the reverse proxy

Page 39: DDoS Attacks and Countermeasures

Recommend ReadingRecommend Reading

Building scalable web sites

Kí sự các vụ DDoS vào HVAOnline.net

Page 40: DDoS Attacks and Countermeasures

DDoS Attacks & Countermeasures

Thank you!

Questions/Comments?

Duong Ngoc Thai