RealmOsintEx


RealmOsintEx is an OSINT tool built with Elixir for querying Microsoft's GetUserRealm endpoint. It enables efficient investigation of a domain’s authentication configuration by constructing a standardized login using a fixed prefix ("username@") and a provided domain.


Overview

When querying Microsoft’s GetUserRealm endpoint, RealmOsintEx returns a map containing various keys that describe the authentication realm of the specified domain. The response structure can vary depending on the domain’s configuration, and you can generally expect one of two types:

Each key provides detailed insight into how authentication is handled for the domain, making RealmOsintEx a valuable addition to any OSINT toolkit.


Features


Installation

Add RealmOsintEx to your Elixir project by updating your mix.exs dependencies:

defp deps do
  [
    {:realm_osint_ex, "~> 0.1.0"}
  ]
end

Then fetch the dependencies:

mix deps.get

Usage

RealmOsintEx makes it easy to query the Microsoft GetUserRealm endpoint. For example, querying for example.com:

iex> RealmOsintEx.get_realm("example.com")
{:ok,
 %{
   "AuthNForwardType" => 1,
   "AuthURL" =>
     "https://sts.microsoftonline.com/Trust/2005/UsernameMixed?username=username%40example.com&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=",
   "CloudInstanceIssuerUri" => "urn:federation:MicrosoftOnline",
   "CloudInstanceName" => "microsoftonline.com",
   "DomainName" => "example.com",
   "FederationBrandName" => "test_test_06102020MM",
   "FederationGlobalVersion" => -1,
   "Login" => "username@example.com",
   "NameSpaceType" => "Federated",
   "State" => 3,
   "UserState" => 2
 }}

For unknown or managed domains, the returned map will mainly include minimal keys like "State", "UserState", "Login", and "NameSpaceType" (typically set to "Unknown").


Building and Running

  1. Create a New Project (if you haven't already):

    mix new realm_osint_ex
  2. Navigate into the Project Directory:

    cd realm_osint_ex
  3. Add and Fetch Dependencies:

    Update your mix.exs and run:

    mix deps.get
  4. Compile the Project:

    mix compile
  5. Start an Interactive Shell (IEx):

    iex -S mix
  6. Test the Module:

    At the IEx prompt, run:

    RealmOsintEx.get_realm("example.com")

If needed, you can build a release using:

mix release

Contributing

Contributions are welcome! Please open issues or submit pull requests if you find bugs, have feature requests, or would like to help improve RealmOsintEx.


License

RealmOsintEx is released under the BSD 3-Clause License. This license permits redistribution and use in source and binary forms, with or without modification, as long as the following conditions are met:

See the LICENSE file for the full text of the license.


RealmOsintEx provides a straightforward and efficient approach to integrating Microsoft's authentication realm discovery into your OSINT workflows. Enjoy exploring, investigating, and enhancing your domain intelligence capabilities with RealmOsintEx!