├── README.assets
├── img.png
├── image-20240406180609618.png
└── image-20240421230001329.png
├── .gitignore
├── README.md
├── src
└── main
│ ├── java
│ └── cn
│ │ └── kkbo
│ │ └── dicttools
│ │ ├── HelloApplication.java
│ │ └── HelloController.java
│ └── resources
│ └── cn
│ └── kkbo
│ └── dicttools
│ └── hello-view.fxml
├── pom.xml
├── mvnw.cmd
└── mvnw
/README.assets/img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kkbo8005/dicttools/HEAD/README.assets/img.png
--------------------------------------------------------------------------------
/README.assets/image-20240406180609618.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kkbo8005/dicttools/HEAD/README.assets/image-20240406180609618.png
--------------------------------------------------------------------------------
/README.assets/image-20240421230001329.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kkbo8005/dicttools/HEAD/README.assets/image-20240421230001329.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 |
7 |
8 | ### IntelliJ /IDEA ###
9 | .idea/
10 | .idea/modules.xml
11 | .idea/jarRepositories.xml
12 | .idea/compiler.xml
13 | .idea/libraries/
14 | *.iws
15 | *.iml
16 | *.ipr
17 |
18 | ### Eclipse ###
19 | .apt_generated
20 | .classpath
21 | .factorypath
22 | .project
23 | .settings
24 | .springBeans
25 | .sts4-cache
26 |
27 | ### NetBeans ###
28 | /nbproject/private/
29 | /nbbuild/
30 | /dist/
31 | /nbdist/
32 | /.nb-gradle/
33 | build/
34 | !**/src/main/**/build/
35 | !**/src/test/**/build/
36 |
37 | .mvn/
38 |
39 | ### VS Code ###
40 | .vscode/
41 |
42 | ### Mac OS ###
43 | .DS_Storeß
44 |
45 | .gitignore
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | **本工具不存在任何的社工库信息的采集及贩卖,任何利用本软件宣传或则利用的违法事情与本作者无关,请立即删除!**
3 |
4 | **本工具仅供安全测试人员运用于授权测试, 禁止用于未授权测试, 违者责任自负。**
5 |
6 |
7 | ## 简介
8 |
9 |
10 |
11 | 该工具是使用javaFX开发的基于信息收集进行组合生成密码字典的工具,可以快速组成密码字典。
12 |
13 |
14 |
15 | ## 使用说明
16 |
17 |
18 | 直接下载releases版本即可
19 |
20 | **使用JDK8启动,命令如下:**
21 |
22 | ```
23 | java -jar dicttools-1.0-SNAPSHOT.jar
24 | ```
25 | 
26 |
27 | ## 免责声明
28 |
29 |
30 |
31 | 该开源工具是由作者按照开源许可证发布的,仅供个人学习和研究使用。作者不对您使用该工具所产生的任何后果负任何法律责任。
32 |
33 | ## 特别鸣谢
34 |
35 | 本工具开发过程中参考过网上的大佬的文章,在此表示感谢!
36 |
37 | 特别感谢**长风安全(sik)**、**湘安无事-湘南第一深情** ,对于工具的完善提供了很多建议和帮助。大家多多关注他们的公众号与知识星球。
38 |
39 | 更多完善建议和技术交流可以加v:**kkbo680** ,谢谢。
40 |
41 | 
42 |
43 | 
--------------------------------------------------------------------------------
/src/main/java/cn/kkbo/dicttools/HelloApplication.java:
--------------------------------------------------------------------------------
1 | package cn.kkbo.dicttools;
2 |
3 | import javafx.application.Application;
4 | import javafx.fxml.FXMLLoader;
5 | import javafx.scene.Scene;
6 | import javafx.stage.Stage;
7 |
8 | import java.io.IOException;
9 |
10 | /**
11 | * @author kkbo
12 | * @email kkbo8005@gmail.com
13 | */
14 | public class HelloApplication extends Application {
15 | @Override
16 | public void start(Stage stage) throws IOException {
17 | FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
18 | Scene scene = new Scene(fxmlLoader.load(), 1039, 890);
19 | stage.setTitle("kkbo密码字典生成工具,by:kkbo8005@gmail.com");
20 | stage.setScene(scene);
21 | stage.show();
22 | }
23 |
24 | public static void main(String[] args) {
25 | launch();
26 | }
27 | }
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | cn.kkbo
8 | dicttools
9 | 1.1-SNAPSHOT
10 | dicttools1.1
11 |
12 |
13 | UTF-8
14 | 5.9.1
15 | 1.8
16 | 1.8
17 | 1.8
18 | 1.8
19 |
20 |
21 |
22 |
23 | org.openjfx
24 | javafx-controls
25 | 17.0.2
26 |
27 |
28 | org.openjfx
29 | javafx-fxml
30 | 17.0.2
31 |
32 |
33 |
34 | org.junit.jupiter
35 | junit-jupiter-api
36 | ${junit.version}
37 | test
38 |
39 |
40 | org.junit.jupiter
41 | junit-jupiter-engine
42 | ${junit.version}
43 | test
44 |
45 |
46 |
47 |
48 |
49 |
50 | org.apache.maven.plugins
51 | maven-jar-plugin
52 |
53 |
54 |
55 |
56 | cn.kkbo.dicttools.HelloApplication
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 |
21 | @REM ----------------------------------------------------------------------------
22 | @REM Maven Start Up Batch script
23 | @REM
24 | @REM Required ENV vars:
25 | @REM JAVA_HOME - location of a JDK home dir
26 | @REM
27 | @REM Optional ENV vars
28 | @REM M2_HOME - location of maven2's installed home dir
29 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
30 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
31 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | @REM e.g. to debug Maven itself, use
33 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | @REM ----------------------------------------------------------------------------
36 |
37 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
38 | @echo off
39 | @REM set title of command window
40 | title %0
41 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
42 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
43 |
44 | @REM set %HOME% to equivalent of $HOME
45 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
46 |
47 | @REM Execute a user defined script before this one
48 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
49 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
50 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
51 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
52 | :skipRcPre
53 |
54 | @setlocal
55 |
56 | set ERROR_CODE=0
57 |
58 | @REM To isolate internal variables from possible post scripts, we use another setlocal
59 | @setlocal
60 |
61 | @REM ==== START VALIDATION ====
62 | if not "%JAVA_HOME%" == "" goto OkJHome
63 |
64 | echo.
65 | echo Error: JAVA_HOME not found in your environment. >&2
66 | echo Please set the JAVA_HOME variable in your environment to match the >&2
67 | echo location of your Java installation. >&2
68 | echo.
69 | goto error
70 |
71 | :OkJHome
72 | if exist "%JAVA_HOME%\bin\java.exe" goto init
73 |
74 | echo.
75 | echo Error: JAVA_HOME is set to an invalid directory. >&2
76 | echo JAVA_HOME = "%JAVA_HOME%" >&2
77 | echo Please set the JAVA_HOME variable in your environment to match the >&2
78 | echo location of your Java installation. >&2
79 | echo.
80 | goto error
81 |
82 | @REM ==== END VALIDATION ====
83 |
84 | :init
85 |
86 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
87 | @REM Fallback to current working directory if not found.
88 |
89 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
90 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
91 |
92 | set EXEC_DIR=%CD%
93 | set WDIR=%EXEC_DIR%
94 | :findBaseDir
95 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
96 | cd ..
97 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
98 | set WDIR=%CD%
99 | goto findBaseDir
100 |
101 | :baseDirFound
102 | set MAVEN_PROJECTBASEDIR=%WDIR%
103 | cd "%EXEC_DIR%"
104 | goto endDetectBaseDir
105 |
106 | :baseDirNotFound
107 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
108 | cd "%EXEC_DIR%"
109 |
110 | :endDetectBaseDir
111 |
112 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
113 |
114 | @setlocal EnableExtensions EnableDelayedExpansion
115 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
116 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
117 |
118 | :endReadAdditionalConfig
119 |
120 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
121 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
123 |
124 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
125 |
126 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
127 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
128 | )
129 |
130 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
131 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
132 | if exist %WRAPPER_JAR% (
133 | if "%MVNW_VERBOSE%" == "true" (
134 | echo Found %WRAPPER_JAR%
135 | )
136 | ) else (
137 | if not "%MVNW_REPOURL%" == "" (
138 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
139 | )
140 | if "%MVNW_VERBOSE%" == "true" (
141 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
142 | echo Downloading from: %DOWNLOAD_URL%
143 | )
144 |
145 | powershell -Command "&{"^
146 | "$webclient = new-object System.Net.WebClient;"^
147 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
148 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
149 | "}"^
150 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
151 | "}"
152 | if "%MVNW_VERBOSE%" == "true" (
153 | echo Finished downloading %WRAPPER_JAR%
154 | )
155 | )
156 | @REM End of extension
157 |
158 | @REM Provide a "standardized" way to retrieve the CLI args that will
159 | @REM work with both Windows and non-Windows executions.
160 | set MAVEN_CMD_LINE_ARGS=%*
161 |
162 | %MAVEN_JAVA_EXE% ^
163 | %JVM_CONFIG_MAVEN_PROPS% ^
164 | %MAVEN_OPTS% ^
165 | %MAVEN_DEBUG_OPTS% ^
166 | -classpath %WRAPPER_JAR% ^
167 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
168 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
169 | if ERRORLEVEL 1 goto error
170 | goto end
171 |
172 | :error
173 | set ERROR_CODE=1
174 |
175 | :end
176 | @endlocal & set ERROR_CODE=%ERROR_CODE%
177 |
178 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
179 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
180 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
181 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
182 | :skipRcPost
183 |
184 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
185 | if "%MAVEN_BATCH_PAUSE%"=="on" pause
186 |
187 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
188 |
189 | cmd /C exit /B %ERROR_CODE%
190 |
--------------------------------------------------------------------------------
/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | #
20 | # ----------------------------------------------------------------------------
21 |
22 | # ----------------------------------------------------------------------------
23 | # Maven Start Up Batch script
24 | #
25 | # Required ENV vars:
26 | # ------------------
27 | # JAVA_HOME - location of a JDK home dir
28 | #
29 | # Optional ENV vars
30 | # -----------------
31 | # M2_HOME - location of maven2's installed home dir
32 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
33 | # e.g. to debug Maven itself, use
34 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
35 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
36 | # ----------------------------------------------------------------------------
37 |
38 | if [ -z "$MAVEN_SKIP_RC" ] ; then
39 |
40 | if [ -f /usr/local/etc/mavenrc ] ; then
41 | . /usr/local/etc/mavenrc
42 | fi
43 |
44 | if [ -f /etc/mavenrc ] ; then
45 | . /etc/mavenrc
46 | fi
47 |
48 | if [ -f "$HOME/.mavenrc" ] ; then
49 | . "$HOME/.mavenrc"
50 | fi
51 |
52 | fi
53 |
54 | # OS specific support. $var _must_ be set to either true or false.
55 | cygwin=false;
56 | darwin=false;
57 | mingw=false
58 | case "`uname`" in
59 | CYGWIN*) cygwin=true ;;
60 | MINGW*) mingw=true;;
61 | Darwin*) darwin=true
62 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
63 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
64 | if [ -z "$JAVA_HOME" ]; then
65 | if [ -x "/usr/libexec/java_home" ]; then
66 | export JAVA_HOME="`/usr/libexec/java_home`"
67 | else
68 | export JAVA_HOME="/Library/Java/Home"
69 | fi
70 | fi
71 | ;;
72 | esac
73 |
74 | if [ -z "$JAVA_HOME" ] ; then
75 | if [ -r /etc/gentoo-release ] ; then
76 | JAVA_HOME=`java-config --jre-home`
77 | fi
78 | fi
79 |
80 | if [ -z "$M2_HOME" ] ; then
81 | ## resolve links - $0 may be a link to maven's home
82 | PRG="$0"
83 |
84 | # need this for relative symlinks
85 | while [ -h "$PRG" ] ; do
86 | ls=`ls -ld "$PRG"`
87 | link=`expr "$ls" : '.*-> \(.*\)$'`
88 | if expr "$link" : '/.*' > /dev/null; then
89 | PRG="$link"
90 | else
91 | PRG="`dirname "$PRG"`/$link"
92 | fi
93 | done
94 |
95 | saveddir=`pwd`
96 |
97 | M2_HOME=`dirname "$PRG"`/..
98 |
99 | # make it fully qualified
100 | M2_HOME=`cd "$M2_HOME" && pwd`
101 |
102 | cd "$saveddir"
103 | # echo Using m2 at $M2_HOME
104 | fi
105 |
106 | # For Cygwin, ensure paths are in UNIX format before anything is touched
107 | if $cygwin ; then
108 | [ -n "$M2_HOME" ] &&
109 | M2_HOME=`cygpath --unix "$M2_HOME"`
110 | [ -n "$JAVA_HOME" ] &&
111 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
112 | [ -n "$CLASSPATH" ] &&
113 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
114 | fi
115 |
116 | # For Mingw, ensure paths are in UNIX format before anything is touched
117 | if $mingw ; then
118 | [ -n "$M2_HOME" ] &&
119 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
120 | [ -n "$JAVA_HOME" ] &&
121 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
122 | fi
123 |
124 | if [ -z "$JAVA_HOME" ]; then
125 | javaExecutable="`which javac`"
126 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
127 | # readlink(1) is not available as standard on Solaris 10.
128 | readLink=`which readlink`
129 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
130 | if $darwin ; then
131 | javaHome="`dirname \"$javaExecutable\"`"
132 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
133 | else
134 | javaExecutable="`readlink -f \"$javaExecutable\"`"
135 | fi
136 | javaHome="`dirname \"$javaExecutable\"`"
137 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
138 | JAVA_HOME="$javaHome"
139 | export JAVA_HOME
140 | fi
141 | fi
142 | fi
143 |
144 | if [ -z "$JAVACMD" ] ; then
145 | if [ -n "$JAVA_HOME" ] ; then
146 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
147 | # IBM's JDK on AIX uses strange locations for the executables
148 | JAVACMD="$JAVA_HOME/jre/sh/java"
149 | else
150 | JAVACMD="$JAVA_HOME/bin/java"
151 | fi
152 | else
153 | JAVACMD="`\\unset -f command; \\command -v java`"
154 | fi
155 | fi
156 |
157 | if [ ! -x "$JAVACMD" ] ; then
158 | echo "Error: JAVA_HOME is not defined correctly." >&2
159 | echo " We cannot execute $JAVACMD" >&2
160 | exit 1
161 | fi
162 |
163 | if [ -z "$JAVA_HOME" ] ; then
164 | echo "Warning: JAVA_HOME environment variable is not set."
165 | fi
166 |
167 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
168 |
169 | # traverses directory structure from process work directory to filesystem root
170 | # first directory with .mvn subdirectory is considered project base directory
171 | find_maven_basedir() {
172 |
173 | if [ -z "$1" ]
174 | then
175 | echo "Path not specified to find_maven_basedir"
176 | return 1
177 | fi
178 |
179 | basedir="$1"
180 | wdir="$1"
181 | while [ "$wdir" != '/' ] ; do
182 | if [ -d "$wdir"/.mvn ] ; then
183 | basedir=$wdir
184 | break
185 | fi
186 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
187 | if [ -d "${wdir}" ]; then
188 | wdir=`cd "$wdir/.."; pwd`
189 | fi
190 | # end of workaround
191 | done
192 | echo "${basedir}"
193 | }
194 |
195 | # concatenates all lines of a file
196 | concat_lines() {
197 | if [ -f "$1" ]; then
198 | echo "$(tr -s '\n' ' ' < "$1")"
199 | fi
200 | }
201 |
202 | BASE_DIR=`find_maven_basedir "$(pwd)"`
203 | if [ -z "$BASE_DIR" ]; then
204 | exit 1;
205 | fi
206 |
207 | ##########################################################################################
208 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
209 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
210 | ##########################################################################################
211 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
212 | if [ "$MVNW_VERBOSE" = true ]; then
213 | echo "Found .mvn/wrapper/maven-wrapper.jar"
214 | fi
215 | else
216 | if [ "$MVNW_VERBOSE" = true ]; then
217 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
218 | fi
219 | if [ -n "$MVNW_REPOURL" ]; then
220 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
221 | else
222 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
223 | fi
224 | while IFS="=" read key value; do
225 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
226 | esac
227 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
228 | if [ "$MVNW_VERBOSE" = true ]; then
229 | echo "Downloading from: $jarUrl"
230 | fi
231 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
232 | if $cygwin; then
233 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
234 | fi
235 |
236 | if command -v wget > /dev/null; then
237 | if [ "$MVNW_VERBOSE" = true ]; then
238 | echo "Found wget ... using wget"
239 | fi
240 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
241 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
242 | else
243 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
244 | fi
245 | elif command -v curl > /dev/null; then
246 | if [ "$MVNW_VERBOSE" = true ]; then
247 | echo "Found curl ... using curl"
248 | fi
249 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
250 | curl -o "$wrapperJarPath" "$jarUrl" -f
251 | else
252 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
253 | fi
254 |
255 | else
256 | if [ "$MVNW_VERBOSE" = true ]; then
257 | echo "Falling back to using Java to download"
258 | fi
259 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
260 | # For Cygwin, switch paths to Windows format before running javac
261 | if $cygwin; then
262 | javaClass=`cygpath --path --windows "$javaClass"`
263 | fi
264 | if [ -e "$javaClass" ]; then
265 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
266 | if [ "$MVNW_VERBOSE" = true ]; then
267 | echo " - Compiling MavenWrapperDownloader.java ..."
268 | fi
269 | # Compiling the Java class
270 | ("$JAVA_HOME/bin/javac" "$javaClass")
271 | fi
272 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
273 | # Running the downloader
274 | if [ "$MVNW_VERBOSE" = true ]; then
275 | echo " - Running MavenWrapperDownloader.java ..."
276 | fi
277 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
278 | fi
279 | fi
280 | fi
281 | fi
282 | ##########################################################################################
283 | # End of extension
284 | ##########################################################################################
285 |
286 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
287 | if [ "$MVNW_VERBOSE" = true ]; then
288 | echo $MAVEN_PROJECTBASEDIR
289 | fi
290 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
291 |
292 | # For Cygwin, switch paths to Windows format before running java
293 | if $cygwin; then
294 | [ -n "$M2_HOME" ] &&
295 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
296 | [ -n "$JAVA_HOME" ] &&
297 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
298 | [ -n "$CLASSPATH" ] &&
299 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
300 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
301 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
302 | fi
303 |
304 | # Provide a "standardized" way to retrieve the CLI args that will
305 | # work with both Windows and non-Windows executions.
306 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
307 | export MAVEN_CMD_LINE_ARGS
308 |
309 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
310 |
311 | exec "$JAVACMD" \
312 | $MAVEN_OPTS \
313 | $MAVEN_DEBUG_OPTS \
314 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
315 | "-Dmaven.home=${M2_HOME}" \
316 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
317 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
318 |
--------------------------------------------------------------------------------
/src/main/resources/cn/kkbo/dicttools/hello-view.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
58 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
--------------------------------------------------------------------------------
/src/main/java/cn/kkbo/dicttools/HelloController.java:
--------------------------------------------------------------------------------
1 | package cn.kkbo.dicttools;
2 |
3 | import javafx.fxml.FXML;
4 | import javafx.scene.control.*;
5 | import javafx.scene.layout.VBox;
6 | import javafx.stage.FileChooser;
7 | import javafx.stage.Stage;
8 |
9 | import java.io.BufferedWriter;
10 | import java.io.File;
11 | import java.nio.file.Files;
12 | import java.nio.file.Paths;
13 | import java.util.ArrayList;
14 | import java.util.Collections;
15 | import java.util.List;
16 |
17 | public class HelloController {
18 |
19 | @FXML
20 | private TextField birthday;
21 |
22 | @FXML
23 | private TextArea Linkkey;
24 |
25 | @FXML
26 | private TextArea year;
27 |
28 | @FXML
29 | private TextField dictlenStart;
30 | @FXML
31 | private TextField dictlenEnd;
32 |
33 | @FXML
34 | private TextField systemName;
35 |
36 | @FXML
37 | private TextField company;
38 |
39 | @FXML
40 | private VBox gz2;
41 |
42 | @FXML
43 | private VBox gz1;
44 |
45 | @FXML
46 | private TextField qq;
47 |
48 | @FXML
49 | private VBox gz3;
50 |
51 | @FXML
52 | private TextField UserName;
53 |
54 | @FXML
55 | private ScrollPane gz1scroll;
56 | @FXML
57 | private ScrollPane gz3scroll;
58 | @FXML
59 | private TextArea Commonphrases;
60 |
61 | @FXML
62 | private TextField wife;
63 |
64 | @FXML
65 | private TextField workNumber;
66 |
67 | @FXML
68 | private TextField phone;
69 |
70 |
71 | @FXML
72 | private TextField idcard;
73 |
74 | @FXML
75 | private TextField domain;
76 |
77 | @FXML
78 | private TextField babyName;
79 |
80 | @FXML
81 | private TextArea dictlist;
82 |
83 | @FXML
84 | private TextField UserNameEn;
85 |
86 | @FXML
87 | private TextArea oldAccount;
88 |
89 |
90 | @FXML
91 | private Label status;
92 |
93 | private final List str1 = new ArrayList<>();
94 | private final List str2 = new ArrayList<>();
95 | private final List str3 = new ArrayList<>();
96 |
97 | private void GetSelectValue(VBox box,List strlist)
98 | {
99 | box.getChildren().forEach(item->{
100 | CheckBox cbox = (CheckBox) item;
101 | if(cbox.isSelected()) {
102 | InitList(strlist,cbox.getText());
103 | }
104 | });
105 | }
106 | @FXML
107 | protected void onHelloButtonClick() {
108 |
109 | //清空待生成的字符串书组
110 | str1.clear();
111 | str2.clear();
112 | str3.clear();
113 | GetSelectValue(gz1,str1);
114 | GetSelectValue(gz2,str2);
115 | GetSelectValue(gz3,str3);
116 | if(str1.isEmpty()&&str2.isEmpty()&&str3.isEmpty())
117 | {
118 | AlertDlg("请从密码规则中选择规则以生成密码字典");
119 | return ;
120 | }
121 |
122 |
123 |
124 | status.setText("字典生成中....");
125 |
126 |
127 | List> dimensionValues = new ArrayList<>();
128 | if(!str1.isEmpty()) {
129 | dimensionValues.add(str1);
130 | }
131 | if(!str2.isEmpty()) {
132 | dimensionValues.add(str2);
133 | }
134 | if(!str3.isEmpty()) {
135 | dimensionValues.add(str3);
136 | }
137 | List descartes = descartes(dimensionValues, 0, "", new ArrayList<>());
138 | int i = 0;
139 | for (String str :descartes) {
140 | if(str.length()>Integer.parseInt(dictlenStart.getText())&&str.length()<=Integer.parseInt(dictlenEnd.getText())) {
141 | dictlist.setText(str + "\n" + dictlist.getText());
142 | i++;
143 | }
144 | }
145 | status.setText("已按以上规则组成生成"+i+"个密码");
146 | }
147 | private List descartes(List> dimensionValues, int position, String originCode,
148 | List result) {
149 | // if (CollectionUtils.isEmpty(dimensionValues) || position >= dimensionValues.size()) {
150 | // return result;
151 | // }
152 | // 获取指定行数据
153 | List rowValue = dimensionValues.get(position);
154 | for (String code : rowValue) {
155 | // 第一行不用拼接,直接copy,第二行开始需要在末尾拼接code
156 | String resultCode = position == 0 ? code : originCode + "" + code;
157 | // 如果当前位置是最后一行,则可以添加最终resultCode构建结果
158 | if (position == dimensionValues.size() - 1) {
159 | result.add(resultCode);
160 | } else {
161 | // 否则进入下一行
162 | descartes(dimensionValues, position + 1, resultCode, result);
163 | }
164 | }
165 | return result;
166 | }
167 | @FXML
168 | void onClearDictClick() {
169 | dictlist.setText("");
170 | status.setText("");
171 | }
172 |
173 | public void AlertDlg(String alertMsg) {
174 | Alert alert = new Alert(Alert.AlertType.INFORMATION);
175 |
176 | alert.setTitle("提示");
177 | alert.setHeaderText(null);
178 | alert.setContentText(alertMsg);
179 | alert.showAndWait();
180 | }
181 |
182 | private void CheckValue(String textboxName,CheckBox cbox)
183 | {
184 | switch (textboxName)
185 | {
186 | case "姓(英文)":
187 | if(UserName.getText().isEmpty())
188 | {
189 | AlertDlg("姓(英文)不能位空");
190 | UserName.requestFocus();
191 | cbox.setSelected(false);
192 | }
193 | break;
194 | case "名(英文)":
195 | if(UserNameEn.getText().isEmpty())
196 | {
197 | AlertDlg("名(英文)不能位空");
198 | UserNameEn.requestFocus();
199 | cbox.setSelected(false);
200 | }
201 | break;
202 | case "生日":
203 | if(birthday.getText().isEmpty())
204 | {
205 | AlertDlg("生日不能位空");
206 | birthday.requestFocus();
207 | cbox.setSelected(false);
208 | }
209 | break;
210 | case "手机号码":
211 | if(phone.getText().isEmpty())
212 | {
213 | AlertDlg("手机号码不能位空");
214 | phone.requestFocus();
215 | cbox.setSelected(false);
216 | }
217 | break;
218 | case "qq":
219 | if(qq.getText().isEmpty())
220 | {
221 | AlertDlg("qq号码不能位空");
222 | qq.requestFocus();
223 | cbox.setSelected(false);
224 | }
225 | break;
226 | case "身份证后6位":
227 | if(idcard.getText().isEmpty())
228 | {
229 | AlertDlg("身份证后6位不能位空");
230 | idcard.requestFocus();
231 | cbox.setSelected(false);
232 | }
233 | break;
234 | case "配偶姓名":
235 | if(wife.getText().isEmpty())
236 | {
237 | AlertDlg("配偶姓名不能位空");
238 | wife.requestFocus();
239 | cbox.setSelected(false);
240 | }
241 | break;
242 | case "子女姓名":
243 | if(babyName.getText().isEmpty())
244 | {
245 | AlertDlg("子女姓名不能位空");
246 | babyName.requestFocus();
247 | cbox.setSelected(false);
248 | }
249 | break;
250 | case "公司名称":
251 | if(company.getText().isEmpty())
252 | {
253 | AlertDlg("公司名称不能位空");
254 | company.requestFocus();
255 | cbox.setSelected(false);
256 | }
257 | break;
258 | case "工号":
259 | if(workNumber.getText().isEmpty())
260 | {
261 | AlertDlg("工号不能位空");
262 | workNumber.requestFocus();
263 | cbox.setSelected(false);
264 | }
265 | break;
266 | case "域名":
267 | if(domain.getText().isEmpty())
268 | {
269 | AlertDlg("域名不能位空");
270 | domain.requestFocus();
271 | cbox.setSelected(false);
272 | }
273 | break;
274 | case "系统名":
275 | if(systemName.getText().isEmpty())
276 | {
277 | AlertDlg("系统名不能位空");
278 | systemName.requestFocus();
279 | cbox.setSelected(false);
280 | }
281 | break;
282 | case "连接符":
283 | if(Linkkey.getText().isEmpty())
284 | {
285 | AlertDlg("系统名不能位空");
286 | Linkkey.requestFocus();
287 | cbox.setSelected(false);
288 | }
289 | break;
290 | case "年份":
291 | if(year.getText().isEmpty())
292 | {
293 | AlertDlg("年份不能位空");
294 | year.requestFocus();
295 | cbox.setSelected(false);
296 | }
297 | break;
298 | case "常用词组":
299 | if(Commonphrases.getText().isEmpty())
300 | {
301 | AlertDlg("常用词组不能位空");
302 | Commonphrases.requestFocus();
303 | cbox.setSelected(false);
304 | }
305 | break;
306 | case "曾用账号":
307 | if(oldAccount.getText().isEmpty())
308 | {
309 | AlertDlg("曾用账号不能位空");
310 | oldAccount.requestFocus();
311 | cbox.setSelected(false);
312 | }
313 | break;
314 | default:
315 | break;
316 | }
317 | }
318 | private void InitList(List strlist,String textboxName)
319 | {
320 | switch (textboxName)
321 | {
322 | case "姓(英文)":
323 | strlist.add(UserName.getText());
324 | break;
325 | case "名(英文)":
326 | strlist.add(UserNameEn.getText());
327 | break;
328 | case "生日":
329 | strlist.add(birthday.getText());
330 | break;
331 | case "手机号码":
332 | strlist.add(phone.getText());
333 | break;
334 | case "qq":
335 | strlist.add(qq.getText());
336 | break;
337 | case "身份证后6位":
338 | strlist.add(idcard.getText());
339 | break;
340 | case "配偶姓名":
341 | strlist.add(wife.getText());
342 | break;
343 | case "子女姓名":
344 | strlist.add(babyName.getText());
345 | break;
346 | case "公司名称":
347 | strlist.add(company.getText());
348 | break;
349 | case "工号":
350 | strlist.add(workNumber.getText());
351 | break;
352 | case "域名":
353 | strlist.add(domain.getText());
354 | break;
355 | case "系统名":
356 | strlist.add(systemName.getText());
357 | break;
358 | case "连接符":
359 | Collections.addAll(strlist, Linkkey.getText().split("\n"));
360 | break;
361 | case "年份":
362 | Collections.addAll(strlist, year.getText().split("\n"));
363 | break;
364 | case "常用词组":
365 | Collections.addAll(strlist, Commonphrases.getText().split("\n"));
366 | break;
367 | case "曾用账号":
368 | Collections.addAll(strlist, oldAccount.getText().split("\n"));
369 | break;
370 | default:
371 | break;
372 | }
373 | }
374 |
375 | private void CheckBoxBind(VBox box)
376 | {
377 | box.getChildren().forEach(item->{
378 | CheckBox cbox = (CheckBox)item;
379 | cbox.setOnAction((event) -> {
380 | if (cbox.isSelected()) {
381 | CheckValue(cbox.getText(),cbox);
382 | //System.out.println("选项被选中!");
383 | } else {
384 | //System.out.println("选项未被选中!");
385 | }
386 | });
387 | });
388 | }
389 | private void CheckBoxClearSelect(VBox box)
390 | {
391 | box.getChildren().forEach(item->{
392 | CheckBox cbox = (CheckBox)item;
393 | if(cbox.isSelected())
394 | {
395 | cbox.setSelected(false);
396 | }
397 | });
398 | }
399 | @FXML
400 | void initialize() {
401 | CheckBoxBind(gz1);
402 | CheckBoxBind(gz2);
403 | CheckBoxBind(gz3);
404 | gz1scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
405 | gz3scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
406 | }
407 |
408 | @FXML
409 | void oninitTextClick() {
410 | UserName.setText("");
411 | UserNameEn.setText("");
412 | birthday.setText("");
413 | phone.setText("");
414 | qq.setText("");
415 | idcard.setText("");
416 | wife.setText("");
417 | babyName.setText("");
418 | company.setText("");
419 | workNumber.setText("");
420 | domain.setText("");
421 | systemName.setText("");
422 | oldAccount.setText("");
423 | CheckBoxClearSelect(gz1);
424 | CheckBoxClearSelect(gz2);
425 | CheckBoxClearSelect(gz3);
426 | dictlist.setText("");
427 | status.setText("");
428 | }
429 | @FXML
430 | void onSaveDictClick() {
431 |
432 | if(dictlist.getText().isEmpty())
433 | {
434 | AlertDlg("还未生成密码字典!");
435 | }else {
436 | FileChooser fileChooser = new FileChooser();
437 | FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("Text (*.txt)", "*.txt");
438 | fileChooser.getExtensionFilters().add(extFilter);
439 | fileChooser.setInitialFileName("results.txt");
440 | fileChooser.setTitle("密码字典保存");
441 | Stage s = new Stage();
442 | File file = fileChooser.showSaveDialog(s);
443 | if(file==null) {return;}
444 | String exportFilePath = file.getAbsolutePath().replaceAll(".txt", "")+".txt";
445 | //...此处省略客户端向服务器请求,并在服务器端直接下载到本地,建议用流方式,不易内存溢出。
446 | File savefile = new File(exportFilePath);
447 | // 指定要保存的文件名及路径
448 | try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(savefile.toURI()))) {
449 | writer.write(dictlist.getText());
450 | AlertDlg("字典文件保存成功!");
451 | } catch (Exception e) {
452 | System.out.println("保存文件出错 ");
453 | }
454 | }
455 | }
456 |
457 | }
--------------------------------------------------------------------------------