pkg update -y && pkg install proot-distro -y && proot-distro install kali && proot-distro login kali -- bash -c "apt update && apt install nmap metasploit-framework exploitdb -y && echo '#!/bin/bash' > ~/auto_exploit.sh && echo 'nmap -sn 192.168.1.0/24 | grep -E \"Nmap scan|MAC\" > /tmp/hosts.txt' >> ~/auto_exploit.sh && echo 'devices=()' >> ~/auto_exploit.sh && echo 'while read line; do' >> ~/auto_exploit.sh && echo ' if [[ \$line == *\"Nmap scan\"* ]]; then' >> ~/auto_exploit.sh && echo ' ip=\$(echo \$line | awk \"{print \\\$5}\")' >> ~/auto_exploit.sh && echo ' fi' >> ~/auto_exploit.sh && echo ' if [[ \$line == *\"MAC\"* ]]; then' >> ~/auto_exploit.sh && echo ' mac=\$(echo \$line | awk \"{print \\\$3}\")' >> ~/auto_exploit.sh && echo ' devices+=(\"\$ip (\$mac)\")' >> ~/auto_exploit.sh && echo ' fi' >> ~/auto_exploit.sh && echo 'done < /tmp/hosts.txt' >> ~/auto_exploit.sh && echo 'for i in \"\${!devices[@]}\"; do' >> ~/auto_exploit.sh && echo ' echo \"\$((i+1)): \${devices[\$i]}\"' >> ~/auto_exploit.sh && echo 'done' >> ~/auto_exploit.sh && echo 'read -p \"Выберите устройство по номеру: \" num' >> ~/auto_exploit.sh && echo 'target=\$(echo \"\${devices[\$((num-1))]}\" | awk \"{print \\\$1}\")' >> ~/auto_exploit.sh && echo 'echo \"[*] Цель: \$target\"' >> ~/auto_exploit.sh && echo 'nmap -sV -oG /tmp/nmap_output \$target' >> ~/auto_exploit.sh && echo 'searchsploit --nmap /tmp/nmap_output' >> ~/auto_exploit.sh && echo 'read -p \"Запустить автоматическую атаку? (1/0): \" auto' >> ~/auto_exploit.sh && echo 'if [[ \$auto == \"1\" ]]; then' >> ~/auto_exploit.sh && echo ' msfconsole -q -x \"db_import /tmp/nmap_output; vulns; exit -y\"' >> ~/auto_exploit.sh && echo 'else' >> ~/auto_exploit.sh && echo ' msfconsole' >> ~/auto_exploit.sh && echo 'fi' >> ~/auto_exploit.sh && chmod +x ~/auto_exploit.sh && echo 'Готово! Запусти скрипт: ./auto_exploit.sh' && ./auto_exploit.sh"