简体   繁体   English

用于在启用ajax的网站上自动执行操作的脚本

[英]Script to automate actions on ajax-enabled website

Here in Switzerland, people under 26 that have a cell phone contract with Swisscom can send 500 sms per month for free using the website https://xtrazone.sso.bluewin.ch/ . 在瑞士,26岁以下与Swisscom签订手机合同的人可以使用https://xtrazone.sso.bluewin.ch/免费发送每月500短信。

Until a few days ago, this site was structured quite simply, it had a login and an inputbox to enter the sms. 直到几天前,这个网站的结构非常简单,它有一个登录和输入框输入短信。 That's why i wrote a perl script ( http://github.com/gwrtheyrn/Xtrazone-SMS-Tool ) to send sms over that service using curl. 这就是为什么我写了一个perl脚本( http://github.com/gwrtheyrn/Xtrazone-SMS-Tool )使用curl通过该服务发送短信。 That worked perfectly. 这非常有效。

Now they rewrote the entire site, and I'm faced with the following problems to be able to rewrite the script: 现在他们重写了整个网站,我面临以下问题,以便能够重写脚本:

  1. There's a CAPTCHA after the login has been entered 输入登录后有一个CAPTCHA
  2. The loginbox gets loaded using javascript and processes the input using ajax 使用javascript加载loginbox并使用ajax处理输入
  3. The box to enter the receiver isn't a standard input box, it's a special javascript inputbox 进入接收器的框不是标准输入框,它是一个特殊的javascript输入框

My remaining questions: 我剩下的问题:

  • How can i bypass the captcha? 我怎样绕过验证码? I thought of Tesseract ( http://code.google.com/p/tesseract-ocr/ ). 我想到了Tesseract( http://code.google.com/p/tesseract-ocr/ )。 That would probably work with perl (there's a wrapper for it). 这可能适用于perl(有一个包装器)。
  • Is there some way to execute the JavaScript actions without having to start a browser? 有没有办法在不启动浏览器的情况下执行JavaScript操作? I want to keep the tool command-line-only. 我想保留工具命令行。

Thanks in advance. 提前致谢。

If you run through the process with a network trace of some kind on ( there is one that comes as an add-on for firefox, fiddler is a passable standalone alternative ) you should be able to see what requests are actually made by the javascript to the server. 如果您使用某种类型的网络跟踪(有一个作为firefox的附加组件,fiddler是一个可通过的独立备选方案)来运行该过程,您应该能够看到javascript实际发出了什么请求。服务器。 It is these that you will need your script to be able to emulate. 正是这些,你需要你的脚本能够模仿。

I have use Tesseract successfully against one captcha but not the other. 我已成功使用Tesseract对一个验证码而不是另一个验证码。 BUT you may not need that if the captcha is to load the text box. 但如果验证码是加载文本框,则可能不需要。

Grab Tamper Data for firefox. 抢获firefox的篡改数据 start it after you enter the captcha and check out the POST request they make. 输入验证码后启动它并查看它们发出的POST请求。 There is a chance you could directly send POST commands via CURL and not bother with the javascript 有可能你可以通过CURL直接发送POST命令,而不用麻烦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM