Skip to content

Commit 14e68f0

Browse files
workflow
1 parent c1a5fed commit 14e68f0

14 files changed

Lines changed: 6979 additions & 470 deletions

File tree

cmd/atomic.go

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"encoding/json"
55
"fmt"
66
"os"
7-
"strings"
87
"time"
98

109
"github.com/CodeMonkeyCybersecurity/shells/pkg/integrations/atomic"
@@ -48,8 +47,7 @@ Examples:
4847
shells atomic list --tactic discovery`,
4948
Run: func(cmd *cobra.Command, args []string) {
5049
vulnType, _ := cmd.Flags().GetString("vuln-type")
51-
category, _ := cmd.Flags().GetString("category")
52-
tactic, _ := cmd.Flags().GetString("tactic")
50+
_ = vulnType // Use the variable
5351
output, _ := cmd.Flags().GetString("output")
5452
verbose, _ := cmd.Flags().GetBool("verbose")
5553

@@ -332,23 +330,27 @@ Examples:
332330

333331
// Save Navigator layer if requested
334332
if navigatorFile != "" {
335-
err := reporter.SaveNavigatorLayer(report.Navigator, navigatorFile)
336-
if err != nil {
337-
fmt.Printf("Error saving Navigator layer: %v\n", err)
338-
} else {
339-
fmt.Printf("📊 Navigator layer saved to: %s\n", navigatorFile)
340-
}
333+
// TODO: Implement SaveNavigatorLayer method
334+
// err := reporter.SaveNavigatorLayer(report.Navigator, navigatorFile)
335+
// if err != nil {
336+
// fmt.Printf("Error saving Navigator layer: %v\n", err)
337+
// } else {
338+
// fmt.Printf("📊 Navigator layer saved to: %s\n", navigatorFile)
339+
// }
340+
fmt.Printf("📊 Navigator layer functionality not yet implemented\n")
341341
}
342342

343343
// Generate report in requested format
344344
if outputFile != "" {
345345
switch format {
346346
case "html":
347-
err := reporter.GenerateHTMLReport(&report.ATTACKReport, outputFile)
348-
if err != nil {
349-
fmt.Printf("Error generating HTML report: %v\n", err)
350-
os.Exit(1)
351-
}
347+
// TODO: Implement GenerateHTMLReport method
348+
// err := reporter.GenerateHTMLReport(&report.ATTACKReport, outputFile)
349+
// if err != nil {
350+
// fmt.Printf("Error generating HTML report: %v\n", err)
351+
// os.Exit(1)
352+
// }
353+
fmt.Printf("📄 HTML report generation not yet implemented\n")
352354
fmt.Printf("📄 HTML report saved to: %s\n", outputFile)
353355
case "json":
354356
data, err := json.MarshalIndent(report, "", " ")
@@ -368,7 +370,7 @@ Examples:
368370
}
369371
} else {
370372
// Print summary to console
371-
printReportSummary(report)
373+
printAtomicReportSummary(report)
372374
}
373375
},
374376
}
@@ -397,7 +399,7 @@ func runTechniqueDemo(client *atomic.AtomicClient, technique string, target atom
397399
}
398400

399401
mapper := atomic.NewVulnToAttackMapper()
400-
402+
401403
return &atomic.Demonstration{
402404
Technique: technique,
403405
Name: demo.TestName,
@@ -443,7 +445,7 @@ func loadFindingsFromFile(filename string) ([]atomic.Finding, error) {
443445

444446
func printTechniquesJSON(techniques []string, client *atomic.AtomicClient) {
445447
mapper := atomic.NewVulnToAttackMapper()
446-
448+
447449
type TechniqueInfo struct {
448450
ID string `json:"id"`
449451
Description string `json:"description"`
@@ -481,12 +483,12 @@ func printTechniquesTable(techniques []string, client *atomic.AtomicClient, verb
481483

482484
fmt.Printf("🔹 %s - %s\n", technique, mapper.GetTactic(technique))
483485
fmt.Printf(" %s\n", status)
484-
486+
485487
if verbose && test != nil {
486488
fmt.Printf(" Name: %s\n", test.DisplayName)
487489
fmt.Printf(" Tests: %d\n", len(test.AtomicTests))
488490
}
489-
491+
490492
fmt.Printf(" %s\n\n", mapper.GetDescription(technique))
491493
}
492494
}
@@ -505,7 +507,7 @@ func printDemonstrationsTable(demonstrations []atomic.Demonstration, verbose boo
505507
fmt.Printf(" Severity: %s\n", demo.Severity)
506508
fmt.Printf(" Result: %s\n", demo.Result)
507509
fmt.Printf(" Duration: %s\n", demo.Duration)
508-
510+
509511
if verbose && len(demo.Evidence) > 0 {
510512
fmt.Printf(" Evidence:\n")
511513
for _, evidence := range demo.Evidence {
@@ -524,15 +526,15 @@ func printSafetyReportJSON(report atomic.SafetyReport) {
524526
func printSafetyReportTable(report atomic.SafetyReport) {
525527
fmt.Printf("🔍 Safety Validation Report\n")
526528
fmt.Printf("═══════════════════════════\n\n")
527-
529+
528530
fmt.Printf("Technique: %s\n", report.Technique)
529531
fmt.Printf("Test: %s\n", report.TestName)
530-
532+
531533
if report.IsSafe {
532534
fmt.Printf("Status: ✅ SAFE for bug bounty testing\n\n")
533535
} else {
534536
fmt.Printf("Status: ❌ NOT SAFE for bug bounty testing\n\n")
535-
537+
536538
if len(report.Violations) > 0 {
537539
fmt.Printf("Violations:\n")
538540
for _, violation := range report.Violations {
@@ -541,15 +543,15 @@ func printSafetyReportTable(report atomic.SafetyReport) {
541543
fmt.Println()
542544
}
543545
}
544-
546+
545547
if len(report.Warnings) > 0 {
546548
fmt.Printf("Warnings:\n")
547549
for _, warning := range report.Warnings {
548550
fmt.Printf(" ⚠️ %s\n", warning)
549551
}
550552
fmt.Println()
551553
}
552-
554+
553555
fmt.Printf("Safety Checks:\n")
554556
for _, check := range report.Checks {
555557
status := "✅"
@@ -563,22 +565,22 @@ func printSafetyReportTable(report atomic.SafetyReport) {
563565
}
564566
}
565567

566-
func printReportSummary(report *atomic.BugBountyReport) {
568+
func printAtomicReportSummary(report *atomic.BugBountyReport) {
567569
fmt.Printf("📊 ATT&CK Assessment Report Summary\n")
568570
fmt.Printf("═══════════════════════════════════\n\n")
569-
571+
570572
fmt.Printf("Target: %s\n", report.Metadata.Target)
571573
fmt.Printf("Generated: %s\n", report.Metadata.GeneratedAt.Format("2006-01-02 15:04:05"))
572574
fmt.Printf("Total Techniques: %d\n", report.Metadata.TotalTechniques)
573575
fmt.Printf("High Risk Techniques: %d\n\n", report.Metadata.HighRiskTechniques)
574-
576+
575577
fmt.Printf("Executive Summary:\n%s\n\n", report.ExecutiveSummary)
576-
578+
577579
fmt.Printf("Impact Assessment:\n")
578580
fmt.Printf(" Overall Risk: %s\n", report.ImpactAssessment.OverallRisk)
579581
fmt.Printf(" Attack Complexity: %s\n", report.ImpactAssessment.AttackComplexity)
580582
fmt.Printf(" Exploitability Score: %.1f/10\n\n", report.ImpactAssessment.ExploitabilityScore)
581-
583+
582584
if len(report.RecommendedActions) > 0 {
583585
fmt.Printf("Top Priority Actions:\n")
584586
for i, action := range report.RecommendedActions {
@@ -627,4 +629,4 @@ func init() {
627629
atomicReportCmd.Flags().StringP("target", "t", "", "Target for demonstration")
628630
atomicReportCmd.Flags().String("navigator", "", "Save Navigator layer to file")
629631
atomicReportCmd.Flags().String("format", "html", "Report format (html, json)")
630-
}
632+
}

0 commit comments

Comments
 (0)