- This topic has 3 replies, 2 voices, and was last updated 2 years, 5 months ago by .
- You must be logged in to reply to this topic.
Hi, I am wondering what I did wrong with regex.
this is the result I gotten:
“AUSD-Staff\\r\\n All User Profile : Ma\\r\\n All User Profile : cbfix\\r\\n All User Profile
: wifispot1\\r\\n All User Profile : Frontier6368\\r\\n\\r\\n'”
——————————————————————————————————————-
question Why dosn’t it put network name put it into a list? why does it print out the whole string, was there anything wrong with the pattern I input?
This is my code:
import subprocess, smtplib, 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)
networksname= re.findall(“(?:Profile\s*:\s*)(.*)”, str(networks))
print(networksname)
——————————————————————————————
Hi!
Are you using python 3? If so then use python 2, it will be easier.
Let me know.
Diego
hi yes I am, could you help me if I want to use python 3, what would be the regular expression pattern? thank you
Hi!
The regular expression will not change, it’s the same in any python version. The thing is that with python 3 the result is being displayed as a byte-like object, not as a string. This a constant issue with python3 but for this script is better to use python 2.
Greetings!
Diego
Not a member yet? Register now
Are you a member? Login now
All of our courses include:
✔ Lifetime, unlimited access to course materials & training videos.
✔ Verifiable certificate of completion from zSecurity, signed by the course instructor, Zaid.
✔ Get answers from our Support Team within a maximum of 15 hours.
✔ Unlimited Updates.
Get free 1 month VIP membership per course with:
✔ Live mentorship and Q&A session with the course instructor, Zaid.
✔ Instant support from community members through our private discord channel.
✔ Daily updates with the latest tutorials & news in the hacking world.
✔ Daily resources like CTFs, bug bounty programs, onion services and more!
✔ Access our VIP community & connect with like-minded people.
✔ Discounts on other zSecurity products and services.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookies enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!