Roman Hergenreder 2 years ago
parent
commit
21b2396076
11 changed files with 951 additions and 767 deletions
  1. BIN
      chisel
  2. 3 0
      dnsserver.py
  3. 71 42
      fileserver.py
  4. 30 21
      git-dumper.py
  5. 4 20
      linpeas.sh
  6. 17 6
      lse.sh
  7. 54 24
      update.sh
  8. 118 0
      win/amsi-bypass.ps1
  9. 654 654
      win/winPEAS.bat
  10. BIN
      win/winPEAS.exe
  11. BIN
      win/winPEASx64.exe

BIN
chisel


+ 3 - 0
dnsserver.py

@@ -81,6 +81,7 @@ class DnsServer:
         self.debug = False
         self.ttl = 60 * 5
         self.logging = False
+        self.not_found_handler = None
 
     def addEntry(self, type, domain, value):
         if type not in self.entries:
@@ -135,6 +136,8 @@ class DnsServer:
             reply.add_answer(RR(rname=qname, rtype=getattr(QTYPE, rqt), rclass=1, ttl=self.ttl, rdata=entry))
             if self.logging:
                 print(f"Request: {qt} {qn} -> {entry}")
+        elif self.not_found_handler:
+            self.not_found_handler(request, reply)
 
         if self.debug:
             print("DNS RESPONSE:", reply)

+ 71 - 42
fileserver.py

@@ -68,59 +68,61 @@ class FileServerRequestHandler(BaseHTTPRequestHandler):
         self.do_GET()
 
     def do_GET(self):
+        try:
+            if not self.server.is_running:
+                self.send_response(200)
+                self.end_headers()
+                return
 
-        if not self.server.is_running:
-            self.send_response(200)
-            self.end_headers()
-            return
-
-        path = self.server.cleanPath(self.path)
-        route = self.find_route(path)
-        result = route(self)
+            path = self.server.cleanPath(self.path)
+            route = self.find_route(path)
+            result = route(self)
 
-        blacklist_headers = ["transfer-encoding", "content-length", "content-encoding", "allow", "connection"]
-        status_code = 200 if len(result) < 1 else result[0]
-        data        = b"" if len(result) < 2 else result[1]
-        headers     = { } if len(result) < 3 else result[2]
+            blacklist_headers = ["transfer-encoding", "content-length", "content-encoding", "allow", "connection"]
+            status_code = 200 if len(result) < 1 else result[0]
+            data        = b"" if len(result) < 2 else result[1]
+            headers     = { } if len(result) < 3 else result[2]
 
-        if path in self.server.dumpRequests:
-            headers["Access-Control-Allow-Origin"] = "*"
+            if path in self.server.dumpRequests:
+                headers["Access-Control-Allow-Origin"] = "*"
 
-        headers["Content-Length"] = len(data)
+            headers["Content-Length"] = len(data)
 
-        if len(headers) == 0:
-            self.send_response(status_code)
-        else:
-            if path != "/dummy":
-                self.log_request(status_code)
-            self.send_response_only(status_code)
+            if len(headers) == 0:
+                self.send_response(status_code)
+            else:
+                if path != "/dummy":
+                    self.log_request(status_code)
+                self.send_response_only(status_code)
 
-            for key, value in headers.items():
-                if key.lower() not in blacklist_headers:
-                    self.send_header(key, value)
+                for key, value in headers.items():
+                    if key.lower() not in blacklist_headers:
+                        self.send_header(key, value)
 
-            if self.command.upper() == "OPTIONS":
-                self.send_header("Allow", "OPTIONS, GET, HEAD, POST")
+                if self.command.upper() == "OPTIONS":
+                    self.send_header("Allow", "OPTIONS, GET, HEAD, POST")
 
-        self.end_headers()
+            self.end_headers()
 
-        if data and self.command.upper() not in ["HEAD","OPTIONS"]:
-            self.wfile.write(data)
+            if data and self.command.upper() not in ["HEAD","OPTIONS"]:
+                self.wfile.write(data)
 
-        if (path in self.server.dumpRequests or "/" in self.server.dumpRequests) and path != "/dummy":
-            contentLength = self.headers.get('Content-Length')
-            body = None
+            if (path in self.server.dumpRequests or "/" in self.server.dumpRequests) and path != "/dummy":
+                contentLength = self.headers.get('Content-Length')
+                body = None
 
-            if contentLength and int(contentLength) > 0:
-                body = self.rfile.read(int(contentLength))
+                if contentLength and int(contentLength) > 0:
+                    body = self.rfile.read(int(contentLength))
 
-            print("===== Connection from:",self.client_address[0])
-            print("%s %s %s" % (self.command, self.path, self.request_version))
-            print(str(self.headers).strip())
-            if body:
-                print()
-                print(body)
-            print("==========")
+                print("===== Connection from:",self.client_address[0])
+                print("%s %s %s" % (self.command, self.path, self.request_version))
+                print(str(self.headers).strip())
+                if body:
+                    print()
+                    print(body)
+                print("==========")
+        except Exception as e:
+            print("Exception on handling http", str(e))
 
     def log_message(self, format, *args):
         if self.server.logRequests:
@@ -148,9 +150,15 @@ class HttpFileServer(HTTPServer):
         return path.strip()
 
     def addFile(self, name, data, mimeType=None):
+
+        if hasattr(data, "read"):
+            fd = data
+            data = data.read()
+            fd.close()
+
         if isinstance(data, str):
             data = data.encode("UTF-8")
-
+    
         headers = { 
             "Access-Control-Allow-Origin": "*",
         }
@@ -160,6 +168,27 @@ class HttpFileServer(HTTPServer):
         # return 200 - OK and data
         self.addRoute(name, lambda req: (200, data, headers))
 
+    def add_file_path(self, path, name=None):
+        def readfile():
+            with open(path, "rb") as f:
+                return f.read()
+
+        if name is None:
+            name = os.path.basename(path)
+        self.addRoute(name, lambda req: (200, readfile()))
+
+    def load_directory(self, path, recursive=True, exclude_ext=[]):
+        if not os.path.isdir(path):
+            print("Not a directory:", path)
+            return
+
+        for dp, dn, filenames in os.walk(path):
+            for f in filenames:
+                file_path = os.path.join(dp, f)
+                if not exclude_ext or os.path.splitext(file_path)[1] not in exclude_ext:
+                    relative_path = file_path[len(path):]
+                    self.add_file_path(file_path, relative_path)
+
     def dumpRequest(self, name):
         self.dumpRequests.append(self.cleanPath(name))
 

+ 30 - 21
git-dumper.py

@@ -44,6 +44,8 @@ def get_indexed_files(response):
         if (url.path and
                 url.path != '.' and
                 url.path != '..' and
+                url.path != './' and
+                url.path != '../' and
                 not url.path.startswith('/') and
                 not url.scheme and
                 not url.netloc):
@@ -171,15 +173,15 @@ def process_tasks(initial_tasks, worker, jobs, args=(), tasks_done=None):
 class DownloadWorker(Worker):
     ''' Download a list of files '''
 
-    def init(self, url, directory, retry, timeout, module=None):
+    def init(self, url, directory, retry, timeout, follow_redirects=False, module=None):
         self.session = requests.Session()
         self.session.verify = False
         self.session.mount(url, requests.adapters.HTTPAdapter(max_retries=retry))
         self.module = module
 
-    def do_task(self, filepath, url, directory, retry, timeout, module=None):
+    def do_task(self, filepath, url, directory, retry, timeout, follow_redirects=False, module=None):
         with closing(self.session.get('%s/%s' % (url, filepath),
-                                      allow_redirects=False,
+                                      allow_redirects=follow_redirects,
                                       stream=True,
                                       timeout=timeout,
                                       headers={"User-Agent": USER_AGENT})) as response:
@@ -202,9 +204,9 @@ class DownloadWorker(Worker):
 class RecursiveDownloadWorker(DownloadWorker):
     ''' Download a directory recursively '''
 
-    def do_task(self, filepath, url, directory, retry, timeout):
+    def do_task(self, filepath, url, directory, retry, timeout, follow_redirects=False):
         with closing(self.session.get('%s/%s' % (url, filepath),
-                                      allow_redirects=False,
+                                      allow_redirects=follow_redirects,
                                       stream=True,
                                       timeout=timeout,
                                       headers={"User-Agent": USER_AGENT})) as response:
@@ -237,9 +239,9 @@ class RecursiveDownloadWorker(DownloadWorker):
 class FindRefsWorker(DownloadWorker):
     ''' Find refs/ '''
 
-    def do_task(self, filepath, url, directory, retry, timeout, module):
+    def do_task(self, filepath, url, directory, retry, timeout, follow_redirects=False, module=None):
         response = self.session.get('%s/%s' % (url, filepath),
-                                    allow_redirects=False,
+                                    allow_redirects=follow_redirects,
                                     timeout=timeout,
                                     headers={"User-Agent": USER_AGENT})
         printf('[-] Fetching %s/%s [%d]\n', url, filepath, response.status_code)
@@ -271,11 +273,11 @@ class FindRefsWorker(DownloadWorker):
 class FindObjectsWorker(DownloadWorker):
     ''' Find objects '''
 
-    def do_task(self, obj, url, directory, retry, timeout, module):
+    def do_task(self, obj, url, directory, retry, timeout, follow_redirects, module):
         # module = ".git" if not url.endswith("/modules") else ""
         filepath = '%s/objects/%s/%s' % (self.module, obj[:2], obj[2:])
         response = self.session.get('%s/%s' % (url, filepath),
-                                    allow_redirects=False,
+                                    allow_redirects=follow_redirects,
                                     timeout=timeout,
                                     headers={"User-Agent": USER_AGENT})
         printf('[-] Fetching %s/%s [%d]\n', url, filepath, response.status_code)
@@ -295,7 +297,7 @@ class FindObjectsWorker(DownloadWorker):
         return get_referenced_sha1(obj_file)
 
 
-def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
+def fetch_git(url, directory, jobs, retry, timeout, follow_redirects, module=".git"):
     ''' Dump a git repository into the output directory '''
 
     assert os.path.isdir(directory), '%s is not a directory' % directory
@@ -320,7 +322,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
 
     # check for /.git/HEAD
     printf('[-] Testing %s/%s/HEAD ', url, module)
-    response = requests.get('%s/%s/HEAD' % (url, module), verify=False, allow_redirects=False, headers={"User-Agent": USER_AGENT})
+    response = requests.get('%s/%s/HEAD' % (url, module), verify=False, allow_redirects=follow_redirects, headers={"User-Agent": USER_AGENT})
     printf('[%d]\n', response.status_code)
 
     if response.status_code != 200:
@@ -332,7 +334,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
 
     # check for directory listing
     printf('[-] Testing %s/%s/ ', url, module)
-    response = requests.get('%s/%s/' % (url, module), verify=False, allow_redirects=False, headers={"User-Agent": USER_AGENT})
+    response = requests.get('%s/%s/' % (url, module), verify=False, allow_redirects=follow_redirects, headers={"User-Agent": USER_AGENT})
     printf('[%d]\n', response.status_code)
 
     if response.status_code == 200 and is_html(response) and 'HEAD' in get_indexed_files(response):
@@ -340,7 +342,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
         process_tasks(['.git/', '.gitignore'],
                       RecursiveDownloadWorker,
                       jobs,
-                      args=(url, directory, retry, timeout))
+                      args=(url, directory, retry, timeout, follow_redirects))
 
         printf('[-] Running git checkout .\n')
         os.chdir(directory)
@@ -378,7 +380,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
     process_tasks(tasks,
                   DownloadWorker,
                   jobs,
-                  args=(url, directory, retry, timeout, module))
+                  args=(url, directory, retry, timeout, follow_redirects, module))
 
     if module == ".git":
         modules_path = os.path.join(directory, '.gitmodules')
@@ -392,7 +394,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
                     printf("[-] Fetching module: %s\n", module_name)
                     # os.makedirs(os.path.abspath(module_dir))
                     module_url = url + "/.git/modules"
-                    fetch_git(module_url, module_dir, jobs, retry, timeout, module=module_name)
+                    fetch_git(module_url, module_dir, jobs, retry, timeout, follow_redirects, module=module_name)
                     printf("[+] Done iterating module\n")
 
     # find refs
