jamesxg1 Posted May 18, 2009 Share Posted May 18, 2009 ok iv noticed that auto-mated robots fill the selected form in and then searches the page for a button, if i was to do the following would it works, ok so u have this. . . if (isset($_POST['submit'])) { your code here !! } and <input type="button" id="submit" name="submit" value="submit"> ok so to make it so that the robot doesnt know what the submit button is i wanted to make the script randomly generate a 4 figure mixed line and i want it to be like so. . . $random = rand(1, 10); and then go. . . if (isset($_POST['$random'])) { <input type="button" id="$random" name="$random" value="$random"> Would this work ? Thanks, James. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/ Share on other sites More sharing options...
Ken2k7 Posted May 18, 2009 Share Posted May 18, 2009 I don't think so. If you want something bot-proof, try a CAPTCHA. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836182 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 Well, first of all, HTML IDs are not allowed to start with numbers. Secondly, they aren't "clicking" the button. They're just looking for the action attribute in your <form> tag. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836246 Share on other sites More sharing options...
jamesxg1 Posted May 18, 2009 Author Share Posted May 18, 2009 oh ok, well thanks guys , just thought i would see if my little brain storm would actually be worth making lol cheers for all the help Thanks, James. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836305 Share on other sites More sharing options...
kickstart Posted May 18, 2009 Share Posted May 18, 2009 Hi As above, but plenty of other things you can do to make life more difficult for the spammers. You can use dynamic field names. You can have form fields that are not displayed and check if they have changed. Possibly repeat all the form with one copy hidden using CSS but with alternative field names which could be real names. Wrong fields returned then you know it wasn't a normal user. Ask a question which is easy for a normal person to answer. Timestamp the form and check how quickly it is returned. Maybe use Javascript to change the action tag on the form once the page is loaded (although this would prevent the page being used by those who have javascript turned off). etc. Nothing will ensure that a bot cannot get through (including Captcha stuff), but all make life difficult for the them. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836327 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 As above, but plenty of other things you can do to make life more difficult for the spammers. You can use dynamic field names. You can have form fields that are not displayed and check if they have changed. Possibly repeat all the form with one copy hidden using CSS but with alternative field names which could be real names. Wrong fields returned then you know it wasn't a normal user. Ask a question which is easy for a normal person to answer. Timestamp the form and check how quickly it is returned. Maybe use Javascript to change the action tag on the form once the page is loaded (although this would prevent the page being used by those who have javascript turned off). I could easily create a script that would circumvent all of those things... Except maybe the "ask a question". It would sort of depend on what the question is. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836329 Share on other sites More sharing options...
kickstart Posted May 18, 2009 Share Posted May 18, 2009 I could easily create a script that would circumvent all of those things... Except maybe the "ask a question". It would sort of depend on what the question is. Possibly you could, but 99% couldn't and would just go for attacking another site. Anything which just returns a normal form is far easier to attack, and having the hacker have to evaluate not only the form but also the css and / or javascript will make it far more of a job. As mentioned captchas can be broken as well. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836332 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 Evaluating CSS and Javascript wouldn't be necessary for specialized attacks. The developer of the bot could simply check the Javascript algorithms and the CSS rules to determine what to do with the served HTML, and write his bot accordingly. Relying on Javascript could in some countries be regarded as violation of disability discrimination laws. As an example, if you are blind you would have to rely on screen readers, and these cannot use Javascript. Then there are of course all the normal users like me browsing with Javascript off who you would piss off. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836334 Share on other sites More sharing options...
kickstart Posted May 18, 2009 Share Posted May 18, 2009 Evaluating CSS and Javascript wouldn't be necessary for specialized attacks. The developer of the bot could simply check the Javascript algorithms and the CSS rules to determine what to do with the served HTML, and write his bot accordingly. Relying on Javascript could in some countries be regarded as violation of disability discrimination laws. As an example, if you are blind you would have to rely on screen readers, and these cannot use Javascript. Then there are of course all the normal users like me browsing with Javascript off who you would piss off. All true, and the same applies to all other techniques (including any captchas), although no reason the CSS cannot be generated dynamically, forcing the spammer to write code to process it. All we can do is make life more difficult to write software to spam, and these ideas will all make it more difficult. Even then you just land up with people using cheap bureaus to use humans to get through the spam checks and do things manually. Biggest issue is running common software (such as bulletin boards), used by many sites. Requires minimal coding to hit a max number of sites. In these cases minor changes can help by rendering the particular site different enough from the other millions being attacked. Certainly has worked on a phpBB based site I run, where I have no doubt the minor changes could be coped with. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836341 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 The most effective solutions seems to be using sophisticated AI and machine learning algorithms to analyze and detect the content of spam messages like I would assume is how Gmail's spam filter works. That's way over the head of most web developers though. There are some services such as Akismet that offer an API for content based spam detection. Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836358 Share on other sites More sharing options...
kickstart Posted May 18, 2009 Share Posted May 18, 2009 Hi Gmails spam filters are not perfect, although it is a doddle to report spam. I suspect the ease of reporting and the large user base makes analysing such spam easy. However not sure how many of us are processing emails except in limited circumstances (including the original poster). My view is just to pick and choose many different methods (customised to your own site) to make life difficult for those trying to automate the use of sites to make their coding more difficult and more expensive. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/158539-will-this-be-a-good-anti-robot-function/#findComment-836370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.