Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BOT_vs_reCAPTCHA.pdf

 BOT_vs_reCAPTCHA.pdf

Hazumi Ichijo

July 05, 2018
Tweet

More Decks by Hazumi Ichijo

Other Decks in Programming

Transcript

  1. ©2018 Wantedly, Inc. ϑϩϯτΤϯυ https://developers.google.com/recaptcha/docs/invisible#auto_render <html> <head> <title>reCAPTCHA demo: Simple

    page</title> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <script> function onSubmit(token) { document.getElementById("demo-form").submit(); } </script> </head> <body> <form id='demo-form' action="?" method="POST"> <button class="g-recaptcha" data-sitekey="your_site_key" data-callback='onSubmit'>Submit</button> <br/> </form> </body> </html>
  2. ©2018 Wantedly, Inc. ϑϩϯτΤϯυ https://developers.google.com/recaptcha/docs/invisible#auto_render <html> <head> <title>reCAPTCHA demo: Simple

    page</title> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <script> function onSubmit(token) { document.getElementById("demo-form").submit(); } </script> </head> <body> <form id='demo-form' action="?" method="POST"> <button class="g-recaptcha" data-sitekey="your_site_key" data-callback='onSubmit'>Submit</button> <br/> </form> </body> </html>
  3. ©2018 Wantedly, Inc. ϑϩϯτΤϯυ ࢀߟ: https://developers.google.com/recaptcha/docs/invisible#programmatic_execute <html> <head> <title>reCAPTCHA demo:

    Simple page</title> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <script> function onSubmit(token) { document.getElementById("demo-form").submit(); } function onClick() { // όϦσʔγϣϯΛߦ͏ grecaptcha.execute(); } </script> </head> <body> <form id='demo-form' action="?" method="POST"> <div class="g-recaptcha" data-sitekey="your_site_key" data-callback="onSubmit" data-size="invisible"> </div> <button onClick="onClick" /> </form> </body> </html>
  4. ©2018 Wantedly, Inc. ϑϩϯτΤϯυ ࢀߟ: https://developers.google.com/recaptcha/docs/invisible#programmatic_execute <html> <head> <title>reCAPTCHA demo:

    Simple page</title> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <script> function onSubmit(token) { document.getElementById("demo-form").submit(); } function onClick() { // όϦσʔγϣϯΛߦ͏ grecaptcha.execute(); } </script> </head> <body> <form id='demo-form' action="?" method="POST"> <div class="g-recaptcha" data-sitekey="your_site_key" data-callback="onSubmit" data-size="invisible"> </div> <button onClick="onClick" /> </form> </body> </html>
  5. ©2018 Wantedly, Inc. αʔόαΠυ ࢀߟ: https://developers.google.com/recaptcha/docs/verify conn = Faraday.new(:url =>

    'https://www.google.com/') res = conn.post '/recaptcha/api/siteverify', { :secret => ‘RECAPTCHA_SECRET_KEY’, :response => ‘RECAPTCHA_TOKEN’ } is_bot = JSON.parse(res.body)["success"]
  6. ©2018 Wantedly, Inc. SF$"15$)"W // ਓؒ {"success"=>true, "challenge_ts"=>"2018-07-05T06:35:35Z", "hostname"=>"localhost", "score"=>0.9,

    “action"=>"demo"} // BOT {"success"=>true, "challenge_ts"=>"2018-07-05T06:36:36Z", "hostname"=>"localhost", "score"=>0.1, "action"=>"demo"}
  7. ©2018 Wantedly, Inc. SF$"15$)"W // ਓؒ {"success"=>true, "challenge_ts"=>"2018-07-05T06:35:35Z", "hostname"=>"localhost", "score"=>0.9,

    “action"=>"demo"} // BOT {"success"=>true, "challenge_ts"=>"2018-07-05T06:36:36Z", "hostname"=>"localhost", "score"=>0.1, "action"=>"demo"}