Forum Discussion

yosry92_331999's avatar
yosry92_331999
Icon for Nimbostratus rankNimbostratus
Dec 03, 2017
Solved

how can i block this url?

Hi ,i want to block this url by irule /browse.php?id=125 i want to block it by id=125

 

Thank you .

 

  • There are many ways to block the ID. I have prepared the below irule which will match ID value

    125
    & reject connection. Use Datagroup class if you have multiple ID.

    when HTTP_REQUEST {
    if { [URI::query [HTTP::uri] id ] contains 125 } {
        log local0. "Query string of URI [HTTP::uri] is [URI::query [HTTP::uri]]"
            reject
            } 
    }
    

    OR-- If you have multiple ID value

        when HTTP_REQUEST {
    value_id is object, you can add multiple id value in class.
           if {(matchclass value_id contains [URI::query [HTTP::uri] id]) } {
         reject
        } 
    }
    

3 Replies

  • There are many ways to block the ID. I have prepared the below irule which will match ID value

    125
    & reject connection. Use Datagroup class if you have multiple ID.

    when HTTP_REQUEST {
    if { [URI::query [HTTP::uri] id ] contains 125 } {
        log local0. "Query string of URI [HTTP::uri] is [URI::query [HTTP::uri]]"
            reject
            } 
    }
    

    OR-- If you have multiple ID value

        when HTTP_REQUEST {
    value_id is object, you can add multiple id value in class.
           if {(matchclass value_id contains [URI::query [HTTP::uri] id]) } {
         reject
        } 
    }
    
    • Stanislas_Piro2's avatar
      Stanislas_Piro2
      Icon for Cumulonimbus rankCumulonimbus

      you can use 403 response instead of tcp reset.

      HTTP::respond 403 -version "1.1" content {Access Denied!}
      event disable
      TCP::close