Octoberfest7 / TeamsPhisher

Send phishing messages and attachments to Microsoft Teams users
998 stars 129 forks source link

Python script breaks on fetching bearer token #21

Open s1nglethr3ad opened 1 year ago

s1nglethr3ad commented 1 year ago

OS: Ubuntu 22 Python 3.10.6

Authenticating, verifying files, and uploading attachment

Reading target email list..................................................[+] SUCCESS!
Fetching Bearer token for Teams............................................Traceback (most recent call last):
  File "/home/user/TeamsPhisher/teamsphisher.py", line 688, in <module>
    bToken, skypeToken, sharepointToken, senderInfo = authenticate(args)
  File "/home/user/TeamsPhisher/teamsphisher.py", line 247, in authenticate
    bToken = getBearerToken(args.username, args.password, 'https://api.spaces.skype.com/.default')
  File "/home/user/TeamsPhisher/teamsphisher.py", line 144, in getBearerToken
    result = app.acquire_token_by_username_password(username, password, scopes=[scope])
  File "/home/user/.local/lib/python3.10/site-packages/msal/application.py", line 1610, in acquire_token_by_username_password
    response = _clean_up(self._acquire_token_by_username_password_federated(
  File "/home/user/.local/lib/python3.10/site-packages/msal/application.py", line 1637, in _acquire_token_by_username_password_federated
    wstrust_result = wst_send_request(
  File "/home/user/.local/lib/python3.10/site-packages/msal/wstrust_request.py", line 60, in send_request
    return parse_response(resp.text)
  File "/home/user/.local/lib/python3.10/site-packages/msal/wstrust_response.py", line 48, in parse_response
    error = parse_error(body)
  File "/home/user/.local/lib/python3.10/site-packages/msal/wstrust_response.py", line 52, in parse_error
    dom = ET.fromstring(body)
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1343, in XML
    return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 1, column 0

I do have masl installed

user@dumpster:~/TeamsPhisher$ pip3 install msal
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: msal in /home/user/.local/lib/python3.10/site-packages (1.22.0)
Requirement already satisfied: PyJWT[crypto]<3,>=1.0.0 in /home/user/.local/lib/python3.10/site-packages (from msal) (2.7.0)
Requirement already satisfied: cryptography<43,>=0.6 in /home/user/.local/lib/python3.10/site-packages (from msal) (39.0.2)
Requirement already satisfied: requests<3,>=2.0.0 in /home/user/.local/lib/python3.10/site-packages (from msal) (2.26.0)
Requirement already satisfied: cffi>=1.12 in /home/user/.local/lib/python3.10/site-packages (from cryptography<43,>=0.6->msal) (1.15.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests<3,>=2.0.0->msal) (1.26.5)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests<3,>=2.0.0->msal) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/user/.local/lib/python3.10/site-packages (from requests<3,>=2.0.0->msal) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests<3,>=2.0.0->msal) (2020.6.20)
Requirement already satisfied: pycparser in /home/user/.local/lib/python3.10/site-packages (from cffi>=1.12->cryptography<43,>=0.6->msal) (2.21)