The Most/Recent Articles

Showing posts with label owa. Show all posts
Showing posts with label owa. Show all posts
owa

Daily Blog #418: Exploring Extended MAPI Part 19

Exploring Extended MAPI Part 19 by David Cowen - Hacking Exposed Computer Forensics Blog



Hello Reader,
         Since my last test that showed that the Extended MAPI data wasn't be updated when I modified a message in OWA in my local outlook client I've been testing ways to get this updated data.

First I tried to download my mailbox, but apparently I need to get a working EWS url first. So I'll try that again tomorrow.

Second I went into the compliance center and searched for and found my test message I've been experimenting with. In doing this I downloaded the original message in EML format (the only option given) and I still did not find the updated extended MAPI data as seen below:

Exploring Extended MAPI Part 19 by David Cowen - Hacking Exposed Computer Forensics Blog

Here the Last Modification time got set to when I downloaded the message from Compliance Center and the original submission time exists. But I have no Last Verb time or code showing this message was replied too.

Third I emailed myself the message in OWA as an attachment by drag and dropping the message into a new email, this actually put the message as a MSG attached to the email message. Once I accessed this within Outlook in my local system I was able to see the expected data:

Exploring Extended MAPI Part 19 by David Cowen - Hacking Exposed Computer Forensics Blog


Here you can see that we finally have the expected Last Verb time showing when the message was replied to and when it was replied to. The Last Modification has been updated to reflect when I sent the message to myself as an attachment.


So I now need to download the mailbox fresh and then look into my local outlook account to see if this data has finally been updated.


This is a 19-part series on Exploring Extended MAPI. You can find the rest of the posts here. 
owa

Daily Blog #414: Exploring Extended MAPI Part 18

Exploring Extended MAPI Part 18 by David Cowen - Hacking Exposed Computer Forensics Blog



Hello Reader,
         I'm in the BKK airport heading to Phuket today in my continued adventures. Got here nice and early so now I'm at the gate writing a blog post! After my last post I'm very curious now about what other actions I take in OWA will effect my already downloaded Outlook mail. So to get a base line I'm doing something that I think will for sure modify the message on both sides, I'm reply to the message.

In my initial testing, replying to a message in OWA for a message I sent through Outlook connected to the same account, I brought up the original message and inspected the Extended MAPI to find there was No Change!

Meaning that the message wasn't marked a replied to and within outlook it didn't recognize the conversation thread within the message. Something very interesting is happening.

I'm going to attempt to restart Outlook and see if I can get it resync everything but this certainly changes how I'm going to have to approach these investigations. I need to start pulling the data from exchange directly to see if doing that will update the metadata.


This is a 19-part series on Exploring Extended MAPI. You can find the rest of the posts here. 
owa

Using OWA logs to make your Civil Case

Using OWA logs to make your Civil Case by David Cowen - Hacking Exposed Computer Forensics Blog

Hello Readers,

I will not be talking about OWA every time.

In our prior time together we discussed parsing OWA logs to determine who has been accessing someone else's account. For criminal prosecution (unauthorized access) or internal investigations this might be enough, but for investigations involving the civil court system you need to show that the information accessed and the time they accessed it corresponds to some claim such as tortuous interference.

The same OWA logs we looked at last time will allow you to do this, with some caveats. When you see a single entry to access an item such as:

" /exchange/USA/Attach/read.asp?obj=000000007C6A5AC4439BD948B2EDEC2B4701083907007DC649E6901ED711982E0002B3A2389C000000C0411400007DC649E6901ED711982E0002B3A2389C0000013340B20000&att=ATT-0-C9D9D5C63632DD439C1AF3C6A4B4AF8A-TOD9D1%7E1.PPT"

This is a request to open up an email attachment, the obj show here in the query is a unique identifier for the item within the exchange database. This means that if you replay that url while, and this is important, logged in as that user you will be able to bring up the exact same message that was viewed at that time (If it was not deleted). 


If you attempt to access this object while logged in as any other user it will deny you, even if you login as the administrator. If you want to make sure the messages exist (meaning not deleted) restore the exchange server from a backup tape referring to the time period the message we viewed and replay it to the restored server. 

These are the following asp pages that can be called by an OWA user according to about two years worth of logs from one case I worked:

/exchange/USA/LogonFrm.asp

/exchange/USA/root.asp

/exchange/USA/Navbar/nbInbox.asp

/exchange/USA/inbox/main_fr.asp

/exchange/USA/inbox/peerfldr.asp

/exchange/USA/inbox/title.asp

/exchange/USA/inbox/messages.asp

/exchange/USA/inbox/commands.asp

/exchange/USA/forms/IPM/NOTE/frmRoot.asp

/exchange/USA/forms/IPM/NOTE/read.asp    

/exchange/USA/logoff.asp

/exchange/USA/Attach/read.asp

/exchange/USA/logon.asp

/exchange/USA/forms/IPM/NOTE/commands.asp

/exchange/USA/forms/IPM/NOTE/cmpTitle.asp

/exchange/USA/forms/IPM/NOTE/cmpMsg.asp

/exchange/USA/errinbox.asp

/exchange/USA/forms/IPM/SCHEDULE/MEETING/RESP/frmRoot.asp

/exchange/USA/forms/IPM/SCHEDULE/MEETING/RESP/read.asp

/exchange/USA/forms/IPM/SCHEDULE/MEETING/RESP/commands.asp

/exchange/USA/options/set.asp

/exchange/USA/calendar/main_fr.asp

/exchange/USA/calendar/title.asp

/exchange/USA/calendar/events.asp

/exchange/USA/calendar/appts.asp

/exchange/USA/calendar/pick.asp

/exchange/USA/forms/IPM/SCHEDULE/MEETING/REQUEST/frmRoot.asp

/exchange/USA/forms/IPM/SCHEDULE/MEETING/REQUEST/mrread.asp

/exchange/USA/forms/IPM/SCHEDULE/MEETING/REQUEST/commands.asp

/exchange/USA/contacts/main_fr.asp

/exchange/USA/contacts/title.asp

/exchange/USA/contacts/peerfldr.asp

/exchange/USA/contacts/messages.asp

/exchange/USA/contacts/commands.asp

/exchange/USA/finduser/root.asp

/exchange/USA/finduser/fumid.asp

/exchange/USA/finduser/fumsgdef.asp

/exchange/USA/finduser/fumsg.asp

/exchange/USA/finduser/details.asp

/exchange/USA/forms/REPORT/DR/frmRoot.asp

/exchange/USA/tshoot.asp

 

Of these we care about the following:


This is a user logging in - /exchange/USA/LogonFrm.asp

This is a user requesting to read a specific message - /exchange/USA/forms/IPM/NOTE/read.asp

This is a user opening an attachment - /exchange/USA/Attach/read.asp

This is a user composing a new message - /exchange/USA/forms/IPM/NOTE/cmpMsg.asp

This is a user reading a message request - /exchange/USA/forms/IPM/SCHEDULE/MEETING/REQUEST/mrread.asp

If you parsed our just these commands identified by the logged in user you could see what specific emails, meetings, and attachments a webmail user had viewed, created, sent using OWA and the time on which they did. Using these times and matching the ip address to the suspect you can then combine the information accessed, to the time it was accessed, to the benefit they received by having that information at that time. 

As an example, in the case Exel Transporation Services Inc v. Total Transportation Services LLC et al (3:06-cv-00593) I used this to uncover a large industrial espionage case. First I used the program in the prior post to find which accounts were being used to access other email accounts in the system. 


Then I looked up the IP Addresses and found out one of them was actually registered to one of the ex-executives of exel directly on ARIN. We then broke out just the accesses used by those accounts (I mean really why else would the blackberry server administrative account or the voicemail server be logging into a website .. something we had to explain to counsel) into a database divided up by type of item accessed (email, attachment, calendar).


