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.tab; | |
12 | ||
13 | import com.jsql.view.swing.manager.*; | |
14 | import com.jsql.view.swing.util.MediatorHelper; | |
15 | import com.jsql.view.swing.util.UiUtil; | |
16 | import org.apache.commons.lang3.StringUtils; | |
17 | ||
18 | import javax.swing.*; | |
19 | import java.awt.*; | |
20 | import java.util.Arrays; | |
21 | import java.util.List; | |
22 | import java.util.concurrent.atomic.AtomicInteger; | |
23 | ||
24 | /** | |
25 | * Panel on the left with functionalities like webshell, file reading and admin page finder. | |
26 | */ | |
27 | public class TabManagersCards extends JPanel { | |
28 | | |
29 | private final ManagerFile managerFile = new ManagerFile(); | |
30 | private final ManagerExploit managerExploit = new ManagerExploit(); | |
31 | ||
32 | /** | |
33 | * Create manager panel. | |
34 | */ | |
35 | public TabManagersCards() { | |
36 |
1
1. <init> : removed call to com/jsql/view/swing/tab/TabManagersCards::setName → NO_COVERAGE |
this.setName("tabManagersProxy"); |
37 |
1
1. <init> : removed call to com/jsql/view/swing/tab/TabManagersCards::setLayout → NO_COVERAGE |
this.setLayout(new CardLayout()); |
38 |
1
1. <init> : removed call to com/jsql/view/swing/tab/TabManagersCards::setMinimumSize → NO_COVERAGE |
this.setMinimumSize(new Dimension(100, 0)); // allow proper minimize |
39 | ||
40 | var managerScanList = new ManagerScan(); | |
41 | var managerDatabase = new ManagerDatabase(); | |
42 | var managerAdminPage = new ManagerAdminPage(); | |
43 | var managerBruteForce = new ManagerBruteForce(); | |
44 | ||
45 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(this.managerFile); |
46 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(this.managerExploit); |
47 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(managerScanList); |
48 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(managerAdminPage); |
49 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(managerBruteForce); |
50 | ||
51 | var managers = Arrays.asList( | |
52 | managerDatabase, managerAdminPage, this.managerFile, this.managerExploit, managerBruteForce, | |
53 | new ManagerCoder(), managerScanList | |
54 | ); | |
55 | AtomicInteger i = new AtomicInteger(); | |
56 |
2
1. <init> : removed call to java/util/List::forEach → NO_COVERAGE 2. lambda$new$0 : removed call to com/jsql/view/swing/tab/TabManagersCards::buildI18nTab → NO_COVERAGE |
MediatorHelper.frame().getTabManagers().getIconsTabs().forEach(modelSvgIcon -> this.buildI18nTab( |
57 | modelSvgIcon.getKeyLabel(), | |
58 | managers.get(i.getAndIncrement()) | |
59 | )); | |
60 | ||
61 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(this); |
62 | } | |
63 | ||
64 | public void addToLists(String path, String name) { | |
65 |
1
1. addToLists : removed call to com/jsql/view/swing/manager/ManagerExploit::addToList → NO_COVERAGE |
this.managerExploit.addToList(path.replace(name, StringUtils.EMPTY)); |
66 | } | |
67 | | |
68 | public void markFileSystemInvulnerable() { | |
69 |
1
1. markFileSystemInvulnerable : removed call to java/util/List::forEach → NO_COVERAGE |
this.getManagers().forEach(manager -> { |
70 |
1
1. lambda$markFileSystemInvulnerable$1 : removed call to com/jsql/view/swing/manager/AbstractManagerList::changePrivilegeIcon → NO_COVERAGE |
manager.changePrivilegeIcon(UiUtil.CROSS_RED.getIcon()); |
71 |
1
1. lambda$markFileSystemInvulnerable$1 : removed call to com/jsql/view/swing/manager/AbstractManagerList::endProcess → NO_COVERAGE |
manager.endProcess(); |
72 | }); | |
73 | } | |
74 | | |
75 | public void endPreparation() { | |
76 |
2
1. endPreparation : removed call to java/util/List::forEach → NO_COVERAGE 2. lambda$endPreparation$2 : removed call to com/jsql/view/swing/manager/AbstractManagerList::setButtonEnable → NO_COVERAGE |
this.getManagers().forEach(manager -> manager.setButtonEnable(true)); |
77 | } | |
78 | | |
79 | public void markFileSystemVulnerable() { | |
80 |
2
1. markFileSystemVulnerable : removed call to java/util/List::forEach → NO_COVERAGE 2. lambda$markFileSystemVulnerable$3 : removed call to com/jsql/view/swing/manager/AbstractManagerList::changePrivilegeIcon → NO_COVERAGE |
this.getManagers().forEach(manager -> manager.changePrivilegeIcon(UiUtil.TICK_GREEN.getIcon())); |
81 | } | |
82 | ||
83 | private void buildI18nTab(String keyLabel, Component manager) { | |
84 |
1
1. buildI18nTab : removed call to java/awt/Component::setName → NO_COVERAGE |
manager.setName(keyLabel); |
85 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/tab/TabManagersCards::add → NO_COVERAGE |
this.add(manager, keyLabel); |
86 | } | |
87 | ||
88 | private List<AbstractManagerList> getManagers() { | |
89 |
1
1. getManagers : replaced return value with Collections.emptyList for com/jsql/view/swing/tab/TabManagersCards::getManagers → NO_COVERAGE |
return Arrays.asList(this.managerFile, this.managerExploit); |
90 | } | |
91 | } | |
Mutations | ||
36 |
1.1 |
|
37 |
1.1 |
|
38 |
1.1 |
|
45 |
1.1 |
|
46 |
1.1 |
|
47 |
1.1 |
|
48 |
1.1 |
|
49 |
1.1 |
|
56 |
1.1 2.2 |
|
61 |
1.1 |
|
65 |
1.1 |
|
69 |
1.1 |
|
70 |
1.1 |
|
71 |
1.1 |
|
76 |
1.1 2.2 |
|
80 |
1.1 2.2 |
|
84 |
1.1 |
|
85 |
1.1 |
|
89 |
1.1 |