MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / Target

Class Target

core/models.py:20–46  ·  view source on GitHub ↗

Represents a scan target.

Source from the content-addressed store, hash-verified

18
19
20class Target(BaseModel):
21 """Represents a scan target."""
22
23 value: str = Field(..., description="Target value (domain, IP, URL, email, etc.)")
24 target_type: str = Field(..., description="Type of target: domain, ip, url, email, username")
25 metadata: dict[str, Any] = Field(default_factory=dict)
26
27 @classmethod
28 def from_string(cls, value: str) -> "Target":
29 """Auto-detect target type from string."""
30 value = value.strip()
31
32 # URL detection
33 if value.startswith(("http://", "https://")):
34 return cls(value=value, target_type="url")
35
36 # Email detection
37 if "@" in value and "." in value.split("@")[-1]:
38 return cls(value=value, target_type="email")
39
40 # IP detection (simple check)
41 parts = value.split(".")
42 if len(parts) == 4 and all(p.isdigit() and 0 <= int(p) <= 255 for p in parts):
43 return cls(value=value, target_type="ip")
44
45 # Default to domain
46 return cls(value=value, target_type="domain")
47
48
49class Finding(BaseModel):

Callers 1

_phase_scanMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected