关于PHP写的投票网站之刷票终结版
告诉大家一个坏消息,还是有刷票的行为,有图有真相:
倒数第三项是时间轴,倒数第二项是IP,倒数第一项是邮箱,你们要刷票,拦都拦不住呀呀呀呀呀呀!!!!!
看看这些时间的间隔,看看这些IP的地址,哎,再看看邮箱,全163的,再也不爱了。
再来看看这些软件,有图有真相:
还有神马人工输入验证码的,自动输入验证码的,哎,被秒杀了瞬间。。。。
继上篇刷票风云的随笔之后,我还是决定用每个学生登录教务处的密码尝试一下,虽然这个我在开学的时候做微信开发的时候弄过。
首先要做的是登录学校教务处网站,然后打开sharkwire,取得传过去的信息,这些图我就明天上传补上,现在是用的同学电脑。
获取到传过去的数据之后,我们就可以copy一下,用curl这个PHP中的API,创造个cookie传过去。
1 //第一步:提交数据,生成cookie,将cookie保存在临时目录下 2 //在指定目录中建立一个具有唯一文件名的文件。如果该目录不存在,tempnam() 会在系统临时目录中生成一个文件,并返回其文件名 3 $cookie_file=tempnam('./temp','cookie'); 4 $ch=curl_init(); 5 $login_url="网址"; 6 $curlPost="uname=账号&upwd=密码&usertypex=%B9%DC%C0%ED%D4%B1"; 7 curl_setopt($ch,CURLOPT_URL,$login_url); 8 //启用时会将头文件的信息作为数据流输出 9 curl_setopt($ch,CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible;MS IE 9.0; Windows NT 6.1; WOW 64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; BRI/2; MASM; .NET4.0C; .NET4.0E; InfoPath.3; Media Center PC 6.0; SE 2.X MeTaSr 1.0)');10 curl_setopt($ch,CURLOPT_HEADER,true); 11 curl_setopt($ch,CURLOPT_MAXREDIRS,1); 12 curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);13 curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); 14 curl_setopt($ch,CURLOPT_POST,1);15 curl_setopt($ch,CURLOPT_POSTFIELDS,$curlPost);16 //设置连接结束后保存cookie信息的文件17 curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie_file);18 $content_login=curl_exec($ch);19 //print_r($content_login);20 var_dump($cookie_file);21 curl_close($ch);
测试什么都没有显示,因为:
$content_login=curl_exec($ch);//print_r($content_login);
后面会解释,继续:
1 $ch2=curl_init(); 2 $login_url2=网址2"; 3 curl_setopt($ch2,CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible;MS IE 9.0; Windows NT 6.1; WOW 64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; BRI/2; MASM; .NET4.0C; .NET4.0E; InfoPath.3; Media Center PC 6.0; SE 2.X MeTaSr 1.0)'); 4 curl_setopt($ch2,CURLOPT_HEADER,0); 5 curl_setopt($ch2,CURLOPT_URL,$login_url2); 6 curl_setopt($ch2,CURLOPT_RETURNTRANSFER,1); 7 curl_setopt($ch2,CURLOPT_CONNECTTIMEOUT,120); 8 9 curl_setopt($ch2,CURLOPT_AUTOREFERER,1); 10 curl_setopt($ch2,CURLOPT_POST,1);11 12 curl_setopt($ch2,CURLOPT_POSTFIELDS,$curlPost); 13 curl_setopt($ch2,CURLOPT_REFERER,"来源"); 14 //设置连接结束后保存cookie信息的文件15 curl_setopt($ch2,CURLOPT_COOKIEFILE,$cookie_file); 16 $content_login=curl_exec($ch2);17 //$content_login='1';18 print_r($content_login);19 //curl_exec($ch);20 curl_close($ch2);
在这里,用到的是同一个cookie,这样服务器就可以直接识别了。
$content_login=curl_exec($ch2);
这是获取到网页上的内容。
print_r($content_login);
这是将获取到的内容打印出来,如果你细心,你可以发现前面有:
$content_login='1';
这么一句话被我注释掉了,这是我检测是否能修改数据用的,当初在获取课表的时候就不能修改获得的数据,也不知道是为何,但是在这里可以。
如果账号密码错了,就会按网站那样弹出个对话框显示账号密码错误,这样,只要再数据表里面再添加一项student_id便可以了,一个账号只能用一次。
真心希望这次能真正的制止住刷票,我已经心疲力尽了。
也谢谢网友们,蘑菇街的验证码真心好,我也弄出来了,明天与大家分享,但是刷票器有个功能是手工输入验证码,这又没辙了,所以放弃验证码了。
我要被那些人骂死了。
转载请注明出处:http://www.cnblogs.com/yydcdut/p/3472248.html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.
