Skip to content

Commit 9ff1933

Browse files
committed
Cleaning
1 parent 4ae8a22 commit 9ff1933

File tree

9 files changed

+48
-52
lines changed

9 files changed

+48
-52
lines changed

model/src/main/java/com/jsql/model/accessible/ExploitMethod.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import java.util.Optional;
55

66
public enum ExploitMethod {
7-
AUTO("KEY_LABEL_AUTO", "KEY_TOOLTIP_AUTO"),
8-
QUERY_BODY("KEY_LABEL_QUERY_BODY", "KEY_TOOLTIP_QUERY_BODY"),
9-
TEMP_TABLE("KEY_LABEL_TEMP_TABLE", "KEY_TOOLTIP_TEMP_TABLE"),
10-
NETSHARE("KEY_LABEL_NETSHARE", "KEY_TOOLTIP_NETSHARE");
7+
AUTO("MODE_AUTO", "MODE_AUTO_TOOLTIP"),
8+
QUERY_BODY("MODE_QUERY_BODY", "MODE_QUERY_BODY_TOOLTIP"),
9+
TEMP_TABLE("MODE_TEMP_TABLE", "MODE_TEMP_TABLE_TOOLTIP"),
10+
NETSHARE("MODE_NETSHARE", "MODE_NETSHARE_TOOLTIP");
1111
private final String keyLabel;
1212
private final String keyTooltip;
1313
ExploitMethod(String keyLabel, String keyTooltip) {

model/src/main/resources/config.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ jsql.version = 0.106
22

33
github.url = https://github.com/ron190/jsql-injection
44
github.issues.url = https://api.github.com/repos/ron190/jsql-injection/issues
5-
github.token = Z2hwX3FPcVpvWU1BRUVhUlFiY3JSMHNFT3BGaGtIVks1SzNud3gwVg
5+
github.token = Z2hwX25qSFN1TzYyR1VoVHozZzNhdHE0VFJKaWlJQ2NZTzA4UG9KTQ==
66

77
github.webservice.url = https://raw.githubusercontent.com/ron190/jsql-injection/master/web/services/jsql-injection.json
88
github.webservice.i18n.root = https://raw.githubusercontent.com/ron190/jsql-injection/master/model/src/main/resources/i18n/jsql.properties

model/src/main/resources/i18n/jsql.properties

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

model/src/test/resources/docker/Dockerfile.jsql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ COPY ./ ./
88

99
ENV DEBUG_COLORS "true"
1010
ENV TERM xterm-256color
11-
ENV DEBIAN_FRONTEND noninteractive
1211
ENV COLORTERM truecolor
1312
ENV MAVEN_NASHORN ${MAVEN_NASHORN}
1413
ENV MAVEN_BYTEBUDDY ${MAVEN_BYTEBUDDY}

view/src/main/java/com/jsql/view/swing/interaction/CreateAdminPageTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public void mouseReleased(MouseEvent evt) {
177177
// Create a custom tab header
178178
var header = new TabHeader(
179179
this.url.replaceAll(".*/", StringUtils.EMPTY),
180-
UiUtil.ADMIN.getIcon()
180+
UiUtil.ADMIN.getIcon()
181181
);
182182
MediatorHelper.tabResults().setTabComponentAt(MediatorHelper.tabResults().indexOfComponent(scroller), header); // Apply the custom header to the tab
183183
browser.setCaretPosition(0);

view/src/main/java/com/jsql/view/swing/list/MouseAdapterMenuAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public MouseAdapterMenuAction(DnDList dndList) {
5353
*/
5454
@SuppressWarnings("unchecked")
5555
public void showPopup(final MouseEvent mouseEvent) {
56-
5756
if (mouseEvent.isPopupTrigger()) {
58-
5957
JList<ItemList> list = (JList<ItemList>) mouseEvent.getSource();
6058

6159
JPopupMenu popupMenuList = this.initMenu(mouseEvent);

view/src/main/java/com/jsql/view/swing/manager/ManagerExploit.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,27 @@ public class ManagerExploit extends AbstractManagerList {
5353
private final AtomicReference<JTextField> netshare = new AtomicReference<>();
5454
protected final JTextField textfieldUrlShell;
5555

56-
public static final String KEY_UDF_TAB = "UDF_TAB";
57-
public static final String KEY_EXPLOIT_WEB_MYSQL = "EXPLOIT_WEB_MYSQL";
58-
public static final String KEY_EXPLOIT_WEB_SQLITE = "EXPLOIT_WEB_SQLITE";
59-
public static final String KEY_EXPLOIT_SQL_MYSQL = "EXPLOIT_SQL_MYSQL";
60-
public static final String KEY_EXPLOIT_UPLOAD_MYSQL = "EXPLOIT_UPLOAD_MYSQL";
61-
public static final String KEY_EXPLOIT_UPLOAD_SQLITE = "EXPLOIT_UPLOAD_SQLITE";
62-
public static final String KEY_RCE_TAB = "RCE_TAB";
56+
public static final String EXPLOIT_UDF = "EXPLOIT_UDF";
57+
public static final String EXPLOIT_WEB_MYSQL = "EXPLOIT_WEB_MYSQL";
58+
public static final String EXPLOIT_WEB_SQLITE = "EXPLOIT_WEB_SQLITE";
59+
public static final String EXPLOIT_SQL_MYSQL = "EXPLOIT_SQL_MYSQL";
60+
public static final String EXPLOIT_UPLOAD_MYSQL = "EXPLOIT_UPLOAD_MYSQL";
61+
public static final String EXPLOIT_UPLOAD_SQLITE = "EXPLOIT_UPLOAD_SQLITE";
62+
public static final String EXPLOIT_RCE = "EXPLOIT_RCE";
6363

6464
private final JComboBox<Object> comboBoxExploitTypes = new JComboBox<>(new Object[]{
65-
new ModelItemType(ManagerExploit.KEY_UDF_TAB, "UDF_TOOLTIP"),
66-
new ModelItemType(ManagerExploit.KEY_RCE_TAB, "RCE_TOOLTIP"),
65+
new ModelItemType(ManagerExploit.EXPLOIT_UDF, "EXPLOIT_UDF_TOOLTIP"),
66+
new ModelItemType(ManagerExploit.EXPLOIT_RCE, "EXPLOIT_RCE_TOOLTIP"),
6767
ComboBoxMethodRenderer.SEPARATOR,
68-
new ModelItemType(ManagerExploit.KEY_EXPLOIT_WEB_MYSQL, "EXPLOIT_WEB_MYSQL_TOOLTIP"),
69-
new ModelItemType(ManagerExploit.KEY_EXPLOIT_SQL_MYSQL, "EXPLOIT_SQL_MYSQL_TOOLTIP"),
70-
new ModelItemType(ManagerExploit.KEY_EXPLOIT_UPLOAD_MYSQL, "EXPLOIT_UPLOAD_MYSQL_TOOLTIP"),
68+
new ModelItemType(ManagerExploit.EXPLOIT_WEB_MYSQL, "EXPLOIT_WEB_MYSQL_TOOLTIP"),
69+
new ModelItemType(ManagerExploit.EXPLOIT_SQL_MYSQL, "EXPLOIT_SQL_MYSQL_TOOLTIP"),
70+
new ModelItemType(ManagerExploit.EXPLOIT_UPLOAD_MYSQL, "EXPLOIT_UPLOAD_MYSQL_TOOLTIP"),
7171
ComboBoxMethodRenderer.SEPARATOR,
72-
new ModelItemType(ManagerExploit.KEY_EXPLOIT_WEB_SQLITE, "EXPLOIT_WEB_SQLITE_TOOLTIP"),
73-
new ModelItemType(ManagerExploit.KEY_EXPLOIT_UPLOAD_SQLITE, "EXPLOIT_UPLOAD_SQLITE_TOOLTIP"),
72+
new ModelItemType(ManagerExploit.EXPLOIT_WEB_SQLITE, "EXPLOIT_WEB_SQLITE_TOOLTIP"),
73+
new ModelItemType(ManagerExploit.EXPLOIT_UPLOAD_SQLITE, "EXPLOIT_UPLOAD_SQLITE_TOOLTIP"),
7474
});
7575

76-
private final JComboBox<Object> comboBoxExploitMethods = new JComboBox<>(new Object[]{
76+
private final JComboBox<Object> comboBoxExploitModes = new JComboBox<>(new Object[]{
7777
ExploitMethod.AUTO,
7878
ComboBoxMethodRenderer.SEPARATOR,
7979
ExploitMethod.QUERY_BODY,
@@ -151,17 +151,17 @@ public JToolTip createToolTip() {
151151
Arrays.asList(this.username.get(), this.password.get(), this.scrollListPaths, this.textfieldUrlShell)
152152
.forEach(component -> component.setVisible(false));
153153
ModelItemType selectedItem = (ModelItemType) e.getItem();
154-
if (!Arrays.asList(ManagerExploit.KEY_UDF_TAB, ManagerExploit.KEY_RCE_TAB).contains(selectedItem.getKeyLabel())) {
154+
if (!Arrays.asList(ManagerExploit.EXPLOIT_UDF, ManagerExploit.EXPLOIT_RCE).contains(selectedItem.getKeyLabel())) {
155155
this.scrollListPaths.setVisible(true);
156156
this.textfieldUrlShell.setVisible(true);
157-
if (ManagerExploit.KEY_EXPLOIT_SQL_MYSQL.equals(selectedItem.getKeyLabel())) {
157+
if (ManagerExploit.EXPLOIT_SQL_MYSQL.equals(selectedItem.getKeyLabel())) {
158158
this.username.get().setVisible(true);
159159
this.password.get().setVisible(true);
160160
}
161161
}
162162
this.updateUI(); // required to adapt panel
163163
});
164-
this.comboBoxExploitMethods.addItemListener(e -> {
164+
this.comboBoxExploitModes.addItemListener(e -> {
165165
if (e.getStateChange() == ItemEvent.SELECTED && e.getItem() instanceof ExploitMethod) {
166166
ExploitMethod selectedItem = (ExploitMethod) e.getItem();
167167
this.netshare.get().setVisible(false);
@@ -172,8 +172,8 @@ public JToolTip createToolTip() {
172172
}
173173
});
174174

175-
this.comboBoxExploitMethods.setRenderer(new ComboBoxMethodRenderer());
176-
this.comboBoxExploitMethods.addActionListener(new SeparatorListener(this.comboBoxExploitMethods));
175+
this.comboBoxExploitModes.setRenderer(new ComboBoxMethodRenderer());
176+
this.comboBoxExploitModes.addActionListener(new SeparatorListener(this.comboBoxExploitModes));
177177
var labelUsing = new JLabel("via");
178178
labelUsing.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
179179
groupLayout.setHorizontalGroup(
@@ -184,7 +184,7 @@ public JToolTip createToolTip() {
184184
.createSequentialGroup()
185185
.addComponent(this.comboBoxExploitTypes)
186186
.addComponent(labelUsing, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
187-
.addComponent(this.comboBoxExploitMethods, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
187+
.addComponent(this.comboBoxExploitModes, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
188188
)
189189
.addGroup(
190190
groupLayout.createParallelGroup()
@@ -202,7 +202,7 @@ public JToolTip createToolTip() {
202202
.createParallelGroup(GroupLayout.Alignment.BASELINE)
203203
.addComponent(this.comboBoxExploitTypes)
204204
.addComponent(labelUsing)
205-
.addComponent(this.comboBoxExploitMethods)
205+
.addComponent(this.comboBoxExploitModes)
206206
)
207207
.addGroup(
208208
groupLayout
@@ -235,7 +235,7 @@ public ActionExploit(JComboBox<Object> comboBoxExploitTypes) {
235235
public void actionPerformed(ActionEvent evt) {
236236
var modelSelectItem = (ModelItemType) this.comboBoxExploitTypes.getSelectedItem();
237237
var labelSelectItem = Objects.requireNonNull(modelSelectItem).getKeyLabel();
238-
if (Arrays.asList(ManagerExploit.KEY_UDF_TAB, ManagerExploit.KEY_RCE_TAB).contains(labelSelectItem)) {
238+
if (Arrays.asList(ManagerExploit.EXPLOIT_UDF, ManagerExploit.EXPLOIT_RCE).contains(labelSelectItem)) {
239239
new SwingWorker<>() {
240240
@Override
241241
protected Object doInBackground() { Thread.currentThread().setName("SwingWorkerExploitUdf");
@@ -246,7 +246,7 @@ public void actionPerformed(ActionEvent evt) {
246246
return;
247247
}
248248
if (
249-
ManagerExploit.KEY_EXPLOIT_SQL_MYSQL.equals(labelSelectItem)
249+
ManagerExploit.EXPLOIT_SQL_MYSQL.equals(labelSelectItem)
250250
&& (
251251
ManagerExploit.this.password.get().getText().isEmpty()
252252
|| ManagerExploit.this.username.get().getText().isEmpty()
@@ -257,20 +257,20 @@ public void actionPerformed(ActionEvent evt) {
257257
}
258258
if (
259259
Arrays.asList(
260-
ManagerExploit.KEY_EXPLOIT_SQL_MYSQL, ManagerExploit.KEY_EXPLOIT_UPLOAD_MYSQL, ManagerExploit.KEY_EXPLOIT_WEB_MYSQL, ManagerExploit.KEY_UDF_TAB
260+
ManagerExploit.EXPLOIT_SQL_MYSQL, ManagerExploit.EXPLOIT_UPLOAD_MYSQL, ManagerExploit.EXPLOIT_WEB_MYSQL, ManagerExploit.EXPLOIT_UDF
261261
).contains(labelSelectItem)
262262
&& MediatorHelper.model().getMediatorVendor().getVendor() != MediatorHelper.model().getMediatorVendor().getMysql()
263263
) {
264264
LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Unsupported for [{}], choose a MySQL target instead", MediatorHelper.model().getMediatorVendor().getVendor());
265265
return;
266266
} else if (
267-
Arrays.asList(ManagerExploit.KEY_EXPLOIT_UPLOAD_SQLITE, ManagerExploit.KEY_EXPLOIT_WEB_SQLITE).contains(labelSelectItem)
267+
Arrays.asList(ManagerExploit.EXPLOIT_UPLOAD_SQLITE, ManagerExploit.EXPLOIT_WEB_SQLITE).contains(labelSelectItem)
268268
&& MediatorHelper.model().getMediatorVendor().getVendor() != MediatorHelper.model().getMediatorVendor().getSqlite()
269269
) {
270270
LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Unsupported for [{}], choose a SQLite target instead", MediatorHelper.model().getMediatorVendor().getVendor());
271271
return;
272272
} else if (
273-
ManagerExploit.KEY_RCE_TAB.equals(labelSelectItem)
273+
ManagerExploit.EXPLOIT_RCE.equals(labelSelectItem)
274274
&& MediatorHelper.model().getMediatorVendor().getVendor() != MediatorHelper.model().getMediatorVendor().getOracle()
275275
) {
276276
LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Unsupported for [{}], choose an Oracle target instead", MediatorHelper.model().getMediatorVendor().getVendor());
@@ -300,7 +300,7 @@ public void actionPerformed(ActionEvent evt) {
300300
}
301301

302302
AtomicReference<File> fileToUpload = new AtomicReference<>();
303-
if (Arrays.asList(ManagerExploit.KEY_EXPLOIT_UPLOAD_MYSQL, ManagerExploit.KEY_EXPLOIT_UPLOAD_SQLITE).contains(labelSelectItem)) {
303+
if (Arrays.asList(ManagerExploit.EXPLOIT_UPLOAD_MYSQL, ManagerExploit.EXPLOIT_UPLOAD_SQLITE).contains(labelSelectItem)) {
304304
fileToUpload.set(ManagerExploit.chooseFile());
305305
if (fileToUpload.get() == null) {
306306
LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Missing file, please select a file");
@@ -344,7 +344,7 @@ private static File chooseFile() {
344344
}
345345

346346
protected void createPayload(String remotePathFolder, String urlShell, File fileToUpload) throws JSqlException {
347-
var exploitMethod = ExploitMethod.forName(Objects.requireNonNull(this.comboBoxExploitMethods.getSelectedItem()).toString())
347+
var exploitMethod = ExploitMethod.forName(Objects.requireNonNull(this.comboBoxExploitModes.getSelectedItem()).toString())
348348
.orElse(ExploitMethod.AUTO);
349349

350350
if (remotePathFolder != null && !remotePathFolder.endsWith("/")) {
@@ -356,23 +356,23 @@ protected void createPayload(String remotePathFolder, String urlShell, File file
356356
}
357357

358358
var modelItemType = Objects.requireNonNull((ModelItemType) this.comboBoxExploitTypes.getSelectedItem());
359-
if (ManagerExploit.KEY_UDF_TAB.equals(modelItemType.getKeyLabel())) {
359+
if (ManagerExploit.EXPLOIT_UDF.equals(modelItemType.getKeyLabel())) {
360360
MediatorHelper.model().getUdfAccess().createUdf(pathNetshare, exploitMethod);
361-
} else if (ManagerExploit.KEY_RCE_TAB.equals(modelItemType.getKeyLabel())) {
361+
} else if (ManagerExploit.EXPLOIT_RCE.equals(modelItemType.getKeyLabel())) {
362362
MediatorHelper.model().getUdfAccess().createExploitRce(exploitMethod);
363-
} else if (ManagerExploit.KEY_EXPLOIT_WEB_MYSQL.equals(modelItemType.getKeyLabel())) {
363+
} else if (ManagerExploit.EXPLOIT_WEB_MYSQL.equals(modelItemType.getKeyLabel())) {
364364
MediatorHelper.model().getResourceAccess().createExploitWebMysql(
365365
remotePathFolder,
366366
urlShell,
367367
pathNetshare,
368368
exploitMethod
369369
);
370-
} else if (ManagerExploit.KEY_EXPLOIT_WEB_SQLITE.equals(modelItemType.getKeyLabel())) {
370+
} else if (ManagerExploit.EXPLOIT_WEB_SQLITE.equals(modelItemType.getKeyLabel())) {
371371
MediatorHelper.model().getResourceAccess().createExploitWebSqlite(
372372
remotePathFolder,
373373
urlShell
374374
);
375-
} else if (ManagerExploit.KEY_EXPLOIT_SQL_MYSQL.equals(modelItemType.getKeyLabel())) {
375+
} else if (ManagerExploit.EXPLOIT_SQL_MYSQL.equals(modelItemType.getKeyLabel())) {
376376
MediatorHelper.model().getResourceAccess().createExploitSqlMysql(
377377
remotePathFolder,
378378
urlShell,
@@ -381,15 +381,15 @@ protected void createPayload(String remotePathFolder, String urlShell, File file
381381
this.username.get().getText(),
382382
this.password.get().getText()
383383
);
384-
} else if (ManagerExploit.KEY_EXPLOIT_UPLOAD_MYSQL.equals(modelItemType.getKeyLabel())) {
384+
} else if (ManagerExploit.EXPLOIT_UPLOAD_MYSQL.equals(modelItemType.getKeyLabel())) {
385385
MediatorHelper.model().getResourceAccess().createExploitUploadMysql(
386386
remotePathFolder,
387387
urlShell,
388388
pathNetshare,
389389
exploitMethod,
390390
fileToUpload
391391
);
392-
} else if (ManagerExploit.KEY_EXPLOIT_UPLOAD_SQLITE.equals(modelItemType.getKeyLabel())) {
392+
} else if (ManagerExploit.EXPLOIT_UPLOAD_SQLITE.equals(modelItemType.getKeyLabel())) {
393393
MediatorHelper.model().getResourceAccess().createExploitUploadSqlite(
394394
remotePathFolder,
395395
urlShell,

web/services/jsql-injection.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"version": "0.106",
33
"news": [
4-
"[Credit: @selectfromblackhydra] RCE shell for oracle added to tab Exploits, needs reviewers and testers",
5-
"[Credit: @mrdragonblack] UDF shell for mysql added to tab Exploits, now run system command on remote easily",
6-
"[HowTo UDF/RCE] How to use shells explained on GitHub at https://github.com/ron190/jsql-injection/wiki/Exploit",
4+
"[v0.107] New SQLite php shell, including MySQL php shell, Oracle RCE and MySQL UDF shell",
5+
"[UDF/RCE] How to use shells explained on GitHub at https://github.com/ron190/jsql-injection/wiki/Exploit",
76
"[Pinned] Report any bugs and thoughts and add your star to the project at https://github.com/ron190/jsql-injection",
8-
"[Community] Improve your CTF and bounty research, what should be done by jSQL that you do manually?",
9-
"[Contribute] Some translation is still missing, open menu Community and translate a single item to make progress"
7+
"[Community] What should be done by jSQL that you do manually? Improve your CTF and bounty research by contributing",
8+
"[Contribute] Some button translation is still missing, open menu Community and translate a single item to make progress"
109
]
1110
}

web/test-bed/others/cockroach.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$drv = new PJBS(null, null);
55

6-
$drv->connect('jdbc:postgres://ip:port/db', 'login', 'password');
6+
$drv->connect('jdbc:postgresql://ip:port/db', 'login', 'password');
77

88
$res = $drv->exec("SELECT col1, col2 FROM my_table where id=$_GET[lib]");
99

0 commit comments

Comments
 (0)