mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-12 20:32:40 +08:00
合并dev。变动太大吗,又得重新优化输出,进度50%。rpc服务冲突,暂时删除
This commit is contained in:
parent
5aa2fd3599
commit
c4378545b9
@ -108,7 +108,7 @@ func formatLogMessage(entry *LogEntry) string {
|
||||
|
||||
// printLog 根据日志级别打印日志
|
||||
func printLog(entry *LogEntry) {
|
||||
if LogLevel != "debug" && entry.Level == LogLevelDebug {
|
||||
if LogLevel != "debug" && (entry.Level == LogLevelDebug || entry.Level == LogLevelError) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ func LogDebug(msg string) {
|
||||
})
|
||||
}
|
||||
|
||||
// LogInfo 记录进度信息
|
||||
// LogBase 记录进度信息
|
||||
func LogBase(msg string) {
|
||||
handleLog(&LogEntry{
|
||||
Level: LogLevelBase,
|
||||
@ -183,6 +183,7 @@ func LogBase(msg string) {
|
||||
}
|
||||
|
||||
// LogInfo 记录信息日志
|
||||
// [*]
|
||||
func LogInfo(msg string) {
|
||||
handleLog(&LogEntry{
|
||||
Level: LogLevelInfo,
|
||||
@ -192,6 +193,7 @@ func LogInfo(msg string) {
|
||||
}
|
||||
|
||||
// LogSuccess 记录成功日志,并更新最后成功时间
|
||||
// [+]
|
||||
func LogSuccess(result string) {
|
||||
entry := &LogEntry{
|
||||
Level: LogLevelSuccess,
|
||||
|
@ -43,7 +43,7 @@ func ParseUser() error {
|
||||
// 处理命令行参数指定的用户名列表
|
||||
if Username != "" {
|
||||
usernames = strings.Split(Username, ",")
|
||||
LogInfo(GetText("no_username_specified", len(usernames)))
|
||||
LogBase(GetText("no_username_specified", len(usernames)))
|
||||
}
|
||||
|
||||
// 从文件加载用户名列表
|
||||
@ -59,12 +59,12 @@ func ParseUser() error {
|
||||
usernames = append(usernames, user)
|
||||
}
|
||||
}
|
||||
LogInfo(GetText("load_usernames_from_file", len(fileUsers)))
|
||||
LogBase(GetText("load_usernames_from_file", len(fileUsers)))
|
||||
}
|
||||
|
||||
// 去重处理
|
||||
usernames = RemoveDuplicate(usernames)
|
||||
LogInfo(GetText("total_usernames", len(usernames)))
|
||||
LogBase(GetText("total_usernames", len(usernames)))
|
||||
|
||||
// 更新所有字典的用户名列表
|
||||
for name := range Userdict {
|
||||
@ -113,7 +113,7 @@ func parsePasswords() {
|
||||
}
|
||||
}
|
||||
Passwords = pwdList
|
||||
LogInfo(GetText("load_passwords", len(pwdList)))
|
||||
LogBase(GetText("load_passwords", len(pwdList)))
|
||||
}
|
||||
|
||||
// 从文件加载密码列表
|
||||
@ -130,7 +130,7 @@ func parsePasswords() {
|
||||
}
|
||||
}
|
||||
Passwords = pwdList
|
||||
LogInfo(GetText("load_passwords_from_file", len(passes)))
|
||||
LogBase(GetText("load_passwords_from_file", len(passes)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ func parseHashes() {
|
||||
LogError(GetText("invalid_hash", line))
|
||||
}
|
||||
}
|
||||
LogInfo(GetText("load_valid_hashes", validCount))
|
||||
LogBase(GetText("load_valid_hashes", validCount))
|
||||
}
|
||||
|
||||
// parseURLs 解析URL目标配置
|
||||
@ -201,7 +201,7 @@ func parseURLs() {
|
||||
}
|
||||
|
||||
if len(URLs) > 0 {
|
||||
LogInfo(GetText("load_urls", len(URLs)))
|
||||
LogBase(GetText("load_urls", len(URLs)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ func parseHosts(Info *HostInfo) error {
|
||||
Info.Host += "," + hostStr
|
||||
}
|
||||
|
||||
LogInfo(GetText("load_hosts_from_file", len(hosts)))
|
||||
LogBase(GetText("load_hosts_from_file", len(hosts)))
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -270,7 +270,7 @@ func parsePorts() error {
|
||||
|
||||
// 更新全局端口配置
|
||||
Ports = portBuilder.String()
|
||||
LogInfo(GetText("load_ports_from_file"))
|
||||
LogBase(GetText("load_ports_from_file"))
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -279,7 +279,7 @@ func parsePorts() error {
|
||||
// 更新全局排除端口配置
|
||||
func parseExcludePorts() {
|
||||
if ExcludePorts != "" {
|
||||
LogInfo(GetText("exclude_ports", ExcludePorts))
|
||||
LogBase(GetText("exclude_ports", ExcludePorts))
|
||||
// 确保排除端口被正确设置到全局配置中
|
||||
// 这将由PortScan函数在处理端口时使用
|
||||
}
|
||||
@ -316,7 +316,7 @@ func ReadFileLines(filename string) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
LogInfo(GetText("read_file_success", filename, lineCount))
|
||||
LogBase(GetText("read_file_success", filename, lineCount))
|
||||
return content, nil
|
||||
}
|
||||
|
||||
@ -392,12 +392,12 @@ func processPortsConfig() {
|
||||
} else {
|
||||
Ports += "," + AddPorts
|
||||
}
|
||||
LogInfo(GetText("extra_ports", AddPorts))
|
||||
LogBase(GetText("extra_ports", AddPorts))
|
||||
}
|
||||
|
||||
// 确保排除端口配置被记录
|
||||
if ExcludePorts != "" {
|
||||
LogInfo(GetText("exclude_ports_applied", ExcludePorts))
|
||||
LogBase(GetText("exclude_ports_applied", ExcludePorts))
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ func processExtraCredentials() {
|
||||
Userdict[dict] = append(Userdict[dict], users...)
|
||||
Userdict[dict] = RemoveDuplicate(Userdict[dict])
|
||||
}
|
||||
LogInfo(GetText("extra_usernames", AddUsers))
|
||||
LogBase(GetText("extra_usernames", AddUsers))
|
||||
}
|
||||
|
||||
// 处理额外密码
|
||||
@ -419,7 +419,7 @@ func processExtraCredentials() {
|
||||
passes := strings.Split(AddPasswords, ",")
|
||||
Passwords = append(Passwords, passes...)
|
||||
Passwords = RemoveDuplicate(Passwords)
|
||||
LogInfo(GetText("extra_passwords", AddPasswords))
|
||||
LogBase(GetText("extra_passwords", AddPasswords))
|
||||
}
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ func setupSocks5Proxy() error {
|
||||
|
||||
// 使用Socks5代理时禁用Ping(无法通过代理进行ICMP)
|
||||
DisablePing = true
|
||||
LogInfo(GetText("socks5_proxy", Socks5Proxy))
|
||||
LogBase(GetText("socks5_proxy", Socks5Proxy))
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -499,7 +499,7 @@ func setupHttpProxy() error {
|
||||
return fmt.Errorf(GetText("proxy_format_error", err))
|
||||
}
|
||||
|
||||
LogInfo(GetText("http_proxy", HttpProxy))
|
||||
LogBase(GetText("http_proxy", HttpProxy))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ func ParseIP(host string, filename string, nohosts ...string) (hosts []string, e
|
||||
host = hostport[0]
|
||||
hosts = parseIPList(host)
|
||||
Ports = hostport[1]
|
||||
LogInfo(GetText("host_port_parsed", Ports))
|
||||
LogBase(GetText("host_port_parsed", Ports))
|
||||
}
|
||||
} else {
|
||||
// 解析主机地址
|
||||
@ -48,7 +48,7 @@ func ParseIP(host string, filename string, nohosts ...string) (hosts []string, e
|
||||
LogError(GetText("read_host_file_failed", err))
|
||||
} else {
|
||||
hosts = append(hosts, fileHosts...)
|
||||
LogInfo(GetText("extra_hosts_loaded", len(fileHosts)))
|
||||
LogBase(GetText("extra_hosts_loaded", len(fileHosts)))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ func ParseIP(host string, filename string, nohosts ...string) (hosts []string, e
|
||||
|
||||
// 去重并排序
|
||||
hosts = removeDuplicateIPs(hosts)
|
||||
LogInfo(GetText("final_valid_hosts", len(hosts)))
|
||||
LogBase(GetText("final_valid_hosts", len(hosts)))
|
||||
|
||||
// 检查解析结果
|
||||
if len(hosts) == 0 && len(HostPort) == 0 && (host != "" || filename != "") {
|
||||
@ -160,7 +160,7 @@ func parseCIDR(cidr string) []string {
|
||||
// 转换为IP范围
|
||||
ipRange := calculateIPRange(ipNet)
|
||||
hosts := parseIPRange(ipRange)
|
||||
LogInfo(GetText("parse_cidr_to_range", cidr, ipRange))
|
||||
LogBase(GetText("parse_cidr_to_range", cidr, ipRange))
|
||||
return hosts
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ func calculateIPRange(cidr *net.IPNet) string {
|
||||
end := bcst.String()
|
||||
|
||||
result := fmt.Sprintf("%s-%s", start, end)
|
||||
LogInfo(GetText("cidr_range", result))
|
||||
LogBase(GetText("cidr_range", result))
|
||||
return result
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ func parseShortIPRange(startIP, endSuffix string) []string {
|
||||
allIP = append(allIP, fmt.Sprintf("%s.%d", prefixIP, i))
|
||||
}
|
||||
|
||||
LogInfo(GetText("generate_ip_range", prefixIP, startNum, prefixIP, endNum))
|
||||
LogBase(GetText("generate_ip_range", prefixIP, startNum, prefixIP, endNum))
|
||||
return allIP
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ func parseFullIPRange(startIP, endIP string) []string {
|
||||
allIP = append(allIP, ip)
|
||||
}
|
||||
|
||||
LogInfo(GetText("generate_ip_range_full", startIP, endIP, len(allIP)))
|
||||
LogBase(GetText("generate_ip_range_full", startIP, endIP, len(allIP)))
|
||||
return allIP
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ func parseSubnet8(subnet string) []string {
|
||||
firstOctet := strings.Split(baseIP, ".")[0]
|
||||
var sampleIPs []string
|
||||
|
||||
LogInfo(GetText("parse_subnet", firstOctet))
|
||||
LogBase(GetText("parse_subnet", firstOctet))
|
||||
|
||||
// 预分配足够的容量以提高性能
|
||||
// 每个二级网段10个IP,共256*256个二级网段
|
||||
@ -388,7 +388,7 @@ func parseSubnet8(subnet string) []string {
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo(GetText("sample_ip_generated", len(sampleIPs)))
|
||||
LogBase(GetText("sample_ip_generated", len(sampleIPs)))
|
||||
return sampleIPs
|
||||
}
|
||||
|
||||
@ -445,7 +445,7 @@ func readIPFile(filename string) ([]string, error) {
|
||||
for _, host := range hosts {
|
||||
HostPort = append(HostPort, fmt.Sprintf("%s:%s", host, portPart))
|
||||
}
|
||||
LogInfo(GetText("parse_ip_port", line))
|
||||
LogBase(GetText("parse_ip_port", line))
|
||||
} else {
|
||||
LogError(GetText("invalid_ip_port_format", line))
|
||||
}
|
||||
@ -453,7 +453,7 @@ func readIPFile(filename string) ([]string, error) {
|
||||
// 处理纯IP格式
|
||||
hosts := parseIPList(line)
|
||||
ipList = append(ipList, hosts...)
|
||||
LogInfo(GetText("parse_ip_address", line))
|
||||
LogBase(GetText("parse_ip_address", line))
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,7 +463,7 @@ func readIPFile(filename string) ([]string, error) {
|
||||
return ipList, err
|
||||
}
|
||||
|
||||
LogInfo(GetText("file_parse_complete", len(ipList)))
|
||||
LogBase(GetText("file_parse_complete", len(ipList)))
|
||||
return ipList, nil
|
||||
}
|
||||
|
||||
@ -505,7 +505,7 @@ func excludeHosts(hosts []string, nohosts []string) []string {
|
||||
|
||||
// 排序以保持结果的稳定性
|
||||
sort.Strings(result)
|
||||
LogInfo(GetText("hosts_excluded", len(excludeList)))
|
||||
LogBase(GetText("hosts_excluded", len(excludeList)))
|
||||
|
||||
return result
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ func handleAliveHosts(chanHosts chan string, hostslist []string, isPing bool) {
|
||||
|
||||
// 保留原有的控制台输出
|
||||
if !Common.Silent {
|
||||
Common.LogSuccess(Common.GetText("target_alive", ip, protocol))
|
||||
Common.LogInfo(Common.GetText("target_alive", ip, protocol))
|
||||
}
|
||||
}
|
||||
livewg.Done()
|
||||
@ -107,7 +107,7 @@ func probeWithICMP(hostslist []string, chanHosts chan string) {
|
||||
return
|
||||
}
|
||||
|
||||
Common.LogError(Common.GetText("icmp_connect_failed", err))
|
||||
Common.LogBase(Common.GetText("icmp_connect_failed", err))
|
||||
Common.LogBase(Common.GetText("insufficient_privileges"))
|
||||
Common.LogBase(Common.GetText("switching_to_ping"))
|
||||
|
||||
@ -121,7 +121,7 @@ func printAliveStats(hostslist []string) {
|
||||
if len(hostslist) > 1000 {
|
||||
arrTop, arrLen := ArrayCountValueTop(AliveHosts, Common.LiveTop, true)
|
||||
for i := 0; i < len(arrTop); i++ {
|
||||
Common.LogSuccess(Common.GetText("subnet_16_alive", arrTop[i], arrLen[i]))
|
||||
Common.LogInfo(Common.GetText("subnet_16_alive", arrTop[i], arrLen[i]))
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ func printAliveStats(hostslist []string) {
|
||||
if len(hostslist) > 256 {
|
||||
arrTop, arrLen := ArrayCountValueTop(AliveHosts, Common.LiveTop, false)
|
||||
for i := 0; i < len(arrTop); i++ {
|
||||
Common.LogSuccess(Common.GetText("subnet_24_alive", arrTop[i], arrLen[i]))
|
||||
Common.LogInfo(Common.GetText("subnet_24_alive", arrTop[i], arrLen[i]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ func (s *LocalScanStrategy) Description() string {
|
||||
|
||||
// Execute 执行本地扫描策略
|
||||
func (s *LocalScanStrategy) Execute(info Common.HostInfo, ch *chan struct{}, wg *sync.WaitGroup) {
|
||||
Common.LogInfo("执行本地信息收集")
|
||||
Common.LogBase("执行本地信息收集")
|
||||
|
||||
// 验证插件配置
|
||||
if err := validateScanPlugins(); err != nil {
|
||||
@ -81,7 +81,7 @@ func (s *LocalScanStrategy) LogPluginInfo() {
|
||||
|
||||
// 如果是自定义模式,直接显示用户指定的插件
|
||||
if isCustomMode {
|
||||
Common.LogInfo(fmt.Sprintf("本地模式: 使用指定插件: %s", strings.Join(allPlugins, ", ")))
|
||||
Common.LogBase(fmt.Sprintf("本地模式: 使用指定插件: %s", strings.Join(allPlugins, ", ")))
|
||||
return
|
||||
}
|
||||
|
||||
@ -95,9 +95,9 @@ func (s *LocalScanStrategy) LogPluginInfo() {
|
||||
}
|
||||
|
||||
if len(applicablePlugins) > 0 {
|
||||
Common.LogInfo(fmt.Sprintf("本地模式: 使用本地插件: %s", strings.Join(applicablePlugins, ", ")))
|
||||
Common.LogBase(fmt.Sprintf("本地模式: 使用本地插件: %s", strings.Join(applicablePlugins, ", ")))
|
||||
} else {
|
||||
Common.LogInfo("本地模式: 未找到可用的本地插件")
|
||||
Common.LogBase("本地模式: 未找到可用的本地插件")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ func EnhancedPortScan(hosts []string, ports string, timeout int64) []string {
|
||||
// 记录开放端口
|
||||
atomic.AddInt64(&count, 1)
|
||||
aliveMap.Store(addr, struct{}{})
|
||||
Common.LogSuccess("端口开放 " + addr)
|
||||
Common.LogInfo("端口开放 " + addr)
|
||||
Common.SaveResult(&Common.ScanResult{
|
||||
Time: time.Now(), Type: Common.PORT, Target: host,
|
||||
Status: "open", Details: map[string]interface{}{"port": port},
|
||||
@ -128,7 +128,7 @@ func EnhancedPortScan(hosts []string, ports string, timeout int64) []string {
|
||||
sb.WriteString(" Banner:[" + strings.TrimSpace(info.Banner) + "]")
|
||||
}
|
||||
|
||||
Common.LogSuccess(sb.String())
|
||||
Common.LogInfo(sb.String())
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,6 +146,6 @@ func EnhancedPortScan(hosts []string, ports string, timeout int64) []string {
|
||||
return true
|
||||
})
|
||||
|
||||
Common.LogSuccess(fmt.Sprintf("扫描完成, 发现 %d 个开放端口", count))
|
||||
Common.LogBase(fmt.Sprintf("扫描完成, 发现 %d 个开放端口", count))
|
||||
return aliveAddrs
|
||||
}
|
||||
|
@ -53,19 +53,19 @@ func (s *Scanner) selectStrategy(info Common.HostInfo) {
|
||||
switch {
|
||||
case Common.LocalMode:
|
||||
s.strategy = NewLocalScanStrategy()
|
||||
Common.LogInfo("已选择本地扫描模式")
|
||||
Common.LogBase("已选择本地扫描模式")
|
||||
case len(Common.URLs) > 0:
|
||||
s.strategy = NewWebScanStrategy()
|
||||
Common.LogInfo("已选择Web扫描模式")
|
||||
Common.LogBase("已选择Web扫描模式")
|
||||
default:
|
||||
s.strategy = NewServiceScanStrategy()
|
||||
Common.LogInfo("已选择服务扫描模式")
|
||||
Common.LogBase("已选择服务扫描模式")
|
||||
}
|
||||
}
|
||||
|
||||
// Scan 执行整体扫描流程
|
||||
func (s *Scanner) Scan(info Common.HostInfo) {
|
||||
Common.LogInfo("开始信息扫描")
|
||||
Common.LogBase("开始信息扫描")
|
||||
lib.Inithttp()
|
||||
|
||||
// 并发控制初始化
|
||||
@ -86,7 +86,7 @@ func (s *Scanner) finishScan() {
|
||||
Common.ProgressBar.Finish()
|
||||
fmt.Println()
|
||||
}
|
||||
Common.LogSuccess(fmt.Sprintf("扫描已完成: %v/%v", Common.End, Common.Num))
|
||||
Common.LogBase(fmt.Sprintf("扫描已完成: %v/%v", Common.End, Common.Num))
|
||||
}
|
||||
|
||||
// 任务执行通用框架
|
||||
@ -158,7 +158,7 @@ func logScanPlan(tasks []ScanTask) {
|
||||
planInfo.WriteString(fmt.Sprintf(" - %s: %d 个目标\n", plugin, count))
|
||||
}
|
||||
|
||||
Common.LogInfo(planInfo.String())
|
||||
Common.LogBase(planInfo.String())
|
||||
}
|
||||
|
||||
// 初始化进度条
|
||||
@ -199,7 +199,7 @@ func scheduleScanTask(pluginName string, target Common.HostInfo, ch *chan struct
|
||||
// 完成任务,释放资源
|
||||
duration := time.Since(startTime)
|
||||
if Common.ShowScanPlan {
|
||||
Common.LogInfo(fmt.Sprintf("完成 %s 扫描 %s:%s (耗时: %.2fs)",
|
||||
Common.LogBase(fmt.Sprintf("完成 %s 扫描 %s:%s (耗时: %.2fs)",
|
||||
pluginName, target.Host, target.Ports, duration.Seconds()))
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ func scheduleScanTask(pluginName string, target Common.HostInfo, ch *chan struct
|
||||
func executeSingleScan(pluginName string, info Common.HostInfo) {
|
||||
plugin, exists := Common.PluginManager[pluginName]
|
||||
if !exists {
|
||||
Common.LogInfo(fmt.Sprintf("扫描类型 %v 无对应插件,已跳过", pluginName))
|
||||
Common.LogBase(fmt.Sprintf("扫描类型 %v 无对应插件,已跳过", pluginName))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ func (s *ServiceScanStrategy) Execute(info Common.HostInfo, ch *chan struct{}, w
|
||||
return
|
||||
}
|
||||
|
||||
Common.LogInfo("开始主机扫描")
|
||||
Common.LogBase("开始主机扫描")
|
||||
|
||||
// 输出插件信息
|
||||
s.LogPluginInfo()
|
||||
@ -64,7 +64,7 @@ func (s *ServiceScanStrategy) performHostScan(hosts []string, info Common.HostIn
|
||||
// 主机存活检测
|
||||
if s.shouldPerformLivenessCheck(hosts) {
|
||||
hosts = CheckLive(hosts, Common.UsePing)
|
||||
Common.LogInfo(fmt.Sprintf("存活主机数量: %d", len(hosts)))
|
||||
Common.LogBase(fmt.Sprintf("存活主机数量: %d", len(hosts)))
|
||||
}
|
||||
|
||||
// 端口扫描
|
||||
@ -76,7 +76,7 @@ func (s *ServiceScanStrategy) performHostScan(hosts []string, info Common.HostIn
|
||||
|
||||
// 执行漏洞扫描
|
||||
if len(targetInfos) > 0 {
|
||||
Common.LogInfo("开始漏洞扫描")
|
||||
Common.LogBase("开始漏洞扫描")
|
||||
ExecuteScanTasks(targetInfos, s, ch, wg)
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ func (s *ServiceScanStrategy) discoverAlivePorts(hosts []string) []string {
|
||||
// 根据扫描模式选择端口扫描方式
|
||||
if len(hosts) > 0 {
|
||||
alivePorts = EnhancedPortScan(hosts, Common.Ports, Common.Timeout)
|
||||
Common.LogInfo(fmt.Sprintf("存活端口数量: %d", len(alivePorts)))
|
||||
Common.LogBase(fmt.Sprintf("存活端口数量: %d", len(alivePorts)))
|
||||
}
|
||||
|
||||
// 合并额外指定的端口
|
||||
@ -101,7 +101,7 @@ func (s *ServiceScanStrategy) discoverAlivePorts(hosts []string) []string {
|
||||
alivePorts = append(alivePorts, Common.HostPort...)
|
||||
alivePorts = Common.RemoveDuplicate(alivePorts)
|
||||
Common.HostPort = nil
|
||||
Common.LogInfo(fmt.Sprintf("存活端口数量: %d", len(alivePorts)))
|
||||
Common.LogBase(fmt.Sprintf("存活端口数量: %d", len(alivePorts)))
|
||||
}
|
||||
|
||||
return alivePorts
|
||||
@ -176,7 +176,7 @@ func (s *ServiceScanStrategy) LogPluginInfo() {
|
||||
|
||||
// 如果是自定义模式,直接显示用户指定的插件
|
||||
if isCustomMode {
|
||||
Common.LogInfo(fmt.Sprintf("使用指定插件: %s", strings.Join(allPlugins, ", ")))
|
||||
Common.LogBase(fmt.Sprintf("使用指定插件: %s", strings.Join(allPlugins, ", ")))
|
||||
return
|
||||
}
|
||||
|
||||
@ -190,9 +190,9 @@ func (s *ServiceScanStrategy) LogPluginInfo() {
|
||||
}
|
||||
|
||||
if len(applicablePlugins) > 0 {
|
||||
Common.LogInfo(fmt.Sprintf("使用服务插件: %s", strings.Join(applicablePlugins, ", ")))
|
||||
Common.LogBase(fmt.Sprintf("使用服务插件: %s", strings.Join(applicablePlugins, ", ")))
|
||||
} else {
|
||||
Common.LogInfo("未找到可用的服务插件")
|
||||
Common.LogBase("未找到可用的服务插件")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ func (s *WebScanStrategy) Description() string {
|
||||
|
||||
// Execute 执行Web扫描策略
|
||||
func (s *WebScanStrategy) Execute(info Common.HostInfo, ch *chan struct{}, wg *sync.WaitGroup) {
|
||||
Common.LogInfo("开始Web扫描")
|
||||
Common.LogBase("开始Web扫描")
|
||||
|
||||
// 验证插件配置
|
||||
if err := validateScanPlugins(); err != nil {
|
||||
@ -94,7 +94,7 @@ func (s *WebScanStrategy) LogPluginInfo() {
|
||||
|
||||
// 如果是自定义模式,直接显示用户指定的插件
|
||||
if isCustomMode {
|
||||
Common.LogInfo(fmt.Sprintf("Web扫描模式: 使用指定插件: %s", strings.Join(allPlugins, ", ")))
|
||||
Common.LogBase(fmt.Sprintf("Web扫描模式: 使用指定插件: %s", strings.Join(allPlugins, ", ")))
|
||||
return
|
||||
}
|
||||
|
||||
@ -108,9 +108,9 @@ func (s *WebScanStrategy) LogPluginInfo() {
|
||||
}
|
||||
|
||||
if len(applicablePlugins) > 0 {
|
||||
Common.LogInfo(fmt.Sprintf("Web扫描模式: 使用Web插件: %s", strings.Join(applicablePlugins, ", ")))
|
||||
Common.LogBase(fmt.Sprintf("Web扫描模式: 使用Web插件: %s", strings.Join(applicablePlugins, ", ")))
|
||||
} else {
|
||||
Common.LogInfo("Web扫描模式: 未找到可用的Web插件")
|
||||
Common.LogBase("Web扫描模式: 未找到可用的Web插件")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7401,9 +7401,9 @@ match http m|^HTTP/1\.[01] \d\d\d.*<title>Metasploit Framework Web Console v([-\
|
||||
match http m|^HTTP/1\.0 200 OK\r\nHTTP/1\.0 200 OK\r\nServer: (\w+)\r\nConnection: close\r\nCache-Control: must-revalidate = no-cache\r\nContent-Type: text/html\r\nExpires: 0\r\nLast-Modified: 0\r\n\r\n<html><head>\r\n<title>Netgear Access Point http config</title>| p/$1/ i/Netgear WG602 wireless router http config/ d/router/ cpe:/h:netgear:wg602/a
|
||||
match http m|^HTTP/1\.1 200 OK\r\nContent-Type: text/html; charset=iso-8859-1\r\nServer: Grandstream/([\d.]+)\r\n\r\n<HTML><HEAD><TITLE>Login Page</TITLE>.*<font size=4 color=\"ffffffff\">Welcome to Grandstream IP Phone</font>|s p/Grandstream httpd/ v/$1/ i/BudgeTone-100 VoIP phone http config/ d/VoIP phone/
|
||||
match http m|^HTTP/1\.0 200 OK\r\nContent-Type: text/html;charset=iso-8859-1\r\nContent-Length: \d+\r\nServer: Grandstream (BT\w+) ([\w._-]+)\r\n| p/Grandstream $1 VoIP phone http config/ v/$2/ d/VoIP phone/ cpe:/h:grandstream:$1/
|
||||
match http m|^HTTP/1\.0 200 OK\r\n(?:[^\r\n]+\r\n)*?Server: Grandstream\r\n.*<title>Grandstream Device Configuration</title>\n.*<form action=\"dologin\.htm\" method=\"post\" name=\"loginForm\">\n|s p/Grandstream GXV-3000 VoIP phone http config/ d/VoIP phone/ cpe:/h:grandstream:gxv-3000/
|
||||
match http m|^HTTP/1\.0 200 OK\n.*<title>Grandstream Device Configuration</title>\n.*<form action=\"/cgi-bin/dologin\" method=\"post\" name=\"loginForm\">|s p/Grandstream HT502 VoIP router http config/ d/VoIP adapter/ cpe:/h:grandstream:ht502/
|
||||
match http m|^HTTP/1\.1 200 OK\r\n.*<title>Grandstream Device Configuration</title>\r\n.*<form action=\"dologin\.htm\" method=\"post\" name=\"loginForm\">|s p/Grandstream HT286 VoIP router http config/ d/VoIP adapter/ cpe:/h:grandstream:ht286/
|
||||
match http m|^HTTP/1\.0 200 OK\r\n(?:[^\r\n]+\r\n)*?Server: Grandstream\r\n.*<title>Grandstream Device Configuration</title>\n.*<form action=\"dologin\.htm\" method=\"post\" name=\"LogBaserm\">\n|s p/Grandstream GXV-3000 VoIP phone http config/ d/VoIP phone/ cpe:/h:grandstream:gxv-3000/
|
||||
match http m|^HTTP/1\.0 200 OK\n.*<title>Grandstream Device Configuration</title>\n.*<form action=\"/cgi-bin/dologin\" method=\"post\" name=\"LogBaserm\">|s p/Grandstream HT502 VoIP router http config/ d/VoIP adapter/ cpe:/h:grandstream:ht502/
|
||||
match http m|^HTTP/1\.1 200 OK\r\n.*<title>Grandstream Device Configuration</title>\r\n.*<form action=\"dologin\.htm\" method=\"post\" name=\"LogBaserm\">|s p/Grandstream HT286 VoIP router http config/ d/VoIP adapter/ cpe:/h:grandstream:ht286/
|
||||
match http m|^HTTP/1\.0 \d\d\d (?:[^\r\n]*\r\n(?!\r\n))*?Server: Tcl-Webserver/([\d.]+) .*CRADLE VERSION ([\d.]+) CONTENTS TEMPLATE\r\n|s p/Tcl-Webserver/ v/$1/ i/Cradle Web-Access httpd $2/
|
||||
match http m|^HTTP/1\.0 \d\d\d .*\r\nDate: .*\r\nServer: Tcl-Webserver/([\d.]+) .*\r\n| p/Tcl-Webserver/ v/$1/
|
||||
match http m|^HTTP/1\.0 \d\d\d (?:[^\r\n]*\r\n(?!\r\n))*?Server: ListManagerWeb/([\w.]+) \(based on Tcl-Webserver/([\d.]+)\)\r\n|s p/Lyris ListManagerWeb/ v/$1/ i/based on Tcl-Webserver $2/
|
||||
|
@ -224,6 +224,6 @@ func read(text []byte, host string) error {
|
||||
}
|
||||
}
|
||||
|
||||
Common.LogSuccess(output.String())
|
||||
Common.LogInfo(output.String())
|
||||
return nil
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ func MS17010Scan(info *Common.HostInfo) error {
|
||||
defer MS17010EXP(info)
|
||||
}
|
||||
} else if os != "" {
|
||||
Common.LogInfo(fmt.Sprintf("系统信息 %s [%s]", ip, os))
|
||||
Common.LogBase(fmt.Sprintf("系统信息 %s [%s]", ip, os))
|
||||
|
||||
// 保存系统信息
|
||||
sysResult := &Common.ScanResult{
|
||||
|
@ -488,5 +488,5 @@ func logShareInfo(info *Common.HostInfo, user string, pass string, hash []byte,
|
||||
msg += fmt.Sprintf(" Pass:%s", pass)
|
||||
}
|
||||
msg += fmt.Sprintf(" 共享:%v", shares)
|
||||
Common.LogInfo(msg)
|
||||
Common.LogBase(msg)
|
||||
}
|
||||
|
@ -537,9 +537,9 @@ func (c *TelnetClient) Login() error {
|
||||
case UnauthorizedAccess:
|
||||
return nil
|
||||
case OnlyPassword:
|
||||
return c.loginForOnlyPassword()
|
||||
return c.LogBaserOnlyPassword()
|
||||
case UsernameAndPassword:
|
||||
return c.loginForUsernameAndPassword()
|
||||
return c.LogBaserUsernameAndPassword()
|
||||
default:
|
||||
return errors.New("unknown server type")
|
||||
}
|
||||
@ -605,8 +605,8 @@ func isNoAuthRequired(line string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// loginForOnlyPassword 处理只需密码的登录
|
||||
func (c *TelnetClient) loginForOnlyPassword() error {
|
||||
// LogBaserOnlyPassword 处理只需密码的登录
|
||||
func (c *TelnetClient) LogBaserOnlyPassword() error {
|
||||
c.Clear() // 清空之前的响应
|
||||
|
||||
// 发送密码并等待响应
|
||||
@ -625,8 +625,8 @@ func (c *TelnetClient) loginForOnlyPassword() error {
|
||||
return errors.New("login failed")
|
||||
}
|
||||
|
||||
// loginForUsernameAndPassword 处理需要用户名和密码的登录
|
||||
func (c *TelnetClient) loginForUsernameAndPassword() error {
|
||||
// LogBaserUsernameAndPassword 处理需要用户名和密码的登录
|
||||
func (c *TelnetClient) LogBaserUsernameAndPassword() error {
|
||||
// 发送用户名
|
||||
c.WriteContext(c.UserName)
|
||||
time.Sleep(time.Second * 2)
|
||||
|
@ -89,7 +89,7 @@ func WebTitle(info *Common.HostInfo) error {
|
||||
// 检查是否为打印机,避免意外打印
|
||||
for _, v := range info.Infostr {
|
||||
if v == printerFingerPrint {
|
||||
Common.LogInfo("检测到打印机,停止扫描")
|
||||
Common.LogBase("检测到打印机,停止扫描")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@ -406,7 +406,7 @@ func saveWebResult(info *Common.HostInfo, resp *WebResponse) {
|
||||
logMsg += fmt.Sprintf(" 指纹:%v", fingerprints)
|
||||
}
|
||||
|
||||
Common.LogSuccess(logMsg)
|
||||
Common.LogInfo(logMsg)
|
||||
}
|
||||
|
||||
// 检测目标主机的协议类型(HTTP/HTTPS)
|
||||
|
@ -1,13 +0,0 @@
|
||||
version: v1
|
||||
plugins:
|
||||
- plugin: go
|
||||
out: lib
|
||||
opt: paths=import
|
||||
|
||||
- plugin: go-grpc
|
||||
out: lib
|
||||
opt: paths=import
|
||||
|
||||
- plugin: grpc-gateway
|
||||
out: lib
|
||||
opt: paths=import
|
@ -1,8 +0,0 @@
|
||||
# Generated by buf. DO NOT EDIT.
|
||||
version: v1
|
||||
deps:
|
||||
- remote: buf.build
|
||||
owner: googleapis
|
||||
repository: googleapis
|
||||
commit: 61b203b9a9164be9a834f58c37be6f62
|
||||
digest: shake256:e619113001d6e284ee8a92b1561e5d4ea89a47b28bf0410815cb2fa23914df8be9f1a6a98dcf069f5bc2d829a2cfb1ac614863be45cd4f8a5ad8606c5f200224
|
@ -1,3 +0,0 @@
|
||||
version: v1
|
||||
deps:
|
||||
- buf.build/googleapis/googleapis
|
@ -1,476 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc (unknown)
|
||||
// source: lib/rpc.proto
|
||||
|
||||
package lib
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 启动任务的请求
|
||||
type StartScanRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Arg string `protobuf:"bytes,1,opt,name=arg,proto3" json:"arg,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StartScanRequest) Reset() {
|
||||
*x = StartScanRequest{}
|
||||
mi := &file_lib_rpc_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StartScanRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StartScanRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StartScanRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lib_rpc_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StartScanRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StartScanRequest) Descriptor() ([]byte, []int) {
|
||||
return file_lib_rpc_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *StartScanRequest) GetArg() string {
|
||||
if x != nil {
|
||||
return x.Arg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// 启动任务的响应
|
||||
type StartScanResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StartScanResponse) Reset() {
|
||||
*x = StartScanResponse{}
|
||||
mi := &file_lib_rpc_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StartScanResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StartScanResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StartScanResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lib_rpc_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StartScanResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StartScanResponse) Descriptor() ([]byte, []int) {
|
||||
return file_lib_rpc_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *StartScanResponse) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StartScanResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// 获取扫描结果的请求
|
||||
type TaskResultsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Filter *Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` // 筛选条件(如关键字、状态等)
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskResultsRequest) Reset() {
|
||||
*x = TaskResultsRequest{}
|
||||
mi := &file_lib_rpc_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TaskResultsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskResultsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TaskResultsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lib_rpc_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TaskResultsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*TaskResultsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_lib_rpc_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *TaskResultsRequest) GetFilter() *Filter {
|
||||
if x != nil {
|
||||
return x.Filter
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Filter struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // 任务ID
|
||||
StartTime string `protobuf:"bytes,2,opt,name=Start_time,json=StartTime,proto3" json:"Start_time,omitempty"` // 开始时间
|
||||
EndTime string `protobuf:"bytes,3,opt,name=End_time,json=EndTime,proto3" json:"End_time,omitempty"` // 结束时间
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Filter) Reset() {
|
||||
*x = Filter{}
|
||||
mi := &file_lib_rpc_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Filter) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Filter) ProtoMessage() {}
|
||||
|
||||
func (x *Filter) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lib_rpc_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Filter.ProtoReflect.Descriptor instead.
|
||||
func (*Filter) Descriptor() ([]byte, []int) {
|
||||
return file_lib_rpc_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *Filter) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Filter) GetStartTime() string {
|
||||
if x != nil {
|
||||
return x.StartTime
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Filter) GetEndTime() string {
|
||||
if x != nil {
|
||||
return x.EndTime
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// 获取扫描结果的响应
|
||||
type TaskResultsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Results []*ScanResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"`
|
||||
Finished bool `protobuf:"varint,3,opt,name=finished,proto3" json:"finished,omitempty"`
|
||||
Total int64 `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"` // 总结果数
|
||||
End int64 `protobuf:"varint,5,opt,name=end,proto3" json:"end,omitempty"` // 结束结果数
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) Reset() {
|
||||
*x = TaskResultsResponse{}
|
||||
mi := &file_lib_rpc_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskResultsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TaskResultsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lib_rpc_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TaskResultsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*TaskResultsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_lib_rpc_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) GetResults() []*ScanResult {
|
||||
if x != nil {
|
||||
return x.Results
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) GetFinished() bool {
|
||||
if x != nil {
|
||||
return x.Finished
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) GetTotal() int64 {
|
||||
if x != nil {
|
||||
return x.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskResultsResponse) GetEnd() int64 {
|
||||
if x != nil {
|
||||
return x.End
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 扫描结果结构体
|
||||
type ScanResult struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Time string `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
|
||||
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
||||
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
|
||||
DetailsJson *structpb.Struct `protobuf:"bytes,5,opt,name=details_json,json=detailsJson,proto3" json:"details_json,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ScanResult) Reset() {
|
||||
*x = ScanResult{}
|
||||
mi := &file_lib_rpc_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ScanResult) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ScanResult) ProtoMessage() {}
|
||||
|
||||
func (x *ScanResult) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lib_rpc_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ScanResult.ProtoReflect.Descriptor instead.
|
||||
func (*ScanResult) Descriptor() ([]byte, []int) {
|
||||
return file_lib_rpc_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ScanResult) GetTime() string {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ScanResult) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ScanResult) GetTarget() string {
|
||||
if x != nil {
|
||||
return x.Target
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ScanResult) GetStatus() string {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ScanResult) GetDetailsJson() *structpb.Struct {
|
||||
if x != nil {
|
||||
return x.DetailsJson
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_lib_rpc_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_lib_rpc_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\rlib/rpc.proto\x12\x03lib\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"$\n" +
|
||||
"\x10StartScanRequest\x12\x10\n" +
|
||||
"\x03arg\x18\x01 \x01(\tR\x03arg\"F\n" +
|
||||
"\x11StartScanResponse\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\tR\x06taskId\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\"9\n" +
|
||||
"\x12TaskResultsRequest\x12#\n" +
|
||||
"\x06filter\x18\x01 \x01(\v2\v.lib.FilterR\x06filter\"[\n" +
|
||||
"\x06Filter\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\tR\x06taskId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"Start_time\x18\x02 \x01(\tR\tStartTime\x12\x19\n" +
|
||||
"\bEnd_time\x18\x03 \x01(\tR\aEndTime\"\x9d\x01\n" +
|
||||
"\x13TaskResultsResponse\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\tR\x06taskId\x12)\n" +
|
||||
"\aresults\x18\x02 \x03(\v2\x0f.lib.ScanResultR\aresults\x12\x1a\n" +
|
||||
"\bfinished\x18\x03 \x01(\bR\bfinished\x12\x14\n" +
|
||||
"\x05total\x18\x04 \x01(\x03R\x05total\x12\x10\n" +
|
||||
"\x03end\x18\x05 \x01(\x03R\x03end\"\xa0\x01\n" +
|
||||
"\n" +
|
||||
"ScanResult\x12\x12\n" +
|
||||
"\x04time\x18\x01 \x01(\tR\x04time\x12\x12\n" +
|
||||
"\x04type\x18\x02 \x01(\tR\x04type\x12\x16\n" +
|
||||
"\x06target\x18\x03 \x01(\tR\x06target\x12\x16\n" +
|
||||
"\x06status\x18\x04 \x01(\tR\x06status\x12:\n" +
|
||||
"\fdetails_json\x18\x05 \x01(\v2\x17.google.protobuf.StructR\vdetailsJson2\xc4\x01\n" +
|
||||
"\fFscanService\x12T\n" +
|
||||
"\tStartScan\x12\x15.lib.StartScanRequest\x1a\x16.lib.StartScanResponse\"\x18\x82\xd3\xe4\x93\x02\x12:\x01*\"\r/v1/startscan\x12^\n" +
|
||||
"\x0eGetScanResults\x12\x17.lib.TaskResultsRequest\x1a\x18.lib.TaskResultsResponse\"\x19\x82\xd3\xe4\x93\x02\x13:\x01*\"\x0e/v1/getresultsB\bZ\x06./;libb\x06proto3"
|
||||
|
||||
var (
|
||||
file_lib_rpc_proto_rawDescOnce sync.Once
|
||||
file_lib_rpc_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_lib_rpc_proto_rawDescGZIP() []byte {
|
||||
file_lib_rpc_proto_rawDescOnce.Do(func() {
|
||||
file_lib_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_lib_rpc_proto_rawDesc), len(file_lib_rpc_proto_rawDesc)))
|
||||
})
|
||||
return file_lib_rpc_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_lib_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_lib_rpc_proto_goTypes = []any{
|
||||
(*StartScanRequest)(nil), // 0: lib.StartScanRequest
|
||||
(*StartScanResponse)(nil), // 1: lib.StartScanResponse
|
||||
(*TaskResultsRequest)(nil), // 2: lib.TaskResultsRequest
|
||||
(*Filter)(nil), // 3: lib.Filter
|
||||
(*TaskResultsResponse)(nil), // 4: lib.TaskResultsResponse
|
||||
(*ScanResult)(nil), // 5: lib.ScanResult
|
||||
(*structpb.Struct)(nil), // 6: google.protobuf.Struct
|
||||
}
|
||||
var file_lib_rpc_proto_depIdxs = []int32{
|
||||
3, // 0: lib.TaskResultsRequest.filter:type_name -> lib.Filter
|
||||
5, // 1: lib.TaskResultsResponse.results:type_name -> lib.ScanResult
|
||||
6, // 2: lib.ScanResult.details_json:type_name -> google.protobuf.Struct
|
||||
0, // 3: lib.FscanService.StartScan:input_type -> lib.StartScanRequest
|
||||
2, // 4: lib.FscanService.GetScanResults:input_type -> lib.TaskResultsRequest
|
||||
1, // 5: lib.FscanService.StartScan:output_type -> lib.StartScanResponse
|
||||
4, // 6: lib.FscanService.GetScanResults:output_type -> lib.TaskResultsResponse
|
||||
5, // [5:7] is the sub-list for method output_type
|
||||
3, // [3:5] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_lib_rpc_proto_init() }
|
||||
func file_lib_rpc_proto_init() {
|
||||
if File_lib_rpc_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_lib_rpc_proto_rawDesc), len(file_lib_rpc_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_lib_rpc_proto_goTypes,
|
||||
DependencyIndexes: file_lib_rpc_proto_depIdxs,
|
||||
MessageInfos: file_lib_rpc_proto_msgTypes,
|
||||
}.Build()
|
||||
File_lib_rpc_proto = out.File
|
||||
file_lib_rpc_proto_goTypes = nil
|
||||
file_lib_rpc_proto_depIdxs = nil
|
||||
}
|
@ -1,217 +0,0 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: lib/rpc.proto
|
||||
|
||||
/*
|
||||
Package lib is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package lib
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var (
|
||||
_ codes.Code
|
||||
_ io.Reader
|
||||
_ status.Status
|
||||
_ = errors.New
|
||||
_ = runtime.String
|
||||
_ = utilities.NewDoubleArray
|
||||
_ = metadata.Join
|
||||
)
|
||||
|
||||
func request_FscanService_StartScan_0(ctx context.Context, marshaler runtime.Marshaler, client FscanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq StartScanRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := client.StartScan(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_FscanService_StartScan_0(ctx context.Context, marshaler runtime.Marshaler, server FscanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq StartScanRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := server.StartScan(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_FscanService_GetScanResults_0(ctx context.Context, marshaler runtime.Marshaler, client FscanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq TaskResultsRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := client.GetScanResults(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_FscanService_GetScanResults_0(ctx context.Context, marshaler runtime.Marshaler, server FscanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq TaskResultsRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := server.GetScanResults(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
// RegisterFscanServiceHandlerServer registers the http handlers for service FscanService to "mux".
|
||||
// UnaryRPC :call FscanServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFscanServiceHandlerFromEndpoint instead.
|
||||
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
|
||||
func RegisterFscanServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FscanServiceServer) error {
|
||||
mux.Handle(http.MethodPost, pattern_FscanService_StartScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lib.FscanService/StartScan", runtime.WithHTTPPathPattern("/v1/startscan"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_FscanService_StartScan_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_FscanService_StartScan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_FscanService_GetScanResults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lib.FscanService/GetScanResults", runtime.WithHTTPPathPattern("/v1/getresults"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_FscanService_GetScanResults_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_FscanService_GetScanResults_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterFscanServiceHandlerFromEndpoint is same as RegisterFscanServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterFscanServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
return RegisterFscanServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterFscanServiceHandler registers the http handlers for service FscanService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterFscanServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterFscanServiceHandlerClient(ctx, mux, NewFscanServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterFscanServiceHandlerClient registers the http handlers for service FscanService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FscanServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FscanServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "FscanServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
|
||||
func RegisterFscanServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FscanServiceClient) error {
|
||||
mux.Handle(http.MethodPost, pattern_FscanService_StartScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/lib.FscanService/StartScan", runtime.WithHTTPPathPattern("/v1/startscan"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_FscanService_StartScan_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_FscanService_StartScan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_FscanService_GetScanResults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/lib.FscanService/GetScanResults", runtime.WithHTTPPathPattern("/v1/getresults"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_FscanService_GetScanResults_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_FscanService_GetScanResults_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_FscanService_StartScan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "startscan"}, ""))
|
||||
pattern_FscanService_GetScanResults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getresults"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_FscanService_StartScan_0 = runtime.ForwardResponseMessage
|
||||
forward_FscanService_GetScanResults_0 = runtime.ForwardResponseMessage
|
||||
)
|
@ -1,73 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package lib;
|
||||
|
||||
option go_package = "./;lib";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
|
||||
service FscanService {
|
||||
// 启动扫描任务
|
||||
rpc StartScan(StartScanRequest) returns (StartScanResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/startscan"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// 获取扫描结果(非流式)
|
||||
rpc GetScanResults(TaskResultsRequest) returns (TaskResultsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/getresults"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: 流式获取扫描结果
|
||||
// rpc StreamScanResults(TaskResultsRequest) returns (stream ScanResult) {
|
||||
// option (google.api.http) = {
|
||||
// get: "/v1/streamresults"
|
||||
// };
|
||||
// }
|
||||
}
|
||||
|
||||
// 启动任务的请求
|
||||
message StartScanRequest {
|
||||
string arg= 1;
|
||||
}
|
||||
|
||||
// 启动任务的响应
|
||||
message StartScanResponse {
|
||||
string task_id = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
// 获取扫描结果的请求
|
||||
message TaskResultsRequest {
|
||||
Filter filter = 1; // 筛选条件(如关键字、状态等)
|
||||
}
|
||||
|
||||
message Filter {
|
||||
string task_id = 1; // 任务ID
|
||||
string Start_time = 2; // 开始时间
|
||||
string End_time = 3; // 结束时间
|
||||
}
|
||||
|
||||
// 获取扫描结果的响应
|
||||
message TaskResultsResponse {
|
||||
string task_id = 1;
|
||||
repeated ScanResult results = 2;
|
||||
bool finished = 3;
|
||||
int64 total = 4; // 总结果数
|
||||
int64 end = 5; // 结束结果数
|
||||
}
|
||||
|
||||
// 扫描结果结构体
|
||||
message ScanResult {
|
||||
string time = 1;
|
||||
string type = 2;
|
||||
string target = 3;
|
||||
string status = 4;
|
||||
google.protobuf.Struct details_json = 5;
|
||||
}
|
@ -1,163 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: lib/rpc.proto
|
||||
|
||||
package lib
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
FscanService_StartScan_FullMethodName = "/lib.FscanService/StartScan"
|
||||
FscanService_GetScanResults_FullMethodName = "/lib.FscanService/GetScanResults"
|
||||
)
|
||||
|
||||
// FscanServiceClient is the client API for FscanService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type FscanServiceClient interface {
|
||||
// 启动扫描任务
|
||||
StartScan(ctx context.Context, in *StartScanRequest, opts ...grpc.CallOption) (*StartScanResponse, error)
|
||||
// 获取扫描结果(非流式)
|
||||
GetScanResults(ctx context.Context, in *TaskResultsRequest, opts ...grpc.CallOption) (*TaskResultsResponse, error)
|
||||
}
|
||||
|
||||
type fscanServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewFscanServiceClient(cc grpc.ClientConnInterface) FscanServiceClient {
|
||||
return &fscanServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *fscanServiceClient) StartScan(ctx context.Context, in *StartScanRequest, opts ...grpc.CallOption) (*StartScanResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StartScanResponse)
|
||||
err := c.cc.Invoke(ctx, FscanService_StartScan_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fscanServiceClient) GetScanResults(ctx context.Context, in *TaskResultsRequest, opts ...grpc.CallOption) (*TaskResultsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TaskResultsResponse)
|
||||
err := c.cc.Invoke(ctx, FscanService_GetScanResults_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// FscanServiceServer is the server API for FscanService service.
|
||||
// All implementations must embed UnimplementedFscanServiceServer
|
||||
// for forward compatibility.
|
||||
type FscanServiceServer interface {
|
||||
// 启动扫描任务
|
||||
StartScan(context.Context, *StartScanRequest) (*StartScanResponse, error)
|
||||
// 获取扫描结果(非流式)
|
||||
GetScanResults(context.Context, *TaskResultsRequest) (*TaskResultsResponse, error)
|
||||
mustEmbedUnimplementedFscanServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedFscanServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedFscanServiceServer struct{}
|
||||
|
||||
func (UnimplementedFscanServiceServer) StartScan(context.Context, *StartScanRequest) (*StartScanResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StartScan not implemented")
|
||||
}
|
||||
func (UnimplementedFscanServiceServer) GetScanResults(context.Context, *TaskResultsRequest) (*TaskResultsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetScanResults not implemented")
|
||||
}
|
||||
func (UnimplementedFscanServiceServer) mustEmbedUnimplementedFscanServiceServer() {}
|
||||
func (UnimplementedFscanServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeFscanServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to FscanServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeFscanServiceServer interface {
|
||||
mustEmbedUnimplementedFscanServiceServer()
|
||||
}
|
||||
|
||||
func RegisterFscanServiceServer(s grpc.ServiceRegistrar, srv FscanServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedFscanServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&FscanService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _FscanService_StartScan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartScanRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FscanServiceServer).StartScan(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FscanService_StartScan_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FscanServiceServer).StartScan(ctx, req.(*StartScanRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FscanService_GetScanResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TaskResultsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FscanServiceServer).GetScanResults(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FscanService_GetScanResults_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FscanServiceServer).GetScanResults(ctx, req.(*TaskResultsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// FscanService_ServiceDesc is the grpc.ServiceDesc for FscanService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var FscanService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "lib.FscanService",
|
||||
HandlerType: (*FscanServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StartScan",
|
||||
Handler: _FscanService_StartScan_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetScanResults",
|
||||
Handler: _FscanService_GetScanResults_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "lib/rpc.proto",
|
||||
}
|
112
RPC/server.go
112
RPC/server.go
@ -1,112 +0,0 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/shadow1ng/fscan/Common"
|
||||
pb "github.com/shadow1ng/fscan/RPC/lib"
|
||||
"github.com/shadow1ng/fscan/RPC/service"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
var internalSecretKey string
|
||||
|
||||
// 启动 gRPC + HTTP Gateway 服务(仅当设置了 API 地址时)
|
||||
func StartApiServer() error {
|
||||
if Common.ApiAddr == "" {
|
||||
return nil
|
||||
}
|
||||
if Common.SecretKey != "" {
|
||||
internalSecretKey = Common.SecretKey
|
||||
} else {
|
||||
internalSecretKey = time.Now().Format("20060102150405")
|
||||
}
|
||||
|
||||
grpcAddr := "127.0.0.1:50051"
|
||||
httpAddr := validateHTTPAddr(Common.ApiAddr, ":8088")
|
||||
|
||||
go runGRPCServer(grpcAddr)
|
||||
|
||||
if err := runHTTPGateway(httpAddr, grpcAddr); err != nil {
|
||||
Common.LogError("HTTP 启动失败: " + err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// 启动 gRPC 服务
|
||||
func runGRPCServer(addr string) {
|
||||
lis, err := net.Listen("tcp", addr)
|
||||
if err != nil {
|
||||
Common.LogError("监听失败: " + err.Error())
|
||||
return
|
||||
}
|
||||
s := grpc.NewServer()
|
||||
pb.RegisterFscanServiceServer(s, &service.FscanService{})
|
||||
Common.LogSuccess("✅ gRPC 服务已启动,地址: " + addr)
|
||||
if err := s.Serve(lis); err != nil {
|
||||
Common.LogError("gRPC 启动失败: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// 启动 HTTP Gateway
|
||||
func runHTTPGateway(httpAddr, grpcAddr string) error {
|
||||
ctx := context.Background()
|
||||
mux := runtime.NewServeMux()
|
||||
opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}
|
||||
|
||||
err := pb.RegisterFscanServiceHandlerFromEndpoint(ctx, mux, grpcAddr, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 使用中间件包装 mux
|
||||
handler := applyMiddlewares(mux)
|
||||
|
||||
Common.LogSuccess("✅ HTTP Gateway 已启动,地址: http://" + httpAddr)
|
||||
Common.LogSuccess("✅ API Secret: " + internalSecretKey)
|
||||
return http.ListenAndServe(httpAddr, handler)
|
||||
}
|
||||
|
||||
// 注册 HTTP 中间件
|
||||
func applyMiddlewares(handler http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization, Fscan-API-SECRET")
|
||||
|
||||
if r.Method == "OPTIONS" {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return
|
||||
}
|
||||
|
||||
secret := r.Header.Get("Fscan-API-SECRET")
|
||||
if secret == "" || secret != internalSecretKey {
|
||||
http.Error(w, `无效的 API Secret,请通过请求头 Fscan-API-SECRET 提供正确的密钥。
|
||||
如果你未手动配置 SecretKey,服务会在启动时自动生成一个随机密钥,并输出到日志中。`, http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
handler.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
// 校验监听地址格式,格式非法使用默认
|
||||
func validateHTTPAddr(input, fallback string) string {
|
||||
if input == "" {
|
||||
Common.LogInfo("未指定 API 地址,使用默认地址: " + fallback)
|
||||
return fallback
|
||||
}
|
||||
_, _, err := net.SplitHostPort(input)
|
||||
if err != nil {
|
||||
Common.LogError("无效的 API 地址格式 [" + input + "],使用默认地址: " + fallback)
|
||||
return fallback
|
||||
}
|
||||
return input
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/shadow1ng/fscan/Common"
|
||||
"github.com/shadow1ng/fscan/Core"
|
||||
pb "github.com/shadow1ng/fscan/RPC/lib"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
)
|
||||
|
||||
type FscanService struct {
|
||||
pb.UnimplementedFscanServiceServer
|
||||
scanMutex sync.Mutex
|
||||
isScanning int32
|
||||
scanStartTime time.Time // 记录扫描开始时间
|
||||
}
|
||||
|
||||
func (s *FscanService) StartScan(ctx context.Context, req *pb.StartScanRequest) (*pb.StartScanResponse, error) {
|
||||
if !atomic.CompareAndSwapInt32(&s.isScanning, 0, 1) {
|
||||
return &pb.StartScanResponse{
|
||||
TaskId: "current",
|
||||
Message: "已有扫描任务正在运行,请稍后重试",
|
||||
}, nil
|
||||
}
|
||||
|
||||
s.scanStartTime = time.Now() // 记录任务开始时间
|
||||
|
||||
go func(req *pb.StartScanRequest) {
|
||||
defer atomic.StoreInt32(&s.isScanning, 0)
|
||||
|
||||
s.scanMutex.Lock()
|
||||
defer s.scanMutex.Unlock()
|
||||
|
||||
Common.LogDebug("异步执行扫描请求,目标: " + req.Arg)
|
||||
|
||||
var info Common.HostInfo
|
||||
if err := Common.FlagFromRemote(&info, req.Arg); err != nil {
|
||||
return
|
||||
}
|
||||
if err := Common.Parse(&info); err != nil {
|
||||
return
|
||||
}
|
||||
if err := Common.CloseOutput(); err != nil {
|
||||
Common.LogError(fmt.Sprintf("关闭输出系统失败: %v", err))
|
||||
return
|
||||
}
|
||||
if err := Common.InitOutput(); err != nil {
|
||||
Common.LogError(fmt.Sprintf("初始化输出系统失败: %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
Core.Scan(info)
|
||||
|
||||
Common.LogDebug("扫描任务完成")
|
||||
}(req)
|
||||
|
||||
return &pb.StartScanResponse{
|
||||
TaskId: "current",
|
||||
Message: "成功启动扫描任务",
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *FscanService) GetScanResults(ctx context.Context, req *pb.TaskResultsRequest) (*pb.TaskResultsResponse, error) {
|
||||
// 获取扫描结果
|
||||
results, err := Common.GetResults()
|
||||
if err != nil {
|
||||
// 记录详细错误信息
|
||||
Common.LogError(fmt.Sprintf("读取结果失败: %v", err))
|
||||
return nil, fmt.Errorf("读取结果失败: %w", err)
|
||||
}
|
||||
|
||||
// 创建一个用于存储转换后的pb扫描结果的切片
|
||||
pbResults := make([]*pb.ScanResult, 0, len(results))
|
||||
|
||||
// 遍历每一项结果,进行转换
|
||||
for _, r := range results {
|
||||
// 尝试将详情转换为Struct
|
||||
detailsStruct, err := structpb.NewStruct(r.Details)
|
||||
if err != nil {
|
||||
// 记录转换失败的详细信息,并跳过当前项
|
||||
Common.LogError(fmt.Sprintf("转换为 Struct 失败 (Target: %s, Type: %s): %v", r.Target, r.Type, err))
|
||||
continue
|
||||
}
|
||||
|
||||
// 将转换后的结果添加到 pbResults
|
||||
pbResults = append(pbResults, &pb.ScanResult{
|
||||
Time: r.Time.Format(time.RFC3339), // 使用 RFC3339 格式化时间
|
||||
Type: string(r.Type),
|
||||
Target: r.Target,
|
||||
Status: r.Status,
|
||||
DetailsJson: detailsStruct,
|
||||
})
|
||||
}
|
||||
|
||||
// 通过原子操作判断扫描是否完成
|
||||
finished := atomic.LoadInt32(&s.isScanning) == 0
|
||||
|
||||
// 如果任务未完成,计算 Total 和 End,仅在需要时计算
|
||||
var total, end int64
|
||||
if !finished {
|
||||
total = Common.Num
|
||||
end = Common.End
|
||||
}
|
||||
|
||||
// 返回响应
|
||||
return &pb.TaskResultsResponse{
|
||||
Results: pbResults,
|
||||
Finished: finished,
|
||||
Total: total, // 返回 Total
|
||||
End: end, // 返回 End
|
||||
}, nil
|
||||
}
|
@ -59,7 +59,7 @@ func InfoCheck(Url string, CheckData *[]CheckDatas) []string {
|
||||
// 输出结果
|
||||
if len(matchedInfos) > 0 {
|
||||
result := fmt.Sprintf("发现指纹 目标: %-25v 指纹: %s", Url, matchedInfos)
|
||||
Common.LogSuccess(result)
|
||||
Common.LogInfo(result)
|
||||
return matchedInfos
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ func loadPocsConcurrently(pocFiles []string, isEmbedded bool, pocPath string) {
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
Common.LogSuccess(fmt.Sprintf("POC加载完成: 总共%d个,成功%d个,失败%d个",
|
||||
Common.LogBase(fmt.Sprintf("POC加载完成: 总共%d个,成功%d个,失败%d个",
|
||||
pocCount, successCount, failCount))
|
||||
}
|
||||
|
||||
|
20
go.mod
20
go.mod
@ -1,8 +1,8 @@
|
||||
module github.com/shadow1ng/fscan
|
||||
|
||||
go 1.23.0
|
||||
go 1.22
|
||||
|
||||
toolchain go1.23.3
|
||||
toolchain go1.23.7
|
||||
|
||||
require (
|
||||
github.com/IBM/sarama v1.43.3
|
||||
@ -13,7 +13,6 @@ require (
|
||||
github.com/gocql/gocql v1.7.0
|
||||
github.com/google/cel-go v0.13.0
|
||||
github.com/gosnmp/gosnmp v1.38.0
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3
|
||||
github.com/hirochachacha/go-smb2 v1.1.0
|
||||
github.com/jlaffaye/ftp v0.2.0
|
||||
github.com/lib/pq v1.10.9
|
||||
@ -25,14 +24,13 @@ require (
|
||||
github.com/sijms/go-ora/v2 v2.5.29
|
||||
github.com/stacktitan/smb v0.0.0-20190531122847-da9a425dceb8
|
||||
github.com/tomatome/grdp v0.0.0-20211231062539-be8adab7eaf3
|
||||
golang.org/x/crypto v0.33.0
|
||||
golang.org/x/net v0.35.0
|
||||
golang.org/x/sync v0.11.0
|
||||
golang.org/x/sys v0.30.0
|
||||
golang.org/x/text v0.22.0
|
||||
golang.org/x/crypto v0.31.0
|
||||
golang.org/x/net v0.32.0
|
||||
golang.org/x/sync v0.10.0
|
||||
golang.org/x/sys v0.28.0
|
||||
golang.org/x/text v0.21.0
|
||||
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c
|
||||
google.golang.org/grpc v1.70.0
|
||||
google.golang.org/protobuf v1.36.5
|
||||
google.golang.org/protobuf v1.28.1
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
@ -75,7 +73,7 @@ require (
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
||||
github.com/stoewer/go-strcase v1.2.0 // indirect
|
||||
golang.org/x/term v0.29.0 // indirect
|
||||
golang.org/x/term v0.27.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
)
|
||||
|
||||
|
49
go.sum
49
go.sum
@ -85,10 +85,6 @@ github.com/go-ldap/ldap/v3 v3.4.9 h1:KxX9eO44/MpqPXVVMPJDB+k/35GEePHE/Jfvl7oRMUo
|
||||
github.com/go-ldap/ldap/v3 v3.4.9/go.mod h1:+CE/4PPOOdEPGTi2B7qXKQOq+pNBvXZtlBNcVZY0AWI=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
@ -119,8 +115,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
@ -134,9 +128,8 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gxui v0.0.0-20151028112939-f85e0a97b3a4/go.mod h1:Pw1H1OjSNHiqeuxAduB1BKYXIwFtsyrY47nEqSgEiCM=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
@ -161,8 +154,6 @@ github.com/goxjs/glfw v0.0.0-20191126052801-d2efb5f20838/go.mod h1:oS8P8gVOT4ywT
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
@ -226,8 +217,8 @@ github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ib
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
@ -363,16 +354,6 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
@ -396,9 +377,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
||||
golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@ -457,9 +437,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
|
||||
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
|
||||
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -474,9 +453,8 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
|
||||
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -514,9 +492,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.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/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
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=
|
||||
@ -526,9 +503,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
|
||||
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
@ -540,9 +516,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
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/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
@ -596,8 +571,6 @@ google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
|
||||
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@ -606,8 +579,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
5
main.go
5
main.go
@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/shadow1ng/fscan/Common"
|
||||
"github.com/shadow1ng/fscan/Core"
|
||||
rpc "github.com/shadow1ng/fscan/RPC"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -15,10 +14,6 @@ func main() {
|
||||
var Info Common.HostInfo
|
||||
Common.Flag(&Info)
|
||||
|
||||
// 启动 gRPC + HTTP Gateway 服务
|
||||
if err := rpc.StartApiServer(); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
// 解析 CLI 参数
|
||||
if err := Common.Parse(&Info); err != nil {
|
||||
os.Exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user