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

62
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,30 +229,54 @@ 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 =~ "mx.google.com" ]] || [[ $server_info =~ "gmail-smtp" ]] || [[ $additional_info =~ "mx.google.com" ]]; then
if [[ $server_info =~ "gsmtp" ]]; then
if [[ $HOSTNAME =~ "gmail-smtp" ]]; then
log "INFO" "Servidor detectado: Google Gmail (SMTP)"
elif [[ $HOSTNAME =~ "aspmx" ]]; then
log "INFO" "Servidor detectado: 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 [[ $server_info =~ "Microsoft" ]]; then if [[ $response =~ "STARTTLS" ]]; then
log "INFO" "Servidor detectado: Microsoft Exchange/Office 365" [[ $VERBOSE == true ]] && log "DEBUG" "Soporta: STARTTLS (Cifrado TLS)"
[[ $VERBOSE == true ]] && log "DEBUG" "Sistema de correo empresarial Microsoft" fi
elif [[ $server_info =~ "Google" ]]; then if [[ $response =~ "SMTPUTF8" ]]; then
log "INFO" "Servidor detectado: Google Workspace" [[ $VERBOSE == true ]] && log "DEBUG" "Soporta: SMTPUTF8 (Caracteres internacionales)"
[[ $VERBOSE == true ]] && log "DEBUG" "Sistema de correo Google Workspace" 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)"
elif [[ $server_info =~ "Exim" ]]; then elif [[ $server_info =~ "Exim" ]]; then
log "INFO" "Servidor detectado: Exim" log "INFO" "Servidor detectado: Exim"
[[ $VERBOSE == true ]] && log "DEBUG" "Servidor de correo Exim" [[ $VERBOSE == true ]] && log "DEBUG" "Servidor de correo Exim"
elif [[ $server_info =~ "Sendmail" ]]; then elif [[ $server_info =~ "Sendmail" ]]; then
log "INFO" "Servidor detectado: Sendmail" log "INFO" "Servidor detectado: Sendmail"
[[ $VERBOSE == true ]] && log "DEBUG" "Servidor de correo Sendmail" [[ $VERBOSE == true ]] && log "DEBUG" "Servidor de correo Sendmail"
elif [[ $server_info =~ "Zimbra" ]]; then elif [[ $server_info =~ "Zimbra" ]]; then
log "INFO" "Servidor detectado: Zimbra" log "INFO" "Servidor detectado: Zimbra"
[[ $VERBOSE == true ]] && log "DEBUG" "Suite de colaboración Zimbra" [[ $VERBOSE == true ]] && log "DEBUG" "Suite de colaboración Zimbra"
else else
log "INFO" "Servidor no identificado específicamente" log "INFO" "Servidor no identificado específicamente"
[[ $VERBOSE == true ]] && log "DEBUG" "Banner del servidor: $server_info" [[ $VERBOSE == true ]] && log "DEBUG" "Banner del servidor: $server_info"
fi fi
} }
validate_email() { validate_email() {
local email=$1 local email=$1
@ -296,7 +320,7 @@ EOF
if [ -n "$primary_mx" ]; then if [ -n "$primary_mx" ]; then
[[ $STEALTH == true ]] && sleep $DELAY [[ $STEALTH == true ]] && sleep $DELAY
echo -ne "${LOADING} Iniciando diálogo con $primary_mx " echo -ne "${LOADING} Iniciando diálogo con $primary_mx "
temp_commands=$(mktemp) temp_commands=$(mktemp)
{ {