2012年3月7日 星期三

Telnet SMTP bash script


Telnet SMTP bash script
Code:
#!/bin/bash 
   ( 
        sleep 1 
        echo "ehlo x" 
        sleep 1 
        echo "mail from:frommail" 
        sleep 1 
        echo "rcpt to:tomail" 
        sleep 1 
        echo "data" 
        sleep 1 
        echo "subject:Test message" 
        sleep 1 
        echo "from:frommail 
        sleep 1 
        echo "to:tomail" 
        sleep 1 
        echo " " 
        #sleep 1 
        echo "Hello." 
        sleep 1 
        echo "This is a test message." 
        sleep 1 
        echo "Bye." 
        sleep 1 
        echo "." 
        sleep 1 
        echo "QUIT" 
   ) | telnet 172.17.7.140 25
You use netcat for this, not telnet.

Code:
[xxx@xxx src]$ nc localhost 25 << EOF
> HELO localhost
> MAIL FROM: user@whatever.com
> RCPT TO: user@whatever.com
> DATA
> this is a test
> .
> QUIT

沒有留言:

Nginx漏洞修補與升級方式說明(Windows)

面對這個剛爆發不久的 CVE-2026-42945 (NGINX Rift) 高風險漏洞,果斷選擇升級是非常正確的決定。這個漏洞存在於 Nginx 的重寫模組(ngx_http_rewrite_module)中,會導致堆疊緩衝區溢位(Heap Buffer Overflow)...