Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author nintechnet

    (@nintechnet)

    NinjaFirewall doesn’t have that feature. The reason is because it would require to perform a reverse DNS lookup and that would slow down the access to the site.

    Thread Starter proguid

    (@procarmanuals)

    Maybe there is an option to block such requests?

    Plugin Author nintechnet

    (@nintechnet)

    Can you show some of those HTTP requests to see if they could be blocked using another option?

    Thread Starter proguid

    (@procarmanuals)

    Each request has a unique user-aget (real or fake). All requests come from google cloud. We found a variant of blocking by hostname: googleusercontent.com. Perhaps it is enough to block all requests by google ASN.

    Plugin Author nintechnet

    (@nintechnet)

    The domain doesn’t even have a A record:

    $ dig googleusercontent.com
    
    ; <<>> DiG 9.18.19-1~deb12u1-Debian <<>> googleusercontent.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16503
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;googleusercontent.com.		IN	A
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
    ;; WHEN: Mon Oct 09 15:49:42 +07 2023
    ;; MSG SIZE  rcvd: 50
    

    It seems that the correct ASN for those addresses IP is “AS396982” (GOOGLE-CLOUD-PLATFORM).
    Blocking on the ASN would be much faster than doing a reverse DNS lookup.

    Make sure you don’t block “AS15169”, otherwise Google bot couldn’t index your site!

    Thread Starter proguid

    (@procarmanuals)

    https://postimg.cc/gallery/BjZQPHD

    here is a sample request

    Plugin Author nintechnet

    (@nintechnet)

    That’s from AS396982 (GOOGLE-CLOUD-PLATFORM). Blocking on that AS number would get rid of them.

    Thread Starter proguid

    (@procarmanuals)

    search robots from google won’t be blocked?

    Plugin Author nintechnet

    (@nintechnet)

    No, they won’t as Google uses another AS number for its own services, AS15169.

    Thread Starter proguid

    (@procarmanuals)

    I still have appeals from other addresses. How can I recognize the AS so that I can block.
    Here are the requests coming from: IP: 34.27.25.231 Hostname: 231.25.27.27.34.bc.googleusercontent.com

    Plugin Author nintechnet

    (@nintechnet)

    AS whitelist/blacklist isn’t available in the free version on NinjaFirewall, but only in the WP+ Edition.
    If you want to write your own code, you’ll need the list of AS numbers in CSV format: https://nintechnet.com/share/GeoLite2-ASN-CSV.zip

    Thread Starter proguid

    (@procarmanuals)

    Thank you.
    I’ll get used to the other plugin.
    If there are any questions, I’ll be sure to post.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘blocking by user hostname’ is closed to new replies.