/
githubmirror
/
libnet
Обзор
Документация
Войти
/
githubmirror
/
libnet
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.1.5
lua/recoding-test
38 строк
964 B
Sam Roberts
Run a corpus of fuzzed pcap files through libnet to verify recoding.
23 фев 2010, 04:14
23 фев 2010, 04:14
4311f77
Код
Авторство
О чём код?
#!/usr/bin/env lua5.1 require"net" require"netutil" threshold = { ["1266868886.00000007.pcap"] = 4, ["1266868886.00000008.pcap"] = 4, ["dhcp0.pcap"] = 4, ["1266868886.00000016.pcap"] = 2, } do local function recode_invalid_packets(infile) print("") print("") print("-test: recode") print("infile", infile) print("outfile", outfile) local outfile = pcaprecode(infile) assertpcapsimilar(threshold, infile, outfile) print("+ok") end -- dhcp0 actually has invalid ip checksums, must have been captured on a local host local pcaps = assert(io.popen("/bin/ls *.pcap")) while true do local fname = pcaps:read"*l" if not fname then break end if not string.match(fname, "^recoded-") and not string.match(fname, "^passed-") then recode_invalid_packets(fname) os.rename(fname, "passed-"..fname) end end end