-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffufify.lua
60 lines (46 loc) · 1.33 KB
/
ffufify.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
local getters = require("getters")
local utils = require("utils")
if #arg == 0 then
utils.missing_parameters()
end
if arg[1] == "-h" or arg[1] == "--help" then
print([[
Usage:
lua ffufify.lua [OPTIONS] [FILE WORDLIST]
ARGUMENTS:
FILE path to burp file request
WORDLIST path to wordlist
OPTIONS:
-h, --help show list of command-line options
]])
os.exit()
end
local function read_file_to_table(filename)
local file = io.open(filename, "r")
or (function()
print("File " .. filename .. " not found, exiting")
os.exit()
end)()
local content = {}
for line in file:lines() do
table.insert(content, line)
end
file:close()
return content
end
if #arg ~= 2 then
utils.missing_parameters()
end
local filename = arg[1]
local wordlist = arg[2]
-- Read file content and store into a table
local content = read_file_to_table(filename)
-- Getters
local method = getters.get_method(content)
local url = getters.get_url(content)
local headers = getters.get_headers(content)
print("FFUFIFIED:\n")
print("ffuf -u " .. url .. ' -X "' .. method .. '" -w ' .. wordlist .. (#headers ~= 0 and ' \\' or ""))
for i, header in pairs(headers) do
print("-H '" .. header[1] .. ":" .. header[2] .. "'" .. (i ~= #headers and " \\" or ""))
end