mrheinen / lophiid

A distributed honeypot for monitoring large scale web attacks
GNU General Public License v2.0
6 stars 1 forks source link

Implement AI powered payload response (for RCE's initially) #48

Closed mrheinen closed 3 weeks ago

mrheinen commented 1 month ago

We often see similar attacks but with a different payload. For example, payloads like these are common:

They are nothing special. However, when adding rules for an application, right now you would need to add either a Content Script that handles the different payloads or you'd have to add one Content for each different payload. Regardless none of these would be reusable for a different application.

A much more flexible approach would be to use an LLM to analyze the payload and to tell us what kind of response we should send. In the implementation we should then either send that response as-is OR we should allow a template to be specified so that the LLM response can be positioned at the correct location (e.g. in the middle of the HTML).

In the initial implementation the LLM calling logic should use the LLM to:

We want to focus on using a local LLM for this but bonus points for using a library that also supported commercial LLMs.

It should be possible to enable this logic via a checkbox on a per Rule basis.

mrheinen commented 3 weeks ago

This was implemented as part of https://github.com/mrheinen/lophiid/pull/53.

Some more work is being done on dealing with code injection but that will be done separately