Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab 6 - Random Password Generator #176

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Code/daryll/capstone/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Proposal:
Create a website scraper to clone websites for offensive security personnel to use as phishing sites to lure victims into entering their real credentials into a cloned website.

I plan to use website scraper APIs to clone a real site and be able to start the site and use it for phishing campaigns.

To-Do:
1. Write code in python to to test API functionality
2. Set-up Django back-end
3. Convert python code into Django compatible code
4. Set-up HTML front-end
a. Create input field for user to enter url to clone
b. Create input filed for user to enter number of levels to clone
c. *Create Status Indicator
d. Create button to start cloned website
e. *Create pass-through to pass credentials to real url

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions Code/daryll/html_css_flask/Lab5_Burrito Order Form/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Forms</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Permanent+Marker&display=swap" rel="stylesheet">
</head>

<body>
<header>
<div>
<h1>
Burrito Order Form
</h1>
</div>
</header>
<div>
<main>
<img src="burrito.jpg" alt="">
<form action="https://webhook.site/bd6aab8b-e91c-4fef-af71-19edc786abbb" method="POST">

<br>
<input placeholder="Name" name="name" type="text" pattern="[a-zA-Z]{1,20}" required>
<br>
<br>
<input placeholder="Enter Password" name="password" type="password" required>

<h3>Pick Your Tortilla: </h3>
<label for="white">White Flour</label>
<input id="white" name="tortilla" type="radio" value="white">

<label for="wheat">Wheat Flower</label>
<input id="wheat" name="tortilla" type="radio" value="wheat">

<label for="spinach">Spinach</label>
<input id="spinach" name="tortilla" type="radio" value="spinach">

<label for="corn">Corn</label>
<input id="corn" name="tortilla" type="radio" value="corn">

<h3>Pick Your Rice: </h3>
<label for="white">White Rice</label>
<input id="white" name="rice" type="radio" value="white">

<label for="brown">Brown Rice</label>
<input id="brown" name="rice" type="radio" value="brown">

<h3>Pick Your Protein: </h3>
<label for="carnitas">carnitas</label>
<input id="carnitas" name="protein" type="radio" value="carnitas">

<label for="chicken">chicken</label>
<input id="chicken" name="protein" type="radio" value="chicken">

<label for="sofritas">Sofritas</label>
<input id="sofritas" name="protein" type="radio" value="sofritas">

<label for="none">None</label>
<input id="none" name="protein" type="radio" value="none">

<h3>Additional Ingredients:</h3>
<label for="cheese">Cheese</label>
<input id="cheese" name="cheese" type="checkbox" value="yes">

<label for="sour cream">Sour Cream</label>
<input id="sour cream" name="sour cream" type="checkbox" value="yes">

<label for="guacamole">Guacamole</label>
<input id="guacamole" name="guacamole" type="checkbox" value="yes">
<br>
<br>
<h4>Delivery Instructions</h4>
<textarea name="delivery" cols="50" rows="10"></textarea>
<br>
<br>
<button type="submit">Submit Order</button>
</form>
</main>
</div>

</body>

</html>
17 changes: 17 additions & 0 deletions Code/daryll/html_css_flask/Lab5_Burrito Order Form/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
header {
background-color: lightblue;
height: 150px;
text-align: center;
font-size: 45px;
}
h1 {
color: rgb(95, 71, 40);
font-family: 'Permanent Marker', cursive;
text-shadow: -1px -1px 0 yellow, 1px -1px 0 yellow, -1px 1px 0 yellow, 1px 1px 0 yellow, -2px 0 0 yellow, 2px 0 0 yellow, 0 2px 0 yellow, 0 -2px 0 yellow;
text-align: center;
padding: 4px;
}
main {
display: flex;
justify-content: space-around;
}
34 changes: 34 additions & 0 deletions Code/daryll/html_css_flask/Lab6_pw_gen/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from flask import Flask, render_template, request
import random
import string

app = Flask(__name__)

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

@app.route("/password", methods=["POST"])
def password():
result = request.form
upper = int(result["pwu"])
lower = int(result["pwl"])
numbers = int(result["pwn"])
special = int(result["pws"])
pw_length = upper + lower + numbers + special
random_pw = []
while len(random_pw) < pw_length:
for x in range(upper):
random_pw.append(random.choice(string.ascii_uppercase))
for x in range(lower):
random_pw.append(random.choice(string.ascii_lowercase))
for x in range(numbers):
random_pw.append(random.choice(string.digits))
for x in range(special):
random_pw.append(random.choice(string.punctuation))
random.shuffle(random_pw)

return render_template("password.html", random_pw=random_pw)



3 changes: 3 additions & 0 deletions Code/daryll/html_css_flask/Lab6_pw_gen/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
text-align: center;
}
29 changes: 29 additions & 0 deletions Code/daryll/html_css_flask/Lab6_pw_gen/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Password Generator</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css')}}">
</head>
<body>
<h1>Random Password Generator</h1>

<form action="/password" method="POST">
<input name="pwu" type="text" placeholder="# of Uppercase Letters">
<br>
<br>
<input name="pwl" type="text" placeholder="# of Lowercase Letters">
<br>
<br>
<input name="pwn" type="text" placeholder="# of Digits">
<br>
<br>
<input name="pws" type="text" placeholder="# of Special Characters">
<br>
<br>
<button type="submit"submit>Generate Password</button>
</form>
</body>
</html>
15 changes: 15 additions & 0 deletions Code/daryll/html_css_flask/Lab6_pw_gen/templates/password.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ ''.join(random_pw) }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css')}}">
</head>
<body>
<h2>Your Password is:</h2>
<h1>{{ ''.join(random_pw) }}</h1>
<a href="/">Generate Another Password?</a>
</body>
</html>