Giter Club home page Giter Club logo

Comments (6)

Octoberfest7 avatar Octoberfest7 commented on July 17, 2024

401 means "Unauthorized"... Which is strange given you successfully retrieved the SharePoint token.

at line 326 in the program there is this:

    # Seem to have seen both of these codes for file uploads...
    if content.status_code != 201 and content.status_code != 200:
        p_err("Error uploading file: %d" % (content.status_code), True)

make it look like this and re-run it in order to see the headers and body of the error

    # Seem to have seen both of these codes for file uploads...
    if content.status_code != 201 and content.status_code != 200:
        p_err("Error uploading file: %d" % (content.status_code), True)
        print(content.headers)
        print(content.text)

from teamsphisher.

DarknightCanada avatar DarknightCanada commented on July 17, 2024

Same! Do not want to take much of your time but plz if you think of any other way to troubleshoot it let me know please. FYI! I can manually upload files on sharepoint
`Authenticating, verifying files, and uploading attachment

Reading target email list..................................................[+] SUCCESS!
Fetching Bearer token for Teams............................................[+] SUCCESS!
Fetching Skype token.......................................................[+] SUCCESS!
Fetching sender info.......................................................[+] SUCCESS!
Fetching Bearer token for SharePoint.......................................[+] SUCCESS!
Uploading file: .\README.MD................................................[-] Error uploading file: 401`

from teamsphisher.

Octoberfest7 avatar Octoberfest7 commented on July 17, 2024

My bad, make it look like this:

    # Seem to have seen both of these codes for file uploads...
    if content.status_code != 201 and content.status_code != 200:
        print(content.headers)
        print(content.text)
        p_err("Error uploading file: %d" % (content.status_code), True)

The way I had you do it before made the program exit before it printed the headres and text

from teamsphisher.

DarknightCanada avatar DarknightCanada commented on July 17, 2024

Same thing dude! I am going to play with the python script to see if I can get it to work! thanks for taking the time to respond

`Configuration:

[-] Sending file link that is accessible by anyone with the link
[-] No delay between messages
[+] Using greeting: Hi, --personalize greeting: Hi ,
[-] Not logging TeamsPhisher output

Operational mode: Sending phishing messages to targets!

Time left to abort: 00

Authenticating, verifying files, and uploading attachment

Reading target email list..................................................[+] SUCCESS!
Fetching Bearer token for Teams............................................[+] SUCCESS!
Fetching Skype token.......................................................[+] SUCCESS!
Fetching sender info.......................................................[+] SUCCESS!
Fetching Bearer token for SharePoint.......................................[+] SUCCESS!
Uploading file: .\README.MD................................................[-] Error uploading file: 401`

from teamsphisher.

Octoberfest7 avatar Octoberfest7 commented on July 17, 2024

You still got no output? As a sanity check, add a prefix to the print statements so you can be sure they are actually executing

# Seem to have seen both of these codes for file uploads...
if content.status_code != 201 and content.status_code != 200:
    print("failed headers: " + str(content.headers))
    print("failed body: " + str(content.text))
    p_err("Error uploading file: %d" % (content.status_code), True)

from teamsphisher.

Octoberfest7 avatar Octoberfest7 commented on July 17, 2024

The issue in this case was that when the user created their AAD tenant they gave the tenant a different 'Organization Name' than their 'Initial Domain Name' like in the below screenshot:

image

I truthfully didn't know/remember that there were two separate fields there or that someone might make them different. TeamsPhisher uses the 'tenantName' property to resolve the Sharepoint address, so in this case it was looking for Sharepoint at 'myorgname-my.sharepoint.com...' when it really lives at 'myorgnameiscool-my.sharepoint.com'

This has been fixed by now resolving the 'tenantName' by splitting out the domain name from the UPN e.g. '[email protected]' would return 'mycoolorg' as the 'tenantName' field for subsequent use.

User was able to resolve this by going to AAD -> Properties and renaming their tenant to match the domain name.

from teamsphisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.