Skip to content

Commit a6e4f23

Browse files
committed
edit Windows PrivEsc
1 parent 9610adb commit a6e4f23

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/exploit/blockchain/interact-with-ethereum-using-foundry.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags:
88
refs:
99
- https://github.com/foundry-rs/foundry
1010
- https://book.getfoundry.sh/
11-
date: 2023-08-14
11+
date: 2025-03-28
1212
draft: false
1313
---
1414

@@ -28,8 +28,6 @@ We can set the environment variable for **Ethereum RPC URL** to interact the Eth
2828
export ETH_RPC_URL="http://10.0.0.1:12345/path/to/rpc"
2929
```
3030

31-
<br />
32-
3331
## Investigating a Chain
3432

3533
**`cast`** command of Foundry performs Ethereum RPC calls.
@@ -51,8 +49,6 @@ cast block-number
5149
cast block
5250
```
5351

54-
<br />
55-
5652
## Investigating Account
5753

5854
```bash
@@ -62,17 +58,22 @@ cast balance 0x123...
6258
cast balance beer.eth
6359
```
6460

65-
<br />
66-
6761
## Investigating Contract
6862

6963
```sh
7064
# Get the source code of a contract from Etherscan
71-
cast etherscan-source <contract_address>
72-
cast etherscan-source 0x123...
65+
cast source <contract_address> -e <etherscan_api_key>
7366
```
7467

75-
<br />
68+
## Call Functions
69+
70+
If we know the functions of a target contract, we can simply call them. Note that these command do NOT send transactions, so cannot change states or values in the contract.
71+
72+
```bash
73+
cast call --private-key <private_key_addr> <contract_addr> "getFlag()(string memory)"
74+
75+
cast call --private-key <private_key_addr> <contract_addr> "isSolved()(bool)"
76+
```
7677

7778
## Send Transactions
7879

@@ -92,4 +93,6 @@ cast send --private-key 0x123... 0xabc... "dummy()"
9293
# Send Ether to call the receive function
9394
cast send --private-key <private_key_addr> <contract_addr> --value 10gwei
9495
cast send --private-key 0x123... 0xabc... --value 10gwei
95-
```
96+
```
97+
98+
If we got error like unsupported feature: eip1559 , add `--legacy` flag for the command.

src/exploit/windows/privilege-escalation/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags:
88
refs:
99
- https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation
1010
- https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.3
11-
date: 2025-03-19
11+
date: 2025-03-28
1212
draft: false
1313
---
1414

@@ -111,6 +111,9 @@ dir "C:\Program Files (x86)\hMailServer\Data\"
111111
# DPAPI protected data (https://www.thehacker.recipes/ad/movement/credentials/dumping/dpapi-protected-secrets)
112112
dir -Force C:\Users\<user>\AppData\Local\Microsoft\Credentials\
113113
dir -Force C:\Users\<user>\AppData\Roaming\Microsoft\Credentials\
114+
115+
# Check access control for a specific directory
116+
Get-Acl C:\Users\Administrator
114117
```
115118

116119
### Find Vulnerable Privileges

0 commit comments

Comments
 (0)