仅使用bash将IP地址或文件发送到病毒总数

2024-05-18 23:28:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我想给virus total发一封电子邮件,里面有一个中国IP地址和我在linux系统上发现的一些恶意软件。我不断地受到攻击,我很好奇如何在bash中自动化发送过程。你知道吗

尝试在bash中使用mail命令,但没有效果。你知道吗

也许可以将这个python脚本从https://www.virustotal.com/fr/documentation/email-submissions/转换为bash:

import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from email.Utils import formatdate

msg = MIMEMultipart()

mfrom = 'spam-me-not@virustotal.com'
mto = 'scan@virustotal.com'

msg['Subject'] = 'SCAN'
msg['From'] = mfrom
msg['To'] = mto
msg['Date'] = formatdate()

# Open the file to scan in binary mode
fp = open('/path/to/file', 'rb')
attachment = MIMEBase('application', 'octet-stream')
attachment.set_payload(fp.read())
encoders.encode_base64(attachment)
attachment.add_header('Content-Disposition', 'attachment;
filename="filename"')
fp.close()
msg.attach(attachment)

# Send the email via your own SMTP server.
s = smtplib.SMTP('smtp.yourserver.com')
s.sendmail(mfrom, mto, msg.as_string())
s.quit()

或者可能有一个验证码免费的方式来报告恶意IP地址从命令行?你知道吗


Tags: fromimportcombashattachmentemailmtomsg

热门问题