-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathNessus_Activation_Code.py
70 lines (63 loc) · 2.66 KB
/
Nessus_Activation_Code.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
from bs4 import BeautifulSoup
import requests
import time
import re
from tempmail import TempMail
import os
import sys
def banner():
print("==================================================================")
print(" Generate Multiple Nessus Activation code ")
print(" Don't misuse this script other then for Pentesting purpose ")
print(" \033[1;31;10mBy:Fools of Security :)\033[1;31;0m ")
print("==================================================================")
def nessus_activation():
tmp = TempMail()
email = tmp.get_email_address()
print("Your Temp mail address is successfully created!")
print ("Email Address: "+ email)
# print tmp.get_mailbox(email)
#Nessus Registeration Form
print ("\033[1;32;10mNessus Registeration Form \033[1;32;0m")
ht=requests.get("https://www.tenable.com/products/nessus-home")
bs=BeautifulSoup(ht.text,'html.parser')
for link in bs.findAll("input",{"name":"token"}):
if 'name' in link.attrs:
tkn=link.attrs['value']
else:
print("not found")
fname=raw_input("First Name:")
lname=raw_input("Last Name:")
# nes_email=raw_input("Email:")
params={"first_name":fname,"last_name":lname,"email":email,"country":"IN","Accept":"Agree","robot":"human","type":"homefeed","token":tkn,"submit":"Register"}
r = requests.post("https://www.tenable.com/products/nessus-home", data=params)
if r.status_code == 200:
bs=BeautifulSoup(r.text,'html.parser')
keyword=bs.find("title").get_text()
success=keyword.split('|')
if str(success[0][:-1]) == 'Thank You for Registering for Nessus Home!':
print('\033[1;32;10m'+str(success[0][:-1])+'\033[1;32;0m')
while True:
if tmp.get_mailbox(email):
for emails in tmp.get_mailbox(email):
if emails['mail_subject'] == 'Tenable Nessus Home Activation Code':
message=emails['mail_text']
receive=raw_input("To check for Nessus Activation Code in Inbox, press enter")
regex = r"\w{4}(?:-\w{4}){4}"
activation_code=re.search(regex,message)
print('\033[1;32;10mNessus Activation Code is:\033[1;32;0m'+activation_code.group())
sys.exit()
else:
print ('There are no emails yet....')
elif bs.find('span',{"style":"color:#FF0000;"}).get_text():
os.system('clear')
# print('\033[1;31;10m'+bs.find('span',{"style":"color:#FF0000;"}).get_text()+'\033[1;31;0m')
print('\033[1;31;10m Sorry, This Email Address is already Registered for Nessus Activation Code\033[1;31;0m')
print("Wait..Regenerating new Temp email address")
nessus_activation()
else:
print("something went wrong with the request")
sys.exit()
if __name__ == "__main__":
banner()
nessus_activation()