m o

Reducing the impact of DoS attacks with MikroTik RouterOS Alfredo Giordano Matthew Ciantar

s

h a

o o

c . i b

WWW.TIKTRAIN.COM

1

About Us Alfredo Giordano

c . i b Matthew Ciantar

MikroTik Certified Trainer and Consultant Support deployment of WISP Providers

Advanced MikroTik User since 2002

o o

Internet Bandwidth Provider From Italy

h a

m o

MikroTik Certified Trainer and Consultant Works in the Betting Industry From Malta, located in Dublin, Ireland

Providing professional and specialised MikroTik Training Classes in varies languages, as well as Consultancy Services under the TikTrain.com brand since March 2014.

s

WWW.TIKTRAIN.COM

2

Denial of Service Attack

c . i b

m o

an attack on a computer or network that prevents legitimate use of its resources

o o

What does it Affect?

Software Systems Network Equipment like Routers and Switches Servers and End-User PCs

s

h a

Are there any attacks happening right now? WWW.TIKTRAIN.COM

3

s

h a

o o

c . i b

WWW.TIKTRAIN.COM

m o 4

OSI Reference Model The OSI Model is a always a good starting point to understand and troubleshoot network behaviour and this is especially true, when the network is under heavy stress like in the case of a DDoS Attack.

s

h a

o o

c . i b

© 2014 TIKTRAIN.COM

m o 5

Analysis of an Attack

c . i b

An attack can be conducted at any level of the OSI Layer: OSI Layer Example of Attacks

m o

7

PDF GET requests, HTTP GET, HTTP POST, = website forms

6

Malformed SSL Requests -- Inspecting SSL encryption packets is resource intensive.

5

Telnet DDoS-attacker exploits Telnet server software running on switches and routers

4

SYN Flood, Smurf Attack

3

ICMP Flooding

2

MAC flooding -- inundates the network switch with data packets

1

Physical destruction, obstruction, manipulation, or malfunction of physical assets

s

h a

o o

WWW.TIKTRAIN.COM

6

DoS Shortfalls

c . i b

m o

DoS attacks are unable to attack large bandwidth websites – one upstream client cannot generate enough bandwidth to cripple major websites with a large bandwidth capability

o o

What about DDoS Attacks?

s

h a

WWW.TIKTRAIN.COM

7

m o

Distributed Denial of Service Attacks (DDoS)

c . i b

As described by Webopedia: DDoS is a type of DoS attack where multiple compromised systems (bot or zombie) -- which are usually infected with a Trojan -- are used to target a single system causing a Denial of Service (DoS) attack

o o

DDoS can be of a very large scale potentially bringing down a whole network or an Internet Service Provider

How big?

s

h a

WWW.TIKTRAIN.COM

8

m o

Example of Real Life DDoS #1 Attacked Entity: Spamhouse Date: 27th March 2013 Peak: 300 Gigabits per second

o o

Type: DNS Reflection

c . i b

Mitigation: Redirected Traffic to Cloudflare

h a

MikroTik Devices with the DNS Server feature enabled, and left open to resolve names to the public, could have potentially been used during such an attack.

s

Reference: http://arstechnica.com/information-technology/2013/03/how-spamhaus-attackers-turned-dns-into-a-weapon-of-mass-destruction/

WWW.TIKTRAIN.COM

9

m o

Example of Real Life DDoS #2 Attacked Entity: Cloudflare Date: 10th February 2014 Peak: 400 gigabits per second

o o

Type: NTP Reflection and Amplification

h a

c . i b

MikroTik Devices with NTP Server Service feature left open to resolve to the public could have potentially been used during such an attack.

s

Reference: http://arstechnica.com/security/2014/02/biggest-ddos-ever-aimed-at-cloudflares-content-delivery-network/

WWW.TIKTRAIN.COM

10

m o

Are we at risk to such attacks?

c . i b

A Botnet (also known as a zombie army) is a resource which is easily available to be used against us! These are infected computers located around the world which can be rented to launch such an attack.

o o

Just as an example, an online search returns the price to rent 1,000 infected computers in the United States for the costs of $180. If the hosts are located in the United Kingdom, the price is $240. France and Russia both costs $200, Canada costs $270, and 1,000 infected computers located around the world costs $35.

