• Resolved johnvrijck

    (@johnvrijck)


    Hi Wordfence team,

    I’m trying to block a specific user agent of someone who is manually scraping my database, in the hopes not to prevent legitimate users from my site.

    What precisely is the syntax to use in the Browser User Agent custom pattern field?
    I want to block the following user agent (changed numbers due to GDPR)

    Mozilla/6.0 (Windows NT 10.0; Win63; x64) AppleWebKit/523.31 (KHTML, like Gecko) Chrome/75.1.3454.96 Safari/512.24 OPR/12.0.3347.58

    Placing this between asterisks doesn’t work. I just want to ban this entire user agent and not every user agent that contains one of these terms..

    I tried this
    *OPR/12.0.3347.58
    *Safari/512.24*
    *Mozilla/6.0 (Windows NT 10.0; Win63; x64) AppleWebKit/523.31 (KHTML, like Gecko) Chrome/75.1.3454.96 Safari/512.24 OPR/12.0.3347.58*
    *Mozilla/6.0 (Windows NT 10.0; Win63; x64) AppleWebKit/523.31 (KHTML, like Gecko) Chrome/75.1.3454.96 Safari/512.24 OPR/12.0.3347.58

    etc.
    Maybe I need to escape this string?

    Hopefully you can help me out!

    Thanks!

    • This topic was modified 6 years, 5 months ago by johnvrijck.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey @johnvrijck,

    You can try blocking this part of the User-Agent:

    Go the “Advanced Blocking” tab on the “Blocking” page.

    Add *Mozilla/6.0* to the text field “User-Agent (browser) that matches”.

    This is an old version of Mozilla from 2011 and it is highly unlikely that a human visitor would be using such an old version of Mozilla.

    Please let me know how it goes.

    Thanks,

    Gerroald

    • This reply was modified 6 years, 5 months ago by WFGerroald.
    Thread Starter johnvrijck

    (@johnvrijck)

    Hi Gerroald,

    Thank you for the quick reply. Apologies for the confusion, I changed the numbers for GDPR purposes, but the real part of the user-agent was Mozilla/5.0, which unfortunately is very common.

    I was just hoping that it was possible to block the entire user agent, since it is unique enough to just block that 1 scraper.

    I will try the other partial user agent parts that are less commons if there’s not an option to block the entire thing.

    Thanks again!

    Hi @johnvrijck,

    I’d recommend simply IP banning or rate-limiting certain pages you don’t want scraped.

    Changing the user-agent is pretty simple, and you run the risk of blocking out users that may share the same user-agent.

    Dave

    Hi @johnvrijck,

    We haven’t heard back from you in a while, so I’ve gone ahead and marked this thread as resolved.

    Please feel free to open another thread if you’re still having issues with Wordfence.

    Thanks,

    Gerroald

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

The topic ‘Browser User Agent Block’ is closed to new replies.