The next part was more difficult, we had to replicate their exchange network, AD controller, etc.. to restore their exchange server backups and replay those months to find out what our suspects were viewing. This included almost every decision maker within exel and according to the filings I read about $120 million dollars in lost business as they were able to read the contracts sent to customers during a bidding process and always beat them. 


We fed the urls into a GUI automation tool that would interact with the web browser and save the emails and attachments into MHT (full website archive) files for the lawyers review. I couldn't within the time frame get a pure perl program to work the way I needed it to.


For more information read this news article:

http://www.bizjournals.com/memphis/stories/2006/08/21/daily30.html


 

The case was settled out of court with a public apology written by TTS. The final stone in my understanding that led to settlement was when we matched the TTS OWA logs to the Exel OWA logs and showed the suspects logged into the TTS server with their real user name, with the same ip and at the same date/time, as they were logged into the Exel OWA server with their administrative accounts.

I hope this was useful, I can post parsers I wrote if you think it would help you in the future.

Don't miss out on: Outlook Web Access Log Analysis

Outlook Web Access Log Analysis

Outlook Web Access Log Analysis by David Cowen - Hacking Exposed Computer Forensics Blog

Hello Reader,

In this post, I’d like to discuss log analysis on Outlook Web Access servers. I’ve successfully used OWA log analysis in the past to quickly determine who has been reading mailboxes other than their own. Two pieces of information in the logs that exist by default in the OWA creation process allow this to occur. 

The first is that OWA uses NTLM authentication for web mail users who log in and the domain and username authenticated is stored in the logs in the cs-username field with format “domain\username”, remember this field will only be populated if the user successfully authenticated otherwise it will be filled with “-“. The second is that the mailbox accessed is stored in the cs-uri-query field in the logs and will look something like “isnewwindow=0&mailbox=username”. By comparing the authenticated NTLM username to the username of the mailbox requested we can write some pretty easy code to determine who has been accessing the mailboxes of other users, or attempting to.

First things first, we need the OWA logs themselves. They should be located in the “%systemroot%\system32\logfiles” directory usually in W3SVC1 if it’s the first default web created. Once we have them we need to either copy or export the log files in that directory from the image. Our first bit of code reads the content of the directory:


opendir(IMD, $dirtoget) die("Cannot open directory");
@thefiles=
readdir(IMD);
closedir(IMD);

foreach $file
(@thefiles)
{

print "my file: $file\n";
open(FILE, "$file");
}
Next we need to do something with these files. We want to parse each line looking for people accessing mailboxes:

while(FILEHANDLE)
{

if ($_ =~ m/^([0-9\-]+
[0-9:]+) ([0-9.]+) ([^ ]+) [^ ]+ [^ ]+ [0-9.]+
[0-9]+ (GETPOST) ([^ ]+)
isnewwindow=0&mailbox=([^ ]+) ([1-3][0-9][0-9]) [0-9] [0-9]+ [0-9]+
[0-
9]+ HTTP.+ [^ ]+ ([^ ]+) ([^ ]+) (.+)$/i)

{
my ($access, $ip, $username, $method, $url, $query,
$status,
$useragent, $cookie, $referer) = ($1, $2, $3, $4, $5, $6, $7, $8,
$9,
$10);
}

Next we want to see if the username they have authenticated with matches the username of the mailbox they have requested. If it does, move on and print a . to the screen so we can see some activity. If it does not print a ! to the screen and write the resulting access to a separate file.

if ($username !~ m/$query/i )

{

print OUTFILE "$access, $ip, $username, $query,
$status\n";

print "!";

}

else

{



print
".";

}

We can also store a unique list of these users in a hash so we can get a list of offenders to review. Additionally you could store all of this in a database table in larger cases so you can begin to run queries in time periods, users affected and start breaking out what messages, attachments, tasks and calendar items have been accessed.

I have posted the raw perl code and the windows compiled executable for this. For the windows executable I made it just search the same directory the executable is in, so just copy it into the directory with the logs and run it. Load up the report.csv file and find out who your suspects are.