Search in sources :

Example 6 with InjectionModel

use of com.jsql.model.InjectionModel in project jsql-injection by ron190.

the class MysqlNormalHeaderTestSuite method initialize.

@BeforeClass
public static void initialize() throws Exception {
    InjectionModel model = new InjectionModel();
    MediatorModel.register(model);
    model.displayVersion();
    MediatorModel.model().addObserver(new SystemOutTerminal());
    PreferencesUtil.setNotTestingConnection(true);
    ParameterUtil.initQueryString("http://" + AbstractTestSuite.HOSTNAME + "/simulate_header.php");
    ParameterUtil.initRequest("");
    ParameterUtil.initHeader("lib: 0");
    ConnectionUtil.setMethodInjection(MethodInjection.HEADER);
    ConnectionUtil.setTypeRequest("POST");
    MediatorModel.model().beginInjection();
    MediatorModel.model().setStrategy(StrategyInjection.NORMAL);
}
Also used : InjectionModel(com.jsql.model.InjectionModel) SystemOutTerminal(com.jsql.view.terminal.SystemOutTerminal) BeforeClass(org.junit.BeforeClass)

Example 7 with InjectionModel

use of com.jsql.model.InjectionModel in project jsql-injection by ron190.

the class MysqlTimeHeaderTestSuite method initialize.

@BeforeClass
public static void initialize() throws Exception {
    InjectionModel model = new InjectionModel();
    MediatorModel.register(model);
    model.displayVersion();
    MediatorModel.model().addObserver(new SystemOutTerminal());
    PreferencesUtil.setNotTestingConnection(true);
    ParameterUtil.initQueryString("http://" + AbstractTestSuite.HOSTNAME + "/simulate_header.php");
    ParameterUtil.initRequest("");
    ParameterUtil.initHeader("lib: 1*");
    ConnectionUtil.setMethodInjection(MethodInjection.HEADER);
    ConnectionUtil.setTypeRequest("POST");
    MediatorModel.model().beginInjection();
    MediatorModel.model().setStrategy(StrategyInjection.TIME);
}
Also used : InjectionModel(com.jsql.model.InjectionModel) SystemOutTerminal(com.jsql.view.terminal.SystemOutTerminal) BeforeClass(org.junit.BeforeClass)

Example 8 with InjectionModel

use of com.jsql.model.InjectionModel in project jsql-injection by ron190.

the class MainApplication method main.

/**
 * Application starting point.
 * @param args CLI parameters (not used)
 * @throws URISyntaxException
 */
public static void main(String[] args) throws URISyntaxException {
    // Configure global environnement settings
    CertificateUtil.ignoreCertificationChain();
    ExceptionUtil.setUncaughtExceptionHandler();
    ProxyUtil.setProxy();
    AuthenticationUtil.setKerberosCifs();
    // Initialize MVC
    InjectionModel model = new InjectionModel();
    MediatorModel.register(model);
    try {
        JFrameView view = new JFrameView();
        MediatorGui.register(view);
        model.addObserver(view.getObserver());
    } catch (HeadlessException e) {
        LOGGER.error("HeadlessException, command line execution in jSQL not supported yet: " + e.getMessage(), e);
        return;
    } catch (AWTError e) {
        // Fix #22668: Assistive Technology not found
        LOGGER.error("Java Access Bridge missing or corrupt, check your access bridge definition in JDK_HOME/jre/lib/accessibility.properties: " + e.getMessage(), e);
        return;
    }
    model.displayVersion();
    // Check application status
    if (!ProxyUtil.isChecked(ShowOnConsole.YES)) {
        return;
    }
    if (PreferencesUtil.isCheckUpdateActivated()) {
        GitUtil.checkUpdate(ShowOnConsole.NO);
    }
    I18n.checkCurrentLanguage();
    GitUtil.showNews();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    int width = (int) screenSize.getWidth();
    if (width >= 3840 && !PreferencesUtil.is4K()) {
        LOGGER.warn("Your screen seems compatible with 4K resolution, please activate high-definition mode in Preferences");
    }
}
Also used : InjectionModel(com.jsql.model.InjectionModel) JFrameView(com.jsql.view.swing.JFrameView) HeadlessException(java.awt.HeadlessException) AWTError(java.awt.AWTError) Dimension(java.awt.Dimension)

Example 9 with InjectionModel

use of com.jsql.model.InjectionModel in project jsql-injection by ron190.

the class OracleBlindGetTestSuite method initialize.

@BeforeClass
public static void initialize() throws InjectionFailureException {
    InjectionModel model = new InjectionModel();
    MediatorModel.register(model);
    model.displayVersion();
    MediatorModel.model().addObserver(new SystemOutTerminal());
    ConnectionUtil.setUrlBase("http://" + AbstractTestSuite.HOSTNAME + "/oracle_simulate_get.php");
    ParameterUtil.setQueryString(Arrays.asList(new SimpleEntry<String, String>("lib", "1")));
    ConnectionUtil.setMethodInjection(MethodInjection.QUERY);
    MediatorModel.model().beginInjection();
    MediatorModel.model().setStrategy(StrategyInjection.BLIND);
}
Also used : InjectionModel(com.jsql.model.InjectionModel) SimpleEntry(java.util.AbstractMap.SimpleEntry) SystemOutTerminal(com.jsql.view.terminal.SystemOutTerminal) BeforeClass(org.junit.BeforeClass)

Example 10 with InjectionModel

use of com.jsql.model.InjectionModel in project jsql-injection by ron190.

the class SQLServerBlindGetTestSuite method initialize.

@BeforeClass
public static void initialize() throws InjectionFailureException {
    InjectionModel model = new InjectionModel();
    MediatorModel.register(model);
    model.displayVersion();
    MediatorModel.model().addObserver(new SystemOutTerminal());
    ConnectionUtil.setUrlBase("http://" + AbstractTestSuite.HOSTNAME + "/sqlserver_simulate_get.php");
    ParameterUtil.setQueryString(Arrays.asList(new SimpleEntry<String, String>("lib", "1")));
    ConnectionUtil.setMethodInjection(MethodInjection.QUERY);
    MediatorModel.model().beginInjection();
    MediatorModel.model().setStrategy(StrategyInjection.BLIND);
}
Also used : InjectionModel(com.jsql.model.InjectionModel) SimpleEntry(java.util.AbstractMap.SimpleEntry) SystemOutTerminal(com.jsql.view.terminal.SystemOutTerminal) BeforeClass(org.junit.BeforeClass)

Aggregations

InjectionModel (com.jsql.model.InjectionModel)22 SystemOutTerminal (com.jsql.view.terminal.SystemOutTerminal)21 BeforeClass (org.junit.BeforeClass)21 SimpleEntry (java.util.AbstractMap.SimpleEntry)15 JFrameView (com.jsql.view.swing.JFrameView)1 AWTError (java.awt.AWTError)1 Dimension (java.awt.Dimension)1 HeadlessException (java.awt.HeadlessException)1