Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 1.0.0 #61

Merged
merged 28 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#### 简介

ultimate-cube 是开源的远程服务器管理工具箱,目标是为渗透测试工程师、程序员、网站管理员、IT 管理员以及几乎所有需要以更简单的方式处理远程工作的用户提供大量定制功能。
ultimate-cube 是开源的远程服务器管理工具箱,目标是为渗透测试工程师、程序员、网站管理员、IT
管理员以及几乎所有需要以更简单的方式处理远程工作的用户提供大量定制功能。

#### 软件架构

Expand All @@ -34,11 +35,10 @@ ultimate-cube 是开源的远程服务器管理工具箱,目标是为渗透测
- [ ] 支持插件系统
- [ ] 支持国际化
- [ ] 友好提示异常及报错信息

#### 拆分项目

- [nuclei-plus](https://github.com/Yong-An-Dang/nuclei-plus)
- [terminal-plus](https://github.com/Yong-An-Dang/terminal-plus)
- [ ] 优化资源释放
- [ ] 主密码(master password)
- [ ] 支持多种加密方法
- [ ] 支持HTTP/SOCK5代理配置

#### 安装教程

Expand Down Expand Up @@ -66,27 +66,27 @@ winget install ultimatecube

1. 构建环境:`JDK11+`, `IDEA`
2. 安装依赖:
```shell
# tightvnc-jviewer.jar, jediterm-pty-2.66.jar, com.jediterm.terminal-2.66.jar, jediterm-typeahead-2.66.jar
mvn install:install-file -Dfile=libs/tightvnc-jviewer.jar -DgroupId=com.g3g4x5x6 -DartifactId=tightvnc-jviewer -Dversion=2.8.3 -Dpackaging=jar
# mvn install:install-file -Dfile=libs/jediterm-typeahead-2.66.jar -DgroupId=com.g3g4x5x6 -DartifactId=jediterm-typeahead -Dversion=2.66 -Dpackaging=jar
# mvn install:install-file -Dfile=libs/jediterm-pty-2.66.jar -DgroupId=com.g3g4x5x6 -DartifactId=jediterm-pty -Dversion=2.66 -Dpackaging=jar
```

```shell
mvn install:install-file -Dfile=libs/tightvnc-jviewer.jar -DgroupId=com.g3g4x5x6 -DartifactId=tightvnc-jviewer -Dversion=2.8.3 -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-core-3.20-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-core -Dversion=3.20-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-ui-3.20-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-ui -Dversion=3.20-SNAPSHOT -Dpackaging=jar
```

3. 编译运行:
1. 统一修改各模块版本号:`mvn versions:set -DnewVersion=6.6.16`
1. 运行 `maven` 插件 `templating` 编译 `Version.java` 文件
1. 安装新版本依赖:`mvn install`
1. `IDEA` 菜单中 `Build Proect` 项目,复制静态文件到 `target` 目录
1. 运行项目或者打包(`maven` 插件 `assembly:assembly`)


#### 注意事项

1. 请备份配置文件 `application.properties` 中的会话加密密钥 `ssh.session.secret.key`,丢失后将无法解密已加密的会话密码。
2. 程序更新后,配置文件可能有所变动,若无法正常连接SSH,请备份并删除原配置文件 `application.properties`。
3. 关于使用过程中的任何疑问,请于 GitHub 中的 `Discussions` 中的对应版本进行提问和反馈。
4. 任何 `Issues` 请到 github 项目仓库中提出。


#### 参与贡献

1. Fork 本仓库
Expand Down Expand Up @@ -114,4 +114,5 @@ winget install ultimatecube
![img.png](doc/img/img_1.png)

#### [感谢 `JetBrains` 提供的强大编辑器](https://jb.gg/OpenSourceSupport)

![JetBrains Logo (Main) logo](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)
4 changes: 2 additions & 2 deletions buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Wed Jun 28 17:05:30 CST 2023
buildNumber=68
#Fri Aug 11 23:15:53 CST 2023
buildNumber=77
Binary file modified doc/img/splashscreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added libs/jediterm-core-3.20-SNAPSHOT-sources.jar
Binary file not shown.
Binary file added libs/jediterm-core-3.20-SNAPSHOT.jar
Binary file not shown.
Binary file added libs/jediterm-ui-3.20-SNAPSHOT.jar
Binary file not shown.
60 changes: 41 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@
<modules>
<module>ultimate-app</module>
<module>ultimate-editor</module>
<module>ultimate-pty</module>
<module>ultimate-terminal</module>
<module>ultimate-typeahead</module>
</modules>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<fastjson-version>1.2.83</fastjson-version>
<guava-version>30.1.1-jre</guava-version>
<guava-version>32.0.0-jre</guava-version>

<flatlaf-version>2.0.1</flatlaf-version>
<flatlaf-extras-version>2.0.1</flatlaf-extras-version>
Expand All @@ -36,14 +33,16 @@
<sshd-common-version>2.9.2</sshd-common-version>
<sshd-putty-version>2.9.2</sshd-putty-version>

<slf4j-api-version>2.0.0-alpha5</slf4j-api-version>
<slf4j-log4j12-version>2.0.0-alpha5</slf4j-log4j12-version>
<slf4j-api-version>2.0.7</slf4j-api-version>
<slf4j-log4j12-version>2.0.7</slf4j-log4j12-version>

<poi-version>5.0.0</poi-version>
<jna-version>5.8.0</jna-version>
<qqwry-java-version>0.8.0</qqwry-java-version>

<pty4j-version>0.12.7</pty4j-version>
<pty4j-version>0.12.13</pty4j-version>
<jediterm-core-version>3.20-SNAPSHOT</jediterm-core-version>
<jediterm-ui-version>3.20-SNAPSHOT</jediterm-ui-version>
<annotations-version>RELEASE</annotations-version>

<tightvnc-jviewer-version>2.8.3</tightvnc-jviewer-version>
Expand All @@ -56,10 +55,45 @@

<jcolor-version>5.5.1</jcolor-version>
<hutool-version>5.8.4</hutool-version>

<zip4j-version>2.11.5</zip4j-version>
</properties>

<dependencyManagement>
<dependencies>

<dependency>
<groupId>com.g3g4x5x6</groupId>
<artifactId>tightvnc-jviewer</artifactId>
<version>${tightvnc-jviewer-version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains.pty4j</groupId>
<artifactId>pty4j</artifactId>
<version>${pty4j-version}</version>
</dependency>

<dependency>
<groupId>com.jediterm</groupId>
<artifactId>jediterm-core</artifactId>
<version>${jediterm-core-version}</version>
</dependency>

<dependency>
<groupId>com.jediterm</groupId>
<artifactId>jediterm-ui</artifactId>
<version>${jediterm-ui-version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>${zip4j-version}</version>
</dependency>


<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
Expand Down Expand Up @@ -172,24 +206,12 @@
<version>${qqwry-java-version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains.pty4j</groupId>
<artifactId>pty4j</artifactId>
<version>${pty4j-version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>${annotations-version}</version>
</dependency>

<dependency>
<groupId>com.g3g4x5x6</groupId>
<artifactId>tightvnc-jviewer</artifactId>
<version>${tightvnc-jviewer-version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
<dependency>
<groupId>org.yaml</groupId>
Expand Down
3 changes: 3 additions & 0 deletions prepare.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mvn install:install-file -Dfile=libs/tightvnc-jviewer.jar -DgroupId=com.g3g4x5x6 -DartifactId=tightvnc-jviewer -Dversion=2.8.3 -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-core-3.20-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-core -Dversion=3.20-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-ui-3.20-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-ui -Dversion=3.20-SNAPSHOT -Dpackaging=jar
4 changes: 2 additions & 2 deletions ultimate-app/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Sun Jun 11 10:46:26 CST 2023
buildNumber=104
#Fri Aug 11 23:19:59 CST 2023
buildNumber=114
27 changes: 18 additions & 9 deletions ultimate-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,31 @@
<artifactId>ultimate-editor</artifactId>
<version>6.6.16</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.g3g4x5x6</groupId>
<artifactId>ultimate-pty</artifactId>
<version>6.6.16</version>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>

<dependency>
<groupId>com.g3g4x5x6</groupId>
<artifactId>ultimate-typeahead</artifactId>
<version>6.6.16</version>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
</dependency>

<dependency>
<groupId>com.g3g4x5x6</groupId>
<artifactId>ultimate-terminal</artifactId>
<version>6.6.16</version>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>

<dependency>
<groupId>com.jediterm</groupId>
<artifactId>jediterm-core</artifactId>
</dependency>

<dependency>
<groupId>com.jediterm</groupId>
<artifactId>jediterm-ui</artifactId>
</dependency>

<dependency>
Expand Down
68 changes: 61 additions & 7 deletions ultimate-app/src/main/java/com/g3g4x5x6/App.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.g3g4x5x6;

import com.formdev.flatlaf.FlatLightLaf;
import com.g3g4x5x6.dialog.LockDialog;
import com.g3g4x5x6.ui.dialog.LockDialog;
import com.g3g4x5x6.remote.ssh.SessionInfo;
import com.g3g4x5x6.remote.utils.CommonUtil;
import com.g3g4x5x6.utils.CheckUtil;
Expand All @@ -10,6 +10,7 @@

import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.plaf.FontUIResource;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
Expand Down Expand Up @@ -49,6 +50,8 @@ public static void main(String[] args) {
CheckUtil.checkEnv();
// 加载自定义日志配置
initLog4j();
// 修改默认字体
setDefaultFont();
// 启动主程序
SwingUtilities.invokeLater(App::createGUI);
}
Expand All @@ -60,10 +63,62 @@ private static void loadLogger() {
String configFilename = Objects.requireNonNull(App.class.getClassLoader().getResource("")).getPath() + "log4j.properties";
PropertyConfigurator.configureAndWatch(configFilename);
} catch (Exception e) {
e.printStackTrace();
log.error("日志器加载异常:" + e.getMessage());
}
}

private static void setDefaultFont() {
// 读取字体文件
try (InputStream fontStream = Objects.requireNonNull(App.class.getClassLoader().getResourceAsStream("fonts/Noto_Sans_SC/" + "NotoSansSC-Regular.otf"))) {
// 加载字体
Font font = Font.createFont(Font.TRUETYPE_FONT, fontStream);

// 注册字体
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(font);

// 设置所有组件的默认字体
setUIFont(new FontUIResource(font.deriveFont(Font.PLAIN, 14)));

} catch (FontFormatException | IOException e) {
log.debug(e.getMessage());
}
}

private static void setUIFont(FontUIResource fontResource) {
// 设置所有组件的默认字体
UIManager.put("MenuBar.font", fontResource);
UIManager.put("Menu.font", fontResource);
UIManager.put("MenuItem.font", fontResource);
// UIManager.put("Tree.font", fontResource);
// UIManager.put("Label.font", fontResource);
// UIManager.put("Table.font", fontResource);
// UIManager.put("Button.font", fontResource);
// UIManager.put("ToggleButton.font", fontResource);
// UIManager.put("RadioButton.font", fontResource);
// UIManager.put("CheckBox.font", fontResource);
// UIManager.put("ColorChooser.font", fontResource);
// UIManager.put("ComboBox.font", fontResource);
// UIManager.put("List.font", fontResource);
// UIManager.put("RadioButtonMenuItem.font", fontResource);
// UIManager.put("CheckBoxMenuItem.font", fontResource);
// UIManager.put("PopupMenu.font", fontResource);
// UIManager.put("OptionPane.font", fontResource);
// UIManager.put("Panel.font", fontResource);
// UIManager.put("ProgressBar.font", fontResource);
// UIManager.put("ScrollPane.font", fontResource);
// UIManager.put("Viewport.font", fontResource);
// UIManager.put("TableHeader.font", fontResource);
// UIManager.put("TextField.font", fontResource);
// UIManager.put("PasswordField.font", fontResource);
// UIManager.put("TextArea.font", fontResource);
// UIManager.put("TextPane.font", fontResource);
// UIManager.put("EditorPane.font", fontResource);
// UIManager.put("TitledBorder.font", fontResource);
// UIManager.put("ToolBar.font", fontResource);
// UIManager.put("ToolTip.font", fontResource);
}

private static void createGUI() {
// 配置主题皮肤
initFlatLaf();
Expand All @@ -86,7 +141,6 @@ private static void initFlatLaf() {
log.debug("加载主题:" + properties.getProperty("app.theme.class"));
}
} catch (Exception ex) {
ex.printStackTrace();
log.error("Failed to initialize LaF !!!!!!!! \n" + ex.getMessage());
}
UIManager.put("TextComponent.arc", 5);
Expand All @@ -112,7 +166,7 @@ private static Properties loadProperties() {
assert appIn != null;
Files.copy(appIn, Path.of(AppConfig.getPropertiesPath()));
} catch (IOException e) {
e.printStackTrace();
log.error("配置初始化异常:" + e.getMessage());
}
}

Expand All @@ -123,7 +177,7 @@ private static Properties loadProperties() {
assert logIn != null;
Files.copy(logIn, Path.of(AppConfig.getWorkPath() + "/log4j.properties"));
} catch (IOException e) {
e.printStackTrace();
log.error("初始化日志配置异常:" + e.getMessage());
}
}

Expand Down Expand Up @@ -166,13 +220,13 @@ private static void initSystemTray() {
try {
image = ImageIO.read(Objects.requireNonNull(App.class.getClassLoader().getResource("icon.png")));
} catch (IOException e) {
e.printStackTrace();
log.error("托盘图标加载异常:" + e.getMessage());
}
assert image != null;
TrayIcon trayIcon = new TrayIcon(image, "ultimate-cube");
trayIcon.setImageAutoSize(true);
// 设置鼠标提示
trayIcon.setToolTip("My ultimate-cube");
trayIcon.setToolTip("ultimate-cube");
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Expand Down