You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Etienne Stalmans edited this page Feb 19, 2021
·
7 revisions
Getting Started
Ruler works with both RPC/HTTP and MAPI/HTTP. Ruler favours MAPI/HTTP as this is the default in Exchange 2016 and Office365 deployments. If MAPI/HTTP fails, an attempt will be made to use RPC/HTTP. You can also force RPC/HTTP by supplying the --rpc flag.
Exchange and Outlook Support
Ruler has been tested against the following systems:
The easiest way to use Ruler is through the pre-built binaries. These are kept up to date, as far as possible, and can be found in the [Releases].
Getting the Code
Ruler is written in Go so you'll need to have Go setup to run/build the project from source. The easiest way to get up and running from source is through go get.
Get it through Go, make sure you have go modules support:
GO111MODULE=on go get github.com/sensepost/ruler
You can now run the app through go run in the GOPATH/src/github.com/sensepost/ruler directory:
The first step as always is to clone the repo. Here it is probably best to clone into $GOPATH/src/github.com/sensepost/ruler this saves you from having to change a whole bunch of paths. If you are cloning into a different directory, remember you'll need to change all references to github.com/sensepost/ruler in the imports.
git clone https://github.com/sensepost/ruler.git
Ensure you have the dependencies (go get is the easiest option, otherwise clone the repos into your GOPATH):
go get github.com/urfave/cli
go get github.com/howeyc/gopass
go get gopkg.in/yaml.v2
go get github.com/staaldraad/go-ntlm/ntlm
Then build it
go build
If building on a different branch from master, please see this entry about ensuring you have the correct branch/version.
Interacting with Exchange
Ruler works with both RPC/HTTP and MAPI/HTTP. Ruler favours MAPI/HTTP as this is the default in Exchange 2016 and Office365 deployments. If MAPI/HTTP fails, an attempt will be made to use RPC/HTTP. You can also force RPC/HTTP by supplying the --rpc flag.
As mentioned before there are multiple functions to Ruler. In most cases you'll want to first find a set of valid credentials. Do this however you wish, Phishing, Wifi+Mana or brute-force.
Basic Usage
Ruler has 8 basic commands, these are:
display -- list all the current rules
add -- add a rule
delete -- delete a rule
brute -- brute force credentials
send -- send an email to trigger the shell
abk -- interact with the GAL (MAPI/HTTP only)
form -- script execution through custom forms
help -- show the help screen
There are a few global flags that should be used with most commands, while each command has sub-flags. For details on these, use the help command.
There are a number of global options, that are required for most uses of Ruler. These are set before the COMMAND you wish to execute. Think of these as the configuration values that Ruler needs to actually function, credentials etc.
The local options are specific to the command you are executing. These come after the COMMAND and control the different features exposed by a command.
To view the global options: ./ruler --help
To view the local options: ./ruler command --help
The config file
Ruler allows you to supply data via the config file. This allows you to supply values for instances where Exchange may not be exposing the Autodiscover service.
The fields such as email, username, can be left blank, as these can be supplied through the global flags.
Using the config file is simple, just pass the config file location as a global option: