Windows Automated Script AuthoritySoftNight
Original language:
http://www.hackingarticles.in/window-privilege-escalation-via-automated-script/
As you know, when we hack a server and get low-authority shell, we need power.
This post explains how power is raised and what low-authority shells can raise to higher levels.
Contents
Introduction
Drawing vector
windows-Exploit-Suggester
Windows Gather Applied Patches
sherlock
JAWS – Another Windows Script Through Scripts
PowerUp
Introduction
In the process that usually comes after the assailant has successfully invaded the host of the victim, the attackers try to gather more critical information about the system, such as hidden passwords and some inappropriately configured services and applications. All this information helps the assailant infiltrate the host into order to get high-authorized shell.
Drawing vector
The following is the key message in Windows:
Operating system version
Installation packages installed or running with loopholes
Files and folders with full control or modification rights
Map Drive
Discretionary files
Service path without quotation marks
Network information (interface, arp, netstat etc.)
Firewall status and rules
Run Process
Always Install Elevated registration entry check
Certificates to store
DLL hijacking.
Planned tasks
In the process of infiltration testing, there are some scripts that can help you quickly identify the weighting vector in Windows, and we’re going to go into this for a little bit.
Windows-Exploit-suggester
You can use this script if you have obtained a low-authorized meterpreter session or command session from the injured host.
This script tells you about locally available ext. These give exp based on the operating system platform and architecture of the affected host, as well as on local access. Note that not all extps can be used effectively. Exp is selected according to the following conditions: type of session, platform, structure, etc.
Using the script is simple, enter the following command:
use post/multi/recon/local_exploit_suggester msf post(local_exploit_suggester) > set lhost 192.168.1.107 msf post(local_exploit_suggester) > set session 1 msf post(local_exploit_suggester) > exploit
As can be seen from the pictures, the script has detected which exps are available and able to make a move.
Windows Gather Applied Patches
This module will go through the patches installed in Windows based on WMI query results, and the WMI query statement follows:
SELECT HotFixID FROM Win32_QuickFixEngineering
Script usage:
use post/windows/gather/enum_patches msf post(enum_patches) > set session 1 msf post(enum_patches) > exploit
As the figure shows, this script has shown what loopholes exist in the affected host and what corresponding exp is capable of drawing on patches.
sherlock
This is a Powershell script that can quickly find missing software patches and make local moves. The script is similar to the scripts on it, which can identify gaps in the affected host and corresponding source options.
Download a script from GitHub using the following command, and execute it when you retrieve an injured host’s meterpreter session as follows:
git clone https://github.com/rasta-mouse/Sherlock.git
As this script is implemented in powershell, it needs to be loaded and then imported from the download:
load powershell

powershell_import '/root/Desktop/Sherlock/Sherlock.ps1' powershell_execute “find-allvulns”
The above commands will output loopholes in the target’s target and an exp that can be used to raise power, as shown below:
JAWS – Another Windows went through the script.
JAWS is also a Powershell script designed to help osmosis testers and CTF players quickly identify the weighting vector on the Windows mainframe. The script is written in powershell 2.0, so it can be operated on the host after Win7.
Current function
Network information collection (interface, arp, netstat)
Firewall status and rules
Runn Process
Files and folders with full control
Map Drive
Discretionary files
Service path without quotation marks
Recent Documents
System Installer File
Allways Install Eleved Registration Check
Certificates to store
Application for installation
Potential gap service
MuiCache Document
Planned tasks
Download script with the following command:
git clone https://github.com/411Hall/JAWS.git
Once you get a meterpreter session, upload this script and execute it in the command line:
powershell.exe -ExecutionPolicy Bypass -File .\jaws-enum.ps1 -OutputFilename JAWS-Enum.txt
It saves key information in the JAWS-Enum.txt file.
As mentioned earlier, the JAWS-Enum.txt file is stored in vectors capable of drawing power and now we have to open it for results.
The following figure shows all user names and IP profiles.
The results of netstat are also clearly visible, as illustrated by:
All installed programs and patches
Can also see folders with full control and modification rights
Of course, running this script can also extract more critical information that you can find out for yourself.
PowerUp
PowerUp is a powershell tool that helps to upgrade local privileges on Windows. PowerUp aims to consolidate all Windows local rights-based rights-motion vectors resulting from an error in configuration.
Runs the Invoke-Allchecks to output all identifiable loopholes.
Current function
Service all over.
Get-ServiceUnquoted — return service path to a name with open spaces and no quotes
Get-Modificable Servicefile — returns the service that the current user can write to a service binary path and profile
Get-ModificableService – returns the service that can be modified by current user
Get-ServiceDetail – Details for Returning to Designated Service
Abuse of services
Invoke-ServiceAbose – Modify Service with Gaps, Create Local Administrator or Execute Custom Commands
Write-ServiceBinary — Write a modified C# service binary file to add local administrators or execute custom commands
Install-ServiceBinary – Replace Service Binary File to Add Local Administrator or Execute Custom Commands
Restore-ServiceBinary – Restore replacement service binary files with original executable
DLL hijacking.
Find-ProcessDLHijack – Discovers whether the current running process exists for DLL hijacking
Find-PathDLHijack – Find out if the environment variable “%PATH% exists for DLL hijacking”
Write-HijackDll — Preparation of a kidnappingable DLL
Registration Form Check
Get-RegistryAlwaysInstallElevated – Check if Always Install Elevad registration entry is set
Get-RegistryAutoLogon – Check for AutoLogon certificates on the registration form
Get-ModifiableRegistry AutoRun – Check any modified binary files/scripts or profiles in HKLM autouns
As mentioned earlier, PowerUp is a module of powersloit so we need to download the powersloit and download it from GitHub using the following command:
git clone https://github.com/PowerShellMafia/PowerSploit.git
Then switch to Powerspluit, where you can see the powerup script.
cd PowerSploit ls cd Privesc ls
Then load the powershell, import the downloaded script:
load powershell powershell_import '/root/Desktop/PowerSploit/Privesc/PowerUp.ps1' powershell_execute Invoke-AllChecks
These orders can show the loopholes in the target host and its corresponding rights-of-exp, as illustrated by:
未经允许不得转载:萌萌Apprentissage » Windwos Automotion Script
learn NMAP