Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
CynthiaRutledge authored Nov 16, 2019
1 parent 47516e1 commit 2aac178
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 46 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:10
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

COPY . .

EXPOSE 8080

CMD [ "node", "server.js" ]
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node index.js
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Fake bank for messing with refund scammers.

Running in Docker:

```
docker build -t fake-bank .
docker run -d -p 192.168.181.1:443:8080 fake-bank:latest
```

You'll need to replace `192.168.181.1` with whatever interface your virtual machine guest is running on.

Edit your Windows guest host file so that `njcreditunionmutual.com` resolves to `192.168.181.1` (or whatever).
https://www.groovypost.com/howto/edit-hosts-file-windows-10/

Visit the domain, copy the cert to a file, and trust it in the guest.
http://www.hackaapl.com/how-to-trust-self-signed-certificates-in-windows-7/

Cert was generated with:

```
openssl req -subj "/CN=njcreditunionmutual.com" -nodes -new -x509 -keyout server.key -out server.cert -days 3650
```

52 changes: 23 additions & 29 deletions data.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ accounts = [{
balance: 1240.36,
},
{
nickname: 'AARP Platinum Credit Card',
nickname: 'Standard Credit Card',
number: '2579',
balance: 19001,
balance: 2025.25,
},
{
nickname: 'High-Interest Savings',
number: '2580',
balance: -1240.36,
balance: 3250.36,
},
{
nickname: 'Fixed-Rate War Bond',
nickname: 'Fixed-Rate 5 Year Term CD',
number: '9704',
balance: 1240.36,
balance: 5000.00,
}]

transactions = [{
description: 'APL*ITUNES.COM/BILL',
amount: -50,
date: new Date(2019, 6, 22),
date: new Date(2019, 10, 7),
account: 0
},
{
description: 'Dunkin\' Donuts',
amount: -25,
date: new Date(),
date: new Date(2019, 10, 4),
account: 0
},
{
Expand All @@ -39,52 +39,46 @@ transactions = [{
},
{
description: `XFER FROM ACCT x${accounts[2].number}`,
amount: 200,
date: new Date(),
amount: 250,
date: new Date(2019, 10, 1),
account: 0
},
{
description: 'Cheque #103 Deposit',
description: 'Check Deposit',
amount: 33.10,
date: new Date(),
account: 0
date: new Date(2019, 9, 20),
account: 2
},
{
description: 'Social Security',
amount: 1392.19,
date: new Date(),
account: 2
description: 'Check #103 Withdrawal',
amount: -1392.19,
date: new Date(2019, 9, 16),
account: 0
},
{
description: 'QVC*SHOPPING/BILL',
amount: -140.50,
date: new Date(),
date: new Date(2019, 9, 10),
account: 0
},
{
description: 'Netflix',
amount: -12.99,
date: new Date(),
date: new Date(2019, 8, 25),
account: 0
}]

transfers = [{
origin: 2,
destination: 0,
amount: 250,
date: new Date()
},
{
origin: 2,
destination: 0,
amount: 250,
date: new Date()
date: new Date(2019, 10, 1)
},
{
origin: 2,
destination: 0,
amount: 250,
date: new Date()
origin: 0,
destination: 3,
amount: 5000,
date: new Date(2019, 7, 22)
}]

module.exports = (() => ({
Expand Down
17 changes: 17 additions & 0 deletions server.cert
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICwDCCAagCCQC8BPqISsqq7zANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdu
amNyZWRpdHVuaW9ubXV0dWFsLmNvbTAeFw0xOTExMTYxOTE0NDZaFw0yOTExMTMx
OTE0NDZaMCIxIDAeBgNVBAMMF25qY3JlZGl0dW5pb25tdXR1YWwuY29tMIIBIjAN
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApFdLJzdpdfS301iSO7lPRVOqXO+u
BsfR5cqwKUa6QOoPXQNI9ffT8HYxWNy7GdBck4LCSrNOjxPiC8nWW5vhERGIvHZW
LvOw9zc0r3AfbxyEDziWwQDGaujXehEEVOu+Q7nJFt63P1hrOhaL1cZrsw25bcCE
POZZUmLMBIidPdr+B6hHSVwPa5tvcdBVmxin75+DO+0aD4aVY/lBPctZG17/2GRB
/JxX9eCQSFA/aDSPfrI9siYpaYPr8j29FY/fVF6smdVz5Yc8nbtuab5uc7C1u2OS
tyOw9iVCkAZrY8EWcVkqPmKq7avigo2PLe9gXiYljTXnhwxv2T5QlAySvwIDAQAB
MA0GCSqGSIb3DQEBCwUAA4IBAQApRkKyyUj5ET3uTvqM8jsesKHfzMWRKDZj2Y+r
zPMsHRUEhaNF3CgOEnGXrMKFiE4l7+JbWzGvY6wyw/gSGmPs2dFeoVYTfW64GRB3
VsHeJ3dlRWlov1mmIwtmqkixQWVcEyJP7bTOhLxl6vOA0aS04XeT5g1JV2BHVf5A
Il0dUxMvf5+lMTEMDRVG26DUR1QWD4pA2DcmYKqaWWql0189O+5ZtNCv98DMs/8k
OAGBpetXch2hdCqGQFdbI9mV9f1QWIcj4Mx5J96/B5flcm2Gin5y5Zd1SlvWKzai
cmgwFBcqUUZXjY0n63i4eh+1lG5KDfxGJ6V//lV3ZxgWak2r
-----END CERTIFICATE-----
12 changes: 9 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const port = process.env['PORT'] || 8080

const express = require('express')
const path = require('path')
const https = require('https')
const fs = require('fs')

const app = express()

Expand Down Expand Up @@ -45,7 +47,6 @@ app.get('/', function (req, res) {
})
})

app.use('/admin', require('./apps/admin'))
app.use('/a', require('./apps/userauth'))
app.use('/b', require('./apps/banking'))
app.use('/api', require('./apps/api'))
Expand All @@ -64,5 +65,10 @@ app.use((err, req, res, next) => {
})
})

app.listen(port)
console.log(`Server is listening! Port: ${port}`)
https.createServer({
key: fs.readFileSync('server.key'),
cert: fs.readFileSync('server.cert')
}, app).listen(port, () => {
console.log(`Https server is listening! Port: ${port}`)
})

28 changes: 28 additions & 0 deletions server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCkV0snN2l19LfT
WJI7uU9FU6pc764Gx9HlyrApRrpA6g9dA0j199PwdjFY3LsZ0FyTgsJKs06PE+IL
ydZbm+EREYi8dlYu87D3NzSvcB9vHIQPOJbBAMZq6Nd6EQRU675DuckW3rc/WGs6
FovVxmuzDbltwIQ85llSYswEiJ092v4HqEdJXA9rm29x0FWbGKfvn4M77RoPhpVj
+UE9y1kbXv/YZEH8nFf14JBIUD9oNI9+sj2yJilpg+vyPb0Vj99UXqyZ1XPlhzyd
u25pvm5zsLW7Y5K3I7D2JUKQBmtjwRZxWSo+Yqrtq+KCjY8t72BeJiWNNeeHDG/Z
PlCUDJK/AgMBAAECggEAQGzoTWtvsIpLNlNWoIs5BFiURPLBKm9TXd5jyQqtIZ2g
gDo1dBe/wljTZ57AypHgeQOd32MDvRtyVmS94BPv250gGaHaj3WBPqkpwk0WRZzM
OJtanjcLkgXN01CwfgodALfomUqeU/r5rkAAecHbnsoWk2wRaz5ybdXFXVGhMwny
EHA84BGemGfXNehOSawRSZp6WsJ0DKPFed8NfGclaDXL+7GZFYGJzdca5eqDx0Hh
J4xAypJCaovNtzbsJm+/FLHQc9jaZW8+em23eysXIiEF+/0AtMnM9AGb8IzYIdry
EX6QVTdviqhfAMPbiIaN2g4MBgTq+t/B05OSwbabwQKBgQDPF4/WKkDSHV2nppBO
lOYs7wFRMcuDBh2vSBh5wDkQwz4ob1CDoyaTt8jeJGugpvHIpLb+Y7sVwqpSc3IM
1HoARDY8Iihm/W79YkwSPzDWHnYZVfmqaAeBBUOFhEcoZO4c8XIhh8Uzh1oO516T
7fT0GYMfgCmmpB0ZCP77teMl2QKBgQDLJxMq7kHLVb//Ds/ojc5pFw9E/8KpvRX5
yCI7ADcxHTpZDLaXLd7V/CkQ6M+trv1sAPKD6VnZSx4SJskaqIPH+03QRD9sBZy7
VFfx8GqT78CHTUVFrPKjoIt9LIBmmbd5ZUWYjv/x5gWGMWo+19n+5SQZV0qowVkm
31bS4dCmVwKBgHnAfn4JBWcCgMdJ89lfTRvpwDp+LgnwFI+ysUETM/mY7/hRyWI7
DzkVefCwNN6Uh93QiQ1ykNEwS3aCDPFiEgAKGmCsLFiwcwphOhwYLpwT+JbYpxn6
Yz8FWzcqF7O18w/tG45/Bf9PejD88evCoJrKTP6+GL6yCbFoSpCt1MexAoGBAIRs
lDIH3RuOafj4zs3oogQe4/U2Qs4iU5DexHFxUojRZJdnkh456GfUV3COUdIFn2wn
se4Kzma2cIOkhLK75isVxUNdOXpQrjnuYOV0sgR85CNOWzlv4zqGDGcr+wbmbJLV
UOiBTpWAO1meHIOacJ+W/lEGdcRLRLHyI8aTLE9BAoGBALnbpA+FZFyB4pbivvi8
TX5yrf6UNF7CwC93AVDLOh8YoLwCuOWbiBpTwGTnY51vArawNWzlG2uMZ6Ox4ZYa
cGlF9BdRYskXXRbR6DnIfIQ1zg/0ugi8VNy3h6skGSIidkDBbqqRgcWtovFnwwgW
D2WKslgNg6+j3pknTd8nUkP/
-----END PRIVATE KEY-----
3 changes: 1 addition & 2 deletions static/css/main.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ main#landing {

--background-size: 215px;

background-image: url('/fancybg.png');
background-size: var(--background-size) var(--background-size);
background-color: #E68D6E;
height: 100%;
}

