Skip to content

Commit 6c4e768

Browse files
author
Etienne Stalmans
committed
fix a bug where --send and forms wasn't working if you used --config. added --raw to allow raw vbscript
1 parent b138f0b commit 6c4e768

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ ruler
2828
logs/
2929

3030
build.sh
31+
config.yml

mapi/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,5 @@ var PidTag6B00 = PropertyTag{PtypString8, 0x6B00}
607607
var PidTag6902 = PropertyTag{0x001E, 0x6902}
608608
var PidTag6900 = PropertyTag{0x0003, 0x6900}
609609
var PidTagComment = PropertyTag{PtypString, 0x3004}
610+
611+
var PidTagSenderEntryId = PropertyTag{PtypBinary, 0x0C19}

rpc-http/rpctransport.go

+2
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ func DoConnectExRequest(MAPI []byte, auxLen uint32) ([]byte, error) {
388388
//decrypt response PDU
389389
if AuthSession.RPCNetworkAuthLevel == RPC_C_AUTHN_LEVEL_PKT_PRIVACY {
390390
dec, _ := rpcntlmsession.UnSeal(resp.PDU[8:])
391+
fmt.Println(string(dec))
391392
AuthSession.ContextHandle = dec[4:20] //decrypted
392393
} else {
393394
AuthSession.ContextHandle = resp.PDU[12:28]
@@ -552,6 +553,7 @@ func RPCRead(callID int) (RPCResponse, error) {
552553
for k, v := range httpResponses {
553554
st := string(v)
554555
if er := strings.Split(strings.Split(st, "\r\n")[0], " "); er[1] != "200" {
556+
utils.Debug.Println(st)
555557
return RPCResponse{}, fmt.Errorf("Invalid HTTP response: %s", er)
556558
}
557559
httpResponses = append(httpResponses[:k], httpResponses[k+1:]...)

ruler.go

+14-4
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,14 @@ func createForm(c *cli.Context) error {
580580
if err := forms.CreateFormAttachmentPointer(folderid, msgid); err != nil {
581581
return err
582582
}
583-
if err := forms.CreateFormAttachmentTemplate(folderid, msgid, command); err != nil {
584-
return err
583+
if c.Bool("raw") == true {
584+
if err := forms.CreateFormAttachmentForDeleteTemplate(folderid, msgid, command); err != nil {
585+
return err
586+
}
587+
} else {
588+
if err := forms.CreateFormAttachmentTemplate(folderid, msgid, command); err != nil {
589+
return err
590+
}
585591
}
586592
utils.Info.Println("Form created successfully")
587593

@@ -614,7 +620,7 @@ func triggerForm(c *cli.Context) error {
614620
body := c.String("body")
615621
suffix := c.String("suffix")
616622
folderid := mapi.AuthSession.Folderids[mapi.INBOX]
617-
target := c.GlobalString("email")
623+
target := mapi.AuthSession.Email
618624

619625
utils.Trace.Println("Creating Trigger message.")
620626
msgid, err := forms.CreateFormTriggerMessage(suffix, subject, body)
@@ -759,7 +765,7 @@ A tool by @_staaldraad from @sensepost to abuse Exchange Services.`
759765
} else if c.Bool("debug") == true {
760766
utils.Init(os.Stdout, os.Stdout, os.Stdout, os.Stderr)
761767
} else {
762-
utils.Init(ioutil.Discard, os.Stdout, os.Stdout, os.Stderr)
768+
utils.Init(ioutil.Discard, os.Stdout, ioutil.Discard, os.Stderr)
763769
}
764770
return nil
765771
}
@@ -1031,6 +1037,10 @@ A tool by @_staaldraad from @sensepost to abuse Exchange Services.`
10311037
Name: "send,s",
10321038
Usage: "Trigger the form once it's been created.",
10331039
},
1040+
cli.BoolFlag{
1041+
Name: "raw",
1042+
Usage: "Use a blank template allowing Raw VBScript.",
1043+
},
10341044
cli.BoolFlag{
10351045
Name: "rule,r",
10361046
Usage: "Trigger the form with a rule. This will add a new rule!",

0 commit comments

Comments
 (0)