I currentyly use this code to block wget and libwww
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
SetEnvIfNoCase User-Agent "^Wget" bad_user
SetEnvIfNoCase User-Agent "^libwww-perl" bad_user
Deny from env=bad_user
is there one for curl?
Servers cannot block cURL requests per se, but they can block any request that they do not like. If the server checks for some parameters that your cURL request does not satisfy, it could decide to respond differently.
GET Request with cURL -v is used to get verbose output. This will give the following output. The verbose result has details like status code, Content Type, Content Length and so on. It can be used to get a better idea of what happened during the HTTP request.
The client, curl, sends an HTTP request. The request contains a method (like GET, POST, HEAD etc), a number of request headers and sometimes a request body. The HTTP server responds with a status line (indicating if things went well), response headers and most often also a response body.
To make a GET request using Curl, run the curl command followed by the target URL. Curl automatically selects the HTTP GET request method unless you use the -X, --request, or -d command-line option. The target URL is passed as the first command-line option.
Yes, I am sure curl
has a default User-Agent, but that is obviously something that can be changed as easily as -H 'User-Agent=Poop'
In fact, I think there is a switch specifically for setting the user agent. -A
curl user agents can be changed at any time. The reason curl exists is that you can change pretty much everything on your query.
You can block them, but once they change the use agent, they will have access again.
I recommend you block the IP address instead or the whole subnet just to be sure.
Example:
deny from aa.bb.cc.dd ff.gg.hh.0/24
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With