【发布时间】:2015-07-25 00:02:22
【问题描述】:
注1:我没有网络编程经验。 注2:我没有做任何伤害。 cmets 会自动删除,尽管我认为可以,但我不打算做出解决方法。我只是在玩。
这是某网站的评论表:
<form method="post" target="_top" action="index.php" name="akocommentform" />
<input type="hidden" value="com_akocomment" name="option"></input>
<input type="hidden" value="106" name="acitemid"></input>
<input type="hidden" value="20805" name="contentid"></input>
<input type="hidden" value="XX.XX.XXX.XXX" name="ip"></input> # My IP, as a form arg
<input type="hidden" value="entry" name="func"></input>
... stuff ...
<input class="inputbox" type="text" style="width: 250px;" title="Vardas" alt="Vardas" value="" name="acname"></input>
<input type="hidden" value="0" name="iduser"></input>
... more stuff ...
<textarea class="inputbox" wrap="virtual" title="Komentaras" name="comment" rows="8" style="width: 250px; height: 120px;"></textarea>
为了垃圾邮件 20 cmets,我运行这个:
import requests
from random import choice, randrange as rr
from string import ascii_letters as letters
def fake_ip():
return str(rr(256))+'.'+str(rr(256))+'.'+str(rr(256))+'.'+str(rr(256))
comment = ''.join([choice(letters) for x in range(1000)])
name = ''.join([choice(letters) for x in range(15)])
payload = {
'option' : 'com_akocomment',
'acitemid' : '106',
'contentid' : '20586',
'ip' : fake_ip(), # IT WORKS!
'func' : 'entry',
'iduser' : '0',
'acname' : name,
'comment' : comment }
for i in range(20):
response = requests.post('http://www.nyksciai.lt', data=payload)
print (response.status_code, response.reason)
现在我有两个问题:
- 如果这是网站用于接收 cmets 的唯一代码,它怎么可能在其数据库中使用错误的 IP 跟踪我?
【问题讨论】:
-
您的问题都不是主题。我们不知道那个人是谁,所以我们不知道他们是“忘记”了还是完全不知道安全 101。这是否合法取决于一堆东西。我们不是律师。 (顺便说一句:你根本不是不可追踪的。如果你相信,你也需要采取 web sec 101 :-))
-
'是否合法'已删除
-
仍在猜测。据我们所知,他们可能已经打电话给 FBI,因为他们跟踪表单子 IP 地址和实际 TCP 端点连接地址之间的不匹配。他们很生气你发布了 cmets。
-
方便吗?老实说,谁知道呢?我们不是表单的作者。
-
@b4hand 好的,我现在明白了。因此,该网站知道我的真实 IP 并且可能也跟踪它,并记录我的评论 IP 以(可能)方便,例如快速评论 IP 查找或其他。谢谢!
标签: python forms python-3.x post ip