LaneBlog

蝼蚁虽小,也有梦想

PHP Socket服务 | PHP微信开发框架 | 开源博客

PHP实现网络刷投票

Clicks: 5475 Date: 2014-02-10 14:51:51 Power By 李轩Lane

    PHP刷投票,让你高居榜首!本文附上刷票方法和防御策略。
案例为一个半月以前。没有及时放出原因有二,一是因为博客域名备案没有下来,没有心情写东西。二是最主要的,及时放出对案例网站有严重的损害,不是我等IT人应有的。
Ps:刷票有风险,使用需谨慎。本文谨做学习研究讨论之用,不可用作不正当用途!

本文为本博客的处女之作,题材源于近日一朋友要求,是因为她的姐姐参加了一个书法比赛,问我能不能在网站上刷投票。作为刚刚出道一年的小菜鸟,我很惶恐。一年前刚刚接触PHP的时候,完全不知道做,现在第一反应就是Curl。

废话不多说了,直接上代码。

<?php
header('Content-type: text/html; charset=gb2312');
//随机生成IP
$ip1 = rand(101, 255).'.';
$ip2 = rand(1, 255).'.';
$ip3 = rand(1, 255).'.';
$ip4 = rand(1, 255);
$ip = $ip1 . $ip2 . $ip3 . $ip4;
$clientIp = 'CLIENT-IP:'.$ip;
$xforwarded = 'X-FORWARDED-FOR:'.$ip;
//设置目标和来源
$url = 'http://www.dunhuangwomen.org.cn/vote/Vote.asp?id=67';
$referer = 'http://www.dunhuangwomen.org.cn/vote/list.asp?id=2';
//Curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //目标
curl_setopt($ch, CURLOPT_HTTPHEADER, array($xforwarded, $clientIp));  //构造IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //来源
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);

$ret = curl_exec($ch);
curl_close($ch);
echo $ret;
?>
好,来分析一下。 1、仿造IP,网站有限制一个IP在一天只可以投一次 2、填写来源,网站会判断请求的来源是否合法路径 其他就是Curl的常规了选项了。 如何防治? 本人才疏学浅,仅作跑砖引玉。 1、限制IP 本文已经破解 2、限制来源 本文已经破解 3、验证码。作为最反人类的发明之一,可以使用这个拥有高大上的名字的全自动区分计算机和人类的图灵测试。 可用Opencv。 4、记录MAC地址。 理论上每块网卡都有一个唯一的MAC地址,如果更改可能引起冲突而无法上网。目前也可以用软件修改 5、注册会员 虽说仍然可以突破验证码,Curl填写参数然后POST过去,但是门槛毕竟高了一丁点,还是忽略吧。 6、手机 投票时输入手机号和短信验证码,成本高,单位不愿意。用户发送某某指令到某某,用户自掏腰包,用户不愿意。 目前来说,只有验证码,手机并且验证手机的有效性是最好的防治措施。

Reply: Guofeng On 2014-02-10 15:00:49

学习了

回复

Reply: Guofeng On 2014-02-19 16:04:04

测试过了,可以用

回复

Reply: 3aplus63Empok On 2020-04-22 19:35:56

<b></b>

回复

Reply: labedroomLib On 2020-04-25 13:14:43

<b><a href=https://labedroom.com/>5 piece bedroom set</a></b> Dreaming update your external interior? Read carefully the news of goods for home use from our compilation, in her represented as products with colorful floral patterns and coloring and goods with graceful texture and finish metallic. Bench for the garden is necessary attribute any in the apartment. In the online store today you can buy best furniture for garden and home. We can deliver in VENIS (VENICE) client absolutely all furniture at desired time day.Cost of goods, those that offers web shop furniture VENIS (VENICE) surprise all visitor.Again low tariff may cause certain questions regarding high quality. The catalog which is today filled with diverse items furnishings represents exclusively high quality manufactured products.

回复

Reply: labedroomLib On 2020-05-09 03:31:41

<b><a href=https://labedroom.com/>Bedroom sets</a></b> Come in outstanding store in Jefferson Park production for office and home use and cafe! presents over 12000 appointment furniture and goods for a country house and apartments or restaurant. Natural rattan , are used for the purposes of production our branded products , possesses strength and wear resistance, wonderful external data. All furniture processed special compounds, due to which their surface does not absorb water, stable to extremes ambient temperature air and exposure of the sun. Vya our furniture excellent retains its functions even in restaurant in open spaces . In the presented online catalog you offered photos furniture for dining room, hall, bedroom, children's room , as well as intended for organization of storage area - dressers and cabinets, cabinets and others . In our store in Fairfax you can buy everything for any your home not expensive . We invite client come to store , holding in Westwood what cares about its shopper.

回复

Reply: Fran On 2020-05-22 05:22:41

fantastic put up, very informative. I ponder why the opposite specialists of this sector do not understand this. You must proceed your writing. I'm sure, you've a great readers' base already!

回复

Add Comment
©2014 www.lanecn.com , All rights reserved. Power By Li Xuan.  京ICP备14005030号