s

h a

WWW.TIKTRAIN.COM

11

m o

Mitigating a DoS/DDoS Attacks Device

Layer

Router

3-4

o o

h a

Firewall

s

4-7

c . i b

DoS Protections

RP Filter, Routing Black Hole

Address List, Session Limits, Syn Cookie

WWW.TIKTRAIN.COM

12

m o

Tools to mitigate threats at router level rp_filter

o o

Routing Blackhole

s

h a

c . i b

WWW.TIKTRAIN.COM

13

Kind of attacks mitigated Smurf Attacks

o o

IP address spoofing

Malformed traceroute attack

s

h a

c . i b

WWW.TIKTRAIN.COM

m o 14

m o

Unicast Reverse Path Forwarding (RFC3704)

c . i b

Used to stop spoof attacks on the outbound side.

◦ /ip settings set rp-filter=strict|loose|no

o o

• Do I have a matching entry for the source in the routing table? • Is the packet arriving on the same interface the router would use to reach the originator of such packet ? (strict)

h a

Underlying principle of rp_filter is to block outbound traffic if the IP does not belong to the subnet that resides on the LAN

s

WWW.TIKTRAIN.COM

15

m o

Unicast Reverse Path Forwarding

c . i b

To be truly effective, rp_filter should be implemented in front of every potential source of attack

If asymmetric routing is taking place on border gateway, then only loose method can be used

o o

Sometimes attackers can spoof source IP addresses from within the same autonomous system, making the strategy easily vulnerable

s

h a

WWW.TIKTRAIN.COM

16

Routing Black Hole

c . i b

m o

The underlying idea is to black hole offending AS(s) from the local network so traffic is not routed from the border router to the LAN

s

h a

o o

The IP being targeted is no longer reachable but the rest of the network stays up

WWW.TIKTRAIN.COM

17

Routing Black Hole Advantage:

c . i b

m o

Our attacked IP range will appear dead to attackers since we would stop sending any replies back, making them thing that they have succeeded, while we can still exchange data with everyone else;

o o

Disadvantage:

Depending on the type of attack, lots of packets could be sent using spoofed source IP address. It could be the case that, if you also have servers with the same flaw in your network, you could amplify such an attack yourself towards the spoofed address, which in this case could be the victim (Reflection Attack);

s

h a

WWW.TIKTRAIN.COM

18

m o

Tools to mitigate threats at firewall level Address Lists

o o

NAT (use with care) tcp_syncookies

h a

PSD

c . i b

Connections or Packets per second

s

WWW.TIKTRAIN.COM

19

Kind of attacks mitigated

c . i b

SYN Floods SYN + ACK Attacks (3rd packet attacks) Reduce the impact of reflection attacks

s

h a

o o

m o

We shall now demonstrate a simple SYN Attack!

WWW.TIKTRAIN.COM

20

Live Demo – Syn Injector Router

s

h a

o o

c . i b

WWW.TIKTRAIN.COM

m o 21

Live Demo – Target Router

s

h a

o o

c . i b

WWW.TIKTRAIN.COM

m o 22

Address Lists Purpose

c . i b

m o

Used to group blocks of IP addresses Entries can be added statically or dynamically by firewall rules

o o

Requirement

To identify host/networks exceeding our parameters and block them accordingly

s

h a

WWW.TIKTRAIN.COM

23

TCP SynCookies

c . i b

m o

TCP SYN cookie is a technique used to resist SYN flood attacks by manipulating the sequence number in the TCP header

o o

/ip settings tcp_syncookies yes | no

h a

Even if it does NOT break any protocol specifications, restrictions on the tcp options will lead to a reduction in performance

s

It would be nice if could be enabled on port basis, but this a Linux Kernel Limitation

WWW.TIKTRAIN.COM

24

RouterOS Commands

c . i b

m o

/ip firewall mangle add action=add-src-to-addresslist address-list=suspicious address-list-timeout=5m chain=prerouting dst-port=23 protocol=tcp

h a

o o

Matching conditions to create address-list

/ip firewall filter add action=log chain=input srcaddress-list=suspicious

s

Action to be applied to the dynamic address-list

WWW.TIKTRAIN.COM

25

Attack Detection

c . i b

We need to know if the system is under attack /system resource cpu print /system profile

o o

m o

/ip firewall filter print stats interval=3 /ip firewall connection print interval=3

s

h a

WWW.TIKTRAIN.COM

26

m o

Network Address Translation

c . i b

NAT enables translation of IP addresses used within one network to different IP addresses known within another network Related RouterOS commands: /ip firewall nat

Bad Guys

o o

h a

Good Guys

Allow DST-NAT

Do NOT DST-NAT

s

WWW.TIKTRAIN.COM

27

m o

Network Address Translation

c . i b

NAT is commonly accepted as a basic way to avoid DoS attacks

It does not really solve the problem… it moves it away stopping unsolicited inbound traffic from reaching the host on the LAN

o o

Depending on the intensity of the attack NAT might turn against you because it will create a SINGLE bottleneck (NAT router itself)

s

h a

WWW.TIKTRAIN.COM

28

Port Scan Detection

c . i b

m o

PSD is a firewall matcher included in RouterOS used to detect tcp and udp scans

/ip firewall mangle add chain=prerouting protocol=tcp tcp-flags=syn psd=18,2s,3,1

o o

WeightThreshold

s

h a

DelayThreshold HighPortWeight

LowPortWeight

WWW.TIKTRAIN.COM

29

Port Scan Detection

c . i b

m o

/ip firewall mangle add chain=prerouting protocol=tcp tcp-flags=syn psd=18,2s,3,1

o o

This means:

A syn packet on a port lower than 1024, then PSD assigns a weight of 3

h a

A syn packet on a port higher than 1024, then PSD assigns a weight of 1 PSD sums weights for packets that have been seen within 2 seconds from each other If a total of 18 has been reached than the rule matches

s

WWW.TIKTRAIN.COM

30

Port Scan Detection

c . i b

m o

It is not a true aid against DDoS attacks, but it can be useful to identify the offending networks Can be used in combination with address-lists

o o

Provided that connection tracking is already enabled, PSD does NOT have a high impact on resources, such as CPU

s

h a

WWW.TIKTRAIN.COM

31

m o

Connections / Packets per second

c . i b

Best matcher to identify flows that exceed a given limit

/ip firewall filter chain=prerouting action=accept protocol=tcp dst-limit=25/1s,25,dst-address/10s packet rate per interval

o o

time interval

h a

first non counted packets

classify mode expire

Match packets until a given pps limit is exceeded for every destination IP address and destination port combination.

s

WWW.TIKTRAIN.COM

32

Putting all together From the MikroTik wiki:

c . i b

m o

/ip firewall filter add chain=input protocol=tcp connectionlimit=LIMIT,32 action=add-src-to-address-list address-list=blockedaddr address-list-timeout=1d /ip firewall filter add chain=input protocol=tcp src-addresslist=blocked-addr connection-limit=3,32 action=tarpit /ip firewall filter add chain=forward protocol=tcp tcp-flags=syn connection-state=new action=jump jump-target=SYN-Protect comment="SYN Flood protect" disabled=yes /ip firewall filter add chain=SYN-Protect protocol=tcp tcp-flags=syn limit=400,5 connection-state=new action=accept comment="" disabled=no /ip firewall filter add chain=SYN-Protect protocol=tcp tcp-flags=syn connection-state=new action=drop comment="" disabled=no

s

h a

o o

WWW.TIKTRAIN.COM

33

Putting all together What we use:

c . i b

m o

/ip firewall filter add chain=ddos comment="DDoS Protection" srcaddress-list=net-our-ips action=accept /ip firewall filter add chain=ddos src-address-list=net-our-mgmt-ips action=accept /ip firewall filter add chain=ddos dst-limit=25,25,src-and-dstaddresses/10s action=accept /ip firewall filter add chain=ddos action=add-src-to-address-list address-list=ddos-flood address-list-timeout=30m /ip firewall filter add chain=forward connection-state=new src-addresslist=ddos-flood action=drop

s

h a

o o

WWW.TIKTRAIN.COM

34

Live Demo – After Mitigation

s

h a

o o

c . i b

WWW.TIKTRAIN.COM

m o 35

Fancy Solutions DNS + NAT

c . i b

