Updated Basic Usage (markdown)

AlessandroZ 2018-10-10 17:57:42 +02:00
parent 94cdbb611d
commit aa28c00bee
1 changed files with 8 additions and 8 deletions

@ -1,5 +1,5 @@
## Find commands and modules help
First of all it is important to know that nearly all commands in pupy have a help builtin. So if at any moment you are wondering what a command does you can type your command followed by -h or --help.
First of all it is important to know that nearly all commands in pupy have a help builtin. So if at any moment you are wondering what a command does you can type your command followed by `-h` or `--help`.
```code
>> sessions -h
>> jobs -h
@ -59,11 +59,11 @@ or
## Create Aliases
Modules aliases can be defined in the pupy.conf file. If you define the following alias :
Modules aliases can be defined in the `pupy.conf` file. If you define the following alias :
```code
shell=interactive_shell
```
running the command "shell" will be equivalent as running "run interactive_shell".
running the command `shell` will be equivalent as running `run interactive_shell`.
As an example, defining the following alias will add a command to kill the pupy client's process with signal 9:
```code
@ -72,13 +72,13 @@ killme = pyexec -c 'import os;os.kill(os.getpid(),9)'
## Jobs
Jobs are commands running in the background.
Some modules like socks5proxy or portfwd automatically start as jobs, but all modules can be run as jobs when used with the --bg argument.
Some modules like `socks5proxy` or `portfwd` automatically start as jobs, but all modules can be run as jobs when used with the `--bg` argument.
```code
>> run --bg shell_exec 'tasklist /V'
[%] job < shell_exec ['tasklist /V'] > started in background !
```
The --bg switch is typically used when you want to execute a long command/module and want the result later while having the shell still functioning.
The jobs output can be retrieved at any moment by using the jobs -p command. From the "jobs" command you can also list jobs status and kill jobs.
The `--bg` switch is typically used when you want to execute a long command/module and want the result later while having the shell still functioning.
The jobs output can be retrieved at any moment by using the `jobs -p` command. From the `jobs` command you can also list jobs status and kill jobs.
```code
>> jobs
usage: jobs [-h] [-k <job_id>] [-l] [-p <job_id>]
@ -93,7 +93,7 @@ print the job current output before killing it
-p <job_id>, --print-output <job_id>
print a job output
```
Regular jobs can be set in Linux/Unix environments by running your pupysh.py script inside the Screen utility. You can then setup cronjobs to run the below command at whatever intervals you require, this essentially pastes the input after the word 'stuff' into the screen session. Replace 1674 with the ID of your screen session, the echo command is the Enter key being pressed.
Regular jobs can be set in Linux/Unix environments by running your `pupysh.py` script inside the Screen utility. You can then setup cronjobs to run the below command at whatever intervals you require, this essentially pastes the input after the word 'stuff' into the screen session. Replace 1674 with the ID of your screen session, the echo command is the Enter key being pressed.
```code
screen -S 1674 -X stuff 'this is an example command'$(echo -ne '\015')
```
@ -113,7 +113,7 @@ To interact with one client, use the `sessions -i` command.
>> sessions -i 'platform:Windows release:7'
```
You can find all the available filtering parameters using the get_info module.
You can find all the available filtering parameters using the `get_info` module.
## Run local commands
Start your command with a `!`