Enhanced PsExec
Project description
!!!!!!!!!! Use "help(Epsexec)" This will show you the available methods. (This usage form will contain it, but it is yet to be completed.) !!!!!!!!!!
About
Epsexec (Enhanced psexec) uses Microsoft's Sysinternals PsExec utility uses SMB to execute programs on remote systems. PsExec is a light-weight telnet replacement.
Installation
Run the following to install:
pip install Enhanced-PsExec
Requirements
- You MUST have a 64-bit version of python.
- You MUST have psexec installed and in your system32 folder.
Import
To import the package, use 'import Epsexec'.
Usage
- Create a psPc class instance.
pc1 = psPc("IPv4","username","password")
General settings:
sleepBefore
--- This waits before starting the operation in millisecond. (defualt 100)
runAsAdmin
--- If true, it will run the operation in administrative privileges. (default True)
firewallChange
This is probably the most important method. why?
Well, because firewall makes the psexec process extremely slow (It takes about 12 seconds instead of 1).
So, it becomes very frustrating.
downloadNirCmd
NirCMD is A windows command-line utility that allows you to do useful tasks without displaying any user interface.
Unfortunately, NirCMD is NOT installed by default on windows systems.
Thats why this method exists. all this method do, is download NirCMD on the remote PC using powershell.
Nircmd is required for the following methods:
- beep
- sendScreenshot
- setVolume
- textToSpeech
beep
Requires Nircmd
The beep method takes frequency(hz) and duration(millisecond) parameters.
Then it plays A sound at the given frequency and duration.
getShell
The getShell method is the most basic method.
It takes A shell to open as and administration privileges. (default "cmd.exe",True)
This is your everyday remote shell on another PC.
You can also choose powershell instead of cmd
closeProcess
The closeProcess method takes A process name or processID, and sleepBefore to wait before the program closes the process.
Then it uses taskkill (CMD command) to close it.
closeChrome
This method closes every chrome tab on the remote machine.
It takes 2 parameters: runAsAdmin, and sleepBefore. (Default True)
textToSpeech
Requires Nircmd
The textToSpeech method takes A string to speak, and MaleVoice as a boolean. (default True)
Then it uses NirCMD to speak the text on the remote PC.
setVolume
Requires Nircmd
The setVolume method takes a number from 0 to 100 as the precentage And sleepBefore.
Then it opens NirCMD in the remote pc and uses "setsysvolume" to set the computer's volume.
sendScreenshot
Requires Nircmd
The sendScreenshot takes email address and sleepBefore.
It uses NirCMD to take A screenshot, save it to C:\Epsexecscreenshot.png
Then, it uses powershell SMTPClient.send() to send an email to the given Email Address
OpenURL
This method is the most complicated method.
It can potentially take multiple parameters.
I will now explain every parameter:
URL
--- This is the URL to be opened in the remote machine. If fromFile
parameter is used, it must be: '*://*/*'
, its default
fromFile
--- This parameter is used to take A text file and get every URL and its shotcut name.
See more:
tabs
--- This parameter is responsible for the amount of tabs to open on the remote machine. (Default=1)
delayBeforeOpening
--- This parameter decides how much time in millisecond the program should pause before starting the operation. (Default=100)
delayBetweenTabs
--- This parameter decides how much time in millisecond the program should pause BETWEEN every time it opens A new tab.
newWindow
--- This parameter decides whether or not to open the tab(s) in new window each time. It cannot be used in the same method call as the delayBetweenTab
parameter. (Default=False)
incognito
--- This parameter decides if the tab(s) would be opened in Incognito mode. (Default=False)
invisible
--- This parameter decides if the tab(s) would be opened invisibly, and not interactive, so the user would not notice its opened, unless the window plays sound (Default=False).
Available class methods:
psPc(ip, username, password)
beep(frequency, durationMs, sleepBefore=100)
closeChrome(runAsAdmin=True, sleepBefore=100)
closeProcess(procNameOrID, sleepBefore=100)
downloadNirCMD()
firewallChange(state='off', sleepBefore=100)
getShell(shell='cmd.exe', runAsAdmin=True)
openURL(URL='*://*/*', fromFile='@fileName.txt', tabs=1, newWindow=False, delayBeforeOpening=100, delayBetweenTabs=100, incognito=False, invisible=False)
sendScreenshot(emailRecipientAddr, sleepBefore=100)
setVolume(precent, sleepBefore=100)
startRemoteDesktop()
textToSpeech(text, MaleVoice=True, sleepBefore=100)
Credits
Epsexec was created by Ori Shamir.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Enhanced_PsExec-0.3.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cf0ba7f14bb8fec6b5c50eb5ca9da55dd408621b578eb8091070d0c4e2285b0 |
|
MD5 | 1a81a0d49149f98b96a298b45318aa69 |
|
BLAKE2b-256 | f6cc7e504996d14cc99404f28f5e466ef244b2d26e382b69a950a5f919e1a565 |