@@ -420,7 +422,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
     process_tasks(tasks,
                   FindRefsWorker,
                   jobs,
-                  args=(url, directory, retry, timeout, module))
+                  args=(url, directory, retry, timeout, follow_redirects, module))
 
     # find packs
     printf('[-] Finding packs\n')
@@ -439,7 +441,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
     process_tasks(tasks,
                   DownloadWorker,
                   jobs,
-                  args=(url, directory, retry, timeout))
+                  args=(url, directory, retry, timeout, follow_redirects))
 
     # find objects
     printf('[-] Finding objects\n')
@@ -477,8 +479,12 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
     if os.path.exists(index_path):
         index = dulwich.index.Index(index_path)
 
-        for entry in index.iterblobs():
-            objs.add(entry[1].decode())
+        # index.iteritems()
+        for entry in index.iteritems():
+            if isinstance(entry[1], dulwich.index.IndexEntry):
+                objs.add(entry[1].sha.decode())
+            elif hasattr(entry[1], "decode"):
+                objs.add(entry[1].decode())
 
     # use packs to find more objects to fetch, and objects that are packed
     pack_file_dir = os.path.join(directory, module, 'objects', 'pack')
@@ -500,7 +506,7 @@ def fetch_git(url, directory, jobs, retry, timeout, module=".git"):
     process_tasks(objs,
                   FindObjectsWorker,
                   jobs,
-                  args=(url, directory, retry, timeout, module),
+                  args=(url, directory, retry, timeout, follow_redirects, module),
                   tasks_done=packed_objs)
 
     # git checkout
@@ -529,6 +535,9 @@ if __name__ == '__main__':
                         help='number of request attempts before giving up')
     parser.add_argument('-t', '--timeout', type=int, default=3,
                         help='maximum time in seconds before giving up')
+    parser.add_argument('-L', '--follow-redirects', default=False,
+                        dest='follow_redirects', action="store_true",
+                        help='follow redirects')
     args = parser.parse_args()
 
     # jobs
@@ -576,7 +585,7 @@ if __name__ == '__main__':
 
     # fetch everything
     path = os.path.realpath(args.directory)
-    code = fetch_git(args.url, args.directory, args.jobs, args.retry, args.timeout)
+    code = fetch_git(args.url, args.directory, args.jobs, args.retry, args.timeout, args.follow_redirects)
     if not os.listdir(path):
         os.rmdir(path)
 

File diff suppressed because it is too large
+ 4 - 20
linpeas.sh


+ 17 - 6
lse.sh

@@ -5,7 +5,7 @@
 # Author: Diego Blanco <diego.blanco@treitos.com>
 # GitHub: https://github.com/diego-treitos/linux-smart-enumeration
 #
-lse_version="3.9"
+lse_version="3.10"
 
 #( Colors
 #
@@ -117,6 +117,7 @@ lse_common_setuid="
 /usr/bin/firejail
 /usr/bin/fusermount
 /usr/bin/fusermount-glusterfs
+/usr/bin/fusermount3
 /usr/bin/gpasswd
 /usr/bin/kismet_capture
 /usr/bin/mount
@@ -124,6 +125,7 @@ lse_common_setuid="
 /usr/bin/newgidmap
 /usr/bin/newgrp
 /usr/bin/newuidmap
+/usr/bin/ntfs-3g
 /usr/bin/passwd
 /usr/bin/pkexec
 /usr/bin/pmount
@@ -550,17 +552,26 @@ lse_procmon() {
 }
 lse_proc_print() {
   # Pretty prints output from lse_procmom received via stdin
-  printf "${green}%s %8s %8s %s\n" "START" "PID" "USER" "COMMAND"
+  if $lse_color; then
+    printf "${green}%s %8s %8s %s\n" "START" "PID" "USER" "COMMAND"
+  else
+    printf "%s %8s %8s %s\n" "START" "PID" "USER" "COMMAND"
+  fi
   while read -r l; do
     p_num=`echo "$l" | cut -d" " -f1`
     p_time=`echo "$l" | cut -d" " -f2`
     p_pid=`echo "$l" | cut -d" " -f3`
     p_user=`echo "$l" | cut -d" " -f4`
     p_args=`echo "$l" | cut -d" " -f5-`
-    if [ $((p_num)) -lt 20 ]; then # few times probably periodic
-      printf "${red}%s ${reset}%8s ${yellow}%8s ${red}%s\n" "$p_time" "$p_pid" "$p_user" "$p_args"
+
+    if $lse_color; then
+      if [ $((p_num)) -lt 20 ]; then # few times probably periodic
+        printf "${red}%s ${reset}%8s ${yellow}%8s ${red}%s\n" "$p_time" "$p_pid" "$p_user" "$p_args"
+      else
+        printf "${magenta}%s ${reset}%8s ${yellow}%8s ${reset}%s\n" "$p_time" "$p_pid" "$p_user" "$p_args"
+      fi
     else
-      printf "${magenta}%s ${reset}%8s ${yellow}%8s ${reset}%s\n" "$p_time" "$p_pid" "$p_user" "$p_args"
+      printf "%s %8s %8s %s\n" "$p_time" "$p_pid" "$p_user" "$p_args"
     fi
   done
 }
@@ -803,7 +814,7 @@ lse_run_tests_filesystem() {
   #are there possible credentials in any shell history files
   lse_test "fst200" "0" \
     "Are there possible credentials in any shell history file?" \
-    'for h in .bash_history .history .histfile .zhistory; do [ -f "$lse_home/$h" ] && grep $lse_grep_opts -Ei "(user|username|login|pass|password|pw|credentials)[=: ][a-z0-9]+" "$lse_home/$h"; done'
+    'for h in .bash_history .history .histfile .zhistory; do [ -f "$lse_home/$h" ] && grep $lse_grep_opts -Ei "(user|username|login|pass|password|pw|credentials)[=: ][a-z0-9]+" "$lse_home/$h" | grep -v "systemctl"; done'
 
   #nfs exports with no_root_squash
   lse_test "fst210" "0" \

+ 54 - 24
update.sh

@@ -1,33 +1,63 @@
 #!/bin/bash
 
+download () {
+  tmpfile=$(mktemp /tmp/wget.XXXXXX)
+  wget --no-verbose "$1" -O "$tmpfile"
+  status=$?
+  if [ $status -eq 0 ]; then
+    old_permissions=$(stat -c "%a" "$2")
+    mv "$tmpfile" "$2"
+    chmod "$old_permissions" "$2"
+  fi
+}
+
+get_latest_version () {
+  repository=$1
+  prefix=$2
+  location=$(curl -s -I https://github.com/$repository/releases/latest | grep -i "location: " | awk '{ print $2 }')
+  if [[ "$location" =~ ^https://github.com/$repository/releases/tag/$prefix(.*) ]]; then
+    version=${BASH_REMATCH[1]}
+    version=${version%%[[:space:]]}
+    echo $version
+  fi
+}
+
 echo "Updating scripts…"
-wget --no-verbose https://raw.githubusercontent.com/initstring/uptux/master/uptux.py -O uptux.py
-wget --no-verbose https://raw.githubusercontent.com/pentestmonkey/unix-privesc-check/master/upc.sh -O unix-privesc-check.sh
-wget --no-verbose https://github.com/DominicBreuker/pspy/releases/latest/download/pspy64 -O pspy64
-wget --no-verbose https://github.com/DominicBreuker/pspy/releases/latest/download/pspy32 -O pspy
-wget --no-verbose https://raw.githubusercontent.com/flozz/p0wny-shell/master/shell.php -O p0wny-shell.php
-wget --no-verbose https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/master/lse.sh -O lse.sh
-wget --no-verbose https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh -O linux-exploit-suggester.sh
-wget --no-verbose https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/raw/master/linPEAS/linpeas.sh -O linpeas.sh
-wget --no-verbose https://github.com/rebootuser/LinEnum/raw/master/LinEnum.sh -O LinEnum.sh
-wget --no-verbose https://github.com/stealthcopter/deepce/raw/main/deepce.sh -O deepce.sh
+# download https://raw.githubusercontent.com/initstring/uptux/master/uptux.py uptux.py
+# download https://raw.githubusercontent.com/pentestmonkey/unix-privesc-check/master/upc.sh unix-privesc-check.sh
+# download https://github.com/DominicBreuker/pspy/releases/latest/download/pspy64 pspy64
+# download https://github.com/DominicBreuker/pspy/releases/latest/download/pspy32 pspy
+# download https://raw.githubusercontent.com/flozz/p0wny-shell/master/shell.php p0wny-shell.php
+# download https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/master/lse.sh lse.sh
+# download https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh linux-exploit-suggester.sh
+# download https://github.com/rebootuser/LinEnum/raw/master/LinEnum.sh LinEnum.sh
+# download https://github.com/stealthcopter/deepce/raw/main/deepce.sh deepce.sh
+
+echo "Updating LinPEAS + WinPEAS…"
+peas_version=$(get_latest_version carlospolop/PEASS-ng)
+if [ ! -z "$peas_version" ]; then
+  echo "Got PEAS version: $peas_version"
+  download https://github.com/carlospolop/PEASS-ng/releases/download/$peas_version/linpeas.sh linpeas.sh
+  download https://github.com/carlospolop/PEASS-ng/releases/download/$peas_version/winPEASx86.exe win/winPEAS.exe
+  download https://github.com/carlospolop/PEASS-ng/releases/download/$peas_version/winPEASx64.exe win/winPEASx64.exe
+  download https://github.com/carlospolop/PEASS-ng/releases/download/$peas_version/winPEAS.bat win/winPEAS.bat
+else
+  echo "Unable to determine latest PEAS version"
+fi
 
 echo "Updating Chisel…"
-location=$(curl -s -I https://github.com/jpillora/chisel/releases/latest | grep -i "location: " | awk '{ print $2 }')
-if [[ "$location" =~ ^https://github.com/jpillora/chisel/releases/tag/v(.*) ]]; then
-  chisel_version=${BASH_REMATCH[1]}
-  chisel_version=${chisel_version%%[[:space:]]}
-  echo "Got Chisel version: ${chisel_version}"
-  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_linux_386.gz"    | gzip -d > chisel
-  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_linux_amd64.gz"  | gzip -d > chisel64
-  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_windows_386.gz"  | gzip -d > win/chisel.exe
-  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_windows_amd64.gz"  | gzip -d > win/chisel64.exe
+chisel_version=$(get_latest_version jpillora/chisel v)
+if [ ! -z "$peas_version" ]; then
+  echo "Got Chisel version: $chisel_version"
+  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_linux_386.gz" | gzip -d > chisel
+  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_linux_amd64.gz" | gzip -d > chisel64
+  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_windows_386.gz" | gzip -d > win/chisel.exe
+  curl -s -L "https://github.com/jpillora/chisel/releases/download/v${chisel_version}/chisel_${chisel_version}_windows_amd64.gz" | gzip -d > win/chisel64.exe
+else 
+  echo "Unable to determine latest chisel version"
 fi
 
 # TODO: add others
 echo "Updating windows tools…"
-wget --no-verbose https://live.sysinternals.com/accesschk.exe -O win/accesschk.exe
-wget --no-verbose https://live.sysinternals.com/accesschk64.exe -O win/accesschk64.exe
-wget --no-verbose https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/raw/master/winPEAS/winPEASexe/binaries/x86/Release/winPEASx86.exe -O win/winPEAS.exe
-wget --no-verbose https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/raw/master/winPEAS/winPEASexe/binaries/x64/Release/winPEASx64.exe -O win/winPEASx64.exe
-wget --no-verbose https://raw.githubusercontent.com/carlospolop/privilege-escalation-awesome-scripts-suite/master/winPEAS/winPEASbat/winPEAS.bat -O win/winPEAS.bat
+download https://live.sysinternals.com/accesschk.exe win/accesschk.exe
+download https://live.sysinternals.com/accesschk64.exe win/accesschk64.exe

File diff suppressed because it is too large
+ 118 - 0
win/amsi-bypass.ps1


+ 654 - 654
win/winPEAS.bat

@@ -1,654 +1,654 @@
-@ECHO OFF & SETLOCAL EnableDelayedExpansion
-TITLE WinPEAS - Windows local Privilege Escalation Awesome Script
-COLOR 0F
-CALL :SetOnce
-
-REM :: WinPEAS - Windows local Privilege Escalation Awesome Script
-REM :: Code by carlospolop; Re-Write by ThisLimn0
-
-REM Registry scan of other drives besides 
-REM /////true or false
-SET long=false
-
-:Splash
-ECHO.
-CALL :ColorLine "            %E%32m((,.,/((((((((((((((((((((/,  */%E%97m"
-CALL :ColorLine "     %E%32m,/*,..*(((((((((((((((((((((((((((((((((,%E%97m"              
-CALL :ColorLine "   %E%32m,*/((((((((((((((((((/,  %E%92m.*//((//**,%E%32m .*((((((*%E%97m"       
-CALL :ColorLine "   %E%32m((((((((((((((((* %E%94m*****%E%32m,,,/########## %E%32m.(* ,((((((%E%97m"   
-CALL :ColorLine "   %E%32m(((((((((((/* %E%94m******************%E%32m/####### %E%32m.(. ((((((%E%97m"
-CALL :ColorLine "   %E%32m((((((.%E%92m.%E%94m******************%E%97m/@@@@@/%E%94m***%E%92m/######%E%32m /((((((%E%97m"
-CALL :ColorLine "   %E%32m,,.%E%92m.%E%94m**********************%E%97m@@@@@@@@@@(%E%94m***%E%92m,####%E%32m ../(((((%E%97m"
-CALL :ColorLine "   %E%32m, ,%E%92m%E%94m**********************%E%97m#@@@@@#@@@@%E%94m*********%E%92m##%E%32m((/ /((((%E%97m"
-CALL :ColorLine "   %E%32m..((%E%92m(##########%E%94m*********%E%97m/#@@@@@@@@@/%E%94m*************%E%32m,,..((((%E%97m"
-CALL :ColorLine "   %E%32m.((%E%92m(################(/%E%94m******%E%97m/@@@@@#%E%94m****************%E%32m.. /((%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(########################(/%E%94m************************%E%32m..*(%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(#############################(/%E%94m********************%E%32m.,(%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(##################################(/%E%94m***************%E%32m..(%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(######################################(%E%94m************%E%32m..(%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(######(,.***.,(###################(..***(/%E%94m*********%E%32m..(%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(######*(#####((##################((######/(%E%94m********%E%32m..(%E%97m"
-CALL :ColorLine "   %E%32m.(%E%92m(##################(/**********(################(%E%94m**%E%32m...(%E%97m"
-CALL :ColorLine "   %E%32m.((%E%92m(####################/*******(###################%E%32m.((((%E%97m" 
-CALL :ColorLine "   %E%32m.((((%E%92m(############################################/%E%32m  /((%E%97m"
-CALL :ColorLine "   %E%32m..((((%E%92m(#########################################(%E%32m..(((((.%E%97m"
-CALL :ColorLine "   %E%32m....((((%E%92m(#####################################(%E%32m .((((((.%E%97m"
-CALL :ColorLine "   %E%32m......((((%E%92m(#################################(%E%32m .(((((((.%E%97m"
-CALL :ColorLine "   %E%32m(((((((((. ,%E%92m(############################(%E%32m../(((((((((.%E%97m"
-CALL :ColorLine "       %E%32m(((((((((/,  %E%92m,####################(%E%32m/..((((((((((.%E%97m"
-CALL :ColorLine "             %E%32m(((((((((/,.  %E%92m,*//////*,.%E%32m ./(((((((((((.%E%97m"
-CALL :ColorLine "                %E%32m(((((((((((((((((((((((((((/%E%97m"
-ECHO.                       by carlospolop
-ECHO.
-ECHO.
-
-:Advisory
-REM // Increase progress in title by n percent
-CALL :T_Progress 0
-ECHO./^^!\ Advisory: WinPEAS - Windows local Privilege Escalation Awesome Script
-CALL :ColorLine "   %E%41mWinPEAS should be used for authorized penetration testing and/or educational purposes only.%E%40;97m"
-CALL :ColorLine "   %E%41mAny misuse of this software will not be the responsibility of the author or of any other collaborator.%E%40;97m"
-CALL :ColorLine "   %E%41mUse it at your own networks and/or with the network owner's permission.%E%40;97m"
-ECHO.
-
-:SystemInfo
-CALL :ColorLine "%E%32m[*]%E%97m BASIC SYSTEM INFO
-CALL :ColorLine " %E%33m[+]%E%97m WINDOWS OS"
-ECHO.   [i] Check for vulnerabilities for the OS version with the applied patches
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#kernel-exploits
-systeminfo
-ECHO.
-CALL :T_Progress 2
-
-:ListHotFixes
-wmic qfe get Caption,Description,HotFixID,InstalledOn | more
-set expl=no
-for /f "tokens=3-9" %%a in ('systeminfo') do (ECHO."%%a %%b %%c %%d %%e %%f %%g" | findstr /i "2000 XP 2003 2008 vista" && set expl=yes) & (ECHO."%%a %%b %%c %%d %%e %%f %%g" | findstr /i /C:"windows 7" && set expl=yes)
-IF "%expl%" == "yes" ECHO.   [i] Possible exploits (https://github.com/codingo/OSCP-2/blob/master/Windows/WinPrivCheck.bat)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2592799" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS11-080 patch is NOT installed! (Vulns: XP/SP3,2K3/SP3-afd.sys)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3143141" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS16-032 patch is NOT installed! (Vulns: 2K8/SP1/2,Vista/SP2,7/SP1-secondary logon)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2393802" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS11-011 patch is NOT installed! (Vulns: XP/SP2/3,2K3/SP2,2K8/SP2,Vista/SP1/2,7/SP0-WmiTraceMessageVa)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB982799" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-59 patch is NOT installed! (Vulns: 2K8,Vista,7/SP0-Chimichurri)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB979683" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-21 patch is NOT installed! (Vulns: 2K/SP4,XP/SP2/3,2K3/SP2,2K8/SP2,Vista/SP0/1/2,7/SP0-Win Kernel)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2305420" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-092 patch is NOT installed! (Vulns: 2K8/SP0/1/2,Vista/SP1/2,7/SP0-Task Sched)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB981957" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-073 patch is NOT installed! (Vulns: XP/SP2/3,2K3/SP2/2K8/SP2,Vista/SP1/2,7/SP0-Keyboard Layout)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB4013081" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS17-017 patch is NOT installed! (Vulns: 2K8/SP2,Vista/SP2,7/SP1-Registry Hive Loading)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB977165" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-015 patch is NOT installed! (Vulns: 2K,XP,2K3,2K8,Vista,7-User Mode to Ring)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB941693" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS08-025 patch is NOT installed! (Vulns: 2K/SP4,XP/SP2,2K3/SP1/2,2K8/SP0,Vista/SP0/1-win32k.sys)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB920958" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS06-049 patch is NOT installed! (Vulns: 2K/SP4-ZwQuerySysInfo)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB914389" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS06-030 patch is NOT installed! (Vulns: 2K,XP/SP2-Mrxsmb.sys)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB908523" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS05-055 patch is NOT installed! (Vulns: 2K/SP4-APC Data-Free)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB890859" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS05-018 patch is NOT installed! (Vulns: 2K/SP3/4,XP/SP1/2-CSRSS)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB842526" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS04-019 patch is NOT installed! (Vulns: 2K/SP2/3/4-Utility Manager)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB835732" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS04-011 patch is NOT installed! (Vulns: 2K/SP2/3/4,XP/SP0/1-LSASS service BoF)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB841872" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS04-020 patch is NOT installed! (Vulns: 2K/SP4-POSIX)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2975684" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS14-040 patch is NOT installed! (Vulns: 2K3/SP2,2K8/SP2,Vista/SP2,7/SP1-afd.sys Dangling Pointer)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3136041" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS16-016 patch is NOT installed! (Vulns: 2K8/SP1/2,Vista/SP2,7/SP1-WebDAV to Address)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3057191" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS15-051 patch is NOT installed! (Vulns: 2K3/SP2,2K8/SP2,Vista/SP2,7/SP1-win32k.sys)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2989935" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS14-070 patch is NOT installed! (Vulns: 2K3/SP2-TCP/IP)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2778930" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS13-005 patch is NOT installed! (Vulns: Vista,7,8,2008,2008R2,2012,RT-hwnd_broadcast)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2850851" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS13-053 patch is NOT installed! (Vulns: 7SP0/SP1_x86-schlamperei)
-IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2870008" 1>NUL
-IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS13-081 patch is NOT installed! (Vulns: 7SP0/SP1_x86-track_popup_menu)
-ECHO.
-CALL :T_Progress 2
-
-:DateAndTime
-CALL :ColorLine " %E%33m[+]%E%97m DATE and TIME"
-ECHO.   [i] You may need to adjust your local date/time to exploit some vulnerability
-date /T
-time /T
-ECHO.
-CALL :T_Progress 2
-
-:AuditSettings
-CALL :ColorLine " %E%33m[+]%E%97m Audit Settings"
-ECHO.   [i] Check what is being logged
-REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:WEFSettings
-CALL :ColorLine " %E%33m[+]%E%97m WEF Settings"
-ECHO.   [i] Check where are being sent the logs
-REG QUERY HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:LAPSInstallCheck
-CALL :ColorLine " %E%33m[+]%E%97m LAPS installed?"
-ECHO.   [i] Check what is being logged
-REG QUERY "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft Services\AdmPwd" /v AdmPwdEnabled 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:LSAProtectionCheck
-CALL :ColorLine " %E%33m[+]%E%97m LSA protection?"
-ECHO.   [i] Active if "1"
-REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA" /v RunAsPPL 2>nul
-CALL :T_Progress 1
-
-:LSACredentialGuard
-CALL :ColorLine " %E%33m[+]%E%97m Credential Guard?"
-ECHO.   [i] Active if "1" or "2"
-REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA" /v LsaCfgFlags 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:LogonCredentialsPlainInMemory
-CALL :ColorLine " %E%33m[+]%E%97m WDigest?"
-ECHO.   [i] Plain-text creds in memory if "1"
-reg query HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:CachedCreds
-CALL :ColorLine " %E%33m[+]%E%97m Number of cached creds"
-ECHO.   [i] You need System-rights to extract them
-reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v CACHEDLOGONSCOUNT 2>nul
-CALL :T_Progress 1
-
-:UACSettings
-CALL :ColorLine " %E%33m[+]%E%97m UAC Settings"
-ECHO.   [i] If the results read ENABLELUA REG_DWORD 0x1, part or all of the UAC components are on
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access
-REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:AVSettings
-CALL :ColorLine " %E%33m[+]%E%97m Registered Anti-Virus(AV)"
-WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List | more 
-ECHO.Checking for defender whitelisted PATHS
-reg query "HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" 2>nul
-CALL :T_Progress 1
-
-:PSSettings
-CALL :ColorLine " %E%33m[+]%E%97m PowerShell settings"
-ECHO.PowerShell v2 Version:
-REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine /v PowerShellVersion 2>nul
-ECHO.PowerShell v5 Version:
-REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine /v PowerShellVersion 2>nul
-ECHO.Transcriptions Settings:
-REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription 2>nul
-ECHO.Module logging settings:
-REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging 2>nul
-ECHO.Scriptblog logging settings:
-REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging 2>nul
-ECHO.
-ECHO.PS default transcript history
-dir %SystemDrive%\transcripts\ 2>nul
-ECHO.
-ECHO.Checking PS history file
-dir "%APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt" 2>nul
-ECHO.
-CALL :T_Progress 3
-
-:MountedDisks
-CALL :ColorLine " %E%33m[+]%E%97m MOUNTED DISKS"
-ECHO.   [i] Maybe you find something interesting
-(wmic logicaldisk get caption 2>nul | more) || (fsutil fsinfo drives 2>nul)
-ECHO.
-CALL :T_Progress 1
-
-:Environment
-CALL :ColorLine " %E%33m[+]%E%97m ENVIRONMENT"
-ECHO.   [i] Interesting information?
-ECHO.
-set
-ECHO.
-CALL :T_Progress 1
-
-:InstalledSoftware
-CALL :ColorLine " %E%33m[+]%E%97m INSTALLED SOFTWARE"
-ECHO.   [i] Some weird software? Check for vulnerabilities in unknow software installed
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#software
-ECHO.
-dir /b "C:\Program Files" "C:\Program Files (x86)" | sort
-reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | findstr InstallLocation | findstr ":\\"
-reg query HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ /s | findstr InstallLocation | findstr ":\\"
-IF exist C:\Windows\CCM\SCClient.exe ECHO.SCCM is installed (installers are run with SYSTEM privileges, many are vulnerable to DLL Sideloading)
-ECHO.
-CALL :T_Progress 2
-
-:RemodeDeskCredMgr
-CALL :ColorLine " %E%33m[+]%E%97m Remote Desktop Credentials Manager"
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#remote-desktop-credential-manager
-IF exist "%LOCALAPPDATA%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings" ECHO.Found: RDCMan.settings in %AppLocal%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings, check for credentials in .rdg files
-ECHO.
-CALL :T_Progress 1
-
-:WSUS
-CALL :ColorLine " %E%33m[+]%E%97m WSUS"
-ECHO.   [i] You can inject 'fake' updates into non-SSL WSUS traffic (WSUXploit)
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#wsus
-reg query HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\ 2>nul | findstr /i "wuserver" | findstr /i "http://"
-ECHO.
-CALL :T_Progress 1
-
-:RunningProcesses
-CALL :ColorLine " %E%33m[+]%E%97m RUNNING PROCESSES"
-ECHO.   [i] Something unexpected is running? Check for vulnerabilities
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#running-processes
-tasklist /SVC
-ECHO.
-CALL :T_Progress 2
-ECHO.   [i] Checking file permissions of running processes (File backdooring - maybe the same files start automatically when Administrator logs in)
-for /f "tokens=2 delims='='" %%x in ('wmic process list full^|find /i "executablepath"^|find /i /v "system32"^|find ":"') do (
-	for /f eol^=^"^ delims^=^" %%z in ('ECHO.%%x') do (
-		icacls "%%z" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO.
-	)
-)
-ECHO.
-ECHO.   [i] Checking directory permissions of running processes (DLL injection)
-for /f "tokens=2 delims='='" %%x in ('wmic process list full^|find /i "executablepath"^|find /i /v "system32"^|find ":"') do for /f eol^=^"^ delims^=^" %%y in ('ECHO.%%x') do (
-	icacls "%%~dpy\" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO.
-)
-ECHO.
-CALL :T_Progress 3
-
-:RunAtStartup
-CALL :ColorLine " %E%33m[+]%E%97m RUN AT STARTUP"
-ECHO.   [i] Check if you can modify any binary that is going to be executed by admin or if you can impersonate a not found binary
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#run-at-startup
-::(autorunsc.exe -m -nobanner -a * -ct /accepteula 2>nul || wmic startup get caption,command 2>nul | more & ^
-reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run 2>nul & ^
-reg query HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce 2>nul & ^
-reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run 2>nul & ^
-reg query HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce 2>nul & ^
-CALL :T_Progress 2
-icacls "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-icacls "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-icacls "C:\Documents and Settings\%username%\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-icacls "C:\Documents and Settings\%username%\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-CALL :T_Progress 2
-icacls "%programdata%\Microsoft\Windows\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-icacls "%programdata%\Microsoft\Windows\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
-CALL :T_Progress 2
-schtasks /query /fo TABLE /nh | findstr /v /i "disable deshab informa")
-ECHO.
-CALL :T_Progress 2
-
-:AlwaysInstallElevated
-CALL :ColorLine " %E%33m[+]%E%97m AlwaysInstallElevated?"
-ECHO.   [i] If '1' then you can install a .msi file with admin privileges ;)
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#alwaysinstallelevated
-reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
-reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
-ECHO.
-CALL :T_Progress 2
-
-:NetworkShares
-CALL :ColorLine "%E%32m[*]%E%97m NETWORK"
-CALL :ColorLine " %E%33m[+]%E%97m CURRENT SHARES"
-net share
-ECHO.
-CALL :T_Progress 1
-
-:NetworkInterfaces
-CALL :ColorLine " %E%33m[+]%E%97m INTERFACES"
-ipconfig  /all
-ECHO.
-CALL :T_Progress 1
-
-:NetworkUsedPorts
-CALL :ColorLine " %E%33m[+]%E%97m USED PORTS"
-ECHO.   [i] Check for services restricted from the outside
-netstat -ano | findstr /i listen
-ECHO.
-CALL :T_Progress 1
-
-:NetworkFirewall
-CALL :ColorLine " %E%33m[+]%E%97m FIREWALL"
-netsh firewall show state
-netsh firewall show config
-ECHO.
-CALL :T_Progress 2
-
-:ARP
-CALL :ColorLine " %E%33m[+]%E%97m ARP"
-arp -A
-ECHO.
-CALL :T_Progress 1
-
-:NetworkRoutes
-CALL :ColorLine " %E%33m[+]%E%97m ROUTES"
-route print
-ECHO.
-CALL :T_Progress 1
-
-:WindowsHostsFile
-CALL :ColorLine " %E%33m[+]%E%97m Hosts file"
-type C:\WINDOWS\System32\drivers\etc\hosts | findstr /v "^#"
-CALL :T_Progress 1
-
-:DNSCache
-CALL :ColorLine " %E%33m[+]%E%97m DNS CACHE"
-ipconfig /displaydns | findstr "Record" | findstr "Name Host"
-ECHO.
-CALL :T_Progress 1
-
-:WifiCreds
-CALL :ColorLine " %E%33m[+]%E%97m WIFI"
-for /f "tokens=4 delims=: " %%a in ('netsh wlan show profiles ^| find "Profile "') do (netsh wlan show profiles name=%%a key=clear | findstr "SSID Cipher Content" | find /v "Number" & ECHO.)
-CALL :T_Progress 1
-
-:BasicUserInfo
-CALL :ColorLine "%E%32m[*]%E%97m BASIC USER INFO
-ECHO.   [i] Check if you are inside the Administrators group or if you have enabled any token that can be use to escalate privileges like SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebbugPrivilege
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#users-and-groups
-ECHO.
-CALL :ColorLine " %E%33m[+]%E%97m CURRENT USER"
-net user %username%
-net user %USERNAME% /domain 2>nul
-whoami /all
-ECHO.
-CALL :T_Progress 2
-
-:BasicUserInfoUsers
-CALL :ColorLine " %E%33m[+]%E%97m USERS"
-net user
-ECHO.
-CALL :T_Progress 1
-
-:BasicUserInfoGroups
-CALL :ColorLine " %E%33m[+]%E%97m GROUPS"
-net localgroup
-ECHO.
-CALL :T_Progress 1
-
-:BasicUserInfoAdminGroups
-CALL :ColorLine " %E%33m[+]%E%97m ADMINISTRATORS GROUPS"
-REM seems to be localised
-net localgroup Administrators 2>nul
-net localgroup Administradores 2>nul
-ECHO. 
-CALL :T_Progress 1
-
-:BasicUserInfoLoggedUser
-CALL :ColorLine " %E%33m[+]%E%97m CURRENT LOGGED USERS"
-quser
-ECHO. 
-CALL :T_Progress 1
-
-:KerberosTickets
-CALL :ColorLine " %E%33m[+]%E%97m Kerberos Tickets"
-klist
-ECHO. 
-CALL :T_Progress 1
-
-:CurrentClipboard
-CALL :ColorLine " %E%33m[+]%E%97m CURRENT CLIPBOARD"
-ECHO.   [i] Any password inside the clipboard?
-powershell -command "Get-Clipboard" 2>nul
-ECHO.
-CALL :T_Progress 1
-
-:ServiceVulnerabilities
-CALL :ColorLine "%E%32m[*]%E%97m SERVICE VULNERABILITIES"
-:::sysinternals external tool
-::ECHO.
-::CALL :ColorLine " %E%33m[+]%E%97m SERVICE PERMISSIONS WITH accesschk.exe FOR 'Authenticated users', Everyone, BUILTIN\Users, Todos and CURRENT USER"
-::ECHO.   [i] If Authenticated Users have SERVICE_ALL_ACCESS or SERVICE_CHANGE_CONFIG or WRITE_DAC or WRITE_OWNER or GENERIC_WRITE or GENERIC_ALL, you can modify the binary that is going to be executed by the service and start/stop the service
-::ECHO.   [i] If accesschk.exe is not in PATH, nothing will be found here
-::ECHO.   [i] AUTHETICATED USERS
-::accesschk.exe -uwcqv "Authenticated Users" * /accepteula 2>nul
-::ECHO.   [i] EVERYONE
-::accesschk.exe -uwcqv "Everyone" * /accepteula 2>nul
-::ECHO.   [i] BUILTIN\Users
-::accesschk.exe -uwcqv "BUILTIN\Users" * /accepteula 2>nul
-::ECHO.   [i] TODOS
-::accesschk.exe -uwcqv "Todos" * /accepteula 2>nul
-::ECHO.   [i] %USERNAME%
-::accesschk.exe -uwcqv %username% * /accepteula 2>nul
-::ECHO.
-::CALL :ColorLine " %E%33m[+]%E%97m SERVICE PERMISSIONS WITH accesschk.exe FOR *"
-::ECHO.   [i] Check for weird service permissions for unexpected groups"
-::accesschk.exe -uwcqv * /accepteula 2>nul
-CALL :T_Progress 1
-ECHO.
-
-:ServiceBinaryPermissions
-CALL :ColorLine " %E%33m[+]%E%97m SERVICE BINARY PERMISSIONS WITH WMIC and ICACLS"
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
-for /f "tokens=2 delims='='" %%a in ('cmd.exe /c wmic service list full ^| findstr /i "pathname" ^|findstr /i /v "system32"') do (
-    for /f eol^=^"^ delims^=^" %%b in ("%%a") do icacls "%%b" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos usuarios %username%" && ECHO.
-)
-ECHO.
-CALL :T_Progress 1
-
-:CheckRegistryModificationAbilities
-CALL :ColorLine " %E%33m[+]%E%97m CHECK IF YOU CAN MODIFY ANY SERVICE REGISTRY"
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
-for /f %%a in ('reg query hklm\system\currentcontrolset\services') do del %temp%\reg.hiv >nul 2>&1 & reg save %%a %temp%\reg.hiv >nul 2>&1 && reg restore %%a %temp%\reg.hiv >nul 2>&1 && ECHO.You can modify %%a
-ECHO.
-CALL :T_Progress 1
-
-:UnquotedServicePaths
-CALL :ColorLine " %E%33m[+]%E%97m UNQUOTED SERVICE PATHS"
-ECHO.   [i] When the path is not quoted (ex: C:\Program files\soft\new folder\exec.exe) Windows will try to execute first 'C:\Program.exe', then 'C:\Program Files\soft\new.exe' and finally 'C:\Program Files\soft\new folder\exec.exe'. Try to create 'C:\Program Files\soft\new.exe'
-ECHO.   [i] The permissions are also checked and filtered using icacls
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
-for /f "tokens=2" %%n in ('sc query state^= all^| findstr SERVICE_NAME') do (
-	for /f "delims=: tokens=1*" %%r in ('sc qc "%%~n" ^| findstr BINARY_PATH_NAME ^| findstr /i /v /l /c:"c:\windows\system32" ^| findstr /v /c:""""') do (
-		ECHO.%%~s ^| findstr /r /c:"[a-Z][ ][a-Z]" >nul 2>&1 && (ECHO.%%n && ECHO.%%~s && icacls %%s | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%") && ECHO.
-	)
-)
-CALL :T_Progress 2
-::wmic service get name,displayname,pathname,startmode | more | findstr /i /v "C:\\Windows\\system32\\" | findstr /i /v """
-ECHO.
-::CALL :T_Progress 1
-
-:PATHenvHijacking
-CALL :ColorLine "%E%32m[*]%E%97m DLL HIJACKING in PATHenv variable"
-ECHO.   [i] Maybe you can take advantage of modifying/creating some binary in some of the following locations
-ECHO.   [i] PATH variable entries permissions - place binary or DLL to execute instead of legitimate
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dll-hijacking
-for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. )
-ECHO.
-CALL :T_Progress 1
-
-:WindowsCredentials
-CALL :ColorLine "%E%32m[*]%E%97m CREDENTIALS"
-ECHO.
-CALL :ColorLine " %E%33m[+]%E%97m WINDOWS VAULT"
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#windows-vault
-cmdkey /list
-ECHO.
-CALL :T_Progress 2
-
-:DPAPIMasterKeys
-CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
-ECHO.   [i] Use the Mimikatz 'dpapi::masterkey' module with appropriate arguments (/rpc) to decrypt
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
-powershell -command "Get-ChildItem %appdata%\Microsoft\Protect" 2>nul
-powershell -command "Get-ChildItem %localappdata%\Microsoft\Protect" 2>nul
-CALL :T_Progress 2
-CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
-ECHO.   [i] Use the Mimikatz 'dpapi::cred' module with appropriate /masterkey to decrypt
-ECHO.   [i] You can also extract many DPAPI masterkeys from memory with the Mimikatz 'sekurlsa::dpapi' module
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
-ECHO.
-ECHO.Looking inside %appdata%\Microsoft\Credentials\
-ECHO.
-dir /b/a %appdata%\Microsoft\Credentials\ 2>nul 
-CALL :T_Progress 2
-ECHO.
-ECHO.Looking inside %localappdata%\Microsoft\Credentials\
-ECHO.
-dir /b/a %localappdata%\Microsoft\Credentials\ 2>nul
-CALL :T_Progress 2
-ECHO.
-
-:UnattendedFiles
-CALL :ColorLine " %E%33m[+]%E%97m Unattended files"
-IF EXIST %WINDIR%\sysprep\sysprep.xml ECHO.%WINDIR%\sysprep\sysprep.xml exists. 
-IF EXIST %WINDIR%\sysprep\sysprep.inf ECHO.%WINDIR%\sysprep\sysprep.inf exists. 
-IF EXIST %WINDIR%\sysprep.inf ECHO.%WINDIR%\sysprep.inf exists. 
-IF EXIST %WINDIR%\Panther\Unattended.xml ECHO.%WINDIR%\Panther\Unattended.xml exists. 
-IF EXIST %WINDIR%\Panther\Unattend.xml ECHO.%WINDIR%\Panther\Unattend.xml exists. 
-IF EXIST %WINDIR%\Panther\Unattend\Unattend.xml ECHO.%WINDIR%\Panther\Unattend\Unattend.xml exists. 
-IF EXIST %WINDIR%\Panther\Unattend\Unattended.xml ECHO.%WINDIR%\Panther\Unattend\Unattended.xml exists.
-IF EXIST %WINDIR%\System32\Sysprep\unattend.xml ECHO.%WINDIR%\System32\Sysprep\unattend.xml exists.
-IF EXIST %WINDIR%\System32\Sysprep\unattended.xml ECHO.%WINDIR%\System32\Sysprep\unattended.xml exists.
-IF EXIST %WINDIR%\..\unattend.txt ECHO.%WINDIR%\..\unattend.txt exists.
-IF EXIST %WINDIR%\..\unattend.inf ECHO.%WINDIR%\..\unattend.inf exists. 
-ECHO.
-CALL :T_Progress 2
-
-:SAMSYSBackups
-CALL :ColorLine " %E%33m[+]%E%97m SAM and SYSTEM backups"
-IF EXIST %WINDIR%\repair\SAM ECHO.%WINDIR%\repair\SAM exists. 
-IF EXIST %WINDIR%\System32\config\RegBack\SAM ECHO.%WINDIR%\System32\config\RegBack\SAM exists.
-IF EXIST %WINDIR%\System32\config\SAM ECHO.%WINDIR%\System32\config\SAM exists.
-IF EXIST %WINDIR%\repair\SYSTEM ECHO.%WINDIR%\repair\SYSTEM exists.
-IF EXIST %WINDIR%\System32\config\SYSTEM ECHO.%WINDIR%\System32\config\SYSTEM exists.
-IF EXIST %WINDIR%\System32\config\RegBack\SYSTEM ECHO.%WINDIR%\System32\config\RegBack\SYSTEM exists.
-ECHO.
-CALL :T_Progress 3
-
-:McAffeeSitelist
-CALL :ColorLine " %E%33m[+]%E%97m McAffee SiteList.xml"
-cd %ProgramFiles% 2>nul
-dir /s SiteList.xml 2>nul
-cd %ProgramFiles(x86)% 2>nul
-dir /s SiteList.xml 2>nul
-cd "%windir%\..\Documents and Settings" 2>nul
-dir /s SiteList.xml 2>nul
-cd %windir%\..\Users 2>nul
-dir /s SiteList.xml 2>nul
-ECHO.
-CALL :T_Progress 2
-
-:GPPPassword
-CALL :ColorLine " %E%33m[+]%E%97m GPP Password"
-cd "%SystemDrive%\Microsoft\Group Policy\history" 2>nul
-dir /s/b Groups.xml == Services.xml == Scheduledtasks.xml == DataSources.xml == Printers.xml == Drives.xml 2>nul
-cd "%windir%\..\Documents and Settings\All Users\Application Data\Microsoft\Group Policy\history" 2>nul
-dir /s/b Groups.xml == Services.xml == Scheduledtasks.xml == DataSources.xml == Printers.xml == Drives.xml 2>nul
-ECHO.
-CALL :T_Progress 2
-
-:CloudCreds
-CALL :ColorLine " %E%33m[+]%E%97m Cloud Credentials"
-cd "%SystemDrive%\Users"
-dir /s/b .aws == credentials == gcloud == credentials.db == legacy_credentials == access_tokens.db == .azure == accessTokens.json == azureProfile.json 2>nul
-cd "%windir%\..\Documents and Settings"
-dir /s/b .aws == credentials == gcloud == credentials.db == legacy_credentials == access_tokens.db == .azure == accessTokens.json == azureProfile.json 2>nul
-ECHO.
-CALL :T_Progress 2
-
-:AppCMD
-CALL :ColorLine " %E%33m[+]%E%97m AppCmd"
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#appcmd-exe
-IF EXIST %systemroot%\system32\inetsrv\appcmd.exe ECHO.%systemroot%\system32\inetsrv\appcmd.exe exists. 
-ECHO.
-CALL :T_Progress 2
-
-:RegFilesCredentials
-CALL :ColorLine " %E%33m[+]%E%97m Files in registry that may contain credentials"
-ECHO.   [i] Searching specific files that may contains credentials.
-ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files
-ECHO.Looking inside HKCU\Software\ORL\WinVNC3\Password
-reg query HKCU\Software\ORL\WinVNC3\Password 2>nul
-CALL :T_Progress 2
-ECHO.Looking inside HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4/password
-reg query HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4 /v password 2>nul
-CALL :T_Progress 2
-ECHO.Looking inside HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\WinLogon
-reg query "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon" 2>nul | findstr /i "DefaultDomainName DefaultUserName DefaultPassword AltDefaultDomainName AltDefaultUserName AltDefaultPassword LastUsedUsername"
-CALL :T_Progress 2
-ECHO.Looking inside HKLM\SYSTEM\CurrentControlSet\Services\SNMP
-reg query HKLM\SYSTEM\CurrentControlSet\Services\SNMP /s 2>nul
-CALL :T_Progress 2
-ECHO.Looking inside HKCU\Software\TightVNC\Server
-reg query HKCU\Software\TightVNC\Server 2>nul
-CALL :T_Progress 2
-ECHO.Looking inside HKCU\Software\SimonTatham\PuTTY\Sessions
-reg query HKCU\Software\SimonTatham\PuTTY\Sessions /s 2>nul
-CALL :T_Progress 2
-ECHO.Looking inside HKCU\Software\OpenSSH\Agent\Keys
-CALL :T_Progress 2
-reg query HKCU\Software\OpenSSH\Agent\Keys /s 2>nul
-cd %USERPROFILE% 2>nul && dir /s/b *password* == *credential* 2>nul
-cd ..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..
-dir /s/b /A:-D RDCMan.settings == *.rdg == SCClient.exe == *_history == .sudo_as_admin_successful == .profile == *bashrc == httpd.conf == *.plan == .htpasswd == .git-credentials == *.rhosts == hosts.equiv == Dockerfile == docker-compose.yml == appcmd.exe == TypedURLs == TypedURLsTime == History == Bookmarks == Cookies == "Login Data" == places.sqlite == key3.db == key4.db == credentials == credentials.db == access_tokens.db == accessTokens.json == legacy_credentials == azureProfile.json == unattend.txt == access.log == error.log == *.gpg == *.pgp == *config*.php == elasticsearch.y*ml == kibana.y*ml == *.p12 == *.der == *.csr == *.cer == known_hosts == id_rsa == id_dsa == *.ovpn == anaconda-ks.cfg == hostapd.conf == rsyncd.conf == cesi.conf == supervisord.conf == tomcat-users.xml == *.kdbx == KeePass.config == Ntds.dit == SAM == SYSTEM == FreeSSHDservice.ini == sysprep.inf == sysprep.xml == unattend.xml == unattended.xml == *vnc*.ini == *vnc*.c*nf* == *vnc*.txt == *vnc*.xml == groups.xml == services.xml == scheduledtasks.xml == printers.xml == drives.xml == datasources.xml == php.ini == https.conf == https-xampp.conf == httpd.conf == my.ini == my.cnf == access.log == error.log == server.xml == SiteList.xml == ConsoleHost_history.txt == setupinfo == setupinfo.bak 2>nul | findstr /v ".dll"
-cd inetpub 2>nul && (dir /s/b web.config == *.log & cd ..)
-ECHO.
-CALL :T_Progress 2
-
-:ExtendedDriveScan
-if "%long%" == "true" (
-    CALL :ColorLine " %E%33m[+]%E%97m REGISTRY WITH STRING pass OR pwd"
-	reg query HKLM /f passw /t REG_SZ /s
-	reg query HKCU /f passw /t REG_SZ /s
-	reg query HKLM /f pwd /t REG_SZ /s
-	reg query HKCU /f pwd /t REG_SZ /s
-	ECHO.
-	ECHO.   [i] Iterating through the drives
-	ECHO.
-	for /f %%x in ('wmic logicaldisk get name^| more') do (
-		set tdrive=%%x
-		if "!tdrive:~1,2!" == ":" (
-			%%x
-            CALL :ColorLine " %E%33m[+]%E%97m FILES THAT CONTAINS THE WORD PASSWORD WITH EXTENSION: .xml .ini .txt *.cfg *.config"
-	        findstr /s/n/m/i password *.xml *.ini *.txt *.cfg *.config 2>nul | findstr /v /i "\\AppData\\Local \\WinSxS ApnDatabase.xml \\UEV\\InboxTemplates \\Microsoft.Windows.Cloud \\Notepad\+\+\\ vmware cortana alphabet \\7-zip\\" 2>nul
-            ECHO.
-            CALL :ColorLine " %E%33m[+]%E%97m FILES WHOSE NAME CONTAINS THE WORD PASS CRED or .config not inside \Windows\"
-            dir /s/b *pass* == *cred* == *.config* == *.cfg 2>nul | findstr /v /i "\\windows\\"  
-            ECHO.
-		)
-	)
-	CALL :T_Progress 2
-) ELSE (
-	CALL :T_Progress 2
-)
-TITLE WinPEAS - Windows local Privilege Escalation Awesome Script - Idle
-ECHO.---
-ECHO.Scan complete.
-PAUSE >NUL 
-EXIT /B
-
-:::-Subroutines
-
-:SetOnce
-REM :: ANSI escape character is set once below - for ColorLine Subroutine
-SET "E=0x1B["
-SET "PercentageTrack=0"
-EXIT /B
-
-:T_Progress
-SET "Percentage=%~1"
-SET /A "PercentageTrack=PercentageTrack+Percentage"
-TITLE WinPEAS - Windows local Privilege Escalation Awesome Script - Scanning... !PercentageTrack!%%
-EXIT /B
-
-:ColorLine
-SET "CurrentLine=%~1"
-FOR /F "delims=" %%A IN ('FORFILES.EXE /P %~dp0 /M %~nx0 /C "CMD /C ECHO.!CurrentLine!"') DO ECHO.%%A
-EXIT /B
+@ECHO OFF & SETLOCAL EnableDelayedExpansion
+TITLE WinPEAS - Windows local Privilege Escalation Awesome Script
+COLOR 0F
+CALL :SetOnce
+
+REM :: WinPEAS - Windows local Privilege Escalation Awesome Script
+REM :: Code by carlospolop; Re-Write by ThisLimn0
+
+REM Registry scan of other drives besides 
+REM /////true or false
+SET long=false
+
+:Splash
+ECHO.
+CALL :ColorLine "            %E%32m((,.,/((((((((((((((((((((/,  */%E%97m"
+CALL :ColorLine "     %E%32m,/*,..*(((((((((((((((((((((((((((((((((,%E%97m"              
+CALL :ColorLine "   %E%32m,*/((((((((((((((((((/,  %E%92m.*//((//**,%E%32m .*((((((*%E%97m"       
+CALL :ColorLine "   %E%32m((((((((((((((((* %E%94m*****%E%32m,,,/########## %E%32m.(* ,((((((%E%97m"   
+CALL :ColorLine "   %E%32m(((((((((((/* %E%94m******************%E%32m/####### %E%32m.(. ((((((%E%97m"
+CALL :ColorLine "   %E%32m((((((.%E%92m.%E%94m******************%E%97m/@@@@@/%E%94m***%E%92m/######%E%32m /((((((%E%97m"
+CALL :ColorLine "   %E%32m,,.%E%92m.%E%94m**********************%E%97m@@@@@@@@@@(%E%94m***%E%92m,####%E%32m ../(((((%E%97m"
+CALL :ColorLine "   %E%32m, ,%E%92m%E%94m**********************%E%97m#@@@@@#@@@@%E%94m*********%E%92m##%E%32m((/ /((((%E%97m"
+CALL :ColorLine "   %E%32m..((%E%92m(##########%E%94m*********%E%97m/#@@@@@@@@@/%E%94m*************%E%32m,,..((((%E%97m"
+CALL :ColorLine "   %E%32m.((%E%92m(################(/%E%94m******%E%97m/@@@@@#%E%94m****************%E%32m.. /((%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(########################(/%E%94m************************%E%32m..*(%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(#############################(/%E%94m********************%E%32m.,(%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(##################################(/%E%94m***************%E%32m..(%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(######################################(%E%94m************%E%32m..(%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(######(,.***.,(###################(..***(/%E%94m*********%E%32m..(%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(######*(#####((##################((######/(%E%94m********%E%32m..(%E%97m"
+CALL :ColorLine "   %E%32m.(%E%92m(##################(/**********(################(%E%94m**%E%32m...(%E%97m"
+CALL :ColorLine "   %E%32m.((%E%92m(####################/*******(###################%E%32m.((((%E%97m" 
+CALL :ColorLine "   %E%32m.((((%E%92m(############################################/%E%32m  /((%E%97m"
+CALL :ColorLine "   %E%32m..((((%E%92m(#########################################(%E%32m..(((((.%E%97m"
+CALL :ColorLine "   %E%32m....((((%E%92m(#####################################(%E%32m .((((((.%E%97m"
+CALL :ColorLine "   %E%32m......((((%E%92m(#################################(%E%32m .(((((((.%E%97m"
+CALL :ColorLine "   %E%32m(((((((((. ,%E%92m(############################(%E%32m../(((((((((.%E%97m"
+CALL :ColorLine "       %E%32m(((((((((/,  %E%92m,####################(%E%32m/..((((((((((.%E%97m"
+CALL :ColorLine "             %E%32m(((((((((/,.  %E%92m,*//////*,.%E%32m ./(((((((((((.%E%97m"
+CALL :ColorLine "                %E%32m(((((((((((((((((((((((((((/%E%97m"
+ECHO.                       by carlospolop
+ECHO.
+ECHO.
+
+:Advisory
+REM // Increase progress in title by n percent
+CALL :T_Progress 0
+ECHO./^^!\ Advisory: WinPEAS - Windows local Privilege Escalation Awesome Script
+CALL :ColorLine "   %E%41mWinPEAS should be used for authorized penetration testing and/or educational purposes only.%E%40;97m"
+CALL :ColorLine "   %E%41mAny misuse of this software will not be the responsibility of the author or of any other collaborator.%E%40;97m"
+CALL :ColorLine "   %E%41mUse it at your own networks and/or with the network owner's permission.%E%40;97m"
+ECHO.
+
+:SystemInfo
+CALL :ColorLine "%E%32m[*]%E%97m BASIC SYSTEM INFO
+CALL :ColorLine " %E%33m[+]%E%97m WINDOWS OS"
+ECHO.   [i] Check for vulnerabilities for the OS version with the applied patches
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#kernel-exploits
+systeminfo
+ECHO.
+CALL :T_Progress 2
+
+:ListHotFixes
+wmic qfe get Caption,Description,HotFixID,InstalledOn | more
+set expl=no
+for /f "tokens=3-9" %%a in ('systeminfo') do (ECHO."%%a %%b %%c %%d %%e %%f %%g" | findstr /i "2000 XP 2003 2008 vista" && set expl=yes) & (ECHO."%%a %%b %%c %%d %%e %%f %%g" | findstr /i /C:"windows 7" && set expl=yes)
+IF "%expl%" == "yes" ECHO.   [i] Possible exploits (https://github.com/codingo/OSCP-2/blob/master/Windows/WinPrivCheck.bat)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2592799" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS11-080 patch is NOT installed! (Vulns: XP/SP3,2K3/SP3-afd.sys)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3143141" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS16-032 patch is NOT installed! (Vulns: 2K8/SP1/2,Vista/SP2,7/SP1-secondary logon)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2393802" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS11-011 patch is NOT installed! (Vulns: XP/SP2/3,2K3/SP2,2K8/SP2,Vista/SP1/2,7/SP0-WmiTraceMessageVa)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB982799" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-59 patch is NOT installed! (Vulns: 2K8,Vista,7/SP0-Chimichurri)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB979683" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-21 patch is NOT installed! (Vulns: 2K/SP4,XP/SP2/3,2K3/SP2,2K8/SP2,Vista/SP0/1/2,7/SP0-Win Kernel)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2305420" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-092 patch is NOT installed! (Vulns: 2K8/SP0/1/2,Vista/SP1/2,7/SP0-Task Sched)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB981957" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-073 patch is NOT installed! (Vulns: XP/SP2/3,2K3/SP2/2K8/SP2,Vista/SP1/2,7/SP0-Keyboard Layout)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB4013081" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS17-017 patch is NOT installed! (Vulns: 2K8/SP2,Vista/SP2,7/SP1-Registry Hive Loading)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB977165" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS10-015 patch is NOT installed! (Vulns: 2K,XP,2K3,2K8,Vista,7-User Mode to Ring)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB941693" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS08-025 patch is NOT installed! (Vulns: 2K/SP4,XP/SP2,2K3/SP1/2,2K8/SP0,Vista/SP0/1-win32k.sys)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB920958" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS06-049 patch is NOT installed! (Vulns: 2K/SP4-ZwQuerySysInfo)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB914389" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS06-030 patch is NOT installed! (Vulns: 2K,XP/SP2-Mrxsmb.sys)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB908523" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS05-055 patch is NOT installed! (Vulns: 2K/SP4-APC Data-Free)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB890859" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS05-018 patch is NOT installed! (Vulns: 2K/SP3/4,XP/SP1/2-CSRSS)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB842526" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS04-019 patch is NOT installed! (Vulns: 2K/SP2/3/4-Utility Manager)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB835732" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS04-011 patch is NOT installed! (Vulns: 2K/SP2/3/4,XP/SP0/1-LSASS service BoF)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB841872" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS04-020 patch is NOT installed! (Vulns: 2K/SP4-POSIX)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2975684" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS14-040 patch is NOT installed! (Vulns: 2K3/SP2,2K8/SP2,Vista/SP2,7/SP1-afd.sys Dangling Pointer)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3136041" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS16-016 patch is NOT installed! (Vulns: 2K8/SP1/2,Vista/SP2,7/SP1-WebDAV to Address)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3057191" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS15-051 patch is NOT installed! (Vulns: 2K3/SP2,2K8/SP2,Vista/SP2,7/SP1-win32k.sys)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2989935" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS14-070 patch is NOT installed! (Vulns: 2K3/SP2-TCP/IP)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2778930" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS13-005 patch is NOT installed! (Vulns: Vista,7,8,2008,2008R2,2012,RT-hwnd_broadcast)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2850851" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS13-053 patch is NOT installed! (Vulns: 7SP0/SP1_x86-schlamperei)
+IF "%expl%" == "yes" wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2870008" 1>NUL
+IF "%expl%" == "yes" IF errorlevel 1 ECHO.MS13-081 patch is NOT installed! (Vulns: 7SP0/SP1_x86-track_popup_menu)
+ECHO.
+CALL :T_Progress 2
+
+:DateAndTime
+CALL :ColorLine " %E%33m[+]%E%97m DATE and TIME"
+ECHO.   [i] You may need to adjust your local date/time to exploit some vulnerability
+date /T
+time /T
+ECHO.
+CALL :T_Progress 2
+
+:AuditSettings
+CALL :ColorLine " %E%33m[+]%E%97m Audit Settings"
+ECHO.   [i] Check what is being logged
+REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:WEFSettings
+CALL :ColorLine " %E%33m[+]%E%97m WEF Settings"
+ECHO.   [i] Check where are being sent the logs
+REG QUERY HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:LAPSInstallCheck
+CALL :ColorLine " %E%33m[+]%E%97m LAPS installed?"
+ECHO.   [i] Check what is being logged
+REG QUERY "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft Services\AdmPwd" /v AdmPwdEnabled 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:LSAProtectionCheck
+CALL :ColorLine " %E%33m[+]%E%97m LSA protection?"
+ECHO.   [i] Active if "1"
+REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA" /v RunAsPPL 2>nul
+CALL :T_Progress 1
+
+:LSACredentialGuard
+CALL :ColorLine " %E%33m[+]%E%97m Credential Guard?"
+ECHO.   [i] Active if "1" or "2"
+REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA" /v LsaCfgFlags 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:LogonCredentialsPlainInMemory
+CALL :ColorLine " %E%33m[+]%E%97m WDigest?"
+ECHO.   [i] Plain-text creds in memory if "1"
+reg query HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:CachedCreds
+CALL :ColorLine " %E%33m[+]%E%97m Number of cached creds"
+ECHO.   [i] You need System-rights to extract them
+reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v CACHEDLOGONSCOUNT 2>nul
+CALL :T_Progress 1
+
+:UACSettings
+CALL :ColorLine " %E%33m[+]%E%97m UAC Settings"
+ECHO.   [i] If the results read ENABLELUA REG_DWORD 0x1, part or all of the UAC components are on
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access
+REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:AVSettings
+CALL :ColorLine " %E%33m[+]%E%97m Registered Anti-Virus(AV)"
+WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List | more 
+ECHO.Checking for defender whitelisted PATHS
+reg query "HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" 2>nul
+CALL :T_Progress 1
+
+:PSSettings
+CALL :ColorLine " %E%33m[+]%E%97m PowerShell settings"
+ECHO.PowerShell v2 Version:
+REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine /v PowerShellVersion 2>nul
+ECHO.PowerShell v5 Version:
+REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine /v PowerShellVersion 2>nul
+ECHO.Transcriptions Settings:
+REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription 2>nul
+ECHO.Module logging settings:
+REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging 2>nul
+ECHO.Scriptblog logging settings:
+REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging 2>nul
+ECHO.
+ECHO.PS default transcript history
+dir %SystemDrive%\transcripts\ 2>nul
+ECHO.
+ECHO.Checking PS history file
+dir "%APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt" 2>nul
+ECHO.
+CALL :T_Progress 3
+
+:MountedDisks
+CALL :ColorLine " %E%33m[+]%E%97m MOUNTED DISKS"
+ECHO.   [i] Maybe you find something interesting
+(wmic logicaldisk get caption 2>nul | more) || (fsutil fsinfo drives 2>nul)
+ECHO.
+CALL :T_Progress 1
+
+:Environment
+CALL :ColorLine " %E%33m[+]%E%97m ENVIRONMENT"
+ECHO.   [i] Interesting information?
+ECHO.
+set
+ECHO.
+CALL :T_Progress 1
+
+:InstalledSoftware
+CALL :ColorLine " %E%33m[+]%E%97m INSTALLED SOFTWARE"
+ECHO.   [i] Some weird software? Check for vulnerabilities in unknow software installed
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#software
+ECHO.
+dir /b "C:\Program Files" "C:\Program Files (x86)" | sort
+reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | findstr InstallLocation | findstr ":\\"
+reg query HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ /s | findstr InstallLocation | findstr ":\\"
+IF exist C:\Windows\CCM\SCClient.exe ECHO.SCCM is installed (installers are run with SYSTEM privileges, many are vulnerable to DLL Sideloading)
+ECHO.
+CALL :T_Progress 2
+
+:RemodeDeskCredMgr
+CALL :ColorLine " %E%33m[+]%E%97m Remote Desktop Credentials Manager"
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#remote-desktop-credential-manager
+IF exist "%LOCALAPPDATA%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings" ECHO.Found: RDCMan.settings in %AppLocal%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings, check for credentials in .rdg files
+ECHO.
+CALL :T_Progress 1
+
+:WSUS
+CALL :ColorLine " %E%33m[+]%E%97m WSUS"
+ECHO.   [i] You can inject 'fake' updates into non-SSL WSUS traffic (WSUXploit)
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#wsus
+reg query HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\ 2>nul | findstr /i "wuserver" | findstr /i "http://"
+ECHO.
+CALL :T_Progress 1
+
+:RunningProcesses
+CALL :ColorLine " %E%33m[+]%E%97m RUNNING PROCESSES"
+ECHO.   [i] Something unexpected is running? Check for vulnerabilities
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#running-processes
+tasklist /SVC
+ECHO.
+CALL :T_Progress 2
+ECHO.   [i] Checking file permissions of running processes (File backdooring - maybe the same files start automatically when Administrator logs in)
+for /f "tokens=2 delims='='" %%x in ('wmic process list full^|find /i "executablepath"^|find /i /v "system32"^|find ":"') do (
+	for /f eol^=^"^ delims^=^" %%z in ('ECHO.%%x') do (
+		icacls "%%z" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO.
+	)
+)
+ECHO.
+ECHO.   [i] Checking directory permissions of running processes (DLL injection)
+for /f "tokens=2 delims='='" %%x in ('wmic process list full^|find /i "executablepath"^|find /i /v "system32"^|find ":"') do for /f eol^=^"^ delims^=^" %%y in ('ECHO.%%x') do (
+	icacls "%%~dpy\" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO.
+)
+ECHO.
+CALL :T_Progress 3
+
+:RunAtStartup
+CALL :ColorLine " %E%33m[+]%E%97m RUN AT STARTUP"
+ECHO.   [i] Check if you can modify any binary that is going to be executed by admin or if you can impersonate a not found binary
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#run-at-startup
+::(autorunsc.exe -m -nobanner -a * -ct /accepteula 2>nul || wmic startup get caption,command 2>nul | more & ^
+reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run 2>nul & ^
+reg query HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce 2>nul & ^
+reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run 2>nul & ^
+reg query HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce 2>nul & ^
+CALL :T_Progress 2
+icacls "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+icacls "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+icacls "C:\Documents and Settings\%username%\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+icacls "C:\Documents and Settings\%username%\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+CALL :T_Progress 2
+icacls "%programdata%\Microsoft\Windows\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+icacls "%programdata%\Microsoft\Windows\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\*" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. & ^
+CALL :T_Progress 2
+schtasks /query /fo TABLE /nh | findstr /v /i "disable deshab informa")
+ECHO.
+CALL :T_Progress 2
+
+:AlwaysInstallElevated
+CALL :ColorLine " %E%33m[+]%E%97m AlwaysInstallElevated?"
+ECHO.   [i] If '1' then you can install a .msi file with admin privileges ;)
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#alwaysinstallelevated
+reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
+reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
+ECHO.
+CALL :T_Progress 2
+
+:NetworkShares
+CALL :ColorLine "%E%32m[*]%E%97m NETWORK"
+CALL :ColorLine " %E%33m[+]%E%97m CURRENT SHARES"
+net share
+ECHO.
+CALL :T_Progress 1
+
+:NetworkInterfaces
+CALL :ColorLine " %E%33m[+]%E%97m INTERFACES"
+ipconfig  /all
+ECHO.
+CALL :T_Progress 1
+
+:NetworkUsedPorts
+CALL :ColorLine " %E%33m[+]%E%97m USED PORTS"
+ECHO.   [i] Check for services restricted from the outside
+netstat -ano | findstr /i listen
+ECHO.
+CALL :T_Progress 1
+
+:NetworkFirewall
+CALL :ColorLine " %E%33m[+]%E%97m FIREWALL"
+netsh firewall show state
+netsh firewall show config
+ECHO.
+CALL :T_Progress 2
+
+:ARP
+CALL :ColorLine " %E%33m[+]%E%97m ARP"
+arp -A
+ECHO.
+CALL :T_Progress 1
+
+:NetworkRoutes
+CALL :ColorLine " %E%33m[+]%E%97m ROUTES"
+route print
+ECHO.
+CALL :T_Progress 1
+
+:WindowsHostsFile
+CALL :ColorLine " %E%33m[+]%E%97m Hosts file"
+type C:\WINDOWS\System32\drivers\etc\hosts | findstr /v "^#"
+CALL :T_Progress 1
+
+:DNSCache
+CALL :ColorLine " %E%33m[+]%E%97m DNS CACHE"
+ipconfig /displaydns | findstr "Record" | findstr "Name Host"
+ECHO.
+CALL :T_Progress 1
+
+:WifiCreds
+CALL :ColorLine " %E%33m[+]%E%97m WIFI"
+for /f "tokens=4 delims=: " %%a in ('netsh wlan show profiles ^| find "Profile "') do (netsh wlan show profiles name=%%a key=clear | findstr "SSID Cipher Content" | find /v "Number" & ECHO.)
+CALL :T_Progress 1
+
+:BasicUserInfo
+CALL :ColorLine "%E%32m[*]%E%97m BASIC USER INFO
+ECHO.   [i] Check if you are inside the Administrators group or if you have enabled any token that can be use to escalate privileges like SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebbugPrivilege
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#users-and-groups
+ECHO.
+CALL :ColorLine " %E%33m[+]%E%97m CURRENT USER"
+net user %username%
+net user %USERNAME% /domain 2>nul
+whoami /all
+ECHO.
+CALL :T_Progress 2
+
+:BasicUserInfoUsers
+CALL :ColorLine " %E%33m[+]%E%97m USERS"
+net user
+ECHO.
+CALL :T_Progress 1
+
+:BasicUserInfoGroups
+CALL :ColorLine " %E%33m[+]%E%97m GROUPS"
+net localgroup
+ECHO.
+CALL :T_Progress 1
+
+:BasicUserInfoAdminGroups
+CALL :ColorLine " %E%33m[+]%E%97m ADMINISTRATORS GROUPS"
+REM seems to be localised
+net localgroup Administrators 2>nul
+net localgroup Administradores 2>nul
+ECHO. 
+CALL :T_Progress 1
+
+:BasicUserInfoLoggedUser
+CALL :ColorLine " %E%33m[+]%E%97m CURRENT LOGGED USERS"
+quser
+ECHO. 
+CALL :T_Progress 1
+
+:KerberosTickets
+CALL :ColorLine " %E%33m[+]%E%97m Kerberos Tickets"
+klist
+ECHO. 
+CALL :T_Progress 1
+
+:CurrentClipboard
+CALL :ColorLine " %E%33m[+]%E%97m CURRENT CLIPBOARD"
+ECHO.   [i] Any password inside the clipboard?
+powershell -command "Get-Clipboard" 2>nul
+ECHO.
+CALL :T_Progress 1
+
+:ServiceVulnerabilities
+CALL :ColorLine "%E%32m[*]%E%97m SERVICE VULNERABILITIES"
+:::sysinternals external tool
+::ECHO.
+::CALL :ColorLine " %E%33m[+]%E%97m SERVICE PERMISSIONS WITH accesschk.exe FOR 'Authenticated users', Everyone, BUILTIN\Users, Todos and CURRENT USER"
+::ECHO.   [i] If Authenticated Users have SERVICE_ALL_ACCESS or SERVICE_CHANGE_CONFIG or WRITE_DAC or WRITE_OWNER or GENERIC_WRITE or GENERIC_ALL, you can modify the binary that is going to be executed by the service and start/stop the service
+::ECHO.   [i] If accesschk.exe is not in PATH, nothing will be found here
+::ECHO.   [i] AUTHETICATED USERS
+::accesschk.exe -uwcqv "Authenticated Users" * /accepteula 2>nul
+::ECHO.   [i] EVERYONE
+::accesschk.exe -uwcqv "Everyone" * /accepteula 2>nul
+::ECHO.   [i] BUILTIN\Users
+::accesschk.exe -uwcqv "BUILTIN\Users" * /accepteula 2>nul
+::ECHO.   [i] TODOS
+::accesschk.exe -uwcqv "Todos" * /accepteula 2>nul
+::ECHO.   [i] %USERNAME%
+::accesschk.exe -uwcqv %username% * /accepteula 2>nul
+::ECHO.
+::CALL :ColorLine " %E%33m[+]%E%97m SERVICE PERMISSIONS WITH accesschk.exe FOR *"
+::ECHO.   [i] Check for weird service permissions for unexpected groups"
+::accesschk.exe -uwcqv * /accepteula 2>nul
+CALL :T_Progress 1
+ECHO.
+
+:ServiceBinaryPermissions
+CALL :ColorLine " %E%33m[+]%E%97m SERVICE BINARY PERMISSIONS WITH WMIC and ICACLS"
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
+for /f "tokens=2 delims='='" %%a in ('cmd.exe /c wmic service list full ^| findstr /i "pathname" ^|findstr /i /v "system32"') do (
+    for /f eol^=^"^ delims^=^" %%b in ("%%a") do icacls "%%b" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos usuarios %username%" && ECHO.
+)
+ECHO.
+CALL :T_Progress 1
+
+:CheckRegistryModificationAbilities
+CALL :ColorLine " %E%33m[+]%E%97m CHECK IF YOU CAN MODIFY ANY SERVICE REGISTRY"
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
+for /f %%a in ('reg query hklm\system\currentcontrolset\services') do del %temp%\reg.hiv >nul 2>&1 & reg save %%a %temp%\reg.hiv >nul 2>&1 && reg restore %%a %temp%\reg.hiv >nul 2>&1 && ECHO.You can modify %%a
+ECHO.
+CALL :T_Progress 1
+
+:UnquotedServicePaths
+CALL :ColorLine " %E%33m[+]%E%97m UNQUOTED SERVICE PATHS"
+ECHO.   [i] When the path is not quoted (ex: C:\Program files\soft\new folder\exec.exe) Windows will try to execute first 'C:\Program.exe', then 'C:\Program Files\soft\new.exe' and finally 'C:\Program Files\soft\new folder\exec.exe'. Try to create 'C:\Program Files\soft\new.exe'
+ECHO.   [i] The permissions are also checked and filtered using icacls
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
+for /f "tokens=2" %%n in ('sc query state^= all^| findstr SERVICE_NAME') do (
+	for /f "delims=: tokens=1*" %%r in ('sc qc "%%~n" ^| findstr BINARY_PATH_NAME ^| findstr /i /v /l /c:"c:\windows\system32" ^| findstr /v /c:""""') do (
+		ECHO.%%~s ^| findstr /r /c:"[a-Z][ ][a-Z]" >nul 2>&1 && (ECHO.%%n && ECHO.%%~s && icacls %%s | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%") && ECHO.
+	)
+)
+CALL :T_Progress 2
+::wmic service get name,displayname,pathname,startmode | more | findstr /i /v "C:\\Windows\\system32\\" | findstr /i /v """
+ECHO.
+::CALL :T_Progress 1
+
+:PATHenvHijacking
+CALL :ColorLine "%E%32m[*]%E%97m DLL HIJACKING in PATHenv variable"
+ECHO.   [i] Maybe you can take advantage of modifying/creating some binary in some of the following locations
+ECHO.   [i] PATH variable entries permissions - place binary or DLL to execute instead of legitimate
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dll-hijacking
+for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. )
+ECHO.
+CALL :T_Progress 1
+
+:WindowsCredentials
+CALL :ColorLine "%E%32m[*]%E%97m CREDENTIALS"
+ECHO.
+CALL :ColorLine " %E%33m[+]%E%97m WINDOWS VAULT"
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#windows-vault
+cmdkey /list
+ECHO.
+CALL :T_Progress 2
+
+:DPAPIMasterKeys
+CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
+ECHO.   [i] Use the Mimikatz 'dpapi::masterkey' module with appropriate arguments (/rpc) to decrypt
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
+powershell -command "Get-ChildItem %appdata%\Microsoft\Protect" 2>nul
+powershell -command "Get-ChildItem %localappdata%\Microsoft\Protect" 2>nul
+CALL :T_Progress 2
+CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
+ECHO.   [i] Use the Mimikatz 'dpapi::cred' module with appropriate /masterkey to decrypt
+ECHO.   [i] You can also extract many DPAPI masterkeys from memory with the Mimikatz 'sekurlsa::dpapi' module
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
+ECHO.
+ECHO.Looking inside %appdata%\Microsoft\Credentials\
+ECHO.
+dir /b/a %appdata%\Microsoft\Credentials\ 2>nul 
+CALL :T_Progress 2
+ECHO.
+ECHO.Looking inside %localappdata%\Microsoft\Credentials\
+ECHO.
+dir /b/a %localappdata%\Microsoft\Credentials\ 2>nul
+CALL :T_Progress 2
+ECHO.
+
+:UnattendedFiles
+CALL :ColorLine " %E%33m[+]%E%97m Unattended files"
+IF EXIST %WINDIR%\sysprep\sysprep.xml ECHO.%WINDIR%\sysprep\sysprep.xml exists. 
+IF EXIST %WINDIR%\sysprep\sysprep.inf ECHO.%WINDIR%\sysprep\sysprep.inf exists. 
+IF EXIST %WINDIR%\sysprep.inf ECHO.%WINDIR%\sysprep.inf exists. 
+IF EXIST %WINDIR%\Panther\Unattended.xml ECHO.%WINDIR%\Panther\Unattended.xml exists. 
+IF EXIST %WINDIR%\Panther\Unattend.xml ECHO.%WINDIR%\Panther\Unattend.xml exists. 
+IF EXIST %WINDIR%\Panther\Unattend\Unattend.xml ECHO.%WINDIR%\Panther\Unattend\Unattend.xml exists. 
+IF EXIST %WINDIR%\Panther\Unattend\Unattended.xml ECHO.%WINDIR%\Panther\Unattend\Unattended.xml exists.
+IF EXIST %WINDIR%\System32\Sysprep\unattend.xml ECHO.%WINDIR%\System32\Sysprep\unattend.xml exists.
+IF EXIST %WINDIR%\System32\Sysprep\unattended.xml ECHO.%WINDIR%\System32\Sysprep\unattended.xml exists.
+IF EXIST %WINDIR%\..\unattend.txt ECHO.%WINDIR%\..\unattend.txt exists.
+IF EXIST %WINDIR%\..\unattend.inf ECHO.%WINDIR%\..\unattend.inf exists. 
+ECHO.
+CALL :T_Progress 2
+
+:SAMSYSBackups
+CALL :ColorLine " %E%33m[+]%E%97m SAM and SYSTEM backups"
+IF EXIST %WINDIR%\repair\SAM ECHO.%WINDIR%\repair\SAM exists. 
+IF EXIST %WINDIR%\System32\config\RegBack\SAM ECHO.%WINDIR%\System32\config\RegBack\SAM exists.
+IF EXIST %WINDIR%\System32\config\SAM ECHO.%WINDIR%\System32\config\SAM exists.
+IF EXIST %WINDIR%\repair\SYSTEM ECHO.%WINDIR%\repair\SYSTEM exists.
+IF EXIST %WINDIR%\System32\config\SYSTEM ECHO.%WINDIR%\System32\config\SYSTEM exists.
+IF EXIST %WINDIR%\System32\config\RegBack\SYSTEM ECHO.%WINDIR%\System32\config\RegBack\SYSTEM exists.
+ECHO.
+CALL :T_Progress 3
+
+:McAffeeSitelist
+CALL :ColorLine " %E%33m[+]%E%97m McAffee SiteList.xml"
+cd %ProgramFiles% 2>nul
+dir /s SiteList.xml 2>nul
+cd %ProgramFiles(x86)% 2>nul
+dir /s SiteList.xml 2>nul
+cd "%windir%\..\Documents and Settings" 2>nul
+dir /s SiteList.xml 2>nul
+cd %windir%\..\Users 2>nul
+dir /s SiteList.xml 2>nul
+ECHO.
+CALL :T_Progress 2
+
+:GPPPassword
+CALL :ColorLine " %E%33m[+]%E%97m GPP Password"
+cd "%SystemDrive%\Microsoft\Group Policy\history" 2>nul
+dir /s/b Groups.xml == Services.xml == Scheduledtasks.xml == DataSources.xml == Printers.xml == Drives.xml 2>nul
+cd "%windir%\..\Documents and Settings\All Users\Application Data\Microsoft\Group Policy\history" 2>nul
+dir /s/b Groups.xml == Services.xml == Scheduledtasks.xml == DataSources.xml == Printers.xml == Drives.xml 2>nul
+ECHO.
+CALL :T_Progress 2
+
+:CloudCreds
+CALL :ColorLine " %E%33m[+]%E%97m Cloud Credentials"
+cd "%SystemDrive%\Users"
+dir /s/b .aws == credentials == gcloud == credentials.db == legacy_credentials == access_tokens.db == .azure == accessTokens.json == azureProfile.json 2>nul
+cd "%windir%\..\Documents and Settings"
+dir /s/b .aws == credentials == gcloud == credentials.db == legacy_credentials == access_tokens.db == .azure == accessTokens.json == azureProfile.json 2>nul
+ECHO.
+CALL :T_Progress 2
+
+:AppCMD
+CALL :ColorLine " %E%33m[+]%E%97m AppCmd"
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#appcmd-exe
+IF EXIST %systemroot%\system32\inetsrv\appcmd.exe ECHO.%systemroot%\system32\inetsrv\appcmd.exe exists. 
+ECHO.
+CALL :T_Progress 2
+
+:RegFilesCredentials
+CALL :ColorLine " %E%33m[+]%E%97m Files in registry that may contain credentials"
+ECHO.   [i] Searching specific files that may contains credentials.
+ECHO.   [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files
+ECHO.Looking inside HKCU\Software\ORL\WinVNC3\Password
+reg query HKCU\Software\ORL\WinVNC3\Password 2>nul
+CALL :T_Progress 2
+ECHO.Looking inside HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4/password
+reg query HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4 /v password 2>nul
+CALL :T_Progress 2
+ECHO.Looking inside HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\WinLogon
+reg query "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon" 2>nul | findstr /i "DefaultDomainName DefaultUserName DefaultPassword AltDefaultDomainName AltDefaultUserName AltDefaultPassword LastUsedUsername"
+CALL :T_Progress 2
+ECHO.Looking inside HKLM\SYSTEM\CurrentControlSet\Services\SNMP
+reg query HKLM\SYSTEM\CurrentControlSet\Services\SNMP /s 2>nul
+CALL :T_Progress 2
+ECHO.Looking inside HKCU\Software\TightVNC\Server
+reg query HKCU\Software\TightVNC\Server 2>nul
+CALL :T_Progress 2
+ECHO.Looking inside HKCU\Software\SimonTatham\PuTTY\Sessions
+reg query HKCU\Software\SimonTatham\PuTTY\Sessions /s 2>nul
+CALL :T_Progress 2
+ECHO.Looking inside HKCU\Software\OpenSSH\Agent\Keys
+CALL :T_Progress 2
+reg query HKCU\Software\OpenSSH\Agent\Keys /s 2>nul
+cd %USERPROFILE% 2>nul && dir /s/b *password* == *credential* 2>nul
+cd ..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..
+dir /s/b /A:-D RDCMan.settings == *.rdg == SCClient.exe == *_history == .sudo_as_admin_successful == .profile == *bashrc == httpd.conf == *.plan == .htpasswd == .git-credentials == *.rhosts == hosts.equiv == Dockerfile == docker-compose.yml == appcmd.exe == TypedURLs == TypedURLsTime == History == Bookmarks == Cookies == "Login Data" == places.sqlite == key3.db == key4.db == credentials == credentials.db == access_tokens.db == accessTokens.json == legacy_credentials == azureProfile.json == unattend.txt == access.log == error.log == *.gpg == *.pgp == *config*.php == elasticsearch.y*ml == kibana.y*ml == *.p12 == *.der == *.csr == *.cer == known_hosts == id_rsa == id_dsa == *.ovpn == anaconda-ks.cfg == hostapd.conf == rsyncd.conf == cesi.conf == supervisord.conf == tomcat-users.xml == *.kdbx == KeePass.config == Ntds.dit == SAM == SYSTEM == FreeSSHDservice.ini == sysprep.inf == sysprep.xml == unattend.xml == unattended.xml == *vnc*.ini == *vnc*.c*nf* == *vnc*.txt == *vnc*.xml == groups.xml == services.xml == scheduledtasks.xml == printers.xml == drives.xml == datasources.xml == php.ini == https.conf == https-xampp.conf == httpd.conf == my.ini == my.cnf == access.log == error.log == server.xml == SiteList.xml == ConsoleHost_history.txt == setupinfo == setupinfo.bak 2>nul | findstr /v ".dll"
+cd inetpub 2>nul && (dir /s/b web.config == *.log & cd ..)
+ECHO.
+CALL :T_Progress 2
+
+:ExtendedDriveScan
+if "%long%" == "true" (
+    CALL :ColorLine " %E%33m[+]%E%97m REGISTRY WITH STRING pass OR pwd"
+	reg query HKLM /f passw /t REG_SZ /s
+	reg query HKCU /f passw /t REG_SZ /s
+	reg query HKLM /f pwd /t REG_SZ /s
+	reg query HKCU /f pwd /t REG_SZ /s
+	ECHO.
+	ECHO.   [i] Iterating through the drives
+	ECHO.
+	for /f %%x in ('wmic logicaldisk get name^| more') do (
+		set tdrive=%%x
+		if "!tdrive:~1,2!" == ":" (
+			%%x
+            CALL :ColorLine " %E%33m[+]%E%97m FILES THAT CONTAINS THE WORD PASSWORD WITH EXTENSION: .xml .ini .txt *.cfg *.config"
+	        findstr /s/n/m/i password *.xml *.ini *.txt *.cfg *.config 2>nul | findstr /v /i "\\AppData\\Local \\WinSxS ApnDatabase.xml \\UEV\\InboxTemplates \\Microsoft.Windows.Cloud \\Notepad\+\+\\ vmware cortana alphabet \\7-zip\\" 2>nul
+            ECHO.
+            CALL :ColorLine " %E%33m[+]%E%97m FILES WHOSE NAME CONTAINS THE WORD PASS CRED or .config not inside \Windows\"
+            dir /s/b *pass* == *cred* == *.config* == *.cfg 2>nul | findstr /v /i "\\windows\\"  
+            ECHO.
+		)
+	)
+	CALL :T_Progress 2
+) ELSE (
+	CALL :T_Progress 2
+)
+TITLE WinPEAS - Windows local Privilege Escalation Awesome Script - Idle
+ECHO.---
+ECHO.Scan complete.
+PAUSE >NUL 
+EXIT /B
+
+:::-Subroutines
+
+:SetOnce
+REM :: ANSI escape character is set once below - for ColorLine Subroutine
+SET "E=0x1B["
+SET "PercentageTrack=0"
+EXIT /B
+
+:T_Progress
+SET "Percentage=%~1"
+SET /A "PercentageTrack=PercentageTrack+Percentage"
+TITLE WinPEAS - Windows local Privilege Escalation Awesome Script - Scanning... !PercentageTrack!%%
+EXIT /B
+
+:ColorLine
+SET "CurrentLine=%~1"
+FOR /F "delims=" %%A IN ('FORFILES.EXE /P %~dp0 /M %~nx0 /C "CMD /C ECHO.!CurrentLine!"') DO ECHO.%%A
+EXIT /B

BIN
win/winPEAS.exe


BIN
win/winPEASx64.exe


Some files were not shown because too many files changed in this diff