Skip to content

Commit

Permalink
Merge pull request #8 from lucideus-repo/dev
Browse files Browse the repository at this point in the history
New vulnerabilities and modules introduced.
  • Loading branch information
dspawar authored Jan 15, 2021
2 parents d2e9f50 + 45d24cb commit fd59294
Show file tree
Hide file tree
Showing 66 changed files with 15,363 additions and 587 deletions.
6 changes: 5 additions & 1 deletion Backend/apache/.htaccess
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "*"
Header set Access-Control-Allow-Methods "*"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Credentials "true"
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
4 changes: 4 additions & 0 deletions Backend/apache/my.apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Options FollowSymLinks
</Directory>
<IfModule headers_module>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "*"
Header set Access-Control-Allow-Methods "*"
Header set Access-Control-Allow-Credentials "true"
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
</IfModule>
# Send apache logs to stdout and stderr
CustomLog /proc/self/fd/1 common
Expand Down
13 changes: 6 additions & 7 deletions Backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '3.6'
version: "3.6"

services:

db:
container_name: database
build: ./mysql
Expand All @@ -16,7 +15,7 @@ services:
- backend

server:
build: './apache/'
build: "./apache/"
depends_on:
- db
networks:
Expand All @@ -28,7 +27,7 @@ services:

web:
build:
context: './web'
context: "./web"
dockerfile: Dockerfile
depends_on:
- server
Expand All @@ -38,13 +37,13 @@ services:
- 3000:80

php:
build: './php/'
build:
context: "./src"
dockerfile: Dockerfile
depends_on:
- db
networks:
- backend
volumes:
- ./src/:/var/www/html/
command: /tmp/wait-for-it.sh -t 0 database:3306 -- php-fpm

networks:
Expand Down
24 changes: 21 additions & 3 deletions Backend/mysql/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ DROP TABLE IF EXISTS `session_master`;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `session_master` (
`id_pk` int NOT NULL AUTO_INCREMENT,
`session_id` char(20) NOT NULL,
`session_id` TEXT NOT NULL,
`cust_id` char(8) NOT NULL,
`last_access` varchar(15) DEFAULT NULL,
PRIMARY KEY (`id_pk`)
Expand Down Expand Up @@ -285,7 +285,7 @@ CREATE TABLE `user_details` (
`user_id_fk` int NOT NULL,
`fname` varchar(20) NOT NULL,
`lname` varchar(20) NOT NULL,
`address` varchar(50) NOT NULL,
`address` varchar(100) NOT NULL,
`dob` date NOT NULL,
`mobile_no` char(10) NOT NULL,
`email` varchar(50) NOT NULL,
Expand All @@ -294,6 +294,7 @@ CREATE TABLE `user_details` (
`wallet_id` char(10) NOT NULL,
`gender` int NOT NULL COMMENT 'Male=1,Female=2,Others=3',
`country_id` char(3) NOT NULL,
`avatar` VARCHAR(250),
PRIMARY KEY (`id_pk`),
KEY `user_id_pk_fk_const` (`user_id_fk`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
Expand All @@ -305,10 +306,27 @@ CREATE TABLE `user_details` (

LOCK TABLES `user_details` WRITE;
/*!40000 ALTER TABLE `user_details` DISABLE KEYS */;
INSERT INTO `user_details` VALUES (1,1,'Vipul','Malhotra','19, Ambika Villas, Virar Thiruvananthapuram','1990-11-14','9690008703','vipul.malhotra@ubmail.com','100051650609','7230745428','4489238790',1,'IND'),(2,2,'Kevin','Winkel','1088 Hillhaven Drive, Los Angeles, CA 90017','2001-04-12','3238245428','kevin.winkel@ubmail.com','409631107754','0437232270','1304616359',1,'USA'),(3,3,'Kelly','Campbell','194 Tina ClubClarkburghDN2 5AU','1983-07-04','0192299898','kelly.campbell@ubmail.com','084512943929','4320024956','1065208538',2,'UK'),(4,4,'Krystal','Langworth','26141 Bernhard SquareCrooksfurt, NT R7K 4G8','1995-08-04','1081533578','krystal.langworth@ubmail.com','087605257670','2202661800','9062907004',1,'AUS'),(5,5,'Margarita','Mann','387 Christina CourtMitchellton, AB N9Y-2L3','1991-06-29','4087658970','margarita.mann@ubmail.com','570630845299','3165831863','0701067746',2,'CAN'),(6,6,'David','Mahabir','94, Kusum Society, Marathahalli Ranchi - 416560','1989-09-18','7190473876','david.mahabir@ubmail.com','322421230507','0535052879','9305910677',1,'IND'),(7,7,'Boris','Gerhold','78005 Buford ManorsJastview, AB H2H0C9','1990-04-10','9083884662','boris.gerhold@ubmail.com','280755930525','5640445738','8580304600',1,'CAN'),(8,8,'Nathaniel','Runolfsson','972 Fannie ViaNorth Karolannmouth, SC 21360','1981-11-11','2912835653','nathaniel.runolfsson@ubmail.com','613698367545','0189010909','1904008575',1,'USA'),(9,9,'Yvette','Cooper','94 Souterhead Road, LOSGAINTIR, HS3 0PZ','1999-03-29','8116423130','yvette.cooper@ubmail.com','097852583194','7887733110','1753791897',2,'UK'),(10,10,'Orion','Glover','Unit 81 0 Jeffery ParkwayGutkowskiland, TAS 7274','1981-08-13','7017128990','orion.glover@ubmail.com','510200402330','0070419647','6064583077',2,'AUS');
INSERT INTO `user_details` VALUES (1,1,'Vipul','Malhotra','19, Ambika Villas, Virar Thiruvananthapuram','1990-11-14','9690008703','vipul.malhotra@ubmail.com','100051650609','7230745428','4489238790',1,'IND',''),(2,2,'Kevin','Winkel','1088 Hillhaven Drive, Los Angeles, CA 90017','2001-04-12','3238245428','kevin.winkel@ubmail.com','409631107754','0437232270','1304616359',1,'USA',''),(3,3,'Kelly','Campbell','194 Tina ClubClarkburghDN2 5AU','1983-07-04','0192299898','kelly.campbell@ubmail.com','084512943929','4320024956','1065208538',2,'UK',''),(4,4,'Krystal','Langworth','26141 Bernhard SquareCrooksfurt, NT R7K 4G8','1995-08-04','1081533578','krystal.langworth@ubmail.com','087605257670','2202661800','9062907004',1,'AUS',''),(5,5,'Margarita','Mann','387 Christina CourtMitchellton, AB N9Y-2L3','1991-06-29','4087658970','margarita.mann@ubmail.com','570630845299','3165831863','0701067746',2,'CAN',''),(6,6,'David','Mahabir','94, Kusum Society, Marathahalli Ranchi - 416560','1989-09-18','7190473876','david.mahabir@ubmail.com','322421230507','0535052879','9305910677',1,'IND',''),(7,7,'Boris','Gerhold','78005 Buford ManorsJastview, AB H2H0C9','1990-04-10','9083884662','boris.gerhold@ubmail.com','280755930525','5640445738','8580304600',1,'CAN',''),(8,8,'Nathaniel','Runolfsson','972 Fannie ViaNorth Karolannmouth, SC 21360','1981-11-11','2912835653','nathaniel.runolfsson@ubmail.com','613698367545','0189010909','1904008575',1,'USA',''),(9,9,'Yvette','Cooper','94 Souterhead Road, LOSGAINTIR, HS3 0PZ','1999-03-29','8116423130','yvette.cooper@ubmail.com','097852583194','7887733110','1753791897',2,'UK',''),(10,10,'Orion','Glover','Unit 81 0 Jeffery ParkwayGutkowskiland, TAS 7274','1981-08-13','7017128990','orion.glover@ubmail.com','510200402330','0070419647','6064583077',2,'AUS','');
/*!40000 ALTER TABLE `user_details` ENABLE KEYS */;
UNLOCK TABLES;

DROP TABLE IF EXISTS `loan_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `loan_details` (
`id_pk` int NOT NULL AUTO_INCREMENT,
`user_id_fk` int NOT NULL,
`amount` varchar(20) NOT NULL,
`roi` varchar(20) NOT NULL,
`type` TEXT NOT NULL,
`tenure` varchar(200) NOT NULL,
`AppliedDate` char(10) NOT NULL,
PRIMARY KEY (`id_pk`),
KEY `user_id_pk_fk_const` (`user_id_fk`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `wallet`
--
Expand Down
6 changes: 0 additions & 6 deletions Backend/php/Dockerfile

This file was deleted.

Binary file added Backend/src/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions Backend/src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM php:7.2.7-fpm-alpine
COPY . /var/www/html
RUN apk update && apk add bash
WORKDIR /var/www/html
RUN docker-php-ext-install mysqli \
&& chown -Rf www-data:www-data /var/www/html

ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /tmp/
RUN chmod -R 777 /var/www/html
RUN chmod +x /tmp/wait-for-it.sh
58 changes: 39 additions & 19 deletions Backend/src/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
Expand Down Expand Up @@ -38530,25 +38531,44 @@
<div>
<div class="app-wrapper min-vh-100">
<div class="app-main min-vh-100">


<div class="container">
<h1 class="display-3 text-center mb-3 mt-4 font-weight-bolder">UnSAFE Bank
<h3 class="mb-2 font-weight-bold" >About</h3>
<h5 class="font-weight-normal mb-3">
UnSAFE Bank is a core virtual banking suite designed with the aim to incorporate the cybersecurity risks and various test cases such that newbie, developers, and security analysts can learn, hack and improvise their vulnerability assessment and penetration testing skills on Web, Android and iOS application.
</h5>
<h3 class="mb-2 font-weight-bold" >Application Features</h3>
<h5 class="font-weight-normal" >It currently consists of the following functionalities:</h5>
<ul >
<li><h5>Funds Transfer</h5></li>
<li><h5>Account Statement</h5></li>
<li><h5>Add/View Beneficiary</h5></li>

</ul>
</div>




<div class="container">
<h1 class="display-3 text-center mb-3 mt-4 font-weight-bolder">UnSAFE Bank
<h3 class="mb-2 font-weight-bold">About</h3>
<h5 class="font-weight-normal mb-3">
UnSAFE Bank is a core virtual banking suite designed with the aim to incorporate the cybersecurity risks
and various test cases such that newbie, developers, and security analysts can learn, hack and improvise
their vulnerability assessment and penetration testing skills on Web, Android and iOS application.
</h5>
<h3 class="mb-2 font-weight-bold">Application Features</h3>
<h5 class="font-weight-normal">It currently consists of the following functionalities:</h5>
<ul>
<li>
<h5>Funds Transfer</h5>
</li>
<li>
<h5>Account Statement</h5>
</li>
<li>
<h5>Manage Beneficiary</h5>
</li>
<li>
<h5>Loans</h5>
</li>
<li>
<h5>Account Settings</h5>
</li>
<li>
<h5>Contact us</h5>
</li>
<li>
<h5>About us</h5>
</li>
</ul>
</div>


</div>
</div>
</div>
Expand Down
Binary file added Backend/src/api/.DS_Store
Binary file not shown.
83 changes: 83 additions & 0 deletions Backend/src/api/application/controllers/ContactUs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require APPPATH . '/libraries/REST_Controller.php';

class ContactUs extends CI_Controller
{
public function aa(){
$this->load->helper('request_response');
$headers = request_parse();


echo json_encode($headers);
}

public function index()
{
$this->load->helper('global_methods');
$this->load->helper('request_response');
$headers = getRequestHeaders();
$data = file_get_contents('php://input');
if (isJson($data)) {
$post = json_decode(file_get_contents('php://input'), true);
$data = array('status_code' => 'ALLOK1');
foreach ($post['requestBody'] as $key => $value) {
$data[$key] = $value;
}
$data = $data['data'];

if (array_key_exists("name", $data)) {
$message = 'Thanks for contacting us ' . $data["name"] . '. We will get back to you soon!';
echo prepare_response(
"Success",
"CTS001",
$message,
time(),
array()
);
} else {
echo prepare_response(
"Failed",
"CTS002",
"Error while submitting the response",
time(),
array()
);

}
} elseif (array_key_exists("accept", $headers) && $headers["accept"] == 'application/xml') {

$xmlfile = file_get_contents('php://input');
$dom = new DOMDocument();
$dom->loadXML($xmlfile, LIBXML_NOENT | LIBXML_DTDLOAD);
$xmlData = simplexml_import_dom($dom);
if (isset($xmlData->name)) {
$name = $xmlData->name;
$message = 'Thanks for contacting us ' . $name . '. We will get back to you soon!';
echo prepare_response(
"Success",
"CTS001",
$message,
time(),
array()
);
} else {
echo prepare_response(
"Failed",
"CTS002",
"Error while submitting the response",
time(),
array()
);
}
} else {
echo prepare_response(
"Failed",
"CTS002",
"Error while submitting the response",
time(),
array()
);
}
}
}
69 changes: 69 additions & 0 deletions Backend/src/api/application/controllers/EditUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require APPPATH . '/libraries/REST_Controller.php';

class EditUser extends CI_Controller
{

public function editUserDetails()
{
$this->load->helper('request_response');
$status = new status_codes();

$parsed = request_parse();
if ($parsed['status_code'] != 'ALLOK1') {
echo prepare_response(
'Failed',
$parsed['status_code'],
$parsed['message'],
time(),
(object)array()
);
} else {
$this->load->helper('session');
// check for valid user session
$token = get_sessionId($parsed);
if ($token != null) {
$account_id = is_valid_session($token);
if ($account_id != null) {
$this->load->model('Model_edit_account');
$is_valid_param = $this->Model_edit_account->validateEditUserApiParameter($account_id, $parsed["data"]);
if ($is_valid_param['status_code'] == "ALLOK1") {
$this->Model_edit_account->editUserData($account_id, $parsed["data"]);
echo prepare_response(
"Success",
$status::EditSuccess['status_code'],
$status::EditSuccess['message'],
time(),
(object)array()
);
} else {
echo prepare_response(
"Failed",
$is_valid_param['status_code'],
$is_valid_param['message'],
time(),
(object)array()
);
}
} else {
echo prepare_response(
"Failed",
$status::InvalidSession['status_code'],
$status::InvalidSession['message'],
time(),
(object)array()
);
}
} else {
echo prepare_response(
"Failed",
$status::RequestParameterNotSet['status_code'],
$status::RequestParameterNotSet['message'],
time(),
(object)array()
);
}
}
}
}
Loading

0 comments on commit fd59294

Please sign in to comment.