Skip to content

Commit

Permalink
fix: proper local file naming for sudo_killer.zip (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocervell committed Apr 23, 2024
1 parent d986e01 commit f7e563f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions secator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,17 @@ def download_files(data: dict, target_folder: Path, offline_mode: bool, type: st
local_path = Path(url_or_path)
target_path = target_folder / local_path.name
if not target_path.exists():
console.print(f'[bold turquoise4]Symlinking {type} [bold magenta]{local_path.name}[/] ...[/] ', end='')
console.print(f'[bold turquoise4]Symlinking {type} [bold magenta]{name}[/] ...[/] ', end='')
try:
target_path.symlink_to(local_path)
console.print('[bold green]ok.[/]')
except Exception as e:
console.print(f'[bold red]failed ({str(e)}).[/]')
data[name] = target_path.resolve()
else:
# Download files from URL
filename = url_or_path.split('/')[-1]
# Download file from URL
ext = url_or_path.split('.')[-1]
filename = f'{name}.{ext}'
target_path = target_folder / filename
if not target_path.exists():
try:
Expand Down Expand Up @@ -522,14 +523,12 @@ def download_files(data: dict, target_folder: Path, offline_mode: bool, type: st
dir.mkdir(parents=False)
console.print('[bold green]ok.[/]')


# Download wordlists and set defaults
download_files(CONFIG.wordlists.templates, CONFIG.dirs.wordlists, CONFIG.offline_mode, 'wordlist')
for category, name in CONFIG.wordlists.defaults.items():
if name in CONFIG.wordlists.templates.keys():
CONFIG.wordlists.defaults[category] = str(CONFIG.wordlists.templates[name])


# Download payloads
download_files(CONFIG.payloads.templates, CONFIG.dirs.payloads, CONFIG.offline_mode, 'payload')

Expand Down

0 comments on commit f7e563f

Please sign in to comment.