Change DNS response to point to a different NAT router

Remotely triggered Black Hole

o o

m o

Inject null route into BGP to make all the routers of the AS drop the traffic for the offending prefix without having to elaborate with any access lists

h a

A common BGP community that our upstream peer can Black Hole Requires upstream provider cooperation

s

WWW.TIKTRAIN.COM

36

Fancy Solutions Bogon Feed

c . i b

m o

Have an external source feed us with details of common threats originating prefixes on the internet, updated via BGP One for example is Team Cymru

s

h a

o o

WWW.TIKTRAIN.COM

37

Conclusions

c . i b

m o

DoS and DDoS Attacks can be conducted at any level

There are a few solution to mitigate a DDoS Attack at both the router level and the firewall level

o o

However almost any service may be overloaded by a very large number of requests

h a

Hardware plays an important part. A faster router, server or a bigger bandwidth channel will make a huge difference when trying to resist a DDoS Attack

s

WWW.TIKTRAIN.COM

38

References http://wiki.mikrotik.com https://www.us-cert.gov/

o o

http://www.arstechnica.com http://www.norse-corp.com

s

h a

c . i b

WWW.TIKTRAIN.COM

m o 39

Thank You! Questions and Suggestions -

c . i b

Alfredo Giordano ([email protected]) Matthew Ciantar ([email protected])

s

h a

o o

WWW.TIKTRAIN.COM

m o 40

01. Cara_Lemahkan_Serangan_DDOS_dengan_Mikrotik_sahoobi ...

From Malta, located in Dublin, Ireland. WWW.TIKTRAIN.COM 2. Providing professional and specialised ... sahoobi.com WWW.TIKTRAIN.COM 4. Page 4 of 40. 01. Cara_Lemahkan_Serangan_DDOS_dengan_Mikrotik_sahoobi.com.pdf. 01. Cara_Lemahkan_Serangan_DDOS_dengan_Mikrotik_sahoobi.com.pdf. Open.

2MB Sizes 0 Downloads 265 Views

Recommend Documents

1720-01-01
Mar 28, 2017 - (6) All classifications shall be subject to the Eligibility Verification for .... (9) A “covered individual” under the federal Veterans Access, Choice, ...

03 01 01) 01)z 02). 02)z 01 01)z
polymerization reactor using the CMAC neural network for knowledge storage,” Proc. Inst. Elect. ... work was supported by the National Natural Science Foundation of China under. Grants 60304017, 20336040, and ... impossible to propose a universal s

0800-01-01
Apr 1, 2017 - (5) “Employer” means a person engaged in a business who has one or more employees and includes state ..... Chemical Abstract Service Number, the CAS number is for information only. ... 67-64-1. 750. 1800 1000 2400. —.

0800-01-01
Apr 1, 2017 - (5) “Employer” means a person engaged in a business who has one or more employees and includes state ..... Chemical Abstract Service Number, the CAS number is for information only. ... 67-64-1. 750. 1800 1000 2400. —.

0950-01-01
Apr 1, 2017 - TENNESSEE STATE MINERAL TEST HOLE REGULATORY BOARD. CHAPTER 0950-01-01. REPEALED. TABLE OF CONTENTS. 0950-01-01 Repealed. 0950-01-01-.01 REPEALED. Authority: T.C.A. §§ 4-5-201 et seq., 58-1904, and 60-1-501 et seq. Administrative Hist

1720-01-01
Mar 28, 2017 - while in continuous attendance toward the degree for which he or she is currently enrolled, shall not be required to pay out-of-state tuition if his ...

ICE MAGIC-01 (01-01-18 TO 06-01-2018).pdf
1 Jan 2018 - SF,FJ0 ZM04 lT~5TL 5[8=M, 5\5 ;FD[4. :JFlDGFZFI6 D\lNZ 5F;[4 ZFHSM8P 9375701110 / 9328001110. (01/01/2018 to 06/01/2018). [JANUARY 2018]. ;\5FNS o DF{l,S UM\lWIF (Director - ICE). www.iceonline.in 93276-01110 icerajkot. CURRENT AFFAIRS.

MP-06-01-01.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. MP-06-01-01.

log horizon 01 01.pdf
Log horizon ep.1 anime first look ãƒã‚. °. ホライã‚. oãƒ3 by. Log horizon original soundtrack 1 mp3. download log horizon. Herbstsaison 2013 review zu log ...

01, BCOA - 001, AMK- 01, ,015.pdf
Bachelor of Business Administration. (BBA) in Retailing. II nd. Year. ASSIGNMENTS. 2013-14. School of Management Studies. Indira Gandhi National Open ...

ICE MAGIC-01 ( 01-01-17 TO 07-01-17).pdf
Page 3 of 7. Page 3 of 7. ICE MAGIC-01 ( 01-01-17 TO 07-01-17).pdf. ICE MAGIC-01 ( 01-01-17 TO 07-01-17).pdf. Open. Extract. Open with. Sign In. Main menu.

ICE MAGIC-01 ( 01-01-17 TO 07-01-17).pdf
Page 3 of 7. Page 3 of 7. ICE MAGIC-01 ( 01-01-17 TO 07-01-17).pdf. ICE MAGIC-01 ( 01-01-17 TO 07-01-17).pdf. Open. Extract. Open with. Sign In. Main menu.

0680-01
Oct 21, 2017 - September and November; provided, however, that the Board may change the location of meetings at its ... knowledge of the construction business in which the persons are licensed to perform. (d) For any .... technological advances in th

0820-01
Oct 25, 2017 - (2) If two (2) or more Board members recommend examination of an applicant for the Practice of. Land Surveying (PS) ... (1) The Tennessee State Specific examination is designed to test the applicant's knowledge of .... services as if f

0200-01
Nov 27, 2017 - Anatomy, physiology and systems structure of the head, face and neck, including ... Required Total: 125 Hours. (b) General: Book Knowledge. Teaching Techniques. Visual Aid Equipment. Classroom Management. Student Motivation ... account

1020-01
Oct 1, 2017 - Any institution or facility defined as such pursuant to state law or the rules ...... Alcohol or drugs. 3. Physical injury or threat of injury to any person. 4. Abuse or neglect of any minor, spouse or the elderly. 5. Fraud or theft. (c

01-Rika (01-06).pdf
learning beliefs, self-efficacy and anxiety. Learning achievement were measured by the MCQ which. Questionnaire. data were taken at the end of the block MBS3, which analyzed using Pearson Product Moment correlation. Results: The correlation between i

MP-04-01-01.pdf
Page 1 of 55. Manual de. Procedimientos. Código: MP-04-01-01. Versión: 4.0. Página: 1 de 55. Fecha de Emisión: Noviembre 2015. Título: GESTION DEL ...

17-01-01 Fausses_bonnes_résolutions.pdf
Jan 1, 2017 - Librement inspiré et adapté de : http://carfree.fr/index.php/2012/09/12/les-effets-indesirables-de-velo/. Note de la rédaction : ne voyez à cette ...

2016 01 01 eFootloose.pdf
Page 1 of 25. 1 | P a g e. Pacesetters Athletic Club. Issue #13: January 2016. Foreword by President. 2015 Reflections & Moving Forward in 2016. Today is New ...

1020-01
Oct 1, 2017 - (d) Correctly answering ninety percent (90%) of the examination questions shall constitute a passing score and successful ..... Petitioner's Mailing Address: Petitioner's E-Mail Address: Telephone Number: Attorney for Petitioner: Attorn

0440-01
Nov 1, 2017 - (d) Sufficient protective eyewear (glasses) recommended by manufacturer of laser/light devices for each student .... apprenticeship student who is in responsible charge of supervising and accounting for that student's apprenticeship pro

1020-01
Oct 1, 2017 - (c) Habitual intoxication or personal misuse of any drugs or the use of intoxicating liquors, narcotics, controlled substances, or other drugs or ...

01. Cara_Melumpuhkan_Hacker_dengan_Mikrotik_sahoobi.pdf ...
Page 2 of 46. About Me. Didiet Kusumadihardja. 1. IT Security Specialist. PT. Mitra Solusi Telematika. 2. Trainer & IT Consultant. Arch Networks. MTCNA, MTCINE, MTCWE, MTCUME, MTCTCE, MTCRE. Didiet Kusumadihardja - [email protected]. 2. sahoobi.com.