@CalebEvans1/

Vulnerable Web Server

Python

You should be able to figure out how to hack this!

fork
loading
Files
  • main.py
  • templates
  • requirements.txt
main.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
31
32
33
34
from flask import Flask, render_template, request
from random import choice

#import MySQLdb

#conn = MySQLdb.connect('library', user='suhas', password='python')

app = Flask(__name__)

def valid_login(un,pw):
    if un == 'admin' and pw == 'password':
       return True
    else:
        return False

@app.route('/login')
def login():
    if request.method == 'GET':
        return render_template('login.html')
    elif request.method == 'POST':
        if valid_login(request.form['username'], request.form['password']):
            return redirect(url_for('home.html'))
        else:
            return redirect(url_for('failed_login'))

@app.route('/failed_login')
def failed():
    return render_template('failed_login.html')

@app.route('/')
def index():
    return render_template('index.html')

app.run(host='0.0.0.0', port=8080)