Author Topic: Understanding DoSes  (Read 1615 times)

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4018
  • Reputation: 216
  • Badges:
Understanding DoSes
« on: July 13, 2012, 11:20:12 pm »
Understanding DoS

A DoS (Denial of Service) is a type of attack that denies a resource to someone. I will be explaining some of the basic concepts of a DoS, different types, and teach the basics of the simplest effective DoS (in my opinion at least) and how to make your own.

What does a DoS do?

A DoS is an attack that has the sole purpose of denying computational resources to somebody. In most cases the resource is a server and/or server software, however there are other DoS types that target non-server based resources, however that is outside the scope of this topic but I may cover them in a different one. A successfull DoS will either shut down the resource entirely, tie up all the available resources, or render it too slow to operate effectively. Even an unsuccessfull DoS can slow traffic down a significant amount.


Different Types of DoSes

There are a few different kinds of DoS, but the two most commonly seen are Flood and Exploits. A flood DoS consists of sending vast quantities of data to a specified port on a host in the hopes of cauaing the software running the port to crash from excessive data flow. This type is the easiest, most common, and also the least effective. An exploit DoS relies on a known bug in the server software that will either crash it or tie up its resources. An example of this would be the slowloris exploit. These types of DoS are more rare and harder to pull off due to the constraints of vulnerable software and exploitable bugs, but are vastly more efficient and effective as a result.


The Basics of a DoS: SYN Flood

In my opinion, the SYN flood is a wonderful DoS. It is lightweight, compact, and deligtfully fast when used right. And it is quite easy to learn. However, I just want to show the theory of a DoS tool, so I will be using Scapy, since it is easy to see the various parts of the packet, and as an added bonus is inefficient at rapid sending so you cannot take this lesson and directly use it illegally (well, effectivly at least...)

I am assuming you know at least the basics of networking, TCP/IP theory and packet encapsulation, but if not I will cover the basics here:

TCP (Transmission Control Protocol) is used for connecting sessions of data transfer. It is a layer above IP (Internet protocol). The TCP packet is contained in the IP packet so to speak, and all the respective information is stored inside each of the capsules. 

The part we will be leveraging for the DoS to get to most bang for our buck is the TCP handshake. To start any TCP socket connection (which 95% of all services use), several TCP packets are sent to verify that the client is connecting. The TCP packet will have various flags set in a particular order, as shown below:

client  -------SYN------->  server
            <----SYN/ACK----
            -------ACK------->

The SYN packet starts the handshake, the SYN/ACK is acknowledging the client, then the ACK is finalizing the handshake, validating that the client recieved the SYN/ACK. What we are going to do is send a flood of SYN packets to the server. What this will do is a two step punch. Not only will it flood the server with vast amounts of packets, it will also be sending response packets, and since we arent going to acknowledge to SYN/ACK packet, the sockets should be tied up until they timeout, which is usually more than a minute. Lets open up python and get started:

>>> from scapy.all import *

Now we build the packet.

>>> pkt = IP(dst="fakesite.com", src="123.45.67.89")/ TCP(dport=80, flags="S")

What we just did was create a TCP SYN packet with a destination port of 80, then wrapped it in an IP packet with a destination address of fakesite.com and a source address of 123.45.67.89. Now the interesting piece of this is that the source address can be set to *any* valid IP, so this attack can be completely anonymous. Then all we have to do is put it into a basic loop and we have a SYN DoS:

>>> while True: send(pkt)

It was that easy, just 3 lines of code. I hope you enjoyed this and maybe learned something from it. Feel free to post any questions/comments/requests/tipsetc. 

EliteShadow

  • Jr. Members
  • **
  • Posts: 86
  • Reputation: 5
  • Saints-We Live On
Re: Understanding DoSes
« Reply #1 on: July 14, 2012, 12:07:12 am »
Nice!+1
Saints-We Live On

Apetrick

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3513
  • Reputation: 90
  • <Apetrick> lank is 1337
  • Badges:
  • iDevices: Ipod Touch 4g
