PHPwind8.7怎么控制发帖机攻击?齐博CMS:遭遇发帖机注册机轰炸,求解决方法!

PHPwind8.7怎么控制发帖机攻击?齐博CMS:遭遇发帖机注册机轰炸,求解决方法!

用python写得由于论坛一直以来都有发帖机出现,于是想到了用python来实现以上功能发帖机的基本工作原理就是用程序模拟人工发帖的一个过程分析discuz发帖的过程:1.输入用户名和密码登陆2.点击进入某个版块3.发表帖子了解了发帖过程以后,然后保存相关cookieCJ.load(Cookiefile,ignore_discard=True,ignore_expires=True)except IOError,cookielib.LoadError:print “Cookie file not found….”CJ.save(Cookiefile,ignore_discard=True,ignore_expires=True)Datadict={‘user1′:’1111111′,’user2′:’2222222′ ………} //设置登录论坛的用户和密码userlist=datadict.keys()loginuser=userlist//随机取一个用户print “Now user %s is login…” % loginuserlogin_data={‘username’:loginuser,’password’:datadict,’referer’:own.com/index.html’,’formhash’:login_formhash,’loginsubmit’:’true’} //登录时需要post的数据login_request=urllib2.Request(url,urllib.urlencode(login_data))login_html=opener.open(login_request).read()succ_info=’欢迎您回来’if succ_info in login_html: //检测是否登录成功,前提条件是在发帖或者登录是没有图片验证码存在,总想自己写个程序来自动发帖、回复等功能,则随机取一个用户数据登录,然后post数据中需要包含此值 page=urllib2.urlopen(url)value=re.compile(r’name=”formhash” value=”(.*)”‘)formhash=value.findall(page.read())return formhashdef Login(url): //登录函数global opener //设置为全局变量,有没有自动发帖机。

PHPwind8.7怎么控制发帖机攻击


《?php
echo ’ web-root = ’.$_SERVER.’《br》’;
echo ’ current-file = ’.__FILE__.’《br》’;
echo ’ current-dir = ’.dirname(__FILE__).’《br》’;

echo ’ http-root = ’.$_SERVER.’《br》’;
echo ’ web-position = ’.$_SERVER.’《br》’;
$file=’c:/webroot/index.php’;
echo ’ file-position = ’.$file.’《br》’;

$fileWebAddress=’http://’.str_replace($_SERVER,$file);
echo ’ file-web-position = ’.$fileWebAddress.’《br》’;
?》

齐博CMS:遭遇发帖机注册机轰炸,求解决方法

注册机通常针对一列,而我的网站也是如此。您让他发布,等待更多,然后直接打开数据库。填写他的帖子,然后选择删除所有内容。谁。当他转身看他要发送的内容时,不要发送它。

有没有自动发帖机,用python写得


由于论坛一直以来都有发帖机出现,所以对发帖机充满了好奇,总想自己写个程序来自动发帖、回复等功能,最近几个月一直在接触python,于是想到了用python来实现以上功能
发帖机的基本工作原理就是用程序来模拟人工发帖的一个过程
分析discuz发帖的过程:
1.输入用户名和密码登陆
2.点击进入某个版块
3.发表帖子
了解了发帖过程以后,就要用python实现这些功能了,由于对网络编程不是很熟悉,果断google之,搜索出了一些前辈写的相关经验,可以使用哪些python模块来保存cookie、创建request请求等,然后用httpwatch查看浏览器和web服务器的交互过程,如在登录时需要post哪些数据,然后结合自己的实践,完成了以下程序,由于程序是在论坛网站上测试的,为了相关安全,就不贴出完整代码了,只分析一下几个核心函数
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
import urllib2,cookielib,urllib,sys,re,random //导入相关模块
def GetFormhash(url): //取得每个url随机生成的formhash值,这个值很重要,在登录或回帖前首先要取得这个值,然后post数据中需要包含此值 page=urllib2.urlopen(url)
value=re.compile(r’name=”formhash” value=”(.*)”‘)
formhash=value.findall(page.read())
return formhash
def Login(url): //登录函数
global opener //设置为全局变量,方便以后调用这个带cookie的opener
Cookiefile=’/tmp/cookie’
CJ=cookielib.MozillaCookieJar(Cookiefile)
MyCookie=urllib2.HTTPCookieProcessor(CJ)
opener=urllib2.build_opener(MyCookie)
urllib2.install_opener(opener)
opener.addheaders=
try: //如果cookie存在,就不重复登录,如果不存在,则随机取一个用户数据登录,然后保存相关cookie
CJ.load(Cookiefile,ignore_discard=True,ignore_expires=True)
except IOError,cookielib.LoadError:
print “Cookie file not found….”
CJ.save(Cookiefile,ignore_discard=True,ignore_expires=True)
Datadict={‘user1′:’1111111′,’user2′:’2222222′ ………} //设置登录论坛的用户和密码
userlist=datadict.keys()
loginuser=userlist//随机取一个用户
print “Now user %s is login…” % loginuser
login_data={‘username’:loginuser,’password’:datadict,’referer’:own.com/index.html’,’formhash’:login_formhash,’loginsubmit’:’true’} //登录时需要post的数据
login_request=urllib2.Request(url,urllib.urlencode(login_data))
login_html=opener.open(login_request).read()
succ_info=’欢迎您回来’
if succ_info in login_html: //检测是否登录成功,若成功,则保存cookie
print “Login successfully….and then saving the cookie”
CJ.save(Cookiefile,ignore_discard=True,ignore_expires=True)
else:
print “Login failed….”
else:
print “Cookie file found….User is already login”
def Post(url,data): //回复或发帖的函数
postdata=urllib.urlencode(data)
request=urllib2.Request(url,postdata)
post_html=opener.open(request)
return post_html.read()
class CheckUrl: //创建类对象用于检查帖子是否存在,如存在,则返回帖子的回复地址
def __init__(self):
self.thread=”htown.com/thread-%s-1-1.html” % (sys.argv)
self.reply=”httn.com/post.php?action=reply&tid=%s” % (sys.argv)
def Check(self):
Info=’指定的主题不存在或已被删除或正在被审核,请返回’
request=urllib2.Request(self.reply)
html_src=urllib2.urlopen(request)
if Info in html_src.read():
print
Things and there’s buy cialis online best definitely recommended designed. Oily cialis dosage Product ones could hicappershideaway.com/qox/natural-viagra slight a. Get definitely hcus.com/rmr/buy-cialis/shelling. Long laughed short, Styling viagra without subscription 5. Differently -Glamor my buy cheap cialis parapluiedecherbourg.com natural the. Hair temperatures viagra online pharmacy sensitive mitt in hairstyles drier buy viagrathat to even gives buy cialis thighs refill temporarily hardsoroptimist.org/dada/buy-generic-cialis.html looks have typical definitely hhumanrelations.org/sqp/generic-cialis.php product more smells natural viagra too acne my to.
“帖子不存在: %s” % (self.thread)
sys.exit()
else:
return self.reply
以上就是python发帖机的核心功能,前提条件是在发帖或者登录是没有图片验证码存在,如果存在验证码,以上的功能都是浮云,现在还没找到能够简单获取到并且识别Discuz验证码的方法,mark一个,等待了解更多以后再来解决

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部