mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-08-10 12:23:20 +03:00
Initial commit - 611 cybersecurity skills across all subdomains
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# Standards and Frameworks Reference
|
||||
|
||||
## PowerShell Obfuscation Taxonomy
|
||||
|
||||
### Layer Classification
|
||||
| Layer | Technique | Example |
|
||||
|-------|-----------|---------|
|
||||
| L1 | Base64 EncodedCommand | `powershell -enc SQBFAFgA...` |
|
||||
| L2 | String Concatenation | `$a='Inv'+'oke'+'-Ex'+'pression'` |
|
||||
| L3 | Character Code Array | `[char[]](73,69,88)-join''` |
|
||||
| L4 | Tick-Mark Insertion | `` I`nv`oke-Exp`ress`ion `` |
|
||||
| L5 | Environment Variable | `$env:COMSPEC[4,15,25]-join''` |
|
||||
| L6 | SecureString | `ConvertTo-SecureString ... -Key` |
|
||||
| L7 | Compression + Base64 | `IO.Compression.DeflateStream` |
|
||||
| L8 | XOR Encoding | `$bytes | %{ $_ -bxor 0x42 }` |
|
||||
| L9 | Replace Chain | `.Replace('abc','I').Replace(...)` |
|
||||
| L10 | Format String | `("{2}{0}{1}" -f 'ke-','Ex','Invo')` |
|
||||
|
||||
### MITRE ATT&CK Mappings
|
||||
| Technique | ID | Description |
|
||||
|-----------|-----|------------|
|
||||
| Command and Scripting Interpreter: PowerShell | T1059.001 | Malicious PowerShell execution |
|
||||
| Obfuscated Files or Information | T1027 | Encoding/encryption of scripts |
|
||||
| Deobfuscate/Decode Files | T1140 | Runtime deobfuscation |
|
||||
| Ingress Tool Transfer | T1105 | Downloading payloads via PS |
|
||||
| System Binary Proxy Execution | T1218 | Using trusted binaries |
|
||||
|
||||
## PowerShell AST Node Types for Analysis
|
||||
|
||||
### Key Expression Nodes
|
||||
- `CommandExpression`: Direct command invocations
|
||||
- `InvokeMemberExpression`: Method calls on objects
|
||||
- `BinaryExpression`: String concatenation operators
|
||||
- `ArrayExpression`: Character array construction
|
||||
- `SubExpression`: Nested expression evaluation
|
||||
- `ExpandableStringExpression`: String interpolation
|
||||
|
||||
## References
|
||||
- [PowerShell Language Specification](https://docs.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-01)
|
||||
- [Invoke-Obfuscation Framework](https://github.com/danielbohannon/Invoke-Obfuscation)
|
||||
- [AMSI Interface Documentation](https://docs.microsoft.com/en-us/windows/win32/amsi/)
|
||||
@@ -0,0 +1,50 @@
|
||||
# PowerShell Deobfuscation Workflows
|
||||
|
||||
## Workflow 1: Automated Multi-Layer Deobfuscation
|
||||
|
||||
```
|
||||
[Obfuscated Script] --> [Identify Techniques] --> [Remove Tick Marks]
|
||||
|
|
||||
v
|
||||
[Resolve Concatenation]
|
||||
|
|
||||
v
|
||||
[Decode Base64 Layers]
|
||||
|
|
||||
v
|
||||
[IEX -> Write-Output]
|
||||
|
|
||||
v
|
||||
[Extract Final Payload]
|
||||
```
|
||||
|
||||
## Workflow 2: AST-Based Analysis
|
||||
|
||||
```
|
||||
[Script Input] --> [Parse AST] --> [Walk Expression Nodes] --> [Evaluate Expressions]
|
||||
|
|
||||
v
|
||||
[Reconstruct Commands]
|
||||
|
|
||||
v
|
||||
[Extract IOCs]
|
||||
```
|
||||
|
||||
## Workflow 3: Dynamic Sandbox Deobfuscation
|
||||
|
||||
```
|
||||
[Obfuscated Script] --> [Execute in Sandbox] --> [Capture ScriptBlock Logs]
|
||||
|
|
||||
v
|
||||
[Event ID 4104 Analysis]
|
||||
|
|
||||
v
|
||||
[Reconstruct Execution Chain]
|
||||
```
|
||||
|
||||
### Steps:
|
||||
1. **Enable Logging**: Enable PowerShell ScriptBlock logging (Event ID 4104)
|
||||
2. **Execute**: Run obfuscated script in isolated sandbox
|
||||
3. **Collect**: Gather all ScriptBlock log entries
|
||||
4. **Reconstruct**: Assemble deobfuscated script from logged blocks
|
||||
5. **Extract**: Pull IOCs from the reconstructed clear-text script
|
||||
Reference in New Issue
Block a user