Expand Down
4 changes: 2 additions & 2 deletions views/accounts.pug
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ include partials/header.pug
- else
.text-xl.flex.flex-row.justify-between
span Available Credit
span $ #{balanceString(account.balance)}
span $ #{balanceString(10000-account.balance)}
.flex.flex-row.justify-between
span Outstanding Balance
span $ #{balanceString(1000-account.balance)}
span $ #{balanceString(account.balance)}

.flex.flex-col.w-full.text-center.mt-2(class='md:flex-row')
a.button.flex-grow.green(href=`/b/transfer?account=${account.number}`) Transfer
Expand Down
6 changes: 4 additions & 2 deletions views/landing.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ main#landing
section.card.text-center.p-0
header
h1.text-4xl= siteTitle
h2.text-lg Where all your banking dreams come true.
h2.text-lg The feeling is Mutual. Bank on it.
article
form.text-left(method='post' action='/a/login')
- if(error)
Expand All @@ -37,7 +37,9 @@ main#landing
footer.text-left
h4.normal-case.mb-2.underline
a(href='/a/recover') Forgot your password?
h4.text-gray-500 Microsoft will never ask for your banking details.....
h4.text-gray-500
span Warning: Microsoft will never ask you to log into your bank.
a Learn more.

include partials/footer.pug
include partials/foot.pug
6 changes: 4 additions & 2 deletions views/partials/footer.pug
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
footer.mt-auto.py-5.px-2.bg-gray-100
div.container.text-center
p All content on this site copyright © 2019
p Copyright © 2019
strong= siteTitle
| . All rights reserved.
p
a(href='/') Home
| |
a(href='/admin') Employees
a(href='/rates') Rates
| |
a(href='/contact') Contact
3 changes: 1 addition & 2 deletions views/partials/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ doctype html
<html lang="en">
head
-
const siteTitle = 'Bank of Abogaca'
const siteTitle = 'New Jersey Credit Union Mutual Bank LLC'
if(pageTitle)
//- page title already exists
pageTitle = `${pageTitle} | ${siteTitle}`
Expand All @@ -30,7 +30,6 @@ doctype html
meta(http-equiv='X-UA-Compatible' content='ie=edge')

link(rel='stylesheet' href='/css/main.css')
link(rel='stylesheet' href='https://i.icomoon.io/public/temp/42d0a687e8/Bankogaca/style.css')

style.
html {
Expand Down
22 changes: 18 additions & 4 deletions views/transfer.complete.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@ include partials/header.pug

-
origin = accounts.find((acct) => acct.number === query.origin)
originIndex = accounts.indexOf(origin)
destination = accounts.find((acct) => acct.number === query.destination)
destinationIndex = accounts.indexOf(destination)
amt = +query.amount
transfers.push({
origin: accounts.indexOf(accounts.find((acc) => +acc.number === +query.origin)),
destination: accounts.indexOf(accounts.find((acc) => +acc.number === +query.destination)),
amount: +query.amount,
transfers.unshift({
origin: originIndex,
destination: destinationIndex,
amount: amt,
memo: query.memo,
date: new Date()
})
transactions.unshift({
description: `XFER FROM ACCT x${origin.number}`,
amount: amt,
date: new Date(),
account: destinationIndex
})
origin.balance = origin.balance - amt
destination.balance = destination.balance + amt
div.container(class='my-5 mx-auto')
div.columns
div.column.is-two-fifths
Expand All @@ -36,6 +49,7 @@ div.container(class='my-5 mx-auto')
td= query.memo

a.button.is-info.is-fullwidth(href="/b/transfer") Make Another Transfer
a.button.is-info.is-fullwidth(href="/b/accounts") Accounts

div.column
h1.title Transfer History
Expand Down

0 comments on commit 2aac178

Please sign in to comment.