Re: Understanding DoSes
« Reply #2 on: July 14, 2012, 02:08:52 am »
Really nice a12. I really wish we could get scapy ported for ios :(
<%a12danrulz> Idk, but doing a DoS from an apple device is like fighting a bear with a plastic spork

StealthHacker

  • Hero Member
  • *****
  • Posts: 1018
  • Reputation: 41
  • Supreme Hacker
    • iNinjas
  • Computers: HP S2031 Windows 7 64 Bit Home Premium
  • iDevices: Jailbroken iPhone 4 iOS 5.0.1 Sn0wbreeze 2.9.3 Un-Tethered
Re: Understanding DoSes
« Reply #3 on: July 14, 2012, 07:08:04 am »
Really nice a12. I really wish we could get scapy ported for ios :(
+1
He who asks a question remains foolish for 5 minutes. He who doesn't ask a question remains foolish forever.

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4018
  • Reputation: 216
  • Badges:
Re: Understanding DoSes
« Reply #4 on: July 14, 2012, 10:05:32 am »
We do, partially. I have it on my iPod, but the sending and recieving is a little broken. You can build packets and look at the fields, you just cant send. I cant remember if sniffing works either. Im working on hping since its close to scapy.

Don't like seeing ads? Click here to register!

Apetrick

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3513
  • Reputation: 90
  • <Apetrick> lank is 1337
  • Badges:
  • iDevices: Ipod Touch 4g
Re: Understanding DoSes
« Reply #5 on: July 14, 2012, 10:14:31 am »
We do, partially. I have it on my iPod, but the sending and recieving is a little broken. You can build packets and look at the fields, you just cant send. I cant remember if sniffing works either. Im working on hping since its close to scapy.
That's what I meant because scapy is my favorite to use for dos's on my computer so I would like to have it portable.
<%a12danrulz> Idk, but doing a DoS from an apple device is like fighting a bear with a plastic spork

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4018
  • Reputation: 216
  • Badges:
Re: Understanding DoSes
« Reply #6 on: July 14, 2012, 10:25:54 am »
That's what I meant because scapy is my favorite to use for dos's on my computer so I would like to have it portable.

However, I just want to show the theory of a DoS tool, so I will be using Scapy, since it is easy to see the various parts of the packet, and as an added bonus is inefficient at rapid sending so you cannot take this lesson and directly use it illegally (well, effectivly at least...)

Apetrick

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3513
  • Reputation: 90
  • <Apetrick> lank is 1337
  • Badges:
  • iDevices: Ipod Touch 4g
Re: Understanding DoSes
« Reply #7 on: July 14, 2012, 11:49:47 am »
Against my sister is what I use it for it pisses her off when Facebook is slow :D
<%a12danrulz> Idk, but doing a DoS from an apple device is like fighting a bear with a plastic spork

StealthHacker

  • Hero Member
  • *****
  • Posts: 1018
  • Reputation: 41
  • Supreme Hacker
    • iNinjas
  • Computers: HP S2031 Windows 7 64 Bit Home Premium
  • iDevices: Jailbroken iPhone 4 iOS 5.0.1 Sn0wbreeze 2.9.3 Un-Tethered
Re: Understanding DoSes
« Reply #8 on: July 14, 2012, 11:56:08 am »
Against my sister is what I use it for it pisses her off when Facebook is slow :D
You are so evil lmao
He who asks a question remains foolish for 5 minutes. He who doesn't ask a question remains foolish forever.

Ironman

  • Administrator
  • Hero Member
  • *****
  • Posts: 5105
  • Reputation: 251
  • Badges:
  • Computers: ASUS UL50VT
  • iDevices: iPhone 5, iPhone 4S, iPhone 4, iPhone 3GS
Re: Understanding DoSes
« Reply #9 on: July 14, 2012, 12:32:18 pm »
Excellent A12!! Mighty fine job on this!! +1
Click for How to Add Our Repo
If you're going to ask questions....
At least make them good ones.

Knowledge is the one thing that can never be taken from you

Don't like seeing ads? Click here to register!

h4ck3rpr0n3

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3063
  • Reputation: 130
  • Developer, Genius :P :P
  • Badges:
  • Computers: HP Pavillion g7: Windows 7, BT5 R1, Ubuntu 12.04, Windows 8, Linux Mint
  • iDevices: ipod touch 3g, ipod touch 2g
Re: Understanding DoSes
« Reply #10 on: July 14, 2012, 02:40:57 pm »
Well explained A12, goodjob +1! :D :D
goals:
[] get developer status
[X] get 30+ karma
[X] get to hero member
[X] become part of the staff

languages i know:
JavaScript
CSS
HTML
PHP
C
C++
Cython
Python

grinch

  • Administrator
  • Hero Member
  • *****
  • Posts: 1926
  • Reputation: 187
  • the digital grinch who stole your data
    • @DigitalGrinch
  • Badges:
  • iDevices: iPhone 3GS 4.3.3, HTC Evo V 4G ICS
Re: Understanding DoSes
« Reply #11 on: August 27, 2012, 04:54:12 pm »
Nice work
+1
If I help you or you appreciate my work, clicking that +1 button is the best thanks I could get.

My opinions are my own, you may agree or disagree with them, but they are only just that; opinions
For example: facebook is the microsoft of social networks

http://goo.gl/PiVjI

@DigitalGrinch
https://twitter.com/DigitalGrinch

I follow all iNinjas members back. PM me if I am not following you

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Understanding DoSes
« Reply #12 on: August 27, 2012, 05:06:27 pm »
Against my sister is what I use it for it pisses her off when Facebook is slow :D

Against Facebook a single DoS attack would do hardly anything if not nothing. You have to remember that fb has millions upon millions of people online at any given time. There servers are basically built to withstand DoS attacks because of the amount of traffic they are able to hold...

Do you use it against her IP or facebooks?

A3MIRAL

  • Leader
  • Hero Member
  • *****
  • Posts: 2899
  • Reputation: 105
  • A3MIRAL -- Reporting for Duty
    • A3MIRAL
  • Badges:
  • Computers: Dell XPS15 (6 GB ram, Core i7 @ 2.0 GHz, 750 GB HDD @ 7200 RPM)
  • iDevices: iPod touch 3G 32GB, iPhone 5 32GB
Re: Understanding DoSes
« Reply #13 on: August 27, 2012, 05:08:11 pm »
LOL! a DDos preformed by the entire population of New York would still take quite a while to overload facebook, google, or twitter, for example

Apetrick

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3513
  • Reputation: 90
  • <Apetrick> lank is 1337
  • Badges:
  • iDevices: Ipod Touch 4g
Re: Understanding DoSes
« Reply #14 on: August 27, 2012, 05:16:48 pm »
Against Facebook a single DoS attack would do hardly anything if not nothing. You have to remember that fb has millions upon millions of people online at any given time. There servers are basically built to withstand DoS attacks because of the amount of traffic they are able to hold...

Do you use it against her IP or facebooks?
i dos here local ip or i just drop all connections from facebook from her computer to the router.
<%a12danrulz> Idk, but doing a DoS from an apple device is like fighting a bear with a plastic spork