[Oisf-users] LUA Payload Size

Chris Wakelin cwakelin at emergingthreats.net
Fri Nov 9 18:09:07 UTC 2018


I usually end up doing something like

D = HttpGetResponseBody()
d = ""
for i = 1, #D, 1 do
    d = d .. D[i]
end

then "#d" would be the response size. But there may be better ways
depending; e.g. you might be able to trust a value from a response
header, and of course you could just do

d = 0
for i = 1, #D, 1 do
  d = d + #D[i]
end

if you just need the size.

Best Wishes,
Chris


On 09/11/2018 13:07, Clark Kent wrote:
> I tried looking at the available features in the documentation. So I
> apologize if this is already answer there and I am just missing it.
> 
> Is there a way to return the payload size when writing a LUA script?
> 
> 
> _______________________________________________
> Suricata IDS Users mailing list: oisf-users at openinfosecfoundation.org
> Site: http://suricata-ids.org | Support: http://suricata-ids.org/support/
> List: https://lists.openinfosecfoundation.org/mailman/listinfo/oisf-users
> 
> Conference: https://suricon.net
> Trainings: https://suricata-ids.org/training/
> 


More information about the Oisf-users mailing list