mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
refactor: 输出格式重构,去掉所有插件的多线程,因为多线程会导致结果不准确,加入进度条
This commit is contained in:
@@ -89,10 +89,10 @@ var (
|
||||
)
|
||||
|
||||
func LocalInfoScan(info *Common.HostInfo) (err error) {
|
||||
fmt.Println("[+] LocalInfo扫描模块开始...")
|
||||
fmt.Println("LocalInfo扫描模块开始...")
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
errlog := fmt.Sprintf("[-] Get UserHomeDir error: %v", err)
|
||||
errlog := fmt.Sprintf("Get UserHomeDir error: %v", err)
|
||||
Common.LogError(errlog)
|
||||
return err
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func LocalInfoScan(info *Common.HostInfo) (err error) {
|
||||
// 规则搜索
|
||||
searchSensitiveFiles()
|
||||
|
||||
fmt.Println("[+] LocalInfo扫描模块结束...")
|
||||
fmt.Println("LocalInfo扫描模块结束...")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ func scanFixedLocations(home string) {
|
||||
|
||||
func checkAndLogFile(path string) {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
result := fmt.Sprintf("[+] Found sensitive file: %s", path)
|
||||
result := fmt.Sprintf("Found sensitive file: %s", path)
|
||||
Common.LogSuccess(result)
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ func searchSensitiveFiles() {
|
||||
for _, white := range whitelist {
|
||||
fileName := strings.ToLower(info.Name())
|
||||
if strings.Contains(fileName, white) {
|
||||
result := fmt.Sprintf("[+] Found potential sensitive file: %s", path)
|
||||
result := fmt.Sprintf("Found potential sensitive file: %s", path)
|
||||
Common.LogSuccess(result)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user