We welcome contributions from the community! Whether you’re fixing bugs, adding new features, improving documentation, or creating new POCs, your help is appreciated.
# Build for LinuxGOOS=linux GOARCH=amd64 go build -o scan4all-linux# Build for WindowsGOOS=windows GOARCH=amd64 go build -o scan4all.exe# Build for macOSGOOS=darwin GOARCH=amd64 go build -o scan4all-mac
# Run testsgo test ./...# Test specific packagego test ./pkg/fingerprint# Run with verbose outputgo test -v ./...# Test your changes manually./scan4all -host http://testsite.com -v
// Good: Clear function names and comments// CheckVulnerability checks if the target is vulnerable to CVE-XXXXfunc CheckVulnerability(url string) bool { // Implementation return false}// Good: Proper error handlingif err != nil { log.Printf("Error: %v", err) return false}// Good: Use constants for magic valuesconst ( DefaultTimeout = 10 MaxRetries = 3)
Package Organization
Group related functionality in packages
Use lowercase package names
Keep packages focused on a single responsibility
Export only necessary functions and types
package mypackage// Exported function (public)func PublicFunction() {}// Unexported function (private)func privateHelper() {}
Error Handling
// Always check errorsresult, err := doSomething()if err != nil { return fmt.Errorf("failed to do something: %w", err)}// Use meaningful error messagesif !isValid { return fmt.Errorf("invalid target: %s", target)}
Documentation
// Package documentation// Package tomcat provides POCs for Apache Tomcat vulnerabilities.package tomcat// Function documentation// CVE_2017_12615 checks for Tomcat PUT method RCE vulnerability.// Returns true if the target is vulnerable.func CVE_2017_12615(url string) bool { // Implementation}
# Test against local test environment./scan4all -host http://localhost:8080 -v# Test with specific modules./scan4all -host http://testsite.com -v -debug# Test POC detectionFingerPrint="Apache Tomcat" ./scan4all -host http://tomcat-test.com