Skip to content

Commit

Permalink
Update to v1.5.2.0
Browse files Browse the repository at this point in the history
* Changed algorithms for ESET Protect Hub (--advanced-key)
* --endpoint-key renamed to --advanced-key
* Fixed logic of getting token for mailticking
  • Loading branch information
rzc0d3r authored Oct 10, 2024
1 parent c77af41 commit 5e45243
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ESET-KeyGen
ESET-KeyGen - Trial-Key & Account generator for ESET Antivirus (last test was on 10.10.2024 at 03:49 UTC+3)
ESET-KeyGen - Trial-Key & Account generator for ESET Antivirus (last test was on 10.10.2024 at 13:12 UTC+3)

# Project Preview
![](img/project_preview.png)
Expand Down
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.
22 changes: 12 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from modules.EmailAPIs import *

# ---- Quick settings [for Developers to quickly change behavior without changing all files] ----
VERSION = ['v1.5.1.2', 1512]
VERSION = ['v1.5.2.0', 1520]
LOGO = f"""
███████╗███████╗███████╗████████╗ ██╗ ██╗███████╗██╗ ██╗ ██████╗ ███████╗███╗ ██╗
██╔════╝██╔════╝██╔════╝╚══██╔══╝ ██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔════╝████╗ ██║
Expand Down Expand Up @@ -34,7 +34,7 @@

'key': True,
'small_business_key': False,
'endpoint_key': False,
'advanced_key': False,
'vpn_codes': False,
'account': False,
'protecthub_account': False,
Expand Down Expand Up @@ -110,7 +110,7 @@ def RunMenu():
args,
title='Modes of operation',
action='store_true',
args_names=['key', 'small-business-key', 'endpoint-key', 'vpn-codes', 'account', 'protecthub-account', 'only-webdriver-update', 'update'],
args_names=['key', 'small-business-key', 'advanced-key', 'vpn-codes', 'account', 'protecthub-account', 'only-webdriver-update', 'update'],
default_value='key')
)
SettingMenu.add_item(
Expand Down Expand Up @@ -213,7 +213,7 @@ def parse_argv():
args_modes = args_parser.add_mutually_exclusive_group(required=True)
args_modes.add_argument('--key', action='store_true', help='Creating a license key for ESET Smart Security Premium')
args_modes.add_argument('--small-business-key', action='store_true', help='Creating a license key for ESET Small Business Security (1 key - 5 devices)')
args_modes.add_argument('--endpoint-key', action='store_true', help='Creating a license key for ESET Endpoint Security')
args_modes.add_argument('--advanced-key', action='store_true', help='Creating a license key for ESET PROTECT Advanced (1 key - 25 devices)')
args_modes.add_argument('--vpn-codes', action='store_true', help='Creating 10 codes for ESET VPN + 1 ESET Small Business Security key')
args_modes.add_argument('--account', action='store_true', help='Creating a ESET HOME Account (To activate the free trial version)')
args_modes.add_argument('--protecthub-account', action='store_true', help='Creating a ESET ProtectHub Account (To activate the free trial version)')
Expand Down Expand Up @@ -248,11 +248,12 @@ def main(disable_exit=False):
if not args['update']:
if platform.release() == '7' and sys.platform.startswith('win'): # fix for Windows 7
args['no_headless'] = True
elif args['endpoint_key'] or args['protecthub_account']:
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', 'developermail']:
raise RuntimeError('--endpoint-key, --protecthub-account works ONLY if you use the --custom-email-api argument or the following Email APIs: mailticking, developermail!!!')
if args['email_api'] not in ['mailticking']:
raise RuntimeError('--advanced-key, --protecthub-account works ONLY if you use the --custom-email-api argument or the following Email APIs: mailticking!!!')

# check program updates
if args['update']:
print(f'{Fore.LIGHTMAGENTA_EX}-- Updater --{Fore.RESET}\n')
Expand All @@ -278,6 +279,7 @@ def main(disable_exit=False):
console_log('Project up to date!!!\n', OK)
except:
pass

# initialization and configuration of everything necessary for work
driver = None
webdriver_path = None
Expand Down Expand Up @@ -382,7 +384,7 @@ def main(disable_exit=False):
])

# ESET ProtectHub
elif args['protecthub_account'] or args['endpoint_key']:
elif args['protecthub_account'] or args['advanced_key']:
EPHR_obj = EPHR(email_obj, eset_password, driver)
EPHR_obj.createAccount()
EPHR_obj.confirmAccount()
Expand All @@ -396,7 +398,7 @@ def main(disable_exit=False):
''
])
output_filename = 'ESET ACCOUNTS.txt'
if args['endpoint_key']:
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()
Expand Down Expand Up @@ -455,4 +457,4 @@ def main(disable_exit=False):
else:
main(disable_exit=True)
except KeyboardInterrupt:
continue
continue
74 changes: 64 additions & 10 deletions modules/EsetTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ def createAccount(self):
console_log('\nData filling...', INFO)
exec_js(f'return {GET_EBID}("email-input")').send_keys(self.email_obj.email)
exec_js(f'return {GET_EBID}("company-name-input")').send_keys(dataGenerator(10))
# Select Ukraine country
# Select country
exec_js(f"return {GET_EBID}('country-select')").click()
selected_country = 'Ukraine'
for country in self.driver.find_elements('xpath', '//div[starts-with(@class, "select")]'):
if country.text == 'Ukraine':
if country.text == selected_country:
country.click()
break
exec_js(f'return {GET_EBID}("company-vat-input")').send_keys(dataGenerator(10, True))
Expand Down Expand Up @@ -241,7 +242,7 @@ def confirmAccount(self):
token = parseToken(self.email_obj, self.driver, True, max_iter=100, delay=3)
self.driver.switch_to.window(self.window_handle)
else:
token = parseToken(self.email_obj, eset_business=True, max_iter=100, delay=3) # 1secmail, developermail
token = parseToken(self.email_obj, eset_business=True, max_iter=100, delay=3) # 1secmail
console_log(f'ProtectHub-Token: {token}', OK)
console_log('\nAccount confirmation is in progress...', INFO)
self.driver.get(f'https://protecthub.eset.com/public/activation/{token}/?culture=en-US')
Expand All @@ -260,7 +261,7 @@ def getLicenseData(self):

# Log in
console_log('\nLogging in to the created account...', INFO)
self.driver.get('https://protecthub.eset.com/')
self.driver.get('https://protecthub.eset.com')
uCE(self.driver, f'return {GET_EBID}("username") != null')
exec_js(f'return {GET_EBID}("username")').send_keys(self.email_obj.email)
exec_js(f'return {GET_EBID}("password")').send_keys(self.eset_password)
Expand All @@ -275,13 +276,20 @@ def getLicenseData(self):
exec_js(f'return {GET_EBID}("welcome-dialog-generate-trial-license")').click()
except:
pass

# Waiting for a response from the site
license_is_being_generated = False
for _ in range(DEFAULT_MAX_ITER):
try:
r = exec_js(f"return {GET_EBCN}('Toastify__toast-body toastBody')[0].innerText")
if r.lower().find('a trial license is being generated') != -1:
r = exec_js(f"return {GET_EBCN}('Toastify__toast-body toastBody')[0].innerText").lower()
if r.find('is being generated') != -1:
license_is_being_generated = True
console_log('Request successfully sent!', OK)
try:
exec_js(f'return {GET_EBID}("welcome-dialog-skip-button").click()')
exec_js(f'return {GET_EBID}("welcome-dialog-skip-button")').click()
except:
pass
break
except Exception as E:
pass
Expand All @@ -290,14 +298,60 @@ def getLicenseData(self):
if not license_is_being_generated:
raise RuntimeError('The request has not been sent!')

console_log('\nWaiting for a back response...', INFO)
license_was_generated = False
for _ in range(DEFAULT_MAX_ITER*10): # 5m
try:
r = exec_js(f"return {GET_EBCN}('Toastify__toast-body toastBody')[0].innerText").lower()
if r.find('couldn\'t be generated') != -1:
break
elif r.find('was generated') != -1:
console_log('Successfully!', OK)
license_was_generated = True
break
except Exception as E:
pass
time.sleep(DEFAULT_DELAY)

if not license_was_generated:
raise RuntimeError('The license cannot be generated, try again later!')

# Obtaining license data from the site
console_log('\n[Site] License uploads...', INFO)
license_name = 'ESET PROTECT Advanced'
try:
self.driver.get('https://protecthub.eset.com/licenses')
uCE(self.driver, f'return {GET_EBAV}("div", "data-label", "license-list-body-cell-renderer-row-0-column-0").innerText != ""')
license_id = exec_js(f'{DEFINE_GET_EBAV_FUNCTION}\nreturn {GET_EBAV}("div", "data-label", "license-list-body-cell-renderer-row-0-column-0").innerText')
console_log(f'License ID: {license_id}', OK)
console_log('\nGetting information from the license...', INFO)
self.driver.get(f'https://protecthub.eset.com/licenses/details/2/{license_id}/overview')
uCE(self.driver, f'return {GET_EBAV}("div", "data-label", "license-overview-validity-value") != null')
license_out_date = exec_js(f'{DEFINE_GET_EBAV_FUNCTION}\nreturn {GET_EBAV}("div", "data-label", "license-overview-validity-value").children[0].children[0].innerText')
# Obtaining license key
exec_js(f'{DEFINE_GET_EBAV_FUNCTION}\n{GET_EBAV}("div", "data-label", "license-overview-key-value").children[0].children[0].click()')
uCE(self.driver, f'return {GET_EBID}("show-license-key-auth-modal-password-input") != null')
exec_js(f'return {GET_EBID}("show-license-key-auth-modal-password-input")').send_keys(self.eset_password)
try:
exec_js(f'return {GET_EBID}("show-license-key-auth-modal-authenticate").click()')
exec_js(f'return {GET_EBID}("show-license-key-auth-modal-authenticate")').click()
except:
pass
time.sleep(5)
uCE(self.driver, f'return {GET_EBAV}("div", "data-label", "license-overview-key-value") != null')
license_key = exec_js(f'return {GET_EBAV}("div", "data-label", "license-overview-key-value").children[0].textContent').split(' ')[0].strip()
console_log('Information successfully received!', OK)
return license_name, license_key, license_out_date
except:
pass
# Obtaining license data from the email
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
else:
console_log('\nLicense uploads...', INFO)
license_key, license_out_date, license_id = parseEPHKey(self.email_obj, self.driver, delay=5, max_iter=60)
license_key, license_out_date, license_id = parseEPHKey(self.email_obj, self.driver, delay=5, max_iter=30) # 2m
console_log(f'License ID: {license_id}', OK)
console_log('\nGetting information from the license...', INFO)
console_log('Information successfully received!', OK)
license_name = 'ESET Endpoint Security + ESET Server Security'
return license_name, license_key, license_out_date
return license_name, license_key, license_out_date
2 changes: 1 addition & 1 deletion modules/SharedTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def parseToken(email_obj, driver=None, eset_business=False, delay=DEFAULT_DELAY,
inbox = email_obj.parse_inbox()
for mail in inbox:
mail_id, mail_from, mail_subject = mail
if mail_from.find('product.eset.com') != -1 or mail_from.find('ESET HOME') or mail_subject.find('ESET PROTECT Hub') != -1:
if mail_from.find('product.eset.com') != -1 or mail_from.find('ESET HOME') != -1 or mail_subject.find('ESET PROTECT Hub') != -1:
email_obj.open_mail(mail_id)
if email_obj.class_name == 'mailticking':
time.sleep(1.5)
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.0.8_win64.exe --chrome --account
ESET-KeyGen_v1.5.2.0_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.0.8_win64.exe --chrome --protecthub-account
ESET-KeyGen_v1.5.2.0_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.0.8_win64.exe --chrome --account --custom-email-api
ESET-KeyGen_v1.5.2.0_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.0.8_win64.exe --chrome --protecthub-account --custom-email-api
ESET-KeyGen_v1.5.2.0_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
4 changes: 2 additions & 2 deletions wiki/CommandLineArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
| --------------------- | ---------------------------------------------------------------------------------------------------------- |
| --key | Creating a license key for ESET Smart Security Premium |
| --small-business-key | Creating a license key for ESET Small Business Security (1 key - 5 devices) |
| --endpoint-key | Creating a license key for ESET Endpoint Security - works only with ```--email-api developermail``` and ```--custom-email-api``` |
| --advanced-key | Creating a license key for ESET PROTECT Advanced (1 key - 25 devices) - works only with ```--email-api mailticking``` and ```--custom-email-api``` |
| --vpn-codes | Creating 10 codes for ESET VPN + 1 ESET Small Business Security key |
| --account | Creating an ESET HOME Account (To activate the free trial version) |
| --protecthub-account | Creating a ESET ProtectHub Account (To activate the free trial version) - works only with ```--email-api developermail``` and ```--custom-email-api``` |
| --protecthub-account | Creating a ESET ProtectHub Account (To activate the free trial version) - works only with ```--email-api mailticking``` and ```--custom-email-api``` |
| --only-webdriver-update | Updates/installs webdrivers and browsers without generating accounts and license keys |
| --update | Switching to program update mode - **Overrides all arguments that are available** |
--------------------------------------------------------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 5e45243

Please sign in to comment.