前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nmap NSE 库分析 >>> base64

Nmap NSE 库分析 >>> base64

作者头像
意大利的猫
发布2020-08-19 17:38:37
2740
发布2020-08-19 17:38:37
举报
文章被收录于专栏:漫流砂漫流砂

0x00 简介

base64 这个库就两个函数方法,一个加密一个解密很好理解

0x01 方法实战

  • enc

enc 函数只有一个参数 p,为要编码的数据

代码语言:javascript
复制
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by root.
--- DateTime: 2020/1/2 上午9:39
---

local url = require "url"
local stdnse = require "stdnse"
local base64 = require "base64"

description = [[
This is a test for http.lua's functions
]]

author = "test94"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"default"}

prerule = function()
    print("functest running")
end
portrule = function () return true end --shortport.http

action = function(host, port)
    local output = stdnse.output_table()
    local demo = "abc123"
    local result = base64.enc(demo)
    output.result = result
    return output
end

测试一下

  • dec

只有一个参数,要被解密的数据

代码语言:javascript
复制
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by root.
--- DateTime: 2020/1/2 上午9:39
---

local url = require "url"
local stdnse = require "stdnse"
local base64 = require "base64"

description = [[
This is a test for http.lua's functions
]]

author = "test94"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"default"}

prerule = function()
    print("functest running")
end
portrule = function () return true end --shortport.http

action = function(host, port)
    local output = stdnse.output_table()
    local demo = "YWJjMTIz"
    local result = base64.dec(demo)
    output.result = result
    return output
end

测试一下

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-03-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 NOP Team 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 0x00 简介
  • 0x01 方法实战
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档