zju-cst / drls Goto Github PK
View Code? Open in Web Editor NEWZhejiang University software college dormitory random lottery system
Home Page: http://www.cst.zju.edu.cn/
License: Mozilla Public License 2.0
Zhejiang University software college dormitory random lottery system
Home Page: http://www.cst.zju.edu.cn/
License: Mozilla Public License 2.0
根据文件DRLS/drls/public/views.py:
# check passwd
lock_file_path = os.path.join(app.config['UPLOAD_FOLDER'],app.config['LOCK_FILE_NAME'])
lock = file_exists(lock_file_path)
if lock:
passwd = request.form['passwd']
app.logger.info(passwd)
app.logger.info(lock)
passwd_file = open(lock_file_path,'r')
real_passwd = passwd_file.readline().strip()
passwd_file.close()
if real_passwd != passwd:
return JSONR(ERRCODE.UNAUTHORIZED,'password was wrong')
else:
pass
seed_file_path = os.path.join(app.config['UPLOAD_FOLDER'], app.config['RANDOMSEED_FILE_NAME'])
num_file_path = os.path.join(app.config['UPLOAD_FOLDER'], app.config['RANDOMNUM_FILE_NAME'])
第一个随机种子来自于用户输入,第二次修改需要知道lock.txt中的密码,而http://localhost:2992/
刚好可以读取项目下任意文件,可篡改随机种子。
123
文件DRLS/drls/rng.py中获取随机数使用外部随机种子:
ran = random.uniform(0,self.range)
return ran
第一个随机种子来源于外部文件上传,文件DRLS/drls/public/views.py:
def upload():
if request.method == 'POST':
seed = request.form['randomSeed']
num = request.form['randomNum']
已知的随机种子导致结果可预测
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.