refactor: 重构涉及文件更新

This commit is contained in:
ZacharyZcR
2024-12-18 21:56:08 +08:00
parent cae98e7d90
commit ab14b15864
27 changed files with 260 additions and 235 deletions
+4 -3
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"fmt"
"github.com/shadow1ng/fscan/Config"
"github.com/shadow1ng/fscan/common"
"gopkg.in/yaml.v3"
"net"
@@ -14,7 +15,7 @@ import (
var errNetBIOS = errors.New("netbios error")
func NetBIOS(info *common.HostInfo) error {
func NetBIOS(info *Config.HostInfo) error {
netbios, _ := NetBIOS1(info)
output := netbios.String()
if len(output) > 0 {
@@ -25,7 +26,7 @@ func NetBIOS(info *common.HostInfo) error {
return errNetBIOS
}
func NetBIOS1(info *common.HostInfo) (netbios NetBiosInfo, err error) {
func NetBIOS1(info *Config.HostInfo) (netbios NetBiosInfo, err error) {
netbios, err = GetNbnsname(info)
var payload0 []byte
if netbios.ServerService != "" || netbios.WorkstationService != "" {
@@ -84,7 +85,7 @@ func NetBIOS1(info *common.HostInfo) (netbios NetBiosInfo, err error) {
return
}
func GetNbnsname(info *common.HostInfo) (netbios NetBiosInfo, err error) {
func GetNbnsname(info *Config.HostInfo) (netbios NetBiosInfo, err error) {
senddata1 := []byte{102, 102, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 32, 67, 75, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 0, 0, 33, 0, 1}
//senddata1 := []byte("ff\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00 CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x00\x00!\x00\x01")
realhost := fmt.Sprintf("%s:137", info.Host)