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 : payments.py
#/var/www/website2024/py-maracar.afaa.website/payments.py #python3 payments.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 , datetime import logging from sqlalchemy import exc from datetime import datetime app = Flask(__name__) app.config['SECRET_KEY'] = SECRET_KEY CORS(app, resources={r"/*": {"origins": "*"}}) @app.route('/payments/api/create', methods=['POST']) def create_payment(): try: payments = request.json client_ip = request.remote_addr current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') if not isinstance(payments, list): payments = [payments] for data in payments: reference_number = data.get('ReferenceNumber') iso_datetime = data.get('TransactionDate') mysql_datetime = datetime.fromisoformat(iso_datetime.replace("Z", "+00:00")).strftime('%Y-%m-%d %H:%M:%S') booking_id = data.get('BookingID') expense_type_id = data.get('ExpenseTypeID') customer_id = data.get('CustomerID') employee_id = data.get('EmployeeID') amount = data.get('Amount') currency = data.get('Currency') remaining = data.get('Remaining') payment_method = data.get('PaymentMethod') payment_status = data.get('PaymentStatus') status = data.get('Status') notes = data.get('Notes') if None in [reference_number, booking_id, expense_type_id, customer_id, employee_id, amount, currency, payment_method, payment_status, status]: return jsonify({'error': 'Missing required data'}), 400 query = """ INSERT INTO PaymentTransactions ( ReferenceNumber, TransactionDate, TransactionUpdate, BookingID, ExpenseTypeID, CustomerID, EmployeeID, Amount, Currency, Remaining, PaymentMethod, PaymentStatus, Status, Notes, Transaction_IP ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """ modify_db(query, ( reference_number, current_time, current_time, booking_id, expense_type_id, customer_id, employee_id, amount, currency, remaining, payment_method, payment_status, status, notes, client_ip )) return jsonify({'message': 'Payment transactions created successfully'}), 201 except Exception as e: app.logger.error(f"Payment transaction creation error: {e}") return jsonify({'error': 'Internal server error'}), 500 @app.route('/payments/api/view', methods=['GET']) @token_required def view_payment(): try: # Filter parameters booking_id = request.args.get('BookingID') expense_type_id = request.args.get('ExpenseTypeID') payment_status = request.args.get('PaymentStatus') employee_id = request.args.get('EmployeeID') start_date = request.args.get('StartDate') end_date = request.args.get('EndDate') # Additional filter parameters customer_id = request.args.get('CustomerID') status = request.args.get('Status') exact_amount = request.args.get('Amount') currency = request.args.get('Currency') exact_remaining = request.args.get('Remaining') # Additional sorting parameters sort_by = request.args.get('SortBy') sort_order = request.args.get('SortOrder', 'asc').upper() # Default to ascending if not specified # Building the query dynamically based on the filters provided query_conditions = [] values = [] if booking_id: query_conditions.append("BookingID = %s") values.append(booking_id) if expense_type_id: query_conditions.append("ExpenseTypeID = %s") values.append(expense_type_id) if payment_status: query_conditions.append("PaymentStatus = %s") values.append(payment_status) if employee_id: query_conditions.append("EmployeeID = %s") values.append(employee_id) if start_date: start_date_formatted = datetime.strptime(start_date, '%Y-%m-%d').strftime('%Y-%m-%d %H:%M:%S') query_conditions.append("TransactionDate >= %s") values.append(start_date_formatted) if end_date: end_date_formatted = datetime.strptime(end_date, '%Y-%m-%d').strftime('%Y-%m-%d %H:%M:%S') query_conditions.append("TransactionDate <= %s") values.append(end_date_formatted) # New conditions if customer_id: query_conditions.append("CustomerID = %s") values.append(customer_id) if status: query_conditions.append("Status = %s") values.append(status) if exact_amount: query_conditions.append("Amount = %s") values.append(exact_amount) amount_greater = request.args.get('AmountGreater') amount_lesser = request.args.get('AmountLesser') if amount_greater: query_conditions.append("Amount >= %s") values.append(amount_greater) if amount_lesser: query_conditions.append("Amount <= %s") values.append(amount_lesser) currency = request.args.get('Currency') if currency: query_conditions.append("Currency = %s") values.append(currency) if exact_remaining: query_conditions.append("Remaining = %s") values.append(exact_remaining) remaining_greater = request.args.get('RemainingGreater') remaining_lesser = request.args.get('RemainingLesser') if remaining_greater: query_conditions.append("Remaining >= %s") values.append(remaining_greater) if remaining_lesser: query_conditions.append("Remaining <= %s") values.append(remaining_lesser) # Constructing the query #base_query = "SELECT * FROM PaymentTransactions" base_query = """SELECT pt.*, ps.id AS id, ps.name AS StatusPayment, ps.description AS description FROM PaymentTransactions pt INNER JOIN status ps ON pt.PaymentStatus = ps.id""" if query_conditions: query = f"{base_query} WHERE {' AND '.join(query_conditions)}" else: query = base_query # Adding sorting to the query if sort_by: query += f" ORDER BY {sort_by} {'DESC' if sort_order == 'DESC' else 'ASC'}" # Execute the query payment_data = query_db(query, tuple(values)) return jsonify(payment_data), 200 except Exception as e: app.logger.error(f"Payment view error: {e}") return jsonify({'error': 'Internal server error'}), 500 @app.route('/payments/api/update', methods=['PUT']) def update_payment(): try: data = request.json transaction_id = data.get('TransactionID') if not transaction_id: return jsonify({'error': 'TransactionID is required for update'}), 400 # Capture the client IP address client_ip = request.remote_addr update_fields = ['TransactionUpdate = %s', 'Transaction_IP = %s'] values = [datetime.now().strftime('%Y-%m-%d %H:%M:%S'), client_ip] # Current timestamp and IP for key, value in data.items(): if key != 'TransactionID' and key not in ['PaymentStatus', 'Status'] and value is not None: # Skipping PaymentStatus and Status fields update_fields.append(f"{key} = %s") values.append(value) if len(update_fields) == 2: # Only TransactionUpdate and Transaction_IP fields are present return jsonify({'error': 'No data provided to update except TransactionUpdate and Transaction_IP'}), 400 query = f""" UPDATE PaymentTransactions SET {', '.join(update_fields)} WHERE TransactionID = %s """ values.append(transaction_id) # Execute update query and check for affected rows affected_rows = modify_db(query, tuple(values)) if affected_rows == 0: return jsonify({'error': 'No record updated, check if the TransactionID exists'}), 400 # Log the executed query for review in PHPMyAdmin app.logger.info(f"Executed SQL Query: {query % tuple(values)}") return jsonify({'message': 'Payment updated successfully'}), 200 except Exception as e: app.logger.error(f"Unexpected error during payment update: {e}") return jsonify({'error': 'Internal server error'}), 500 if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=428)
Close