suricata icon indicating copy to clipboard operation
suricata copied to clipboard

Draft: detect/from_base64: Add transform for decoding base64 data

Open jlucovsky opened this issue 2 years ago • 7 comments

This PR adds a transform for base64 encoded data.

Here's a rule showing the transform:

alert http any any -> any any (msg:"from_base64 transform"; flow:established,from_server; http.response_body; from_base64; content: "This is Suricata"; sid: 1;)

This rule decodes the buffer from http.response_body and alerts if the decoded buffer is This is Suricata.

Link to redmine ticket: 5220

Describe changes:

  • Added transform from_base64
  • Added brief documentation
  • Added unit test

suricata-verify-pr: 805 #suricata-verify-repo: #suricata-verify-branch: #suricata-update-pr: #suricata-update-repo: #suricata-update-branch: #libhtp-pr: #libhtp-repo: #libhtp-branch:

jlucovsky avatar Apr 13 '22 13:04 jlucovsky

ERROR:

ERROR: QA failed on build_asan.

Pipeline 6896

suricata-qa avatar Apr 14 '22 02:04 suricata-qa

I was hoping to see if we can support the syntax of the existing base64_decode keyword, where the base64_data would just become a no-op. Think this is doable?

victorjulien avatar Apr 14 '22 15:04 victorjulien

You're asking if base64_decode can become a transform, i think? If so, that's why this is a draft to see if from_base64 is viable -- so a poc.

jlucovsky avatar Apr 14 '22 17:04 jlucovsky

Information: QA ran without warnings.

Pipeline 6936

suricata-qa avatar Apr 17 '22 02:04 suricata-qa

Warning: no commits in this PR have specified the following ticket(s):

  • 5220 - https://redmine.openinfosecfoundation.org/issues/5220

Please update the commit(s) and submit a new PR.

suricata-qa avatar Apr 26 '22 15:04 suricata-qa

@jlucovsky do you need feedback on this PR ?

catenacyber avatar Jul 06 '22 08:07 catenacyber

Information: QA ran without warnings.

Pipeline 6936

suricata-qa avatar Aug 01 '22 07:08 suricata-qa

Information: QA ran without warnings.

Pipeline 6936

suricata-qa avatar Nov 01 '22 23:11 suricata-qa

Jeff, is this draft still live ?

catenacyber avatar Dec 26 '22 16:12 catenacyber

ping @jlucovsky ?

catenacyber avatar Jan 30 '23 12:01 catenacyber

Information: QA ran without warnings.

Pipeline 6936

suricata-qa avatar Jan 30 '23 17:01 suricata-qa

Needs rework.

victorjulien avatar May 05 '23 08:05 victorjulien