-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
effacf3
commit f5ce503
Showing
3 changed files
with
163 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import requests | ||
import json | ||
import urllib3 | ||
import string | ||
import random | ||
from __colors__.colors import * | ||
|
||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | ||
|
||
class EduHelper: | ||
def __init__(self, id): | ||
self.url = 'https://www.openccc.net/f-vs-stand-I-hat-of-yout-ands-Banquoh-Cumberland?d=www.openccc.net' | ||
self.h = { | ||
'accept': 'application/json; charset=utf-8', | ||
'sec-ch-ua-mobile': '?0', | ||
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', | ||
'content-type': 'text/plain; charset=utf-8', | ||
'origin': 'https://www.openccc.net' | ||
} | ||
|
||
self.url1 = 'https://www.openccc.net/cccacct-proxy/createAccount?locale=en&source=https://www.opencccapply.net/SSOLogin/{idd}/false/en'.format(idd=id) | ||
|
||
|
||
self.urlxd = 'https://www.openccc.net/cccacct-proxy/createAccount?locale=en&source=https://www.opencccapply.net/SSOLogin/{idd}/false/en'.format(idd=id) | ||
|
||
self.url2 = 'https://www.openccc.net/f-vs-stand-I-hat-of-yout-ands-Banquoh-Cumberland?d=www.openccc.net' | ||
|
||
self.h2 = { | ||
'accept': 'application/json; charset=utf-8', | ||
'sec-ch-ua-mobile': '?0', | ||
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', | ||
'content-type': 'text/plain; charset=utf-8', | ||
'origin': 'https://www.openccc.net', | ||
'sec-fetch-site': 'same-origin' | ||
} | ||
|
||
self.url3 = 'https://www.openccc.net/uPortal/p/AccountCreation.ctf1/max/action.uP?pP_execution=e1s1' | ||
self.h3 = { | ||
'origin': 'https://www.openccc.net', | ||
'content-type': 'application/x-www-form-urlencoded', | ||
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', | ||
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', | ||
'sec-fetch-site': 'same-origin' | ||
} | ||
self.cookie = { | ||
'reese84': None | ||
} | ||
|
||
self.session = requests.Session() | ||
|
||
def getAuthToken(self): | ||
print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg + 'Fetching Token', end='') | ||
data = { | ||
'solution': { | ||
'interrogation': { | ||
'p': ''.join(random.choices(string.ascii_lowercase + string.digits, k=40)), | ||
'st': 1627823618, | ||
'sr': 9090987876, | ||
'cr': 678989098 | ||
}, | ||
'version': 'stable' | ||
}, | ||
'old_token': None, | ||
'error': None, | ||
'performance': { | ||
'interogation': 248 | ||
} | ||
} | ||
|
||
res = self.session.post(url=self.url, data=json.dumps(data), headers=self.h, verify=False) | ||
|
||
js = res.json() | ||
token = js['token'] | ||
self.cookie['reese84'] = token | ||
print(fg + ' (success)') | ||
return token | ||
|
||
def _tryHarder(self): | ||
token = self.getAuthToken() | ||
print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg + 'Fetching Cookies', end='') | ||
self.session.get(url=self.url1, cookies=self.cookie, headers=self.h, verify=False) | ||
print(fg + ' (success)') | ||
|
||
data2 = '"{tok}"'.format(tok=token) | ||
print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg + 'Sending Custom Fields and Token to Server', end='') | ||
resp = self.session.post(url=self.url2, data=data2, headers=self.h2, verify=False) | ||
print(fg + ' (success)') | ||
js = resp.json() | ||
print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg + 'Setting Incap Token', end='') | ||
token = js['token'] | ||
self.cookie['reese84'] = token | ||
print(fg + ' (success)') | ||
|
||
print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg + 'Sending Custom Cookies', end='') | ||
data3 = '_eventId_continue=&flowId=e1s1' | ||
resp3 = self.session.post(url=self.url3, data=data3, headers=self.h3, cookies=self.cookie, verify=False) | ||
print(fg + ' (success)') | ||
|
||
return resp3.url, self.session.cookies, token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters