Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Chrome Cache Parser #1568

Closed
felipecampanini opened this issue Mar 6, 2023 · 9 comments · Fixed by #1859
Closed

Google Chrome Cache Parser #1568

felipecampanini opened this issue Mar 6, 2023 · 9 comments · Fixed by #1859
Assignees

Comments

@felipecampanini
Copy link
Contributor

Change Discord Parser to interpret Google Chrome browser cached data

@lfcnassif
Copy link
Member

Thanks @felipecampanini. Wouldn't it be better to create another parser? Or is there a lot of code that could be reused?

@felipecampanini
Copy link
Contributor Author

So, the 4 classes of the "iped.parsers.discord.cache" package will be common to both parsers. The classes in "iped.parsers.discord.json" and "iped.parsers.discord" can be used by Chrome cache parser if chats are found in Google Chrome cache.

Since the parser code will change a lot, I thought of:

1 - Develop a new class for the parser, called ChromeCacheParser, which would be in the "iped.parsers.browsers.chrome" package.

2 - Move the classes from the "iped.parsers.discord.cache" package to "iped.parsers.browsers.cache", since the cache structure is used by several tools.

I've had to change the Index, CacheAddr, and CacheEntry classes so far, so I'll need to retest Discord's parser.

If you can give your opinion, I appreciate it.

@lfcnassif
Copy link
Member

Seems very good to me!

@felipecampanini
Copy link
Contributor Author

felipecampanini commented May 17, 2023

Hi @lfcnassif, I have some changes to send.

Some things were a little different from what I had commented above:

The "ChromeCacheParser" class was created, it is the old "DiscordParser", it receives the Index files with mime "application/x-discord-index" and "application/x-chrome-cache-index", since the structure of caching is the same. I treated the two mimes in the same class since in the discord cache, for example, there may be several files, however, no chat. Therefore, I thought of treating both caches in this class, so as not to have code duplication.

The "DiscordParser" class now only handles chats. Perhaps a more suitable name would be "DiscordChatParser".

An important correction was made with performance improvement and disk usage in the CacheAddr class, now it returns the InputStream of exactly the necessary size.

I would have sent the changes today, however, when I renamed the classes, the parser stopped working. I recorded the parser's new name in "ParserConfig.xml", in addition to the automatic changes that were made in the GraphTask, HtmlLinkViewer, QueuesProcessingOrder and ReferencedFileViewer classes.

Do you have any idea which file is missing to update with the new parser name? If you can give your opinion on these changes I would appreciate it.

I didn't change the "RefineCategoryTask.js" file, it's still like this:

if(mime.equals("application/x-chrome-cache-index") && path.contains("/appdata/roaming/discord")){ if(e.getPath().toLowerCase().contains("gpucache")){ e.setMediaTypeStr("application/x-discord-gpucache-index"); } else { e.setMediaTypeStr("application/x-discord-index"); } }

ParserConfig.xml:
... <parser class="iped.parsers.python.PythonParser"></parser> <parser class="iped.parsers.mail.win10.Win10MailParser"></parser> <parser class="iped.parsers.browsers.chrome.ChromeCacheParser"></parser> ...

@lfcnassif
Copy link
Member

Hi @felipecampanini, sorry for the late reply. I'm not sure if we should rename the parser, as it is a breaking API change and can break some profiles created by users. So I think it would be better to keep the name as is for now and put some TODO in the class description explaining it.

@felipecampanini
Copy link
Contributor Author

Got it, didn't know. I'll keep it as it is then. Thanks!

felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
Performance improvement and disk usage in the CacheAddr class, now it
returns the InputStream of exactly the necessary size.
felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
Suitability for using the corrected getInputStream method of the
CacheAddr class
felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
The DiscordParser class is now able to parse any cache that has the
Google Chrome cache structure, and all of its subitems. When a cached
Discord chat file is found, the original JSON file is parsed separately
from the chat file. Therefore, for each chat found, there will be an
original JSON (found in cache) and a chat interpreted in HTML.
@felipecampanini
Copy link
Contributor Author

Hello @lfcnassif, I sent the first version of the new parser, as there is that name problem and now the class works for any cache with google chrome cache structure, I put all the code in the same class (DiscordParser), see if it was good, any necessary change can ask me.

I had created two mime types "application/x-discord-index" and "application/x-chrome-cache-index", but for some reason the parser wouldn't start when I put two mimes in the SUPPORTED_TYPES variable, so I left the lines commented out for now.

I have a small bugfix for the "DiscordHTMLReport" class, however, I still haven't been able to finish the tests.

felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
Deduplication of participant names in calls
felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
Change to display AM/PM indication and time in 24h format for Brazilian
language.
felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
BUGFIX - If there are two files with the same name, the parser could
show the wrong file. Now the file is fetched based on the name and id
contained in the URL.
felipecampanini added a commit to felipecampanini/IPED that referenced this issue May 19, 2023
BUGFIX - The character ")" was being printed wrongly in the HTML;
lfcnassif pushed a commit that referenced this issue Sep 28, 2023
BUGFIX - If there are two files with the same name, the parser could
show the wrong file. Now the file is fetched based on the name and id
contained in the URL.
lfcnassif pushed a commit that referenced this issue Oct 4, 2023
BUGFIX - If there are two files with the same name, the parser could
show the wrong file. Now the file is fetched based on the name and id
contained in the URL.
@lfcnassif
Copy link
Member

I had created two mime types "application/x-discord-index" and "application/x-chrome-cache-index", but for some reason the parser wouldn't start when I put two mimes in the SUPPORTED_TYPES variable, so I left the lines commented out for now.

Hi @felipecampanini, I'm really sorry for my very late replay, this disappeared in my task queue... Declaring 2 mimes into SUPPORTED_TYPES should work, was you able to make it work since then?

@lfcnassif lfcnassif linked a pull request Nov 1, 2023 that will close this issue
@felipecampanini
Copy link
Contributor Author

Hi @felipecampanini, I'm really sorry for my very late replay, this disappeared in my task queue... Declaring 2 mimes into SUPPORTED_TYPES should work, was you able to make it work since then?

Hi @lfcnassif, no problem, I haven't touched this part of the code since then, I'll try again to add two mimes, there must be some detail that I'm not noticing.

lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 22, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 22, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 22, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 22, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 23, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 23, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 23, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 23, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 23, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 23, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 25, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 25, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 26, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 26, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 26, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 26, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 26, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 26, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 27, 2024
lfcnassif added a commit to felipecampanini/IPED that referenced this issue Feb 27, 2024
@github-project-automation github-project-automation bot moved this to Done in 4.2 Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants