Answer the question
In order to leave comments, you need to log in
How to block a POST request with a specific body?
On our IPB 2.3.x forum, some spammers started registering and posting the same links to porn sites in profiles and signatures.
There is no desire to look for mods and hacks for IPB that could solve my problem.
But what if Nginx checks the POST request for the presence of a specific URL in it? And if such a request takes place, send it away.
Who has any ideas?
Answer the question
In order to leave comments, you need to log in
nginx.org/en/docs/http/ngx_http_rewrite_module.html
_
if ($request_method = POST)
_
you can try to go from the other side and do something like this
iptables -A INPUT -m string --string "URL" --algo bm --to 65535 -j DROP
Rough and ugly, but it will work.
Add to the beginning of index.php after <?php
if(isset($_POST))
foreach($_POST as $v)
if(false!=stripos($v,'bad_url'))
die('SPAMMER GO AWAY');
Isn't it easier then to write a script. which will take the last N records from the database by cron and delete those that contain keywords? this seems faster to me.
A transparent captcha is placed on the domain and any POST request is intercepted to solve the problem. If everything is OK, then with other POSTs, it no longer intercepts.
Filtering web form text with isText .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question