1 /*******************************************************************************
2 * Copyhacked (H) 2012-2025.
3 * This program and the accompanying materials
4 * are made available under no term at all, use it like
5 * you want, but share and discuss it
6 * every time possible with every body.
7 *
8 * Contributors:
9 * ron190 at ymail dot com - initial implementation
10 ******************************************************************************/
11 package com.jsql.view.swing.terminal;
12
13 import com.jsql.view.swing.util.MediatorHelper;
14
15 import java.net.MalformedURLException;
16 import java.net.URISyntaxException;
17 import java.util.UUID;
18
19 /**
20 * A terminal for SQL shell injection.
21 */
22 public class ExploitSql extends AbstractExploit {
23
24 /**
25 * Build a SQL shell instance.
26 * @param terminalID Unique identifier to discriminate beyond multiple opened terminals
27 * @param urlShell URL of current shell
28 * @param loginPassword User and password
29 */
30 public ExploitSql(UUID terminalID, String urlShell, String... loginPassword) throws MalformedURLException, URISyntaxException {
31 super(terminalID, urlShell, "sql");
32 this.loginPassword = loginPassword;
33 }
34
35 @Override
36 public void action(String cmd, UUID terminalID, String wbhPath, String... arg) {
37 MediatorHelper.model().getResourceAccess().runSqlShell(cmd, terminalID, wbhPath, arg[0], arg[1]);
38 }
39 }