Skip to content

Commit

Permalink
Update to v1.5.3.3
Browse files Browse the repository at this point in the history
1. Added new Email API: inboxes
2. Added ProtectHub account key unbinding function
4. Improved stability of Email API: developermail 
5. Checking the status of successful email address creation is now more accurate
6. Fixed SyntaxWarning in password generation function
7. Fixed a misprint in the GET_EBTN constant, which caused code sections that used it to fail to work
8. Updated docs and screenshots
  • Loading branch information
rzc0d3r authored Dec 13, 2024
1 parent f8e36fa commit bc45284
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 38 deletions.
Binary file modified img/project_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/unbinding_protecthub_key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 19 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from modules.EmailAPIs import *

# ---- Quick settings [for Developers to quickly change behavior without changing all files] ----
VERSION = ['v1.5.3.2', 1532]
VERSION = ['v1.5.3.3', 1533]
LOGO = f"""
███████╗███████╗███████╗████████╗ ██╗ ██╗███████╗██╗ ██╗ ██████╗ ███████╗███╗ ██╗
██╔════╝██╔════╝██╔════╝╚══██╔══╝ ██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔════╝████╗ ██║
Expand All @@ -24,14 +24,15 @@
LOGO = f"ESET KeyGen {VERSION[0]} by rzc0d3r\n"

DEFAULT_EMAIL_API = 'developermail'
AVAILABLE_EMAIL_APIS = ('1secmail', 'guerrillamail', 'developermail', 'mailticking', 'fakemail')
WEB_WRAPPER_EMAIL_APIS = ('guerrillamail', 'mailticking', 'fakemail')
AVAILABLE_EMAIL_APIS = ('1secmail', 'guerrillamail', 'developermail', 'mailticking', 'fakemail', 'inboxes')
WEB_WRAPPER_EMAIL_APIS = ('guerrillamail', 'mailticking', 'fakemail', 'inboxes')
EMAIL_API_CLASSES = {
'guerrillamail': GuerRillaMailAPI,
'1secmail': OneSecEmailAPI,
'developermail': DeveloperMailAPI,
'mailticking': MailTickingAPI,
'fakemail': FakeMailAPI
'fakemail': FakeMailAPI,
'inboxes': InboxesAPI
}
MAX_REPEATS_LIMIT = 10

Expand Down Expand Up @@ -273,8 +274,8 @@ def main(disable_exit=False):
elif args['advanced_key'] or args['protecthub_account']:
args['no_headless'] = True
if not args['custom_email_api']:
if args['email_api'] not in ['mailticking', 'fakemail']:
raise RuntimeError('--advanced-key, --protecthub-account works ONLY if you use the --custom-email-api argument or the following Email APIs: mailticking, fakemail!!!')
if args['email_api'] not in ['mailticking', 'fakemail', 'inboxes']:
raise RuntimeError('--advanced-key, --protecthub-account works ONLY if you use the --custom-email-api argument or the following Email APIs: mailticking, fakemail, inboxes!!!')
# check program updates
elif args['update']:
print(f'{Fore.LIGHTMAGENTA_EX}-- Updater --{Fore.RESET}\n')
Expand Down Expand Up @@ -352,9 +353,12 @@ def main(disable_exit=False):
email_obj = EMAIL_API_CLASSES[args['email_api']]()
try:
email_obj.init()
console_log('Mail registration completed successfully!', OK)
if email_obj.email is not None:
console_log('Mail registration completed successfully!', OK)
except:
pass
if email_obj.email is None:
console_log('Mail registration was not completed, try using a different Email API!\n', ERROR)
else:
email_obj = CustomEmailAPI()
while True:
Expand All @@ -372,6 +376,8 @@ def main(disable_exit=False):

if email_obj.email is not None:
eset_password = dataGenerator(10)
license_key = None
obtained_from_site = False
# ESET HOME
if args['account'] or args['key'] or args['small_business_key'] or args['vpn_codes']:
ER_obj = ER(email_obj, eset_password, driver)
Expand Down Expand Up @@ -442,7 +448,7 @@ def main(disable_exit=False):
if args['advanced_key']:
output_filename = 'ESET KEYS.txt'
EPHK_obj = EPHK(email_obj, eset_password, driver)
license_name, license_key, license_out_date = EPHK_obj.getLicenseData()
license_name, license_key, license_out_date, obtained_from_site = EPHK_obj.getLicenseData()
if license_name is not None:
output_line = '\n'.join([
'',
Expand All @@ -464,9 +470,11 @@ def main(disable_exit=False):
f = open(f"{str(date.day)}.{str(date.month)}.{str(date.year)} - "+output_filename, 'a')
f.write(output_line)
f.close()
else:
console_log('Mail registration was not completed, try using a different Email API!\n', ERROR)


if license_key is not None and args['advanced_key'] and obtained_from_site:
unbind_key = input(f'[ {colorama.Fore.YELLOW}INPT{colorama.Fore.RESET} ] {colorama.Fore.CYAN}Do you want to unbind the key from this account? (y/n): {colorama.Fore.RESET}').strip().lower()
if unbind_key == 'y':
EPHK_obj.removeLicense()
except Exception as E:
traceback_string = traceback.format_exc()
if str(type(E)).find('selenium') and traceback_string.find('Stacktrace:') != -1: # disabling stacktrace output
Expand Down
49 changes: 48 additions & 1 deletion modules/EmailAPIs.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,56 @@ def open_mail(self, id):
self.driver.switch_to.window(self.window_handle)
self.driver.get(f'https://www.fakemail.net/email/id/{id}')

class InboxesAPI:
def __init__(self, driver: Chrome):
self.class_name = 'inboxes'
self.driver = driver
self.email = None
self.window_handle = None

def init(self):
self.driver.get('https://inboxes.com')
self.window_handle = self.driver.current_window_handle
button = None
for _ in range(DEFAULT_MAX_ITER):
try:
button = self.driver.find_element('xpath', '//button[contains(text(), "Get my first inbox!")]')
break
except:
pass
time.sleep(DEFAULT_DELAY)
if button is not None:
button.click()
time.sleep(1)
for button in self.driver.execute_script(f'return {GET_EBTN}("button")'):
if button.text.strip().lower() == 'choose for me':
button.click()
break
time.sleep(2)
for element in self.driver.execute_script(f'return {GET_EBTN}("span")'):
new_email = ''.join(element.text.split())
if new_email is not None:
new_email = re.match(r'[-a-z0-9+.]+@[a-z]+(\.[a-z]+)+', new_email)
if new_email is not None:
self.email = new_email.group()
break

def get_messages(self):
r = requests.get(f'https://inboxes.com/api/v2/inbox/{self.email}')
raw_inbox = r.json()['msgs']
messages = []
for message in raw_inbox:
r = requests.get(f'https://inboxes.com/api/v2/message/{message["uid"]}').json()
messages.append({
'from': r['ff'][0]['address'],
'subject': message['s'],
'body': r['html']
})
return messages

class CustomEmailAPI:
def __init__(self):
self.class_name = 'custom'
self.email = None

WEB_WRAPPER_EMAIL_APIS_CLASSES = (GuerRillaMailAPI, MailTickingAPI, FakeMailAPI)
WEB_WRAPPER_EMAIL_APIS_CLASSES = (GuerRillaMailAPI, MailTickingAPI, FakeMailAPI, InboxesAPI)
24 changes: 21 additions & 3 deletions modules/EsetTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def getLicenseData(self):
if license_key is not None and not license_key.startswith('XXXX-XXXX-XXXX-XXXX-XXXX'): # ignoring XXXX-XXXX-XXXX-XXXX-XXXX
license_key = license_key.split(' ')[0]
console_log('Information successfully received!', OK)
return license_name, license_key, license_out_date
return license_name, license_key, license_out_date, True # True - License key obtained from the site
except:
pass
time.sleep(DEFAULT_DELAY)
Expand All @@ -376,13 +376,31 @@ def getLicenseData(self):
console_log('\n[Email] License uploads...', INFO)
if self.email_obj.class_name == 'custom':
console_log('\nWait for a message to your e-mail about successful key generation!!!', WARN, True)
return None, None, None
return None, None, None, None
else:
license_key, license_out_date, license_id = parseEPHKey(self.email_obj, self.driver, delay=5, max_iter=30) # 2.5m
console_log(f'License ID: {license_id}', OK)
console_log('\nGetting information from the license...', INFO)
console_log('Information successfully received!', OK)
return license_name, license_key, license_out_date
return license_name, license_key, license_out_date, False # False - License key obtained from the email

def removeLicense(self):
console_log('Deleting the key from the account, the key will still work...', INFO)
try:
self.driver.execute_script(f'return {GET_EBID}("license-actions-button")').click()
time.sleep(1)
self.driver.execute_script(f'return {GET_EBID}("3-0-action_remove_license")').click()
untilConditionExecute(self.driver, f'return {CLICK_WITH_BOOL}({GET_EBID}("remove-license-dlg-remove-btn"))', max_iter=15)
self.driver.execute_script(f'return {GET_EBID}("remove-license-dlg-remove-btn")').click()
for _ in range(DEFAULT_MAX_ITER//2):
if self.driver.page_source.lower().find('to keep the solutions up to date') == -1:
time.sleep(1)
console_log('Key successfully deleted!!!\n', OK)
return True
time.sleep(DEFAULT_DELAY)
except:
pass
console_log('Failed to delete key, this error has no effect on the operation of the key!!!\n', ERROR)

def EsetVPNResetWindows(key_path='SOFTWARE\\ESET\\ESET VPN', value_name='authHash'):
"""Deletes the authHash value of ESET VPN"""
Expand Down
20 changes: 10 additions & 10 deletions modules/SharedTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
DEFAULT_DELAY = 1
GET_EBCN = 'document.getElementsByClassName'
GET_EBID = 'document.getElementById'
GET_EBTN = 'document.getElementByTagName'
GET_EBTN = 'document.getElementsByTagName'
GET_EBAV = 'getElementByAttrValue'
CLICK_WITH_BOOL = 'clickWithBool'
DEFINE_GET_EBAV_FUNCTION = """
Expand Down Expand Up @@ -121,7 +121,7 @@ def dataGenerator(length, only_numbers=False):
random.choice(string.ascii_uppercase),
random.choice(string.ascii_lowercase),
random.choice(string.digits),
random.choice("""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~""")
random.choice("""!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~""")
]
characters = string.ascii_letters + string.digits + string.punctuation
data += [random.choice(characters) for _ in range(length-3)]
Expand Down Expand Up @@ -223,14 +223,14 @@ def parseToken(email_obj, driver=None, eset_business=False, delay=DEFAULT_DELAY,
activated_href = email_obj.get_message(message['id'])['body']
elif message['from'].find('product.eset.com') != -1:
activated_href = email_obj.get_message(message['id'])['body']
elif email_obj.class_name == 'developermail':
elif email_obj.class_name in ['developermail', 'inboxes']:
messages = email_obj.get_messages()
if messages is not None:
message = messages[-1]
if eset_business and message['subject'].find('ESET PROTECT Hub') != -1:
activated_href = message['body']
elif message['from'].find('product.eset.com') != -1:
activated_href = message['body']
for message in messages:
if eset_business and message['subject'].find('ESET PROTECT Hub') != -1:
activated_href = message['body']
elif message['from'].find('product.eset.com') != -1:
activated_href = message['body']
elif email_obj.class_name in ['guerrillamail', 'mailticking', 'fakemail']:
inbox = email_obj.parse_inbox()
for mail in inbox:
Expand Down Expand Up @@ -264,7 +264,7 @@ def parseToken(email_obj, driver=None, eset_business=False, delay=DEFAULT_DELAY,
def parseEPHKey(email_obj, driver=None, delay=DEFAULT_DELAY, max_iter=DEFAULT_MAX_ITER):
for _ in range(max_iter):
license_data = None
if email_obj.class_name == 'developermail':
if email_obj.class_name in ['developermail', 'inboxes']:
messages = email_obj.get_messages()
if messages is not None:
for message in messages:
Expand Down Expand Up @@ -298,7 +298,7 @@ def parseVPNCodes(email_obj, driver=None, delay=DEFAULT_DELAY, max_iter=DEFAULT_
for message in json:
if message['subject'].find('VPN - Setup instructions') != -1:
data = email_obj.get_message(message['id'])['body']
elif email_obj.class_name == 'developermail':
elif email_obj.class_name in ['developermail', 'inboxes']:
messages = email_obj.get_messages()
if messages is not None:
for message in messages:
Expand Down
8 changes: 4 additions & 4 deletions wiki/AccountGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --account
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --account
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --account
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -36,7 +36,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --business-account
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --protecthub-account
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --protecthub-account
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -60,7 +60,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --account --custom-email-api
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --account --custom-email-api
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --account --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down Expand Up @@ -91,7 +91,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --protecthub-account --custom-email-api
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --protecthub-account --custom-email-api
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --protecthub-account --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down
2 changes: 1 addition & 1 deletion wiki/CommandLineArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
| --skip-webdriver-menu | Skips installation/upgrade webdrivers through the my custom wrapper (The built-in selenium-manager will be used) |
| --no-headless | Shows the browser at runtime (The browser is hidden by default, but on (Windows 7) and (enabled --business-key or --business-account options) this option is enabled by itself) |
| --custom-browser-location {string} | Set path to the custom browser (to the binary file, useful when using non-standard releases, for example: Firefox Developer Edition, Brave) |
| --email-api {1secmail, guerrillamail, developermail, mailticking, fakemail} | Specify which api to use for mail, default - ```developermail``` |
| --email-api {1secmail, guerrillamail, developermail, mailticking, fakemail, inboxes} | Specify which api to use for mail, default - ```developermail``` |
| --custom-email-api | Allows you to manually specify any email, and all work will go through it - **Requires manually read inbox and do what is described in the documentation for this argument!!!**, **Also use this argument if you are unable to generate anything using all the implemented email APIs above** |
| --no-logo | Replaces ASCII-Art with plain text |
| --disable-progress-bar | Disables the webdriver download progress bar |
Expand Down
28 changes: 20 additions & 8 deletions wiki/KeyGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --key
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --key
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --key
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -36,7 +36,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --small-business-key
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --small-business-key
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --small-business-key
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -54,7 +54,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --advanced-key
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --advanced-key
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --advanced-key
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -76,7 +76,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --vpn-codes
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --vpn-codes
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --vpn-codes
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -86,6 +86,8 @@ Add a command-line argument: ```--repeat {number}```
![Windows](https://github.com/rzc0d3r/ESET-KeyGen/blob/main/img/vpn_codes_run_win.png)
</details>

---

## 3. Generation using your email provider

<details>
Expand All @@ -97,7 +99,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --key --custom-email-api
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --key --custom-email-api
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --key --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -107,7 +109,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --small-business-key --custom-email-api
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --small-business-key --custom-email-api
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --small-business-key --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down Expand Up @@ -142,7 +144,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --advanced-key --custom-email-api
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --advanced-key --custom-email-api
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --advanced-key --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down Expand Up @@ -185,7 +187,7 @@ Add a command-line argument: ```--repeat {number}```
python main.py --chrome --vpn-codes --custom-email-api
```
```
ESET-KeyGen_v1.5.3.0_win64.exe --chrome --vpn-codes --custom-email-api
ESET-KeyGen_v1.5.3.3_win64.exe --chrome --vpn-codes --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down Expand Up @@ -217,3 +219,13 @@ Add a command-line argument: ```--repeat {number}```

![Windows](https://github.com/rzc0d3r/ESET-KeyGen/blob/main/img/vpn_codes_message.png)
</details>

---

## 4. Unbinding license key from ESET ProtectHub account
Once the **ProtectHub** key has been successfully generated and obtained from the site, you can delete it from the created account (this will not affect the functionality of the key).
This will allow you to bind the key to another **ProtectHub** account (sometimes this can be useful).

To do this, enter ```Y``` to confirm and ```N``` to decline after the message appears in the console:

![Windows](https://github.com/rzc0d3r/ESET-KeyGen/blob/main/img/unbinding_protecthub_key.png)

0 comments on commit bc45284

Please sign in to comment.