javascript - Defeating spam registrations -
i trying learn as possible running high-profile website. designing user registration screens , thinking typical captcha, or annoying alternatives. in opinion, having them either causes accessibility issues, or bothers potential customers , inhibits registration process.
my question whether spambots recognize , trigger javascript events, such keydown
or keypress
event on input field. can gather, bots form posts via action attribute , don't programmatically "fill out" web forms.
in theory, add javascript following:
<input name="email" /> <input name="human" type="hidden" /> <script> var emailfield = document.getelementbyid( 'email' ); emailfield.onkeydown = function( ) { document.getelementbyid( 'human' ).value = "human"; }; </script>
then, on server side, verify post data includes value of "human" hidden form field.
is viable solution, @ least effective typing in bunch of random, difficult-to-read characters? using random generated value server more helpful in repetitive attempts static value of "human"?
most spam bots <form>
on page , post data directly url specified in action
attribute. simple, lightweight, , easy do.
some spam bots use headless browser (such phantomjs) executes javascript on page. these spam bots harder fool, few bots use method since more expensive (in cpu , ram).
i've found it's fine go blocking common spam bots through honeypot (field on page removed programmatically, , other similar methods). bots through, , manual analysis find way exploit page still in. sites, enough, , provides balance in preventing spam while keeping site usable.
Comments
Post a Comment