-
Notifications
You must be signed in to change notification settings - Fork 0
/
app2.py
30 lines (25 loc) · 976 Bytes
/
app2.py
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
from flask import Flask, render_template, url_for, request, redirect
import webbrowser
import requests
import time
import json
from flask.sessions import SecureCookieSessionInterface
from flask.helpers import make_response
site = Flask(__name__)
@site.route('/', methods=['GET', 'POST'])
@site.route('/index', methods=['GET', 'POST'])
def index():
return render_template('site_atacante.html')
@site.route('/req', methods=['GET', 'POST'])
def req():
r = requests.post('http://localhost:5000/login',
data=json.dumps({'email':'[email protected]', 'password':'lui'}),
headers={'content-type': 'application/json'})
response = r.json()
print(response)
response = requests.get('http://127.0.0.1:5000/login?include_auth_token', headers={"Content-Type": "application/json"})
print(response.text)
time.sleep(10)
return redirect(url_for('index'))
if __name__ == '__main__':
site.run(debug=True, port=5001)