You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ PySQLRecon
9
9
10
10
PySQLRecon is a Python port of the awesome [SQLRecon](https://github.com/skahwah/SQLRecon) project by [@sanjivkawa](https://twitter.com/sanjivkawa). See the [commands](#commands) section for a list of capabilities.
11
11
12
+
[Post](https://tw1sm.substack.com/p/takeover-1-with-pysqlrecon) demonstrating SCCM TAKEOVER-1 with PySQLRecon.
13
+
12
14
## Install
13
15
PySQLRecon can be installed with `pip3 install pysqlrecon` or by cloning this repository and running `pip3 install .`
olecmd [PRIV] Execute a system command using OLE automation procedures [I,L]
40
42
query [NORM] Execute a custom SQL query [I,L]
41
43
rows [NORM] Get the count of rows in a table [I,L]
42
-
sample [NORM] Query a sample of table data [I,L]
44
+
sample [NORM] Query a sample of table data [I,L]
45
+
sccm [SUBM] Submodule for SCCM specific commands
43
46
search [NORM] Search a table for a column name [I,L]
44
47
smb [NORM] Coerce NetNTLM auth via xp_dirtree [I,L]
45
48
tables [NORM] Enumerate tables within a database [I,L]
@@ -48,6 +51,19 @@ whoami [NORM] Gather logged in user, mapped user and roles [I,L]
48
51
xpcmd [PRIV] Execute a system command using xp_cmdshell [I,L]
49
52
```
50
53
54
+
### SCCM Commands
55
+
SCCM commands can be found by running `pysqlrecon [OPTIONS] sccm -h` (required global flags will need to be specified for this to work - see [usage](#usage))
56
+
```
57
+
addadmin [PRIV] Elevate an account to Full Administrator [I]
logons [NORM] Display SCCM clients and last logged on user [I]
60
+
removeadmin [PRIV] Remove elevated account or elevated privileges [I]
61
+
sites [NORM] Gather SCCM site info [I]
62
+
taskdata [NORM] Decrypt task sequences [I]
63
+
tasklist [NORM] Display task sequences [I]
64
+
users [NORM] Enumerate SCCM users [I]
65
+
```
66
+
51
67
## Usage
52
68
PySQLRecon has global options (available to any command), with some commands introducing additional flags. All global options must be specified *before* the command name:
53
69
```
@@ -70,7 +86,14 @@ Target execution of a PySQLRecon command on a linked server (instead of the SQL
70
86
71
87
Impersonate a user account while running a PySQLRecon command with the `--impersonate` flag.
72
88
73
-
`--link` and `--impersonate` and incompatible.
89
+
`--link` and `--impersonate` are incompatible.
90
+
91
+
### Usage with `ntlmrelayx`
92
+
PySQLRecon can be used with `proxychains` to take advantage of relayed authentication targeting a `mssql://` service. Due to the way ntlmrelayx sessions work, the `--database` parameter will not be respected when running PySQLRecon (the relay session will always be connected to the master database). This can come into play especially when using SCCM modules, which require the site database to be sepecified. To fix this, first change the database context using the `query` module (this will persist across any subsequent PySQLRecon usage, with the same relay session). Example:
You can now run modules/queries that target resources within that specifc database, even without specifying `--database`, from the same `ntlmrelayx` session.
74
97
75
98
## Development
76
99
pysqlrecon uses Poetry to manage dependencies. Install from source and setup for development with:
@@ -85,7 +108,7 @@ poetry run pysqlrecon --help
85
108
PySQLRecon is easily extensible - see the template and instructions in [resources](resources/command_template/)
86
109
87
110
### TODO
88
-
-[] Add SQLRecon SCCM commands
111
+
-[x] Add SQLRecon SCCM commands
89
112
-[ ] Add Azure SQL DB support?
90
113
91
114
## References and Credits
@@ -94,3 +117,4 @@ PySQLRecon is easily extensible - see the template and instructions in [resource
0 commit comments