Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The way is to store on the session a counter and use the counter to prevent too many calls per time.</p> <p>But if your user may try to avoid that and send different cookie each time*, then you need to make a custom table that act like the session but connect the user with the ip, and not with the cookie.</p> <p>One more here is that if you block basic on the ip you may block an entire company that come out of a proxy. So the final correct way but more complicate is to have <strong>both ip and cookie connected with the user</strong> and know if the browser allow cookie or not. If not then you block with the ip. The difficult part here is to know about the cookie. <strong>Well on every call you can force him to send a valid cookie that is connected with an existing session</strong>. If not then the browser did not have cookies.</p> <p>[ * ] The cookies are connected with the session.<br> [ * ] By making new table to keep the counters and disconnected from session you can also avoid the session lock.</p> <p>In the past I have use a code that used for DosAttack, but none of them are working good when you have many pools and difficult application so I now use a custom table as I describe it. This are the two code that I have test and use</p> <p><a href="http://omaralzabir.com/prevent_denial_of_service__dos__attacks_in_your_web_application/" rel="nofollow">Dos attacks in your web app</a></p> <p><a href="http://madskristensen.net/post/Block-DoS-attacks-easily-in-ASPNET.aspx" rel="nofollow">Block Dos attacks easily on asp.net</a></p> <p>How to find the clicks per seconds saved on a table. Here is the part of my SQL that calculate the Clicks Per Second. One of the tricks is that I continue to add clicks and make the calculation of the average if I have 6 or more seconds from the last one check. This is a code snipped from the calculation as an idea</p> <pre><code>set @cDos_TotalCalls = @cDos_TotalCalls + @NewCallsCounter SET @cMilSecDif = ABS(DATEDIFF(millisecond, @FirstDate, @UtpNow)) -- I left 6sec diferent to make the calculation IF @cMilSecDif &gt; 6000 SET @cClickPerSeconds = (@cDos_TotalCalls * 1000 / @cMilSecDif) else SET @cClickPerSeconds = 0 IF @cMilSecDif &gt; 30000 UPDATE ATMP_LiveUserInfo SET cDos_TotalCalls = @NewCallsCounter, cDos_TotalCallsChecksOn = @UtpNow WHERE cLiveUsersID=@cLiveUsersID ELSE IF @cMilSecDif &gt; 16000 UPDATE ATMP_LiveUserInfo SET cDos_TotalCalls = (cDos_TotalCalls / 2), cDos_TotalCallsChecksOn = DATEADD(millisecond, @cMilSecDif / 2, cDos_TotalCallsChecksOn) WHERE cLiveUsersID=@cLiveUsersID </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload