标签: captcha

怎么写Captcha?

我正在开发一个注册表,因为我想放置CAPTCHA.我生成一个随机字符串,但如何将其转换为图像其他明智的我如何开发CAPTCHA代码或任何参考.谢谢

c# asp.net captcha

2
推荐指数
1
解决办法
1194
查看次数

为什么我不能在Delphi程序中获取AOL验证码图像?

新的演示代码:

我试图从AOL获取验证码图像,并且我一直收到错误418.

unit imageunit;
///
///  https://new.aol.com/productsweb/
///
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL,
  IdSSLOpenSSL, IdIntercept, IdZLibCompressorBase, IdCompressorZLib,
  IdCookieManager, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdHTTP,jpeg,GIFImg, ExtCtrls, PerlRegEx;

type
  TForm2 = class(TForm)
    IdHTTP1: TIdHTTP;
    IdCookieManager1: TIdCookieManager;
    IdCompressorZLib1: TIdCompressorZLib;
    IdConnectionIntercept1: TIdConnectionIntercept;
    IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
    Panel1: TPanel;
    Image1: TImage;
    Panel2: TPanel;
    Button1: TButton;
    PerlRegEx1: TPerlRegEx;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation …
Run Code Online (Sandbox Code Playgroud)

delphi captcha indy indy10

2
推荐指数
1
解决办法
2762
查看次数

在没有CAPTCHA的情况下防止DoS攻击

我很想知道在我的电子邮件和联系表单上防止DoS攻击的好方法.

我有一个"与朋友分享"功能,它打开了我创建的一个表单,但我宁愿不加入CAPTCHA.

我在这里看到了一个jQuery + PHP解决方案:http://docs.jquery.com/Tutorials : Safer_Contact_Forms_Without_CAPTCHAs#PHP_File

它看起来是一个很好的解决方案,我只是想帮助将PHP翻译成C#.我猜测ASHX文件最好用.

如果还有其他(更好的?)解决方案,我很乐意听到它们.

asp.net jquery captcha denial-of-service

2
推荐指数
1
解决办法
2056
查看次数

使用FakeItEasy和FluentValidation伪造来自commonlibnet的Captcha

我正在使用commonlibrary中的Captcha类(http://commonlibrarynet.codeplex.com/).我的代码工作和一切,但现在我正在尝试编写单元测试.

我的验证规则是:

 RuleFor(x => x.CaptchaUserInput)
            .NotEmpty()
            .Must((x, captchaUserInput) => Captcha.IsCorrect(captchaUserInput, x.CaptchaGeneratedText))
            .WithMessage("Invalid captcha code");
Run Code Online (Sandbox Code Playgroud)

在我的设置代码中,我尝试执行以下操作:

A.CallTo(() => Captcha.IsCorrect()).Returns(true);
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误消息:

SetUp : FakeItEasy.Configuration.FakeConfigurationException : 

The current proxy generator can not intercept the specified method for the following reason:
- Static methods can not be intercepted.


at FakeItEasy.Configuration.DefaultInterceptionAsserter.AssertThatMethodCanBeInterceptedOnInstance(Metho    dInfo method, Object callTarget)
at FakeItEasy.Configuration.FakeConfigurationManager.CallTo(Expression`1 callSpecification)
at ProdMaster.Hosts.Web.Tests.Unit.Controllers.AccountControllerTests.SetUp() in     AccountControllerTests.cs: line 44 
Run Code Online (Sandbox Code Playgroud)

所以问题实际上是如何使用FakeItEasy伪造静态方法.

TIA,

大卫

captcha unit-testing common-library fluentvalidation fakeiteasy

2
推荐指数
1
解决办法
1566
查看次数

Django - django-simple-captcha的问题

我有关于http://code.google.com/p/django-simple-captcha/项目的问题.我按照程序安装验证码,表格有效,但浏览器不加载图片.该怎么办?

我的模式:

from django.conf.urls.defaults import patterns, include, url
from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', 'main.views.main', name="main_page"),
    url(r'^registration$', 'main.views.registration', name="registration"),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    # Captcha
    url(r'^captcha/', include('captcha.urls')),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^files/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    )
Run Code Online (Sandbox Code Playgroud)

python django captcha

2
推荐指数
1
解决办法
4823
查看次数

检测到意外导航时显示验证码以防止滥用流量

我注意到有些用户通过下载多个文件(例如同时500个文件)来重载我的网站并在较短的时间内打开更多页面,我想显示验证码,如果用户检测到意外导航.

我知道如何实现Captcha,但我无法弄清楚使用(PHP)检测流量滥用的最佳方法是什么?

php jquery captcha abuse web-traffic

2
推荐指数
1
解决办法
820
查看次数

如何使用Selenium WebDriver和Java从图像(验证码)中读取文本

我有注册网页,但在最后一个验证码显示..

我无法从图像中读取文本.我要提一下代码和输出..

@Test
public void loginTest() throws InterruptedException {
    System.out.println("Testing");
    driver.get("https://customer.onlinelic.in/ForgotPwd.htm");

    WebElement element = driver.findElement(By.xpath("//*[@id='forgotPassword']/table/tbody/tr[5]/td[3]/img"));
    System.out.println(" get the instance ");

    String elementTest = element.getAttribute("src");
    System.out.println("Element : " + elementTest);
}
Run Code Online (Sandbox Code Playgroud)

输出:错误

例外在线程"主" org.openqa.selenium.NoSuchElementException:无法找到元素:{ "方法": "的xpath", "选择器":"// [@ ID = 'forgotPassword'] /表/ tbody的/ TR [ 5]/td [3]/img"}命令持续时间或超时:60.02秒有关此错误的文档,请访问:http://seleniumhq.org/exceptions/no_such_element.html 构建信息:版本: '2.35.0',修订版: '8df0c6b',时间: '2013年8月12日15时43分19秒' 信息:os.name: 'Windows 7的',os.arch: 'AMD64' ,os.version: '6.1',java.version: '1.6.0_26' 会话ID:5f5b2e1a-56a4-49ad-8fd3-2870747a7768驱动信息:org.openqa.selenium.firefox.FirefoxDriver能力[{平台= XP,acceptSslCerts = TRUE,javascriptEnabled = TRUE,browserName =火狐,旋转=假,locationContextEnabled = TRUE,版本= 23.0.1,cssSelectorsEnabled = TRUE,databaseEnabled = TRUE,handlesAlerts = TRUE,browserConnectionEnabled = TRUE,nativeEvents = TRUE,webStorageEnabled = …

java selenium captcha selenium-webdriver

2
推荐指数
1
解决办法
8万
查看次数

如何使用jquery刷新reCaptcha图像

根据我的标题,我如何在PHP中刷新Google的recaptcha插件的重新搜索图像.可能吗?

我意识到没有第二次尝试相同图像的插件,所以我的看法是每次用户输入和失败时,我将需要使用jquery刷新图像.

我不想也不需要刷新页面,因为我使用.post来检查验证码输入.

以下是我的Javascript代码.

        if($("input[name='recaptcha_response_field']").val().length<=0){
            formOkay=0;
            alert('Captcha helps prevent Spamming. Captcha Cannot be empty');
            return false;          
        }else{
            $.post('/external_scripts/recaptcha-php-1.11/jpost/verification.php',$("form[name='registration']").serialize(),function(data){
                if(data==0){
                    formOkay=0;
                    alert('Captcha is Wrong');
                    return false;
                }else{
                    ..CARRY ON WITH FORM SUBMISSION
Run Code Online (Sandbox Code Playgroud)

php jquery captcha recaptcha

2
推荐指数
1
解决办法
4226
查看次数

由于"无效输入密钥",google recaptcha返回false

我已经从谷歌安装了最新的recaptcha,但它总是在提交后返回false并且总是返回"invalid-input-secret"错误,即使从前端视图验证总是正确的.这可能是什么原因.顺便说一句,我正在使用phalcon框架测试localhost xampp中的所有内容.这是我检查验证码的部分:

protected function validate_data($post, $ip){

    $validation = new Validation();
    $validation->add(
        'user_name',
        new PresenceOf(
            array(
                'message' => 'The Username is required'
            )
        )
    );
    $validation->add(
        'email',
        new PresenceOf(
            array(
                'message' => 'The e-mail is required'
            )
        )
    );
    $validation->add(
        'password',
        new PresenceOf(
            array(
                'message' => 'The Password is required'
            )
        )
    );
    $validation->add(
        'cpassword',
        new PresenceOf(
            array(
                'message' => 'The Confirmation Password is required'
            )
        )
    );
    $validation->add(
        'email',
        new Email(
            array(
                'message' => 'The e-mail is not valid'
            ) …
Run Code Online (Sandbox Code Playgroud)

php captcha phalcon

2
推荐指数
2
解决办法
1万
查看次数

验证reCaptcha V2:始终为false

我正在尝试在我的网站(用PHP和Wordpress开发)中植入Google的reCaptcha V2。

我正在尝试验证用户是否在提交之前检查了此验证码。

这是我的验证:

<?php

if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){
  $privatekey = $secret;
  $captcha = $_POST['g-recaptcha-response'];
  $url = 'https://www.google.com/recaptcha/api/siteverify';
  $data = array(
      'secret' => $privatekey,
      'response' => $captcha,
      'remoteip' => $_SERVER['REMOTE_ADDR']
  );

  $curlConfig = array(
      CURLOPT_URL => $url,
      CURLOPT_POST => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_POSTFIELDS => $data
  );

  $ch = curl_init();
  curl_setopt_array($ch, $curlConfig);
  $response = curl_exec($ch);
  curl_close($ch);
  $jsonResponse = json_decode($response);
  if ($jsonResponse->success == true) {
            $succMsg = 'Your contact request have submitted successfully.';
            echo "<script>alert(\"OK\")</script>";
  }
  else {
      $errMsg = 'Robot verification …
Run Code Online (Sandbox Code Playgroud)

php wordpress verification captcha

2
推荐指数
1
解决办法
2487
查看次数