| 1 | package com.jsql.view.subscriber; | |
| 2 | ||
| 3 | import com.jsql.model.injection.strategy.AbstractStrategy; | |
| 4 | import com.jsql.model.injection.strategy.StrategyError; | |
| 5 | import com.jsql.util.LogLevelUtil; | |
| 6 | import com.jsql.view.swing.panel.consoles.NetworkTable; | |
| 7 | import com.jsql.view.swing.terminal.AbstractExploit; | |
| 8 | import com.jsql.view.swing.util.MediatorHelper; | |
| 9 | import org.apache.logging.log4j.LogManager; | |
| 10 | import org.apache.logging.log4j.Logger; | |
| 11 | ||
| 12 | import javax.swing.table.DefaultTableModel; | |
| 13 | import java.awt.*; | |
| 14 | import java.util.Arrays; | |
| 15 | import java.util.UUID; | |
| 16 | ||
| 17 | public class SubscriberView extends AbstractSubscriber { | |
| 18 | ||
| 19 | private static final Logger LOGGER = LogManager.getRootLogger(); | |
| 20 | ||
| 21 | @Override | |
| 22 | protected void execute(Seal request) { | |
| 23 |
1
1. execute : removed call to com/jsql/view/subscriber/SubscriberView::addLog → NO_COVERAGE |
this.addLog(request); |
| 24 |
1
1. execute : removed call to com/jsql/view/subscriber/SubscriberView::progress → NO_COVERAGE |
this.progress(request); |
| 25 |
1
1. execute : removed call to com/jsql/view/subscriber/SubscriberView::executeInjection → NO_COVERAGE |
this.executeInjection(request); |
| 26 |
1
1. execute : removed call to com/jsql/view/subscriber/SubscriberView::createTab → NO_COVERAGE |
this.createTab(request); |
| 27 |
1
1. execute : removed call to com/jsql/view/subscriber/SubscriberView::executeExploit → NO_COVERAGE |
this.executeExploit(request); |
| 28 | } | |
| 29 | ||
| 30 | private void executeInjection(Seal request) { | |
| 31 | switch (request) { | |
| 32 |
1
1. executeInjection : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::setEngine → NO_COVERAGE |
case Seal.ActivateEngine(var engine) -> MediatorHelper.panelAddressBar().getPanelTrailingAddress().setEngine(engine); |
| 33 |
1
1. executeInjection : removed call to com/jsql/view/swing/tree/TreeDatabase::addColumns → NO_COVERAGE |
case Seal.AddColumns(var columns) -> MediatorHelper.treeDatabase().addColumns(columns); |
| 34 |
1
1. executeInjection : removed call to com/jsql/view/swing/tree/TreeDatabase::addTables → NO_COVERAGE |
case Seal.AddTables(var tables) -> MediatorHelper.treeDatabase().addTables(tables); |
| 35 |
1
1. executeInjection : removed call to com/jsql/view/swing/tree/TreeDatabase::addDatabases → NO_COVERAGE |
case Seal.AddDatabases(var databases) -> MediatorHelper.treeDatabase().addDatabases(databases); |
| 36 | ||
| 37 | case Seal.MarkStrategyInvulnerable(int indexError, AbstractStrategy strategy) -> { | |
| 38 |
1
1. executeInjection : negated conditional → NO_COVERAGE |
if (strategy instanceof StrategyError) { |
| 39 |
1
1. executeInjection : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::markInvulnerable → NO_COVERAGE |
MediatorHelper.panelAddressBar().getPanelTrailingAddress().markInvulnerable(indexError, strategy); |
| 40 | } else { | |
| 41 |
1
1. executeInjection : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::markInvulnerable → NO_COVERAGE |
MediatorHelper.panelAddressBar().getPanelTrailingAddress().markInvulnerable(strategy); |
| 42 | } | |
| 43 | } | |
| 44 | case Seal.MarkStrategyVulnerable(int indexError, var strategy) -> { | |
| 45 |
1
1. executeInjection : negated conditional → NO_COVERAGE |
if (strategy instanceof StrategyError) { |
| 46 |
1
1. executeInjection : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::markVulnerable → NO_COVERAGE |
MediatorHelper.panelAddressBar().getPanelTrailingAddress().markVulnerable(indexError, strategy); |
| 47 | } else { | |
| 48 |
1
1. executeInjection : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::markVulnerable → NO_COVERAGE |
MediatorHelper.panelAddressBar().getPanelTrailingAddress().markVulnerable(strategy); |
| 49 | } | |
| 50 | } | |
| 51 |
1
1. executeInjection : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::activateStrategy → NO_COVERAGE |
case Seal.ActivateStrategy(var strategy) -> MediatorHelper.panelAddressBar().getPanelTrailingAddress().activateStrategy(strategy); |
| 52 | ||
| 53 |
1
1. executeInjection : removed call to com/jsql/view/swing/tab/TabManagersCards::markFileSystemInvulnerable → NO_COVERAGE |
case Seal.MarkFileSystemInvulnerable ignored -> MediatorHelper.tabManagersCards().markFileSystemInvulnerable(); |
| 54 |
1
1. executeInjection : removed call to com/jsql/view/swing/tab/TabManagersCards::markFileSystemVulnerable → NO_COVERAGE |
case Seal.MarkFileSystemVulnerable ignored -> MediatorHelper.tabManagersCards().markFileSystemVulnerable(); |
| 55 | default -> { | |
| 56 | // ignore | |
| 57 | } | |
| 58 | } | |
| 59 | } | |
| 60 | ||
| 61 | private void executeExploit(Seal request) { | |
| 62 | switch (request) { | |
| 63 |
1
1. executeExploit : removed call to com/jsql/view/swing/tab/TabResults::addTabExploitSql → NO_COVERAGE |
case Seal.AddTabExploitSql(var urlSuccess, var username, var password) -> MediatorHelper.tabResults().addTabExploitSql(urlSuccess, username, password); |
| 64 |
1
1. executeExploit : removed call to com/jsql/view/swing/tab/TabResults::addTabExploitUdf → NO_COVERAGE |
case Seal.AddTabExploitUdf(var biConsumerRunCmd) -> MediatorHelper.tabResults().addTabExploitUdf(biConsumerRunCmd); |
| 65 |
1
1. executeExploit : removed call to com/jsql/view/swing/tab/TabResults::addTabExploitWeb → NO_COVERAGE |
case Seal.AddTabExploitWeb(String urlSuccess) -> MediatorHelper.tabResults().addTabExploitWeb(urlSuccess); |
| 66 | case Seal.GetTerminalResult(UUID uuidShell, String result) -> { | |
| 67 | AbstractExploit terminal = MediatorHelper.frame().getMapUuidShell().get(uuidShell); | |
| 68 |
1
1. executeExploit : negated conditional → NO_COVERAGE |
if (terminal != null) { // null on reverse shell connection |
| 69 |
1
1. executeExploit : removed call to com/jsql/view/swing/terminal/AbstractExploit::append → NO_COVERAGE |
terminal.append(result); |
| 70 |
1
1. executeExploit : removed call to com/jsql/view/swing/terminal/AbstractExploit::append → NO_COVERAGE |
terminal.append("\n"); |
| 71 |
1
1. executeExploit : removed call to com/jsql/view/swing/terminal/AbstractExploit::reset → NO_COVERAGE |
terminal.reset(); |
| 72 | } | |
| 73 | } | |
| 74 | default -> { | |
| 75 | // ignore | |
| 76 | } | |
| 77 | } | |
| 78 | } | |
| 79 | ||
| 80 | private void addLog(Seal request) { | |
| 81 | switch (request) { | |
| 82 | case Seal.MessageBinary(var message) -> { | |
| 83 |
1
1. addLog : removed call to com/jsql/view/swing/panel/PanelConsoles::messageBinary → NO_COVERAGE |
MediatorHelper.panelConsoles().messageBinary(message); |
| 84 |
1
1. addLog : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::setBold → NO_COVERAGE |
MediatorHelper.tabConsoles().setBold("Boolean"); |
| 85 | } | |
| 86 | case Seal.MessageChunk(var message) -> { | |
| 87 |
1
1. addLog : removed call to com/jsql/view/swing/panel/PanelConsoles::messageChunk → NO_COVERAGE |
MediatorHelper.panelConsoles().messageChunk(message); |
| 88 |
1
1. addLog : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::setBold → NO_COVERAGE |
MediatorHelper.tabConsoles().setBold("Chunk"); |
| 89 | } | |
| 90 | case Seal.MessageHeader r -> { | |
| 91 | NetworkTable table = MediatorHelper.panelConsoles().getNetworkTable(); | |
| 92 |
1
1. addLog : removed call to com/jsql/view/swing/panel/consoles/NetworkTable::addHeader → NO_COVERAGE |
table.addHeader(r); |
| 93 | DefaultTableModel model = (DefaultTableModel) table.getModel(); | |
| 94 | try { | |
| 95 |
1
1. addLog : removed call to javax/swing/table/DefaultTableModel::addRow → NO_COVERAGE |
model.addRow(new Object[] { |
| 96 | r.url(), | |
| 97 | r.size(), | |
| 98 | r.metadataStrategy(), | |
| 99 | Arrays.asList(r.metadataProcess(), r.metadataBoolean()) | |
| 100 | }); | |
| 101 | ||
| 102 |
1
1. addLog : Replaced integer subtraction with addition → NO_COVERAGE |
Rectangle rect = table.getCellRect(table.getRowCount() - 1, 0, true); |
| 103 |
1
1. addLog : removed call to com/jsql/view/swing/panel/consoles/NetworkTable::scrollRectToVisible → NO_COVERAGE |
table.scrollRectToVisible(rect); |
| 104 | ||
| 105 |
1
1. addLog : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::setBold → NO_COVERAGE |
MediatorHelper.tabConsoles().setBold("Network"); |
| 106 | } catch(NullPointerException | IndexOutOfBoundsException e) { | |
| 107 | // Fix #4658, #2224, #1797 on model.addRow() | |
| 108 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e); | |
| 109 | } | |
| 110 | } | |
| 111 | default -> { | |
| 112 | // ignore | |
| 113 | } | |
| 114 | } | |
| 115 | } | |
| 116 | ||
| 117 | private void createTab(Seal request) { | |
| 118 | switch (request) { | |
| 119 |
1
1. createTab : removed call to com/jsql/view/swing/tab/TabResults::addAdminTab → NO_COVERAGE |
case Seal.CreateAdminPageTab(String urlSuccess) -> MediatorHelper.tabResults().addAdminTab(urlSuccess); |
| 120 |
1
1. createTab : removed call to com/jsql/view/swing/tab/TabResults::addReportTab → NO_COVERAGE |
case Seal.CreateAnalysisReport(var content) -> MediatorHelper.tabResults().addReportTab(content.trim()); |
| 121 |
1
1. createTab : removed call to com/jsql/view/swing/tab/TabResults::addFileTab → NO_COVERAGE |
case Seal.CreateFileTab(var name, var content, var path) -> MediatorHelper.tabResults().addFileTab(name, content, path); |
| 122 |
1
1. createTab : removed call to com/jsql/view/swing/tree/TreeDatabase::createValuesTab → NO_COVERAGE |
case Seal.CreateValuesTab(var columns, var table, var tableBean) -> MediatorHelper.treeDatabase().createValuesTab(table, columns, tableBean); |
| 123 | default -> { | |
| 124 | // ignore | |
| 125 | } | |
| 126 | } | |
| 127 | } | |
| 128 | ||
| 129 | private void progress(Seal request) { | |
| 130 | switch (request) { | |
| 131 |
1
1. progress : removed call to com/jsql/view/swing/tree/TreeDatabase::startIndeterminateProgress → NO_COVERAGE |
case Seal.StartIndeterminateProgress(var table) -> MediatorHelper.treeDatabase().startIndeterminateProgress(table); |
| 132 |
1
1. progress : removed call to com/jsql/view/swing/tree/TreeDatabase::startProgress → NO_COVERAGE |
case Seal.StartProgress(var elementDatabase) -> MediatorHelper.treeDatabase().startProgress(elementDatabase); |
| 133 |
1
1. progress : removed call to com/jsql/view/swing/tree/TreeDatabase::updateProgress → NO_COVERAGE |
case Seal.UpdateProgress(var database, var countProgress) -> MediatorHelper.treeDatabase().updateProgress(database, countProgress); |
| 134 |
1
1. progress : removed call to com/jsql/view/swing/tree/TreeDatabase::endIndeterminateProgress → NO_COVERAGE |
case Seal.EndIndeterminateProgress(var table) -> MediatorHelper.treeDatabase().endIndeterminateProgress(table); |
| 135 | case Seal.EndPreparation ignored -> { | |
| 136 |
1
1. progress : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::endPreparation → NO_COVERAGE |
MediatorHelper.panelAddressBar().getPanelTrailingAddress().endPreparation(); |
| 137 |
1
1. progress : negated conditional → NO_COVERAGE |
if (MediatorHelper.model().shouldErasePreviousInjection()) { |
| 138 |
1
1. progress : removed call to com/jsql/view/swing/tab/TabManagersCards::endPreparation → NO_COVERAGE |
MediatorHelper.tabManagersCards().endPreparation(); |
| 139 | } | |
| 140 | } | |
| 141 |
1
1. progress : removed call to com/jsql/view/swing/tree/TreeDatabase::endProgress → NO_COVERAGE |
case Seal.EndProgress(var elementDatabase) -> MediatorHelper.treeDatabase().endProgress(elementDatabase); |
| 142 | default -> { | |
| 143 | // ignore | |
| 144 | } | |
| 145 | } | |
| 146 | } | |
| 147 | } | |
Mutations | ||
| 23 |
1.1 |
|
| 24 |
1.1 |
|
| 25 |
1.1 |
|
| 26 |
1.1 |
|
| 27 |
1.1 |
|
| 32 |
1.1 |
|
| 33 |
1.1 |
|
| 34 |
1.1 |
|
| 35 |
1.1 |
|
| 38 |
1.1 |
|
| 39 |
1.1 |
|
| 41 |
1.1 |
|
| 45 |
1.1 |
|
| 46 |
1.1 |
|
| 48 |
1.1 |
|
| 51 |
1.1 |
|
| 53 |
1.1 |
|
| 54 |
1.1 |
|
| 63 |
1.1 |
|
| 64 |
1.1 |
|
| 65 |
1.1 |
|
| 68 |
1.1 |
|
| 69 |
1.1 |
|
| 70 |
1.1 |
|
| 71 |
1.1 |
|
| 83 |
1.1 |
|
| 84 |
1.1 |
|
| 87 |
1.1 |
|
| 88 |
1.1 |
|
| 92 |
1.1 |
|
| 95 |
1.1 |
|
| 102 |
1.1 |
|
| 103 |
1.1 |
|
| 105 |
1.1 |
|
| 119 |
1.1 |
|
| 120 |
1.1 |
|
| 121 |
1.1 |
|
| 122 |
1.1 |
|
| 131 |
1.1 |
|
| 132 |
1.1 |
|
| 133 |
1.1 |
|
| 134 |
1.1 |
|
| 136 |
1.1 |
|
| 137 |
1.1 |
|
| 138 |
1.1 |
|
| 141 |
1.1 |