Skip to content

Commit

Permalink
chore(cli): Refactor create fingerprint command
Browse files Browse the repository at this point in the history
  • Loading branch information
thehappydinoa committed Oct 16, 2023
1 parent 0be85ba commit 63b8996
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions threatfox_censys/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,32 @@ def validate_malware_name(result: str) -> bool:
# Prompt the user
results = prompt(questions=questions)

# Get the name
name: str = results[0]

# Get the malware name
malware_name: str = results[1]

# Get the Censys query
censys_query: str = results[2]

# Get the virtual hosts
censys_virtual_hosts: bool = results[3]

# Get the confidence level
confidence_level: int = results[4]

# Get the tags
tags: list[str] = results[5]

# Create the fingerprint
fingerprint = Fingerprint( # type: ignore[arg-type]
name=results[0],
malware_name=results[1],
censys_query=results[2],
censys_virtual_hosts=results[3],
confidence_level=results[4],
tags=results[5],
fingerprint = Fingerprint(
name=name,
malware_name=malware_name,
censys_query=censys_query,
censys_virtual_hosts=censys_virtual_hosts,
confidence_level=confidence_level,
tags=tags,
)

# Dump the fingerprint
Expand Down

0 comments on commit 63b8996

Please sign in to comment.