Fake cookie hack to access "case/timeline/advanced-filter" as an API client #428
59e5aaf4
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Interestingly enough, the
case/timeline/advanced-filter
API endpoint has a different behavior depending on the authentication nature. If you're an API client withAuthorization: Bearer $token
, you'll get a not-that-usable JSON, and if you happend to be a web browser withCookie: session=$session_cookie
, you'll get a really usable JSON with ids of associated IOC & assets to your events.Source code that splits the behavior for the same URL:
iris-web/source/app/blueprints/case/case_timeline_routes.py
Line 638 in d433bb6
Here's how we hacked our way through this, so that we could export to our threat intelligence platform the relationships between IOC & assets, should they not be already carried in the asset & IOC properties ( there's a checkbox disabling that when creating a timeline event ) :
We go scavenge the
ClientSession
or ourCase
and build a raw request with it, adding our token as expected, and a fakeCookie: session=hack
header so that the API code is happy to see "a session cookie".There's no valid reason to keep sending a
Content-Type: application/json
for a GET request lol, but heyClientSession
does that so.. :DBeta Was this translation helpful? Give feedback.
All reactions