Skip to content

Commit 1f4ac5a

Browse files
committed
Reworked flags
1 parent 83e2f6b commit 1f4ac5a

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ Credit for the reverse shells goes to [PayloadAllTheThings.](https://github.com/
77
## Usage
88

99
```
10-
usage: web2shell.py [-h] --url URL [--interface INTERFACE] [--force FORCE] [--ip IP] [--port PORT] [--nc NC]
10+
usage: web2shell [-h] [-i INTERFACE] [--force] [--ip IP] [--port PORT] [--nc NC] url
11+
12+
Automate converting webshells into reverse shells.
13+
14+
positional arguments:
15+
url webshell URL, replace the provided command with "SHELL". ex: https://example.com/shell.php?cmd=SHELL
1116
1217
options:
1318
-h, --help show this help message and exit
14-
--url URL webshell URL, replace the provided command with "SHELL". ex: https://example.com/shell.php?cmd=SHELL
15-
--interface INTERFACE
19+
-i INTERFACE, --interface INTERFACE
1620
the interface to use when listening for a remote shell. Default is localhost.
17-
--force FORCE force command execution even if initial check is invalid, must be true or false
18-
--ip IP IP address of your own listener (skips listener setup)
19-
--port PORT port of your own listener (skips listener setup)
21+
--force force command execution even if initial check is invalid
22+
--ip IP IP address of your own listener (skips listener setup if both IP and port are set)
23+
--port PORT port of your own listener
2024
--nc NC path to local nc binary
2125
```
2226

modules/flags.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,29 @@ def splash():
1717

1818
def setup(parser):
1919
parser.add_argument(
20-
"--url",
20+
"url",
2121
help='webshell URL, replace the provided command with "SHELL". ex: https://example.com/shell.php?cmd=SHELL',
2222
type=str,
23-
required=True,
2423
)
2524
parser.add_argument(
25+
"-i",
2626
"--interface",
2727
help="the interface to use when listening for a remote shell. Default is localhost.",
2828
type=str,
2929
required=False,
3030
default="",
3131
)
32-
parser.add_argument(
33-
"--force",
34-
help="force command execution even if initial check is invalid, must be true or false",
35-
type=bool,
36-
required=False,
37-
default=False,
38-
)
32+
parser.add_argument("--force", help="force command execution even if initial check is invalid", required=False, action="store_true")
3933
parser.add_argument(
4034
"--ip",
41-
help="IP address of your own listener (skips listener setup)",
35+
help="IP address of your own listener (skips listener setup if both IP and port are set)",
4236
type=str,
4337
required=False,
4438
default=None,
4539
)
4640
parser.add_argument(
4741
"--port",
48-
help="port of your own listener (skips listener setup)",
42+
help="port of your own listener",
4943
type=int,
5044
required=False,
5145
default=None,

web2shell.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
from modules import commands, connection, flags, local
77

8-
parser = argparse.ArgumentParser()
8+
parser = argparse.ArgumentParser(
9+
prog="web2shell",
10+
description="Automate converting webshells into reverse shells.",
11+
)
912
parser = flags.setup(parser)
1013
results = parser.parse_args()
1114
flags.splash()

0 commit comments

Comments
 (0)