The approach is correct, the script is also.
But I would start from something a little more robust like:
Slowloris.py
https://github.com/gkbrk/slowloris
Basically an HTTP denial of service attack that affects thread servers. It works like this:
- Starts by making many HTTP requests.
- Sends headers periodically every 15s p/ keep connections open.
- Never close the connection unless the server does. If the server closes a connection, Slowloris creates one again.
- In theory this depletes the pool of server threads and the server cannot respond to other people.
Or Pyloris the most famous in the Python community
https://sourceforge.net/projects/pyloris/files/pyloris/
The difference from the above is that Pyloris can use SOCKS proxies and SSL connections and can target protocols such as HTTP, FTP, SMTP, IMAP and Telnet.
In addition to a beautiful UI made in Tkinter.
Because the denial of service through the Slowloris technique, although very interesting technically it is not very effective.
Since most Servers can handle incomplete requests well with the IIS case.
EDIT: Incomplete would be the wrong term, as many slowloris tools make complete and valid requests, just try to keep that connection open.
Then IIS would be invulnerable?
As far as I know IIS is not invulnerable, but it is very difficult an attack like this. the Band of the attacker and resources of the attacker will have to be equal of the attacked. Just the opposite of what Slowloris wants.
Note that in attacks against IIS the system needs to keep recreating packages, since the same one gives a timeout.
Nginx and Squid also enter as difficult to be attacked with this technique.
Update: After a few years, I tested the tool again against my internal IIS 10 server (Windows 2016 Standard) and after 6000 requests the same was quiet without any problem. NOTE: Without having made any extra configuration in it, it was installed as default, since it is the internal server here of the company.
Against whom it is effective?
It is very effective in Apaches old versions 1.x and 2.x
And some other types of servers that are already in disuse or obsolete.
Note that all today’s Ddos techniques no longer use this technique, which although sophisticated is no longer effective, today’s Ddos are in brute force.
Keeping the log of the attack
You can store the output from slowloris.py
to check every time it gives 403, thus confirming the successful attack. be through the storage of the log
or Logging.debug
.
Looking at the window is always an excellent idea in slowloris attacks you will notice windows with the same size every time, another feature you will notice will be a hole in the log a few milliseconds followed by a large amount of simultaneous connections, this usually follows a pattern, can be observed in Sniffer and be classified as a slowloris type attack ...
– ederwander
@ederwander: I read articles where it said that slowloris was only for Apache but I ran against IIS and it worked. Slowloris exploits Handshake on TCP using small window size, right? That is, it exploits PROTOCOL and not just application. Agree?
– Ed S
Under IIS, it works yes, but is much less effective, usually the attacking machine should be able to create many thousands of requests while apache 1ou2 would be easier to execute a successful attack.
– Dorathoto