@@ -77,9 +77,10 @@ type BugBountyEngine struct {
7777 checkpointManager CheckpointManager
7878
7979 // Output and Persistence (REFACTORED: extracted from bounty_engine.go)
80- outputFormatter * OutputFormatter
81- persistenceManager * PersistenceManager
82- platformIntegration * PlatformIntegration
80+ outputFormatter * OutputFormatter
81+ persistenceManager * PersistenceManager
82+ platformIntegration * PlatformIntegration
83+ organizationFootprinting * OrganizationFootprinting
8384
8485 // Configuration
8586 config BugBountyConfig
@@ -506,116 +507,21 @@ func (e *BugBountyEngine) Execute(ctx context.Context, target string) (*BugBount
506507
507508 // Phase 0: Organization Footprinting (if enabled)
508509 var orgDomains []string
509- if e .orgCorrelator != nil && ! e .config .SkipDiscovery {
510- footprintStart := time .Now ()
511-
512- // IMMEDIATE CLI FEEDBACK - Show user what's happening
513- fmt .Println ()
514- fmt .Println ("═══════════════════════════════════════════════════════════════" )
515- fmt .Println (" Phase 0: Organization Footprinting" )
516- fmt .Println ("═══════════════════════════════════════════════════════════════" )
517- fmt .Printf (" Analyzing: %s\n " , target )
518- fmt .Printf (" • WHOIS lookup for organization details...\n " )
519- fmt .Printf (" • Certificate transparency logs for related domains...\n " )
520- fmt .Printf (" • ASN discovery for IP ranges...\n " )
521- fmt .Println ()
522-
523- dbLogger .Infow (" Phase 0: Organization Footprinting" ,
524- "target" , target ,
525- "enable_whois" , e .config .EnableWHOISAnalysis ,
526- "enable_cert_transparency" , e .config .EnableCertTransparency ,
527- "enable_related_domains" , e .config .EnableRelatedDomainDisc ,
528- "component" , "orchestrator" ,
529- )
530-
531- // Correlate organization from target
532- org , err := e .orgCorrelator .FindOrganizationAssets (ctx , target )
533- if err != nil {
534- // ENHANCED ERROR LOGGING: Provide detailed diagnostics
535- dbLogger .Errorw ("CRITICAL: Organization footprinting failed" ,
536- "error" , err ,
537- "error_type" , fmt .Sprintf ("%T" , err ),
538- "target" , target ,
539- "whois_enabled" , e .config .EnableWHOISAnalysis ,
540- "cert_enabled" , e .config .EnableCertTransparency ,
541- "asn_enabled" , true ,
542- "elapsed_time" , time .Since (footprintStart ).String (),
543- "component" , "orchestrator" ,
544- )
545-
546- // Store failed phase result
547- result .PhaseResults ["footprinting" ] = PhaseResult {
548- Phase : "footprinting" ,
549- Status : "failed" ,
550- StartTime : footprintStart ,
551- EndTime : time .Now (),
552- Duration : time .Since (footprintStart ),
553- Error : err .Error (),
510+ if e .organizationFootprinting != nil && e .organizationFootprinting .IsEnabled () {
511+ footprintResult := e .organizationFootprinting .CorrelateOrganization (ctx , target , updateProgress , saveCheckpoint )
512+ if footprintResult != nil {
513+ // Store organization info and domains
514+ if footprintResult .Organization != nil {
515+ result .OrganizationInfo = footprintResult .Organization
554516 }
555- } else if org == nil {
556- // NULL RESULT: Correlation returned nil without error
557- dbLogger .Warnw (" Organization footprinting returned nil (no error)" ,
558- "target" , target ,
559- "elapsed_time" , time .Since (footprintStart ).String (),
560- "component" , "orchestrator" ,
561- )
562-
563- result .PhaseResults ["footprinting" ] = PhaseResult {
564- Phase : "footprinting" ,
565- Status : "completed" ,
566- StartTime : footprintStart ,
567- EndTime : time .Now (),
568- Duration : time .Since (footprintStart ),
569- Findings : 0 ,
570- }
571- } else {
572- // Store org info for later display
573- result .OrganizationInfo = org // Add to result for display
574-
575- dbLogger .Infow (" Organization footprinting completed" ,
576- "organization_name" , org .Name ,
577- "domains_found" , len (org .Domains ),
578- "asns_found" , len (org .ASNs ),
579- "ip_ranges_found" , len (org .IPRanges ),
580- "certificates_found" , len (org .Certificates ),
581- "confidence" , org .Confidence ,
582- "sources" , org .Sources ,
583- "duration" , time .Since (footprintStart ).String (),
584- "component" , "orchestrator" ,
585- )
586-
587- // USER-FRIENDLY CLI DISPLAY
588- e .outputFormatter .DisplayOrganizationFootprinting (org , time .Since (footprintStart ))
517+ orgDomains = footprintResult .Domains
589518
590- // Store discovered domains for parallel scanning
591- orgDomains = org .Domains
592-
593- // Log each discovered domain
594- for i , domain := range org .Domains {
595- dbLogger .Infow (" Discovered related domain" ,
596- "index" , i + 1 ,
597- "domain" , domain ,
598- "organization" , org .Name ,
599- "component" , "orchestrator" ,
600- )
601- }
602-
603- // Store organization metadata in result
519+ // Store phase result
604520 if result .PhaseResults == nil {
605521 result .PhaseResults = make (map [string ]PhaseResult )
606522 }
607- result .PhaseResults ["footprinting" ] = PhaseResult {
608- Phase : "footprinting" ,
609- Status : "completed" ,
610- StartTime : footprintStart ,
611- EndTime : time .Now (),
612- Duration : time .Since (footprintStart ),
613- Findings : len (org .Domains ), // Count domains as findings
614- }
523+ result .PhaseResults ["footprinting" ] = footprintResult .PhaseResult
615524 }
616-
617- updateProgress ("footprinting" , 5.0 , []string {"footprinting" })
618- saveCheckpoint ("footprinting" , 5.0 , []string {"footprinting" }, []types.Finding {})
619525 }
620526
621527 // Phase 1: Asset Discovery (or skip if configured)
0 commit comments