ciscocsirt / netsarlacc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get code ready for additional protocols

bmenrigh opened this issue · comments

Right now the sinkhole is built assuming HTTP only but people may want to add other protocols like SMTP, POP, IRC, etc. The code should at least be ready for these additional protocols to be added without having to restructure too much code.

As part of the TLS additions this was taken care of (as of commit 39767c2). Listening sockets now have some protocol information with them (currently only "http") that gets sent to the workers so the workers know what protocol to speak. This mostly readies the code for additional protocols.

I'm reopening this because I realized that some protocols like SMTP expect the server to say something first before the client says anything. The code we have currently expects the client to talk first. We'll have to keep this in mind when we want to adapt the code to support another protocol like SMTP.

Splitting the workers into readers and workers made this a bit easier. SMTP support was added with commit bebcb31