Created
February 24, 2016 10:53
-
-
Save inliniac/db65597315a46450bcf6 to your computer and use it in GitHub Desktop.
TLS-SNI Lua detection example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init (args) | |
local needs = {} | |
needs["tls"] = tostring(true) | |
return needs | |
end | |
function match(args) | |
sni = TlsGetSNI(); | |
if sni == nil then | |
return 0 | |
end | |
str = string.format("SNI %s", sni); | |
SCLogInfo(str); | |
if sni == "www.google.com" then | |
return 1 | |
end | |
return 0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert tls any any -> any any (flow:to_server; lua:tls-sni.lua; sid:1;) | |
reject tls any any -> any any (flow:to_server; lua:tls-sni.lua; sid:2;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment