ast

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyseJSFuncByFlag

func AnalyseJSFuncByFlag(input string, script string) (string, error)

AnalyseJSFuncByFlag 分析js语法获取部分语法数据

func AnalyseJs

func AnalyseJs(script, t string) []string

AnalyseJs Js的ast语法分析,主要目的是抓取变量,返回变量数组

func ByKeys

func ByKeys(a, b interface{}) bool

ByKeys is a comparison function that compares item keys and returns true when a is less than b.

func Duplicate

func Duplicate(a interface{}) (ret []interface{})

Duplicate 去除重复元素

func GetParamsFromHtml

func GetParamsFromHtml(htmlStr *string, t string) []string

GetParamsFromHtml 获取变量 TODO 有待优化

func JsContexterLeft

func JsContexterLeft(xsschecker string, script string) string

JsContexterLeft 生成左半边的闭合xss payload

func JsContexterRight

func JsContexterRight(xsschecker string, script string) string

JsContexterRight 生成右半边的闭合xss payload

func SaveCrawOutPut

func SaveCrawOutPut(ResultList map[string][]JsonUrl, FilePath string)

Types

type Attribute

type Attribute struct {
	Key string
	Val string
}

type JsonUrl

type JsonUrl struct {
	Url     string                 `json:"url"`
	MetHod  string                 `json:"method"`
	Headers map[string]interface{} `json:"headers"`
	Data    string                 `json:"data"` //post数据
	Source  string                 `json:"source"`
	Hostid  int64                  `json:"hostid"`
}

type Node

type Node struct {
	Key      int
	Value    NodeValue
	Children []*Node
}

func CopyNode

func CopyNode(tn *Node) Node

CopyNode 只拷贝当前节点,并不拷贝其子节点

func (*Node) Clear

func (n *Node) Clear()

func (*Node) Delete

func (n *Node) Delete(key int) bool

func (*Node) Insert

func (n *Node) Insert(key int, tagName string, Content *string, Attributes *[]*Attribute)

Insert 使用二分查找实现节点插入操作 https://github.com/wrenchonline/glint/issues/12

func (*Node) Length

func (n *Node) Length() int

func (*Node) Max

func (n *Node) Max() (*Node, bool)

func (*Node) Search

func (n *Node) Search(key int) (*Node, bool)

func (*Node) Set

func (n *Node) Set(node *Node)

type NodeValue

type NodeValue struct {
	TagName    string
	Content    string
	Attributes []*Attribute
}

type Occurence

type Occurence struct {
	Type     string
	Position int
	Details  Node
}

func SearchInputInResponse

func SearchInputInResponse(input string, body string) []Occurence

SearchInputInResponse 搜索响应信息的位置

func SearchInputInScript

func SearchInputInScript(input, script string) (Occurrences []Occurence)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func (*Parser) Clear

func (parser *Parser) Clear()

func (*Parser) GetRoot

func (parser *Parser) GetRoot() *Node

GetRoot 获取根节点

func (*Parser) HttpParser

func (parser *Parser) HttpParser(body *string) bool

HttpParser http标签解析过滤

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL