fscan/Common/i18n/messages/plugins.go
ZacharyZcR b346e6bdc1 feat: 完善插件系统i18n国际化支持
- 修复重复输出问题:适配器层改为debug输出,避免与插件层重复
- 修复格式化错误:修正SaveExploitResult中的端口格式化问题
- 新增利用方法名称i18n:添加GetExploitMethodName函数支持方法名本地化
- 扩展i18n消息模板:新增利用方法执行、MySQL/Redis专用消息模板
- 完善exploiter国际化:所有利用方法和结果消息支持中英文切换
- 优化用户体验:利用方法显示从"information_gathering"变为"信息收集"
2025-08-07 12:30:17 +08:00

385 lines
11 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package messages
/*
plugins.go - 插件相关消息
包含新插件架构中各种插件的国际化消息定义,
包括扫描、利用、认证等相关消息。
*/
// PluginMessages 插件相关消息
var PluginMessages = map[string]map[string]string{
// ========================= 通用插件消息 =========================
"plugin_init": {
LangZH: "初始化插件: %s",
LangEN: "Initializing plugin: %s",
},
"plugin_scan_start": {
LangZH: "开始%s插件扫描: %s",
LangEN: "Starting %s plugin scan: %s",
},
"plugin_scan_success": {
LangZH: "%s扫描成功: %s",
LangEN: "%s scan successful: %s",
},
"plugin_scan_failed": {
LangZH: "%s插件扫描失败: %v",
LangEN: "%s plugin scan failed: %v",
},
"plugin_exploit_start": {
LangZH: "开始%s自动利用: %s",
LangEN: "Starting %s auto exploitation: %s",
},
"plugin_exploit_success": {
LangZH: "%s利用成功: %s",
LangEN: "%s exploitation successful: %s",
},
"plugin_exploit_failed": {
LangZH: "%s利用失败: %v",
LangEN: "%s exploitation failed: %v",
},
// ========================= 通用成功消息模板 =========================
"plugin_login_success": {
LangZH: "%s弱密码: %s [%s:%s]",
LangEN: "%s weak password: %s [%s:%s]",
},
"plugin_login_success_passwd_only": {
LangZH: "%s弱密码: %s [%s]",
LangEN: "%s weak password: %s [%s]",
},
"plugin_unauthorized_access": {
LangZH: "%s未授权访问: %s",
LangEN: "%s unauthorized access: %s",
},
// ========================= 利用(Exploit)消息模板 =========================
"exploit_weak_password_success": {
LangZH: "%s %s 弱密码利用成功",
LangEN: "%s %s weak password exploit successful",
},
"exploit_unauthorized_success": {
LangZH: "%s %s 未授权访问利用成功",
LangEN: "%s %s unauthorized access exploit successful",
},
"exploit_command_exec_success": {
LangZH: "%s %s 命令执行利用成功",
LangEN: "%s %s command execution exploit successful",
},
"exploit_file_write_success": {
LangZH: "%s %s 文件写入利用成功",
LangEN: "%s %s file write exploit successful",
},
"exploit_sql_injection_success": {
LangZH: "%s %s SQL注入利用成功",
LangEN: "%s %s SQL injection exploit successful",
},
"exploit_data_extraction_success": {
LangZH: "%s %s %s 利用成功",
LangEN: "%s %s %s exploit successful",
},
"exploit_generic_success": {
LangZH: "%s %s %s 利用成功",
LangEN: "%s %s %s exploit successful",
},
"exploit_with_output": {
LangZH: " 输出: %s",
LangEN: " output: %s",
},
"exploit_files_created": {
LangZH: "创建/修改的文件: %v",
LangEN: "Files created/modified: %v",
},
"exploit_shell_obtained": {
LangZH: "获得Shell: %s %s:%d 用户:%s",
LangEN: "Shell obtained: %s %s:%d user:%s",
},
// ========================= 利用方法执行消息 =========================
"exploit_method_trying": {
LangZH: "尝试利用方法: %s",
LangEN: "Trying exploit method: %s",
},
"exploit_method_success": {
LangZH: "利用方法 %s 执行成功",
LangEN: "Exploit method %s executed successfully",
},
"exploit_method_failed": {
LangZH: "利用方法 %s 执行失败: %v",
LangEN: "Exploit method %s failed: %v",
},
"exploit_method_condition_not_met": {
LangZH: "利用方法 %s 前置条件不满足,跳过",
LangEN: "Exploit method %s prerequisites not met, skipping",
},
"exploit_all_methods_failed": {
LangZH: "所有利用方法都失败",
LangEN: "All exploit methods failed",
},
// ========================= MySQL利用方法消息 =========================
"mysql_version_info": {
LangZH: "MySQL版本: %s",
LangEN: "MySQL version: %s",
},
"mysql_current_user": {
LangZH: "当前用户: %s",
LangEN: "Current user: %s",
},
"mysql_current_database": {
LangZH: "当前数据库: %s",
LangEN: "Current database: %s",
},
"mysql_databases_found": {
LangZH: "发现数据库: %s",
LangEN: "Databases found: %s",
},
"mysql_tables_found": {
LangZH: "发现表: %v",
LangEN: "Tables found: %v",
},
"mysql_user_privileges": {
LangZH: "用户权限: %s",
LangEN: "User privileges: %s",
},
"mysql_file_privilege_detected": {
LangZH: "检测到FILE权限可能支持文件操作",
LangEN: "FILE privilege detected, file operations may be supported",
},
"mysql_file_read_success": {
LangZH: "读取文件 %s:\n%s",
LangEN: "File %s read:\n%s",
},
"mysql_file_write_success": {
LangZH: "成功写入文件: %s",
LangEN: "File written successfully: %s",
},
"mysql_no_file_privilege": {
LangZH: "无法读取任何文件可能没有FILE权限",
LangEN: "Cannot read any files, may lack FILE privilege",
},
// ========================= Redis利用方法消息 =========================
"redis_server_info": {
LangZH: "Redis服务器信息: %s",
LangEN: "Redis server info: %s",
},
"redis_config_info": {
LangZH: "Redis配置信息: %s",
LangEN: "Redis config info: %s",
},
"redis_keys_found": {
LangZH: "发现Redis键: %v",
LangEN: "Redis keys found: %v",
},
"redis_backup_created": {
LangZH: "Redis备份创建成功: %s",
LangEN: "Redis backup created: %s",
},
"redis_cron_job_written": {
LangZH: "Cron任务写入成功: %s",
LangEN: "Cron job written successfully: %s",
},
"redis_ssh_key_written": {
LangZH: "SSH密钥写入成功: %s",
LangEN: "SSH key written successfully: %s",
},
"redis_webshell_written": {
LangZH: "Webshell写入成功: %s",
LangEN: "Webshell written successfully: %s",
},
"redis_no_keys_found": {
LangZH: "未发现任何Redis键",
LangEN: "No Redis keys found",
},
"redis_write_failed": {
LangZH: "Redis写入操作失败",
LangEN: "Redis write operation failed",
},
// ========================= 插件架构消息 =========================
"plugin_new_arch_trying": {
LangZH: "尝试使用新插件架构: %s",
LangEN: "Trying new plugin architecture: %s",
},
"plugin_new_arch_success": {
LangZH: "新插件架构处理成功: %s",
LangEN: "New plugin architecture successful: %s",
},
"plugin_new_arch_fallback": {
LangZH: "新插件架构失败,回退到传统实现: %s - %v",
LangEN: "New plugin architecture failed, falling back to legacy: %s - %v",
},
"plugin_legacy_using": {
LangZH: "插件 %s 不支持新架构,使用传统实现",
LangEN: "Plugin %s not supported in new architecture, using legacy",
},
// ========================= MySQL插件消息 =========================
"mysql_scan_start": {
LangZH: "开始MySQL扫描: %s",
LangEN: "Starting MySQL scan: %s",
},
"mysql_scan_success": {
LangZH: "MySQL弱密码扫描成功: %s [%s:%s]",
LangEN: "MySQL weak password scan successful: %s [%s:%s]",
},
"mysql_connection_failed": {
LangZH: "MySQL连接失败: %v",
LangEN: "MySQL connection failed: %v",
},
"mysql_auth_failed": {
LangZH: "MySQL认证失败: %v",
LangEN: "MySQL authentication failed: %v",
},
"mysql_exploit_info_gather": {
LangZH: "MySQL信息收集成功",
LangEN: "MySQL information gathering successful",
},
"mysql_exploit_db_enum": {
LangZH: "MySQL数据库枚举成功",
LangEN: "MySQL database enumeration successful",
},
"mysql_exploit_file_write": {
LangZH: "MySQL文件写入成功: %s",
LangEN: "MySQL file write successful: %s",
},
"mysql_exploit_file_read": {
LangZH: "MySQL文件读取成功: %s",
LangEN: "MySQL file read successful: %s",
},
// ========================= Redis插件消息 =========================
"redis_scan_start": {
LangZH: "开始Redis扫描: %s",
LangEN: "Starting Redis scan: %s",
},
"redis_unauth_success": {
LangZH: "Redis未授权访问: %s",
LangEN: "Redis unauthorized access: %s",
},
"redis_weak_pwd_success": {
LangZH: "Redis弱密码扫描成功: %s [%s]",
LangEN: "Redis weak password scan successful: %s [%s]",
},
"redis_connection_failed": {
LangZH: "Redis连接失败: %v",
LangEN: "Redis connection failed: %v",
},
"redis_auth_failed": {
LangZH: "Redis认证失败: %v",
LangEN: "Redis authentication failed: %v",
},
"redis_exploit_file_write": {
LangZH: "Redis任意文件写入成功: %s",
LangEN: "Redis arbitrary file write successful: %s",
},
"redis_exploit_ssh_key": {
LangZH: "Redis SSH密钥注入成功",
LangEN: "Redis SSH key injection successful",
},
"redis_exploit_crontab": {
LangZH: "Redis定时任务注入成功",
LangEN: "Redis crontab injection successful",
},
"redis_exploit_data_extract": {
LangZH: "Redis数据提取成功",
LangEN: "Redis data extraction successful",
},
// ========================= SSH插件消息 =========================
"ssh_scan_start": {
LangZH: "开始SSH扫描: %s",
LangEN: "Starting SSH scan: %s",
},
"ssh_key_auth_success": {
LangZH: "SSH密钥认证成功: %s [%s]",
LangEN: "SSH key authentication successful: %s [%s]",
},
"ssh_pwd_auth_success": {
LangZH: "SSH密码认证成功: %s [%s:%s]",
LangEN: "SSH password authentication successful: %s [%s:%s]",
},
"ssh_connection_failed": {
LangZH: "SSH连接失败: %v",
LangEN: "SSH connection failed: %v",
},
"ssh_auth_failed": {
LangZH: "SSH认证失败: %v",
LangEN: "SSH authentication failed: %v",
},
"ssh_key_read_failed": {
LangZH: "读取SSH私钥失败: %v",
LangEN: "Failed to read SSH private key: %v",
},
// ========================= 通用错误消息 =========================
"plugin_brute_disabled": {
LangZH: "暴力破解已禁用",
LangEN: "Brute force disabled",
},
"plugin_no_credentials": {
LangZH: "没有可用的凭据",
LangEN: "No credentials available",
},
"plugin_all_creds_failed": {
LangZH: "所有凭据扫描失败",
LangEN: "All credential scans failed",
},
"plugin_invalid_port": {
LangZH: "无效的端口号: %s",
LangEN: "Invalid port number: %s",
},
"plugin_timeout": {
LangZH: "插件扫描超时",
LangEN: "Plugin scan timeout",
},
"plugin_vuln_found": {
LangZH: "%s发现漏洞: %s - %s",
LangEN: "%s vulnerability found: %s - %s",
},
// ========================= 利用方法名称i18n =========================
"exploit_method_name_information_gathering": {
LangZH: "信息收集",
LangEN: "information_gathering",
},
"exploit_method_name_database_enumeration": {
LangZH: "数据库枚举",
LangEN: "database_enumeration",
},
"exploit_method_name_privilege_check": {
LangZH: "权限检查",
LangEN: "privilege_check",
},
"exploit_method_name_file_read": {
LangZH: "文件读取",
LangEN: "file_read",
},
"exploit_method_name_file_write": {
LangZH: "文件写入",
LangEN: "file_write",
},
"exploit_method_name_arbitrary_file_write": {
LangZH: "任意文件写入",
LangEN: "arbitrary_file_write",
},
"exploit_method_name_ssh_key_write": {
LangZH: "SSH密钥写入",
LangEN: "ssh_key_write",
},
"exploit_method_name_crontab_injection": {
LangZH: "定时任务注入",
LangEN: "crontab_injection",
},
"exploit_method_name_data_extraction": {
LangZH: "数据提取",
LangEN: "data_extraction",
},
// ========================= 利用结果消息 =========================
"exploit_result_saved": {
LangZH: "利用结果已保存: %s",
LangEN: "Exploitation result saved: %s",
},
}