mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-08 21:37:15 -07:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 32acf6b445 | |||
| cbcc4f43dc | |||
| afe55f36ee | |||
| 2ea412b04d | |||
| d98a1c4e84 | |||
| 2f288c4eb6 | |||
| 1f808bbea3 | |||
| c9497abfcb |
@@ -0,0 +1,15 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: vmfunc
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
polar: # Replace with a single Polar username
|
||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
thanks_dev: # Replace with a single thanks.dev username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -8,6 +8,7 @@
|
||||
[](https://github.com/vmfunc/sif/actions)
|
||||
[](LICENSE)
|
||||
[](https://aur.archlinux.org/packages/sif)
|
||||
[](https://search.nixos.org/packages?query=sif)
|
||||
[](https://github.com/vmfunc/homebrew-sif)
|
||||
[](https://cloudsmith.io/~sif/repos/deb/packages/)
|
||||
[](https://discord.gg/sifcli)
|
||||
@@ -45,6 +46,25 @@ yay -S sif
|
||||
paru -S sif
|
||||
```
|
||||
|
||||
### nix
|
||||
|
||||
```bash
|
||||
# nixpkgs (declarative — add to configuration.nix or home-manager)
|
||||
environment.systemPackages = [ pkgs.sif ];
|
||||
|
||||
# or imperatively
|
||||
nix profile install nixpkgs#sif
|
||||
|
||||
# or just run it without installing
|
||||
nix run nixpkgs#sif -- -u https://example.com -all
|
||||
```
|
||||
|
||||
the repo also ships a flake if you want to build from source:
|
||||
|
||||
```bash
|
||||
nix run github:vmfunc/sif
|
||||
```
|
||||
|
||||
### debian/ubuntu (apt)
|
||||
|
||||
```bash
|
||||
|
||||
@@ -17,6 +17,7 @@ import "github.com/dropalldatabases/sif/internal/modules"
|
||||
// Register registers all Go-based built-in scans as modules.
|
||||
// Allows complex Go scans to participate in the module system
|
||||
func Register() {
|
||||
modules.Register(&ShodanModule{})
|
||||
modules.Register(&FrameworksModule{})
|
||||
modules.Register(&NucleiModule{})
|
||||
modules.Register(&WhoisModule{})
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
||||
: :
|
||||
: █▀ █ █▀▀ · Blazing-fast pentesting suite :
|
||||
: ▄█ █ █▀ · BSD 3-Clause License :
|
||||
: :
|
||||
: (c) 2022-2025 vmfunc (vmfunc), xyzeva, :
|
||||
: lunchcat alumni & contributors :
|
||||
: :
|
||||
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
||||
*/
|
||||
|
||||
package builtin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/dropalldatabases/sif/internal/modules"
|
||||
"github.com/dropalldatabases/sif/internal/scan"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ShodanModule struct{}
|
||||
|
||||
func (m *ShodanModule) Info() modules.Info {
|
||||
return modules.Info{
|
||||
ID: "shodan-lookup",
|
||||
Name: "Shodan Host Intelligence",
|
||||
Author: "sif",
|
||||
Severity: "info",
|
||||
Description: "Queries Shodan API for host information, open ports, and vulnerabilities (requires SHODAN_API_KEY)",
|
||||
Tags: []string{"recon", "osint", "shodan", "vulns"},
|
||||
}
|
||||
}
|
||||
|
||||
func (m *ShodanModule) Type() modules.ModuleType {
|
||||
return modules.TypeScript
|
||||
}
|
||||
|
||||
func (m *ShodanModule) Execute(ctx context.Context, target string, opts modules.Options) (*modules.Result, error) {
|
||||
// Call existing legacy scan.Shodan function
|
||||
shodanResult, err := scan.Shodan(target, opts.Timeout, opts.LogDir)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := &modules.Result{
|
||||
ModuleID: m.Info().ID,
|
||||
Target: target,
|
||||
Findings: []modules.Finding{},
|
||||
}
|
||||
|
||||
// If nothing returned, return empty result
|
||||
if shodanResult == nil || shodanResult.IP == "" {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Create main finding
|
||||
evidence := fmt.Sprintf("Shodan data found for %s", shodanResult.IP)
|
||||
|
||||
severity := "info"
|
||||
if len(shodanResult.Vulns) > 0 {
|
||||
severity = "high"
|
||||
evidence = fmt.Sprintf("Host %s has %d known vulnerabilities", shodanResult.IP, len(shodanResult.Vulns))
|
||||
}
|
||||
|
||||
finding := modules.Finding{
|
||||
URL: target,
|
||||
Severity: severity,
|
||||
Evidence: evidence,
|
||||
Extracted: map[string]string{
|
||||
"ip": shodanResult.IP,
|
||||
},
|
||||
}
|
||||
|
||||
// Add hostnames
|
||||
if len(shodanResult.Hostnames) > 0 {
|
||||
finding.Extracted["hostnames"] = strings.Join(shodanResult.Hostnames, ", ")
|
||||
}
|
||||
|
||||
// Add organization info
|
||||
if shodanResult.Organization != "" {
|
||||
finding.Extracted["organization"] = shodanResult.Organization
|
||||
}
|
||||
|
||||
// Add ISP info
|
||||
if shodanResult.ISP != "" {
|
||||
finding.Extracted["isp"] = shodanResult.ISP
|
||||
}
|
||||
|
||||
// Add ASN
|
||||
if shodanResult.ASN != "" {
|
||||
finding.Extracted["asn"] = shodanResult.ASN
|
||||
}
|
||||
|
||||
// Add location
|
||||
if shodanResult.Country != "" {
|
||||
location := shodanResult.Country
|
||||
if shodanResult.City != "" {
|
||||
location = shodanResult.City + ", " + shodanResult.Country
|
||||
}
|
||||
|
||||
finding.Extracted["location"] = location
|
||||
}
|
||||
|
||||
// Add OS
|
||||
if shodanResult.OS != "" {
|
||||
finding.Extracted["os"] = shodanResult.OS
|
||||
}
|
||||
|
||||
// Add open ports
|
||||
if len(shodanResult.Ports) > 0 {
|
||||
portStrs := make([]string, len(shodanResult.Ports))
|
||||
for i, port := range shodanResult.Ports {
|
||||
portStrs[i] = fmt.Sprintf("%d", port)
|
||||
}
|
||||
|
||||
finding.Extracted["open_ports"] = strings.Join(portStrs, ", ")
|
||||
finding.Extracted["port_count"] = fmt.Sprintf("%d", len(shodanResult.Ports))
|
||||
}
|
||||
|
||||
// Add vulnerabilities
|
||||
if len(shodanResult.Vulns) > 0 {
|
||||
finding.Extracted["vulnerabilities"] = strings.Join(shodanResult.Vulns, ", ")
|
||||
finding.Extracted["vuln_count"] = fmt.Sprintf("%d", len(shodanResult.Vulns))
|
||||
}
|
||||
|
||||
// Add last update
|
||||
if shodanResult.LastUpdate != "" {
|
||||
finding.Extracted["last_update"] = shodanResult.LastUpdate
|
||||
}
|
||||
|
||||
// Add service count
|
||||
if len(shodanResult.Services) > 0 {
|
||||
finding.Extracted["service_count"] = fmt.Sprintf("%d", len(shodanResult.Services))
|
||||
|
||||
// Add service details
|
||||
serviceDetails := make([]string, 0, len(shodanResult.Services))
|
||||
for _, service := range shodanResult.Services {
|
||||
detail := fmt.Sprintf("%d/%s", service.Port, service.Protocol)
|
||||
if service.Product != "" {
|
||||
detail += " " + service.Product
|
||||
|
||||
if service.Version != "" {
|
||||
detail += " " + service.Version
|
||||
}
|
||||
}
|
||||
serviceDetails = append(serviceDetails, detail)
|
||||
}
|
||||
finding.Extracted["services"] = strings.Join(serviceDetails, "; ")
|
||||
}
|
||||
|
||||
result.Findings = append(result.Findings, finding)
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user