mejora de deteccion de servidores de correo

This commit is contained in:
Kevin Muñoz 2024-11-17 09:06:33 -05:00
parent b6250dff4e
commit 074e790c67
Signed by: mrhacker
GPG Key ID: E5616555DD4EDAAE

36
sevo
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Versión del script # Versión del script
VERSION="1.0.0" VERSION="1.1.0"
# Colores y símbolos # Colores y símbolos
RED='\033[0;31m' RED='\033[0;31m'
@ -229,13 +229,37 @@ EOF
fingerprint_server() { fingerprint_server() {
local response=$1 local response=$1
local server_info=$(echo "$response" | grep -i "^220" | head -n1) local server_info=$(echo "$response" | grep -i "^220" | head -n1)
local additional_info=$(echo "$response" | grep -i "at your service" | head -n1)
if [[ $server_info =~ "Microsoft" ]]; then if [[ $server_info =~ "mx.google.com" ]] || [[ $server_info =~ "gmail-smtp" ]] || [[ $additional_info =~ "mx.google.com" ]]; then
log "INFO" "Servidor detectado: Microsoft Exchange/Office 365" if [[ $server_info =~ "gsmtp" ]]; then
[[ $VERBOSE == true ]] && log "DEBUG" "Sistema de correo empresarial Microsoft" if [[ $HOSTNAME =~ "gmail-smtp" ]]; then
elif [[ $server_info =~ "Google" ]]; then log "INFO" "Servidor detectado: Google Gmail (SMTP)"
elif [[ $HOSTNAME =~ "aspmx" ]]; then
log "INFO" "Servidor detectado: Google Workspace" log "INFO" "Servidor detectado: Google Workspace"
[[ $VERBOSE == true ]] && log "DEBUG" "Sistema de correo Google Workspace" elif [[ $HOSTNAME =~ "google" ]]; then
log "INFO" "Servidor detectado: Google Mail Services"
else
log "INFO" "Servidor detectado: Google Mail Infrastructure"
fi
[[ $VERBOSE == true ]] && log "DEBUG" "Motor SMTP: Google SMTP (gsmtp)"
fi
if [[ $response =~ "STARTTLS" ]]; then
[[ $VERBOSE == true ]] && log "DEBUG" "Soporta: STARTTLS (Cifrado TLS)"
fi
if [[ $response =~ "SMTPUTF8" ]]; then
[[ $VERBOSE == true ]] && log "DEBUG" "Soporta: SMTPUTF8 (Caracteres internacionales)"
fi
if [[ $response =~ "SIZE" ]]; then
local size=$(echo "$response" | grep -i "SIZE" | grep -oP '\d+')
[[ $VERBOSE == true ]] && log "DEBUG" "Tamaño máximo de mensaje: $(($size/1024/1024))MB"
fi
return 0
elif [[ $server_info =~ "Microsoft" ]]; then
log "INFO" "Servidor detectado: Microsoft Exchange/Office 365"
[[ $VERBOSE == true ]] && log "DEBUG" "Sistema de correo empresarial Microsoft Exchange"
elif [[ $server_info =~ "Postfix" ]]; then elif [[ $server_info =~ "Postfix" ]]; then
log "INFO" "Servidor detectado: Postfix" log "INFO" "Servidor detectado: Postfix"
[[ $VERBOSE == true ]] && log "DEBUG" "Servidor de correo Postfix (Linux)" [[ $VERBOSE == true ]] && log "DEBUG" "Servidor de correo Postfix (Linux)"