2021年04月28日
最近偶尔抽时间写,更新了两个模块
参考 nmap
模块,测试代码
-- 代码
local nmap = require("nmap")
function test()
-- 端口扫描例子 IP,端口表,支持"-,"分隔符,超时时间,扫描线程
local result = nmap.scan("127.0.0.1", "80", 10, 50)
for _, service in pairs(result) do
print(string.rep("-", 20))
for name, value in pairs(service) do
print(name, ": ", value)
end
end
end
-- 运行结果
➜ ./node_darwin_amd64 -f test_portscan.poc
_ _
/\ | | | |
/ \ | |_| |__ ___ _ __ __ _
/ /\ \| __| '_ \ / _ \ '_ \ / _ |
/ ____ \ |_| | | | __/ | | | (_| |
/_/ \_\__|_| |_|\___|_| |_|\__,_|
[2021-04-28 03:07:45] DEBUG Node: 正在创建运行环境
[2021-04-28 03:07:45] DEBUG Node: 正在载入模块
[2021-04-28 03:07:45] DEBUG Node: 正在装载程序:test_portscan.poc
[2021-04-28 03:07:45] DEBUG Node: 正在运行 test 测试方法
--------------------
Port : 80
ServiceNmae : http
StatusCode : 502
Title : 502 Bad Gateway
Url : http://127.0.0.1:80
VendorProduct :
Version :
[2021-04-28 03:07:45] DEBUG Node: 运行时间:209.276767ms
参考 jarm
模块,测试代码
-- 代码
local jarm = require("jarm")
function test()
print(jarm.fingerprint("8.210.253.122", 443))
end
-- 运行结果,该结果内容为Cobalt Strike常用
➜ ./node_darwin_amd64 -f test_jarm.poc
_ _
/\ | | | |
/ \ | |_| |__ ___ _ __ __ _
/ /\ \| __| '_ \ / _ \ '_ \ / _ |
/ ____ \ |_| | | | __/ | | | (_| |
/_/ \_\__|_| |_|\___|_| |_|\__,_|
[2021-04-28 03:15:06] DEBUG Node: 正在创建运行环境
[2021-04-28 03:15:06] DEBUG Node: 正在载入模块
[2021-04-28 03:15:06] DEBUG Node: 正在装载程序:test_jarm.poc
[2021-04-28 03:15:06] DEBUG Node: 正在运行 test 测试方法
07d14d16d21d21d07c42d41d00041d24a458a375eef0c576d23a7bab9a9fb1
[2021-04-28 03:15:08] DEBUG Node: 运行时间:1.888426702s