1
0
mirror of https://github.com/nganhkhoa/malware.git synced 2024-06-10 21:32:07 +07:00

PS obfuscattion

This commit is contained in:
HackMD 2020-01-09 14:54:35 +00:00
parent a6cdff6eb6
commit 07d0ed27a3

View File

@ -92,6 +92,54 @@ to do...
## API obfuscation
[A Museum of API Obfuscation on Win32](http://eval.symantec.com/mktginfo/enterprise/media/security_response/whitepapers/a_museum_of_api_obfuscation_on_win32.pdf)<br>
## PowerShell Script obfuscation
### case-insesitive
- コマンドレットや変数を大文字,小文字を混ぜる
- PowerShellでは区別されない
> INvOke-eXpReSsiOn
### alias
- コマンドのエイリアスを用いる
- エイリアスの確認方法
> get-alias # すべてのエイリアスの確認<br>
> get-alias iex #iexのエイリアス(Invoke-Expression)の確認
- よく利用されるエイリアス
> iex -> Invoke-Expression<br>
> sal -> Set-Alias
- エイリアスの設定
> set-alias <Name> <Value>
### dot expression and amp expression(Invoke-Expression)
- 文字列で表現されたコマンドレットを実行
> .("get-alias")<br>
> &('gal')<br>
> iex("GeT-AliAs")
### Combining characters
- 文字や文字列の結合
> 'i'+'ex'
### Backticks
- コマンドレットや変数にバッククォートを挿入
> \`i\`e\`x("\`gal \`gal")
### Split method
- 文字列の分割
> 'bob@alice'.split('@') -> bob alice
> 'bob@alice' -split '@' -split "i" -> bob al ce
### Join method
- リストの結合
> "bob","alice" -join "@" -> bob@alice
### Concatenation operations
- 文字列の並べ替えおよび連結
> "{1} {0}" -f "Alice","Bob" -> Bob Alice<br>
> "{1} {0}" -f "Alice",("{1}{2}{0}" -f "b","B","o") -> Bob Alice
### No Space
- 空白の省略
> "bob","alice"-join"@"
### Pipe operator
- パイプによる引数の引き渡し
> 'Write-host 1' | iex
### ref:
[Powershell Static Analysis & Emotet results](https://hatching.io/blog/powershell-analysis)
# Anti-detection
## DGA
- ドメイン生成アルゴリズム<br>