fork download
  1. function capture(iface)
  2. local hashes = {}, bytes, m, xx, essid_length, essid
  3. while 1 do
  4. bytes = {}
  5. for line in io.popen("exec tcpdump -s0 -lnxi " .. iface .. " subtype probe-req"):lines() do
  6. m = string.match(line, "^%s*0x%w+:%s+(.+)")
  7. if m then
  8. --print(m)
  9. for xx in string.gmatch(m, "%w%w") do
  10. table.insert(bytes, xx)
  11. end
  12. elseif bytes[1] ~= nil then
  13. table.remove(bytes, 1)
  14. if bytes[1] ~= nil then
  15. essid_length = tonumber(table.remove(bytes, 1), 16)
  16. essid = ""
  17. for _, b in ipairs(bytes) do
  18. essid_length = essid_length - 1
  19. if essid_length < 0 then
  20. break
  21. end
  22. essid = essid .. string.char("0x" .. b)
  23. end
  24. end
  25. if hashes[essid] == nil then
  26. hashes[essid] = 1
  27. if string.len(essid) > 0 then
  28. print(essid)
  29. end
  30. end
  31. bytes = {}
  32. end
  33. end
  34. os.execute("sleep 2")
  35. end
  36. end
  37.  
  38. iface = "wlan0"
  39. if arg[1] ~= nil then iface = arg[1] end
  40. capture(iface)
  41.  
Time limit exceeded #stdin #stdout #stderr 5s 4440KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
sh: 1: exec: tcpdump: not found
sh: 1: exec: tcpdump: not found
sh: 1: exec: tcpdump: not found
sh: 1: exec: tcpdump: not found
sh: 1: exec: tcpdump: not found