feat: initialize lfi scanning

This commit is contained in:
vmfunc
2024-07-29 04:25:47 +00:00
parent 322d24e7ff
commit dde5e39c4b

30
pkg/scan/lfi.go Normal file
View File

@@ -0,0 +1,30 @@
package scan
import (
"fmt"
"os"
"strings"
"github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles"
"github.com/dropalldatabases/sif/pkg/logger"
)
func Lfi(url string, logdir string) {
fmt.Println(styles.Separator.Render("💭 Starting " + styles.Status.Render("LFI Scanning") + "..."))
sanitizedURL := strings.Split(url, "://")[1]
if logdir != "" {
if err := logger.WriteHeader(sanitizedURL, logdir, " LFI scanning"); err != nil {
log.Errorf("Error creating log file: %v", err)
return
}
}
whoislog := log.NewWithOptions(os.Stderr, log.Options{
Prefix: "LFI 💭",
})
whoislog.Infof("Starting LFI")
}