m365

package
v0.0.0-...-71e9fef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PROXY = "socks5://127.0.0.1:9050"

Functions

func CheckAutodiscover

func CheckAutodiscover(target string) error

func FindSharepointURL

func FindSharepointURL(env AutodiscoverEnvelope) (string, error)

func NewHTTPClient

func NewHTTPClient() (*http.Client, error)

func ParseTenantID

func ParseTenantID(tenant MicrosoftTenant) string

func PrintAutodiscoverEnvelope

func PrintAutodiscoverEnvelope(env AutodiscoverEnvelope)

func PrintIP

func PrintIP(ip IPQuery)

func PrintRealm

func PrintRealm(realm MicrosoftRealm)

func PrintTenant

func PrintTenant(tenant MicrosoftTenant)

Types

type AutodiscoverEnvelope

type AutodiscoverEnvelope struct {
	XMLName xml.Name `xml:"Envelope"`
	Header  struct {
		XMLName xml.Name `xml:"Header"`
		Action  struct {
			XMLName xml.Name `xml:"Action"`
			Must    string   `xml:"mustUnderstand,attr"`
			Text    string   `xml:",chardata"`
		} `xml:"Action"`
		ServerVersionInfo struct {
			XMLName xml.Name `xml:"ServerVersionInfo"`
			Major   int      `xml:"MajorVersion"`
			Minor   int      `xml:"MinorVersion"`
			MajorB  int      `xml:"MajorBuildNumber"`
			MinorB  int      `xml:"MinorBuildNumber"`
			Version string   `xml:"Version"`
		} `xml:"ServerVersionInfo"`
	} `xml:"Header"`
	Body struct {
		XMLName  xml.Name `xml:"Body"`
		Response struct {
			XMLName  xml.Name `xml:"GetFederationInformationResponseMessage"`
			Response struct {
				XMLName        xml.Name `xml:"Response"`
				ErrorCode      string   `xml:"ErrorCode"`
				ErrorMessage   string   `xml:"ErrorMessage"`
				ApplicationUri string   `xml:"ApplicationUri"`
				Domains        struct {
					XMLName xml.Name `xml:"Domains"`
					Domain  []string `xml:"Domain"`
				} `xml:"Domains"`
				TokenIssuers struct {
					XMLName     xml.Name `xml:"TokenIssuers"`
					TokenIssuer struct {
						XMLName  xml.Name `xml:"TokenIssuer"`
						Endpoint string   `xml:"Endpoint"`
						Uri      string   `xml:"Uri"`
					} `xml:"TokenIssuer"`
				} `xml:"TokenIssuers"`
			} `xml:"Response"`
		} `xml:"GetFederationInformationResponseMessage"`
	} `xml:"Body"`
}

func GetAutodiscoverInformation

func GetAutodiscoverInformation(domain string) (AutodiscoverEnvelope, error)

Get tenant domains

type IPQuery

type IPQuery struct {
	IP  string `json:"ip"`
	ISP struct {
		ASN string `json:"asn"`
		Org string `json:"org"`
		ISP string `json:"isp"`
	} `json:"isp"`
	Location struct {
		Country     string  `json:"country"`
		CountryCode string  `json:"country_code"`
		City        string  `json:"city"`
		State       string  `json:"state"`
		Zipcode     string  `json:"zipcode"`
		Latitude    float64 `json:"latitude"`
		Longitude   float64 `json:"longitude"`
		Timezone    string  `json:"timezone"`
		Localtime   string  `json:"localtime"`
	} `json:"location"`
	Risk struct {
		IsMobile     bool `json:"is_mobile"`
		IsVPN        bool `json:"is_vpn"`
		IsTor        bool `json:"is_tor"`
		IsProxy      bool `json:"is_proxy"`
		IsDatacenter bool `json:"is_datacenter"`
		RiskScore    int  `json:"risk_score"`
	} `json:"risk"`
}

func GetPublicIP

func GetPublicIP() (IPQuery, error)

type MicrosoftRealm

type MicrosoftRealm struct {
	State                   int    `json:"State"`
	UserState               int    `json:"UserState"`
	Login                   string `json:"Login"`
	NameSpaceType           string `json:"NameSpaceType"`
	DomainName              string `json:"DomainName"`
	FederationGlobalVersion int    `json:"FederationGlobalVersion"`
	AuthURL                 string `json:"AuthURL"`
	FederationBrandName     string `json:"FederationBrandName"`
	CloudInstanceName       string `json:"CloudInstanceName"`
	CloudInstanceIssuerUri  string `json:"CloudInstanceIssuerUri"`
}

func GetRealm

func GetRealm(domain string) (MicrosoftRealm, error)

type MicrosoftTenant

type MicrosoftTenant struct {
	TokenEndpoint                string   `json:"token_endpoint"`
	TokenEndpointAuthMethods     []string `json:"token_endpoint_auth_methods_supported"`
	JWKSURI                      string   `json:"jwks_uri"`
	ResponseModes                []string `json:"response_modes_supported"`
	SubjectTypes                 []string `json:"subject_types_supported"`
	IDTokenSigningAlgValues      []string `json:"id_token_signing_alg_values_supported"`
	ResponseTypes                []string `json:"response_types_supported"`
	Scopes                       []string `json:"scopes_supported"`
	Issuer                       string   `json:"issuer"`
	RequestURIParameterSupported bool     `json:"request_uri_parameter_supported"`
	UserInfoEndpoint             string   `json:"userinfo_endpoint"`
	AuthorizationEndpoint        string   `json:"authorization_endpoint"`
	DeviceAuthorizationEndpoint  string   `json:"device_authorization_endpoint"`
	HTTPLogoutSupported          bool     `json:"http_logout_supported"`
	FrontChannelLogoutSupported  bool     `json:"frontchannel_logout_supported"`
	EndSessionEndpoint           string   `json:"end_session_endpoint"`
	ClaimsSupported              []string `json:"claims_supported"`
	KerberosEndpoint             string   `json:"kerberos_endpoint"`
	TenantRegionScope            string   `json:"tenant_region_scope"`
	TenantRegionSubScope         string   `json:"tenant_region_sub_scope"`
	CloudInstanceName            string   `json:"cloud_instance_name"`
	CloudGraphHostName           string   `json:"cloud_graph_host_name"`
	MSGraphHost                  string   `json:"msgraph_host"`
	RBACURL                      string   `json:"rbac_url"`
}

func GetTenantInfo

func GetTenantInfo(domain string) (MicrosoftTenant, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL