Showing posts with label ccSubSDK. Show all posts
Showing posts with label ccSubSDK. Show all posts

Monday, May 3, 2021

SEPparser Released

What is SEPparser?

SEPparser is a command line tool examine artifacts from Symantec Endpoint Protection (SEP). SEPparser can be ran against a single file, directory, dead box system (write-blocked hard drive of mounted collection), or for live response.


Capabilities

  • Parse settings for log files
  • Parse the following log files:
    • Security log
    • System log
    • Firewall Traffic log
    • Firewall Packet log
    • Application and Device Control log
    • AV Management plugin log
    • Daily AV logs
  • Extract packets from Firewall Packet log
  • Parse ccSubSDK database into csv reports
  • Extract potential binary blobs from ccSubSDK
  • Parse VBN files into csv reports
  • Extract quarantine data to file or hex dump
  • Preform hex dump of VBN for research

Using SEPparser

SEPparser can be ran on Windows or Linux. Running SEPparser by itself shows all the available options.



















There are quite a few options, but it is straight forward to use.


Basic usage

To run SEPparser, all you need to do is point it to a file (-f) or a directory (-d) and SEPparser will take care of the rest. Output will be stored in the current directory SEPparser is ran from. This can be changed using OUTPUT (-o) option.



















But what if we don't know the location of the Symantec files? The -d option can be used at the base directory and all files will be scanned from that path recursively. To speed up the process, or if we are using a script, we can use KAPE mode (-k) in conjunction with -d. What this does is SEPparser will only scan files in locations where SEP data is stored instead of every file.

If we want to append data to output files that SEPparser already created, the append (-a) option can be used.

Once SEPparser is finished a series of csv files will be created.













Time Zones

Some of the time stamps in SEP's data are in UTC and others are recorded in the time zone set on the device they came from. There are a couple of ways to get all the time stamps to be in UTC.  

  1. If the registrationInfo.xml file is found during the scan; the offset will be automatically applied.
  2. The -r option can be used to point to the location of the registrationInfo.xml file so the offset can be automatically applied.
  3. The -tz option can be used to manually enter a time zone offset.


Logging

SEPparser has a logging feature (-l) that can be used to save the console output to a log file. This can be useful to check for errors during parsing. If an error occurred, the -v option can be used to get a more verbose output of what went wrong.


Quarantine Files (VBN)

When it comes to quarantine files, SEPparser has some additional features that can be useful.  

SEPparser has the ability to extract (-e) the quarantined data or it can dump the data to the console in hex format with the -qd option.
















SEPparser can also produce a hex dump of the VBN itself. While SEPparser does a rather excellent job of parsing VBN's into the csv report, there is still data that it cannot. There are some parts of the VBN format that are unknown. The hex dump can help researchers to understand and figure out what these unknown parts of the file format mean.










SEPparser also contains hash-file (-hf) option. This can be used when parsing VBN files for reports. Because there can be extra data in the VBN file, the hash reported is not always the hash of the actual file. With the -hf option, SEPparser will record the MD5, SHA1, and SHA256 of the actual quarantined data.


ccSubSDK Database

SEPparser has an extract-blob (-eb) option that can be used when parsing the ccSubSDK database. With this option enabled, SEPparser will extract anything that could be an executable contained in the ccSubSDK database.















Packets

SEPparser has one more trick up its sleeve. When parsing the raw.log (packet log), SEPparser will extract the packets from the log into a text file. This text file can then be loaded into a tool, like Wireshark, to examine the packets. SEP only captures the headers and not the data associated with it.







































There is a public GitHub repository, located at https://github.com/Beercow/SEPparser, containing SEPparser and a wiki with the file formats for the SEP artifacts. KAPE also includes targets and modules for Symantec Endpoint Protection and SEPparser. If you find any errors or would like to contribute, issues/pull requests are always welcome. 

Tuesday, March 23, 2021

Your AV is Trying to Tell You Something: Submission Engine

ccSubSDK

"Symantec Endpoint Protection clients automatically submit pseudonymous information about detections, network, and configuration to Symantec Security Response. Symantec uses this pseudonymous information to address new and changing threats as well as to improve product performance. Pseudonymous data is not directly identified with a particular user.

The detection information that clients send includes information about antivirus detections, intrusion prevention, SONAR, and file reputation detections." [1]

These files can be found at the following location: C:\ProgramData\Symantec\Symantec Endpoint Protection\CurrentVersion\Data\CmnClnt\ccSubSDK

Inside this folder is the submissions.idx file and series of GUID files. Lets look at the submissions.idx file first.

ccSubSDK folder structure














submissions.idx

The submissions.idx file appears to be a type of index for the GUID files. Symantec had a database and word processing software called Q&A form 1985-1998. It just so happens that one of the database extensions was idx. My hypothesis is Symantec is either using their old database format, or parts of it, to index and send submission data back to their servers.

The format of the file is fairly simple. It contains a header and a series of indexed data that points back the GUID files. The header starts with 0x3216144C and contains the size of the submissions.idx file. After the header comes the indexes.







Each index contains a header starting with 0x4099C689. This header contains information on the offset of the current and previous index, the size of the data, and the Blowfish key to decrypt the data. Once the data is decrypted, we can see the information that it contains.







The data is in the same ASN.1 format that the VBN files use. If we start following the tags, the first 0x0F we come to is the name of the GUID file this index references.

GUID in index




GUID file in ccSubSDK







Depending on what type of submission it is, the index will contain information like MD5, SHA256 and some type of report.





















{GUID} file

The GUID files hold the information that was submitted to Symantec. The file consists of three parts: the GUID for the dll responsible for the submission, Blowfish key, and the data encrypted with the Blowfish algorithm.








The following dll GUID's have been identified.

  • 2B5CA624B61E3F408B994BF679001DC2 = BHSvcPlg
  • 334FC1F5F2DA574E9BE8A16049417506 = SubmissionsEim
  • 38ACED4CA8B2134D83ED4D35F94338BD = SubmissionsEim
  • 5E6E81A4A77338449805BB2B7AB12FB4 = AtpiEim, ReportSubmission
  • 6AB68FC93C09E744B828A598179EFC83 = IDSxpx86
  • 95AAE6FD76558D439889B9D02BE0B850 = IDSxpx86
  • 6A007A980A5B0A48BDFC4D887AEACAB0 = IDSxpx86
  • D40650BD02FDE745889CB15F0693C770 = IDSxpx86
  • 3DC1B6DEBAE889458213D8B252C465FC = IDSxpx86
  • 8EF95B94E971E842BAC952B02E79FB74 = AVModule
  • A72BBCC1E52A39418B8BB591BDD9AE76 = RepMgtTim
  • F2ECB3F7D763AE4DB49322CF763FC270 = ccSubEng

Once the submission has been decrypted, we can look at the data. This can hold anything from the detection information, network data, attack data, detection digest, and even the file itself!

Information was derived from @hexicorn
ccSubSDK.md

submissions.idx

Offset Length Field Description
0 4 Header Always 0x3216144C
4 4 Unknown Will require further investigation as to the purpose of this entry.
8 4 Size Size of submissions.idx
12 4 Unknown Will require further investigation as to the purpose of this entry.
16 4 Unknown Will require further investigation as to the purpose of this entry.
20 8 Unknown Will require further investigation as to the purpose of this entry.
28 20 Unknown Will require further investigation as to the purpose of this entry.

Index

Continues to end of file.

Offset Length Field Description
0 4 Header Always 0x4099C689
4 4 Unknown Will require further investigation as to the purpose of this entry.
8 8 Start of Index Offset to begining of Index
16 8 Start of Last Index Offset to begining of previous Index
24 4 Lenght 1 Total size of Data including Blowfish Key
28 4 Lenght 2 Actual size of Data including Blowfish Key
*If length is 0, record is deleted.
32 8 Unknown Will require further investigation as to the purpose of this entry.
40 16 Blowfish Key Symmetric-key for Blowfish
56 Length 1 - 16 Data Data appears to be in ASN.1 format. It is comprised of a series of tags.
Code Value Length Extra Data
0x01 1 None
0x0A 1 None
0x03 4 None
0x06 4 None
0x04 8 None
0x07 4 NUL-terminated ASCII String (of length controlled by dword following 0x07 code)
0x08 4 NUL-terminated Unicode String (of length controlled by dword following 0x08 code)
0x09 4 Container (of length controlled by dword following 0x09 code)
0x0F 16 None
0x10 16 None

{GUID} Files

{GUID} files can be found in the following location: C:\ProgramData\Symantec\Symantec Endpoint Protection\CurrentVersion\Data\CmnClnt\ccSubSDK\{GUID}

Offset Length Field Description
0 16 GUID GUID of dll responsible for submission.
16 16 Blowfish Key Symmetric-key for Blowfish
32 varies Data Data appears to be in ASN.1 format. It is comprised of a series of tags.
Code Value Length Extra Data
0x01 1 None
0x0A 1 None
0x03 4 None
0x06 4 None
0x04 8 None
0x07 4 NUL-terminated ASCII String (of length controlled by dword following 0x07 code)
0x08 4 NUL-terminated Unicode String (of length controlled by dword following 0x08 code)
0x09 4 Container (of length controlled by dword following 0x09 code)
0x0F 16 None
0x10 16 None