├── .gitignore ├── .gradle └── 2.5 │ └── taskArtifacts │ ├── cache.properties │ ├── cache.properties.lock │ ├── fileHashes.bin │ ├── fileSnapshots.bin │ ├── outputFileStates.bin │ └── taskArtifacts.bin ├── LICENSE ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java └── net │ └── letshackit │ └── chromeforensics │ ├── core │ ├── ChromeForensics.java │ ├── OSType.java │ ├── Utils.java │ ├── artefacts │ │ ├── VisitedLinkParser.java │ │ └── package-info.java │ ├── db │ │ ├── BaseDbModel.java │ │ ├── DBConnectionPool.java │ │ ├── SQLiteDbModel.java │ │ └── package-info.java │ ├── export │ │ ├── ExportType.java │ │ ├── IExporter.java │ │ └── TSVExport.java │ └── package-info.java │ └── gui │ ├── ChromeForensicsGui.java │ ├── ExportDialog.java │ ├── MainMenuBar.java │ ├── MainPanel.java │ ├── package-info.java │ └── tools │ ├── FileViewer.java │ ├── SQLiteDataBrowser.java │ └── package-info.java └── resources ├── JTattoo-1.6.11.jar ├── images ├── about.png ├── about_small.png ├── autosearch.png ├── autosearch_small.png ├── bing_small.png ├── chrome_forensics.png ├── clear_small.png ├── csv.png ├── csv_small.png ├── databrowse_small.png ├── duckduckgo_small.png ├── exit.png ├── exit_small.png ├── filter_small.png ├── google_small.png ├── help.png ├── help_small.png ├── html.png ├── html_small.png ├── loaddata.png ├── loaddata_small.png ├── searchengine_small.png ├── sql_small.png └── yahoo_small.png └── log4j2.xml /.gitignore: -------------------------------------------------------------------------------- 1 | ### Java template 2 | *.class 3 | 4 | # Mobile Tools for Java (J2ME) 5 | .mtj.tmp/ 6 | 7 | # Package Files # 8 | *.war 9 | *.ear 10 | 11 | # Thumbs.db file 12 | Thumbs.db 13 | 14 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 15 | hs_err_pid* 16 | 17 | # Created by .ignore support plugin (hsz.mobi) 18 | /.nb-gradle/ 19 | /build/ -------------------------------------------------------------------------------- /.gradle/2.5/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 29 21:13:00 IST 2016 2 | -------------------------------------------------------------------------------- /.gradle/2.5/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/.gradle/2.5/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /.gradle/2.5/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/.gradle/2.5/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/2.5/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/.gradle/2.5/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /.gradle/2.5/taskArtifacts/outputFileStates.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/.gradle/2.5/taskArtifacts/outputFileStates.bin -------------------------------------------------------------------------------- /.gradle/2.5/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/.gradle/2.5/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder) 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #ChromeForensics 2 | 3 | A tool to perform automated forensic analysis of Chrome Browser. 4 | 5 | ## Development Stopped. New Repository will be created. 6 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | group 'net.letshackit' 2 | 3 | apply plugin: 'java' 4 | apply plugin: 'application' 5 | 6 | mainClassName = 'net.letshackit.chromeforensics.gui.ChromeForensicsGui' 7 | 8 | sourceCompatibility = 1.8 9 | targetCompatibility = 1.8 10 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 11 | 12 | task wrapper(type: Wrapper) { 13 | gradleVersion = '3.0' 14 | } 15 | 16 | jar { 17 | baseName = 'ChromeForensics' 18 | version = '1.0-alpha' 19 | manifest { 20 | attributes 'Main-Class': 'net.letshackit.chromeforensics.gui.ChromeForensicsGui' 21 | } 22 | } 23 | 24 | task fatJar(type: Jar) { 25 | manifest.from jar.manifest 26 | classifier = '1.0-alpha-fat' 27 | from { 28 | configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } 29 | } 30 | with jar 31 | } 32 | 33 | artifacts { 34 | archives fatJar 35 | } 36 | 37 | repositories { 38 | mavenCentral() 39 | } 40 | 41 | dependencies { 42 | runtime files('src/main/resources/JTattoo-1.6.11.jar') 43 | compile group: 'com.google.code.gson', name: 'gson', version: '2.3.1' 44 | compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.8.11.2' 45 | compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.5' 46 | compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.5' 47 | testCompile group: 'junit', name: 'junit', version: '4.12' 48 | } 49 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 26 22:49:32 IST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ChromeForensics' 2 | 3 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/ChromeForensics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core; 17 | 18 | import java.nio.file.Files; 19 | import java.nio.file.Path; 20 | import java.nio.file.Paths; 21 | import org.apache.logging.log4j.LogManager; 22 | import org.apache.logging.log4j.Logger; 23 | 24 | public final class ChromeForensics { 25 | 26 | /** 27 | * Essential System environment variables. 28 | */ 29 | private final String USER_HOME; 30 | private final String OS; 31 | private final String WINDOWS_VISTAUP_CHROME_DATAPATH; 32 | private final String WINDOWS_XP_CHROME_DATAPATH; 33 | private final String LINUX_CHROMIUM_DATAPATH; 34 | private final String LINUX_CHROME_DATAPATH; 35 | 36 | /** 37 | * Paths to Forensically important SQLite DB files or other files. 38 | */ 39 | private final String HISTORY_PATH; 40 | private final String LOGINDATA_PATH; 41 | private final String COOKIES_PATH; 42 | private final String WEBDATA_PATH; 43 | private final String TOPSITES_PATH; 44 | private final String EXTENSIONCOOKIES_PATH; 45 | private final String FAVICONS_PATH; 46 | private final String BOOKMARKS_PATH; 47 | private final String BOOKMARKSBAK_PATH; 48 | private final String PREFERENCES_PATH; 49 | private final String SECPREFERENCES_PATH; 50 | private final String VISITED_LINKS_PATH; 51 | 52 | final static Logger logger = LogManager.getLogger(ChromeForensics.class); 53 | 54 | public ChromeForensics() { 55 | USER_HOME = System.getProperty("user.home"); 56 | OS = System.getProperty("os.name"); 57 | WINDOWS_VISTAUP_CHROME_DATAPATH = "AppData/Local/Google/Chrome/User Data/Default"; 58 | WINDOWS_XP_CHROME_DATAPATH = "/Local Settings/Application Data/Google/Chrome/User Data/Default"; 59 | LINUX_CHROMIUM_DATAPATH = ".config/chromium/Default"; 60 | LINUX_CHROME_DATAPATH = ".config/google-chrome/Default"; 61 | 62 | assert getChromeDataPath() != null; 63 | 64 | HISTORY_PATH = Paths.get(getChromeDataPath().toString(), "History").toString(); 65 | LOGINDATA_PATH = Paths.get(getChromeDataPath().toString(), "History").toString(); 66 | COOKIES_PATH = Paths.get(getChromeDataPath().toString(), "Cookies").toString(); 67 | WEBDATA_PATH = Paths.get(getChromeDataPath().toString(), "Web Data").toString(); 68 | TOPSITES_PATH = Paths.get(getChromeDataPath().toString(), "Top Sites").toString(); 69 | EXTENSIONCOOKIES_PATH = Paths.get(getChromeDataPath().toString(), "Extension Cookies").toString(); 70 | FAVICONS_PATH = Paths.get(getChromeDataPath().toString(), "Favicons").toString(); 71 | BOOKMARKS_PATH = Paths.get(getChromeDataPath().toString(), "Bookmarks").toString(); 72 | BOOKMARKSBAK_PATH = Paths.get(getChromeDataPath().toString(), "Bookmarks.bak").toString(); 73 | PREFERENCES_PATH = Paths.get(getChromeDataPath().toString(), "Preferences").toString(); 74 | SECPREFERENCES_PATH = Paths.get(getChromeDataPath().toString(), "Secure Preferences").toString(); 75 | VISITED_LINKS_PATH = Paths.get(getChromeDataPath().toString(), "Visited Links").toString(); 76 | } 77 | 78 | /** 79 | * Returns default User Home depending on OS. 80 | * 81 | * @return returns User Home default to Operating System. 82 | */ 83 | public String getUserHome() { 84 | return USER_HOME; 85 | } 86 | 87 | /** 88 | * Returns the type of OS. Its type is 89 | * {@code net.letshackit.chromeforensics.core.OSType} 90 | * 91 | * @see net.letshackit.chromeforensics.core.OSType 92 | * @return Type of OS. 93 | */ 94 | public OSType getOSType() { 95 | switch (OS) { 96 | case "Windows 10": 97 | return OSType.WINDOWS_10; 98 | case "Windows 8.1": 99 | return OSType.WINDOWS_81; 100 | case "Windows 8": 101 | return OSType.WINDOWS_8; 102 | case "Windows 7": 103 | return OSType.WINDOWS_7; 104 | case "Windows Vista": 105 | return OSType.WINDOWS_VISTA; 106 | case "Windows XP": 107 | return OSType.WINDOWS_XP; 108 | case "Linux": 109 | return OSType.LINUX; 110 | default: 111 | return OSType.NOT_SUPPORTED; 112 | } 113 | } 114 | 115 | /** 116 | * Needs update 117 | * 118 | * @return 119 | */ 120 | public Path getChromeDataPath() { 121 | Path path; 122 | switch (getOSType()) { 123 | case WINDOWS_10: 124 | case WINDOWS_81: 125 | case WINDOWS_8: 126 | case WINDOWS_7: 127 | case WINDOWS_VISTA: 128 | path = Paths.get(USER_HOME, WINDOWS_VISTAUP_CHROME_DATAPATH); 129 | assert Files.exists(path) && Files.isDirectory(path); 130 | return path; 131 | case WINDOWS_XP: 132 | path = Paths.get(USER_HOME, WINDOWS_XP_CHROME_DATAPATH); 133 | assert Files.exists(path) && Files.isDirectory(path); 134 | return path; 135 | case LINUX: 136 | if (isChromeInstalled(OSType.LINUX)) { 137 | path = Paths.get(USER_HOME, LINUX_CHROME_DATAPATH); 138 | return path; 139 | } 140 | path = Paths.get(USER_HOME, LINUX_CHROMIUM_DATAPATH); 141 | assert Files.exists(path) && Files.isDirectory(path); 142 | return path; 143 | case NOT_SUPPORTED: 144 | break; 145 | } 146 | return null; 147 | } 148 | 149 | /** 150 | * 151 | * @param os 152 | * @return 153 | */ 154 | public boolean isChromeInstalled(OSType os) { 155 | if (os == OSType.LINUX) { 156 | return Files.exists(Paths.get(USER_HOME, LINUX_CHROME_DATAPATH)); 157 | } 158 | return false; 159 | } 160 | 161 | /** 162 | * 163 | * @return 164 | */ 165 | public String getHistoryDbPath() { 166 | return HISTORY_PATH; 167 | } 168 | 169 | } -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/OSType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core; 17 | 18 | public enum OSType { 19 | WINDOWS_SERVER3, 20 | WINDOWS_SERVER8, 21 | WINDOWS_SERVER12, 22 | WINDOWS_10, 23 | WINDOWS_81, 24 | WINDOWS_8, 25 | WINDOWS_7, 26 | WINDOWS_VISTA, 27 | WINDOWS_XP, 28 | LINUX, 29 | ANDROID, 30 | NOT_SUPPORTED, 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core; 17 | 18 | import java.io.File; 19 | import java.io.FileInputStream; 20 | import java.io.FileNotFoundException; 21 | import java.io.IOException; 22 | import java.net.URL; 23 | import java.nio.file.Files; 24 | import java.nio.file.Path; 25 | import java.nio.file.attribute.DosFileAttributes; 26 | import java.nio.file.attribute.FileTime; 27 | import java.nio.file.attribute.PosixFileAttributes; 28 | import java.nio.file.attribute.PosixFilePermissions; 29 | import java.text.DecimalFormat; 30 | import java.text.SimpleDateFormat; 31 | import java.util.Arrays; 32 | import java.util.LinkedHashMap; 33 | import java.util.Map; 34 | import java.util.TimeZone; 35 | import javax.swing.ImageIcon; 36 | 37 | public final class Utils { 38 | 39 | private static final int[] SQLITE_MAGIC_HEADER = { 40 | 0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00 41 | }; 42 | 43 | public Utils() { 44 | } 45 | 46 | public static String getOsName() { 47 | return System.getProperty("os.name"); 48 | } 49 | 50 | public static String getUserHome() { 51 | return System.getProperty("user.home"); 52 | } 53 | 54 | /** 55 | * This method is used to create an ImageIcon class of any image resource to set it to any Swing Components. 56 | * 57 | * @param path Path to image resource. 58 | * @param description description for the image icon 59 | * @return Returns an ImageIcon instance for the image sent. 60 | */ 61 | public static ImageIcon createImageIcon(String path, String description) { 62 | URL imgURL = Utils.class.getClassLoader().getResource(path); 63 | if (imgURL != null) { 64 | return new ImageIcon(imgURL, description); 65 | } else { 66 | System.err.println("Couldn't find file: " + path); 67 | return null; 68 | } 69 | } 70 | 71 | /** 72 | * Converts array of bytes to hex string. 73 | * 74 | * @param bytes Byte Array to be converted to Hex String. 75 | * @return Returns the hex string for {@code bytes} array. 76 | */ 77 | public static String byteArrayToHex(byte[] bytes) { 78 | StringBuilder sb = new StringBuilder(); 79 | for (int i = 0; i < bytes.length; i++) { 80 | sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16). 81 | substring(1)); 82 | } 83 | return sb.toString(); 84 | } 85 | 86 | /** 87 | * 88 | * @param dbPath 89 | * @return 90 | */ 91 | public static boolean isSQLiteDb(File dbPath) { 92 | return verifyFileHeader(dbPath, SQLITE_MAGIC_HEADER); 93 | } 94 | 95 | public static boolean verifyFileHeader(File file, int[] magicNumber) { 96 | try (FileInputStream fis = new FileInputStream(file)) { 97 | for (int i : magicNumber) { 98 | if (fis.read() != i) { 99 | return false; 100 | } 101 | } 102 | } catch (FileNotFoundException ex) { 103 | System.err.println(ex.getMessage()); 104 | } catch (IOException ex) { 105 | System.err.println(ex.getMessage()); 106 | } 107 | return true; 108 | } 109 | 110 | /** 111 | * 112 | * @param file 113 | * @param magicNumber 114 | * @return 115 | */ 116 | public static boolean verifyFileHeader(File file, byte[] magicNumber) { 117 | try (FileInputStream fis = new FileInputStream(file)) { 118 | byte[] buffer = new byte[magicNumber.length]; 119 | if (fis.read(buffer) != -1) { 120 | return Arrays.equals(magicNumber, buffer); 121 | } 122 | } catch (FileNotFoundException ex) { 123 | System.err.println(ex.getMessage()); 124 | } catch (IOException ex) { 125 | System.err.println(ex.getMessage()); 126 | } 127 | return false; 128 | } 129 | 130 | /** 131 | * Method to Convert Bytes to More Readable file size attribute. 132 | * 133 | * @param size Size of a file in Bytes 134 | * @return Returns file size in Bi/KiB/Mib/Gib/ format 135 | */ 136 | public static String readableFileSize(long size) { 137 | if (size <= 0) { 138 | return "0"; 139 | } 140 | 141 | final String[] units = new String[]{"Bi", "KiB", "MiB", "GiB"}; 142 | int digitGroups = (int) (Math.log10(size) / Math.log10(1024)); 143 | 144 | return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups]; 145 | } 146 | 147 | /** 148 | * 149 | * @param fileTime 150 | * @return 151 | */ 152 | public static String getDateTime(FileTime fileTime) { 153 | String DEF_FORMAT = "EEE, dd MMM yyyy HH:mm:ss z"; 154 | return getDateTime(fileTime, DEF_FORMAT); 155 | } 156 | 157 | /** 158 | * 159 | * @param fileTime 160 | * @param format 161 | * @return 162 | */ 163 | public static String getDateTime(FileTime fileTime, String format) { 164 | String DEF_FORMAT = null; 165 | 166 | if (format.isEmpty()) { 167 | DEF_FORMAT = "EEE, dd MMM yyyy HH:mm:ss z"; 168 | } else { 169 | DEF_FORMAT = format; 170 | } 171 | 172 | SimpleDateFormat df = new SimpleDateFormat(DEF_FORMAT); 173 | df.setTimeZone(TimeZone.getTimeZone("GMT")); 174 | return df.format(fileTime.toMillis()); 175 | } 176 | 177 | /** 178 | * 179 | * @param millies 180 | * @return 181 | */ 182 | public static String getDateTime(long millies) { 183 | String DEF_FORMAT = "EEE, dd MMM yyyy HH:mm:ss z"; 184 | return getDateTime(millies, DEF_FORMAT); 185 | } 186 | 187 | /** 188 | * 189 | * @param millies 190 | * @param format 191 | * @return 192 | */ 193 | public static String getDateTime(long millies, String format) { 194 | String DEF_FORMAT = null; 195 | 196 | if (format.isEmpty()) { 197 | DEF_FORMAT = "EEE, dd MMM yyyy HH:mm:ss z"; 198 | } else { 199 | DEF_FORMAT = format; 200 | } 201 | 202 | SimpleDateFormat df = new SimpleDateFormat(DEF_FORMAT); 203 | df.setTimeZone(TimeZone.getTimeZone("GMT")); 204 | return df.format(millies); 205 | } 206 | 207 | /** 208 | * 209 | * @param fileLoc 210 | * @return 211 | */ 212 | public static Map getFileMetadata(Path fileLoc) { 213 | Map linkedHashMap = new LinkedHashMap<>(); 214 | 215 | try { 216 | DosFileAttributes dosFileAttr = Files.readAttributes(fileLoc, DosFileAttributes.class); 217 | 218 | linkedHashMap.put("File Name", fileLoc.getFileName().toString()); 219 | linkedHashMap.put("File Location", fileLoc.toString()); 220 | linkedHashMap.put("File Size", readableFileSize(dosFileAttr.size())); 221 | linkedHashMap.put("Creation Time", getDateTime(dosFileAttr.creationTime())); 222 | linkedHashMap.put("Last Accessed Time", getDateTime(dosFileAttr.lastAccessTime())); 223 | linkedHashMap.put("Last Modified Time", getDateTime(dosFileAttr.lastModifiedTime())); 224 | linkedHashMap.put("Is Directory?", dosFileAttr.isDirectory() ? "True" : "False"); 225 | linkedHashMap.put("Is Regular File?", dosFileAttr.isRegularFile() ? "True" : "False"); 226 | linkedHashMap.put("Is Symbolic Link?", dosFileAttr.isSymbolicLink() ? "True" : "False"); 227 | linkedHashMap.put("Is Archive?", dosFileAttr.isArchive() ? "True" : "False"); 228 | linkedHashMap.put("Is Hidden File?", dosFileAttr.isHidden() ? "True" : "False"); 229 | linkedHashMap.put("Is ReadOnly?", dosFileAttr.isReadOnly() ? "True" : "False"); 230 | linkedHashMap.put("Is System File?", dosFileAttr.isSystem() ? "True" : "False"); 231 | 232 | if (getOsName().equals("Linux")) { 233 | PosixFileAttributes attr = Files.readAttributes(fileLoc, PosixFileAttributes.class); 234 | String posixPerm = String.format("%s %s %s%n", attr.owner().getName(), attr.group().getName(), 235 | PosixFilePermissions.toString(attr.permissions())); 236 | 237 | linkedHashMap.put("Posix", posixPerm); 238 | } 239 | 240 | } catch (UnsupportedOperationException | IOException ex) { 241 | System.err.println(ex.getMessage()); 242 | } 243 | 244 | return linkedHashMap; 245 | } 246 | 247 | /** 248 | * 249 | * @param map 250 | * @return 251 | */ 252 | public static Object[][] to2DObjectArray(Map map) { 253 | Object[][] objects = new Object[map.size()][2]; 254 | Object[] keys = map.keySet().toArray(); 255 | Object[] values = map.values().toArray(); 256 | 257 | for (int i = 0; i < map.size(); i++) { 258 | objects[i][0] = keys[i]; 259 | objects[i][1] = values[i]; 260 | } 261 | 262 | return objects; 263 | } 264 | } 265 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/artefacts/VisitedLinkParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ChromeForensics v1.0 3 | * Copyright (C) 2016 Psycho_Coder . 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package net.letshackit.chromeforensics.core.artefacts; 18 | 19 | import java.io.File; 20 | import java.io.FileNotFoundException; 21 | import java.io.IOException; 22 | import java.io.RandomAccessFile; 23 | import java.security.MessageDigest; 24 | import java.security.NoSuchAlgorithmException; 25 | import java.util.Arrays; 26 | import java.util.HashSet; 27 | import net.letshackit.chromeforensics.core.Utils; 28 | 29 | /** 30 | * Class that parses the 31 | *
Visited Links
file and gathers the information contained 32 | * 33 | * @author Psycho_Coder 34 | */ 35 | public class VisitedLinkParser { 36 | 37 | private final File vLnkFile; 38 | 39 | private final HashSet fingerprints; 40 | private final byte[] VLNK_MAGIC_HEADER = "VLnk".getBytes(); 41 | private byte[] salt; 42 | 43 | private final int HEADER_SALT_OFFSET = 0x10; 44 | private final int HEADER_SALT_LENGTH = 8; 45 | private final int URL_FINGERPRINT_LENGTH = 8; 46 | 47 | public VisitedLinkParser(File vLnkFile) { 48 | this.vLnkFile = vLnkFile; 49 | salt = null; 50 | fingerprints = new HashSet<>(); 51 | } 52 | 53 | /** 54 | * Parses the 55 | *
Visited Links
file, retrieves the salt used to hash the urls 56 | * and stores the fingerprints in a HashSet 57 | * 58 | * @return Returns 1 if parsing was successful else returns -1 59 | */ 60 | public int parse() { 61 | if (Utils.verifyFileHeader(vLnkFile, VLNK_MAGIC_HEADER)) { 62 | salt = new byte[HEADER_SALT_LENGTH]; 63 | byte[] bytes = new byte[URL_FINGERPRINT_LENGTH]; 64 | try (RandomAccessFile raf = new RandomAccessFile(vLnkFile, "r")) { 65 | int val; 66 | raf.seek(HEADER_SALT_OFFSET); 67 | raf.read(salt); 68 | while ((val = raf.read()) != -1) { 69 | if (val != 0) { 70 | raf.seek(raf.getFilePointer() - 1); 71 | raf.read(bytes, 0, URL_FINGERPRINT_LENGTH); 72 | fingerprints.add(Utils.byteArrayToHex(bytes)); 73 | } 74 | } 75 | } catch (FileNotFoundException ex) { 76 | System.err.println(ex.getMessage()); 77 | } catch (IOException ex) { 78 | System.err.println(ex.getMessage()); 79 | } 80 | } else { 81 | return -1; 82 | } 83 | return 1; 84 | } 85 | 86 | /** 87 | * Calculates the URL fingerprint for any custom url. 88 | * 89 | * @param salt Salt used during hashing. 90 | * @param data array of bytes for the URL whose fingerprint will be 91 | * calculated. 92 | * @return Returns the first 8 bytes of the digest after hex encoding them. 93 | */ 94 | public String getUrlFingerprint(byte[] salt, byte[] data) { 95 | byte[] mdBytes = null; 96 | 97 | try { 98 | MessageDigest md = MessageDigest.getInstance("MD5"); 99 | md.update(salt); 100 | md.update(data); 101 | mdBytes = md.digest(); 102 | } catch (NoSuchAlgorithmException ex) { 103 | System.err.println("Couldn't determine the hashing algorithm." + ex. 104 | getMessage()); 105 | } 106 | 107 | return Utils.byteArrayToHex(Arrays.copyOf(mdBytes, URL_FINGERPRINT_LENGTH)); 108 | } 109 | 110 | public boolean isVisited(String url) { 111 | return fingerprints.contains(getUrlFingerprint(salt, url.getBytes())); 112 | } 113 | 114 | public byte[] getSalt() { 115 | return salt; 116 | } 117 | 118 | public HashSet getVisitedFingerprints() { 119 | return fingerprints; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/artefacts/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core.artefacts; 17 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/db/BaseDbModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Psycho_Coder . 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core.db; 17 | 18 | import java.sql.Connection; 19 | import java.sql.DriverManager; 20 | import java.sql.ResultSet; 21 | import java.sql.SQLException; 22 | import java.sql.Statement; 23 | 24 | /** 25 | * @author Psycho_Coder 26 | */ 27 | abstract class BaseDbModel { 28 | 29 | public String driver = null; 30 | public String connUrl = null; 31 | public int connTimeout = 60; 32 | public Connection conn = null; 33 | public Statement stmt = null; 34 | 35 | /** 36 | * Default constructor 37 | */ 38 | public BaseDbModel() { 39 | } 40 | 41 | /** 42 | * @param driver 43 | * @param connUrl 44 | */ 45 | public BaseDbModel(String driver, String connUrl) { 46 | initialize(driver, connUrl); 47 | } 48 | 49 | /** 50 | * @param driver 51 | * @param connUrl 52 | * @param connTimeout 53 | */ 54 | public BaseDbModel(String driver, String connUrl, int connTimeout) { 55 | initialize(driver, connUrl, connTimeout); 56 | } 57 | 58 | /** 59 | * @param driver 60 | * @param connUrl 61 | */ 62 | public final void initialize(String driver, String connUrl) { 63 | setDriver(driver); 64 | setConnectionUrl(connUrl); 65 | try { 66 | setConnection(); 67 | setStatement(); 68 | } catch (SQLException | ClassNotFoundException e) { 69 | e.printStackTrace(); 70 | } 71 | } 72 | 73 | /** 74 | * @param driver 75 | * @param connUrl 76 | * @param connTimeout 77 | */ 78 | public final void initialize(String driver, String connUrl, int connTimeout) { 79 | setDriver(driver); 80 | setConnectionUrl(connUrl); 81 | setConnectionTimeout(connTimeout); 82 | try { 83 | setConnection(); 84 | setStatement(); 85 | } catch (SQLException | ClassNotFoundException e) { 86 | e.printStackTrace(); 87 | } 88 | } 89 | 90 | /** 91 | * @return 92 | */ 93 | @Override 94 | public String toString() { 95 | return "Driver : " + driver + " Connection Url : " + connUrl; 96 | } 97 | 98 | /** 99 | * @throws ClassNotFoundException 100 | * @throws SQLException 101 | */ 102 | public void setConnection() throws ClassNotFoundException, SQLException { 103 | assert driver != null && connUrl != null; 104 | Class.forName(driver); 105 | conn = DriverManager.getConnection(connUrl); 106 | } 107 | 108 | /** 109 | * @return 110 | */ 111 | public Connection getConnection() { 112 | return conn; 113 | } 114 | 115 | /** 116 | * 117 | */ 118 | public void closeConnection() { 119 | try { 120 | conn.close(); 121 | } catch (SQLException e) { 122 | e.printStackTrace(); 123 | } 124 | } 125 | 126 | /** 127 | * @return 128 | */ 129 | public int getConnectionTimeout() { 130 | return connTimeout; 131 | } 132 | 133 | /** 134 | * @param connTimeout 135 | */ 136 | public void setConnectionTimeout(int connTimeout) { 137 | this.connTimeout = connTimeout; 138 | } 139 | 140 | /** 141 | * @return 142 | */ 143 | public String getConnectionUrl() { 144 | return connUrl; 145 | } 146 | 147 | /** 148 | * @param connUrl 149 | */ 150 | public void setConnectionUrl(String connUrl) { 151 | this.connUrl = connUrl; 152 | } 153 | 154 | /** 155 | * @return 156 | */ 157 | public String getDriver() { 158 | return driver; 159 | } 160 | 161 | /** 162 | * @param driver 163 | */ 164 | public void setDriver(String driver) { 165 | this.driver = driver; 166 | } 167 | 168 | /** 169 | * @throws SQLException 170 | * @throws ClassNotFoundException 171 | */ 172 | public void setStatement() throws SQLException, ClassNotFoundException { 173 | if (getConnection() != null) { 174 | setConnection(); 175 | } 176 | stmt = conn.createStatement(); 177 | stmt.setQueryTimeout(connTimeout); 178 | } 179 | 180 | /** 181 | * @return 182 | */ 183 | public Statement getStatement() { 184 | return stmt; 185 | } 186 | 187 | /** 188 | * 189 | */ 190 | public void closeStatement() { 191 | try { 192 | stmt.close(); 193 | } catch (SQLException e) { 194 | e.printStackTrace(); 195 | } 196 | } 197 | 198 | /** 199 | * @param sqlQuery 200 | * @throws SQLException 201 | */ 202 | public void executeStatement(String sqlQuery) throws SQLException { 203 | stmt.executeUpdate(sqlQuery); 204 | } 205 | 206 | /** 207 | * @param sqlQueryArray 208 | * @throws SQLException 209 | */ 210 | public void executeStatement(String[] sqlQueryArray) throws SQLException { 211 | for (String sql : sqlQueryArray) { 212 | executeStatement(sql); 213 | } 214 | } 215 | 216 | public ResultSet executeQuery(String sqlQuery) throws SQLException { 217 | return stmt.executeQuery(sqlQuery); 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/db/DBConnectionPool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Psycho_Coder . 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core.db; 17 | 18 | import java.io.File; 19 | import java.sql.SQLException; 20 | import java.util.HashMap; 21 | import java.util.Iterator; 22 | 23 | /** 24 | * This class stores all the instance of opened or alive database connection 25 | * which is likely to be reused later. 26 | * 27 | * @author Psycho_Coder 28 | */ 29 | public class DBConnectionPool { 30 | 31 | private static HashMap connPoolMap; 32 | private static int size; 33 | 34 | /** 35 | * Defined Singleton pattern for the class. 36 | */ 37 | private static final DBConnectionPool dbConnPool = new DBConnectionPool(); 38 | 39 | private DBConnectionPool() { 40 | connPoolMap = new HashMap<>(); 41 | size = 0; 42 | } 43 | 44 | /** 45 | * Returns a Single instance for this class. 46 | * 47 | * @return single instance of this class 48 | */ 49 | public static DBConnectionPool getInstance() { 50 | return dbConnPool; 51 | } 52 | 53 | /** 54 | * Adds a new entry to the Connection Pool HashMap whenever a new database 55 | * is opened. 56 | * 57 | * @param dbPath path to the SQLite database file 58 | * @param dbModel 59 | * {@link net.letshackit.chromeforensics.core.db.SQLiteDbModel} instance for 60 | * the database file. 61 | */ 62 | public void add(File dbPath, SQLiteDbModel dbModel) { 63 | connPoolMap.put(dbPath, dbModel); 64 | size += 1; 65 | } 66 | 67 | /** 68 | * Checks if for a particular db file an open connection exists or not. 69 | * 70 | * @param dbPath file whose connection status is to be checked. 71 | * @return returns true if an opened connection is found. 72 | */ 73 | public boolean isConnectionOpened(File dbPath) { 74 | return connPoolMap.containsKey(dbPath); 75 | } 76 | 77 | public SQLiteDbModel getConnection(File dbPath) { 78 | return connPoolMap.get(dbPath); 79 | } 80 | 81 | /** 82 | * 83 | * @return 84 | */ 85 | public Iterator getAllConnections() { 86 | return connPoolMap.values().iterator(); 87 | } 88 | 89 | /** 90 | * Returns the number of opened connections. 91 | * 92 | * @return no. of opened db connections 93 | */ 94 | public int getSize() { 95 | return connPoolMap.size(); 96 | } 97 | 98 | /** 99 | * Closes all the opened connections by iterating the 100 | * {@link net.letshackit.chromeforensics.core.db.DBConnectionPool} 101 | * instances. 102 | */ 103 | public void closeAll() { 104 | Iterator itr = connPoolMap.values().iterator(); 105 | while (itr.hasNext()) { 106 | try { 107 | itr.next().close(); 108 | } catch (SQLException ex) { 109 | System.err.println(ex.getMessage()); 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/db/SQLiteDbModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core.db; 17 | 18 | import java.io.FileNotFoundException; 19 | import java.sql.DatabaseMetaData; 20 | import java.sql.ResultSet; 21 | import java.sql.ResultSetMetaData; 22 | import java.sql.SQLException; 23 | import java.util.Vector; 24 | 25 | /** 26 | * @author Psycho_Coder 27 | */ 28 | public class SQLiteDbModel extends BaseDbModel { 29 | 30 | private final String sDriver; 31 | private String sConnUrl; 32 | 33 | private String dbPath; 34 | 35 | public SQLiteDbModel() { 36 | sDriver = "org.sqlite.JDBC"; 37 | } 38 | 39 | public SQLiteDbModel(String dbPath) throws FileNotFoundException { 40 | this.dbPath = dbPath; 41 | sDriver = "org.sqlite.JDBC"; 42 | sConnUrl = "jdbc:sqlite:" + dbPath; 43 | 44 | initialize(sDriver, sConnUrl); 45 | } 46 | 47 | public void initialize() { 48 | assert getDbPath() != null; 49 | initialize(sDriver, sConnUrl); 50 | } 51 | 52 | public void close() throws SQLException { 53 | closeConnection(); 54 | closeStatement(); 55 | } 56 | 57 | public String getDbPath() { 58 | return dbPath; 59 | } 60 | 61 | public void setDbPath(String dbPath) { 62 | this.dbPath = dbPath; 63 | sConnUrl = "jdbc:sqlite:" + dbPath; 64 | } 65 | 66 | public Vector getTables() throws SQLException { 67 | String TABLE_NAME = "TABLE_NAME"; 68 | String[] TABLE_TYPES = {"TABLE"}; 69 | Vector tableList = new Vector<>(); 70 | 71 | DatabaseMetaData dbmd = this.getConnection().getMetaData(); 72 | try (ResultSet tables = dbmd.getTables(null, null, null, TABLE_TYPES)) { 73 | while (tables.next()) { 74 | tableList.add(tables.getString(TABLE_NAME)); 75 | } 76 | } 77 | return tableList; 78 | } 79 | 80 | public Vector getColumnNames(ResultSet rs) throws SQLException { 81 | ResultSetMetaData rsmd = rs.getMetaData(); 82 | Vector colNames = new Vector<>(); 83 | int colCount = rsmd.getColumnCount(); 84 | for (int i = 1; i <= colCount; i++) { 85 | colNames.add(rsmd.getColumnName(i)); 86 | } 87 | 88 | return colNames; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core.db; 17 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/export/ExportType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ChromeForensics v1.0 3 | * Copyright (C) 2016 Psycho_Coder . 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package net.letshackit.chromeforensics.core.export; 18 | 19 | /** 20 | * 21 | * @author Psycho_Coder 22 | */ 23 | public enum ExportType { 24 | TSV, 25 | HTML; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/export/IExporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core.export; 17 | 18 | import java.io.File; 19 | import javax.swing.JTable; 20 | import javax.swing.table.TableModel; 21 | 22 | /** 23 | * 24 | * @author Psycho_Coder 25 | */ 26 | public interface IExporter { 27 | 28 | /** 29 | * 30 | * @param table 31 | * @param saveLoc 32 | * @return 33 | */ 34 | public boolean export(JTable table, File saveLoc); 35 | 36 | /** 37 | * 38 | * @param table 39 | * @param saveLoc 40 | * @return 41 | */ 42 | public boolean export(TableModel table, File saveLoc); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/export/TSVExport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ChromeForensics v1.0 3 | * Copyright (C) 2016 Psycho_Coder . 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package net.letshackit.chromeforensics.core.export; 18 | 19 | import java.io.BufferedWriter; 20 | import java.io.File; 21 | import java.io.IOException; 22 | import java.nio.charset.StandardCharsets; 23 | import java.nio.file.Files; 24 | import javax.swing.JTable; 25 | import javax.swing.table.TableModel; 26 | import org.apache.logging.log4j.LogManager; 27 | import org.apache.logging.log4j.Logger; 28 | 29 | /** 30 | * 31 | * @author Psycho_Coder 32 | */ 33 | public class TSVExport implements IExporter { 34 | 35 | final static Logger logger = LogManager.getLogger(TSVExport.class); 36 | 37 | /** 38 | * 39 | * @param table 40 | * @param saveLoc 41 | * @return 42 | */ 43 | @Override 44 | public boolean export(JTable table, File saveLoc) { 45 | return export(table.getModel(), saveLoc); 46 | } 47 | 48 | /** 49 | * 50 | * @param modal 51 | * @param saveLoc 52 | * @return 53 | */ 54 | @Override 55 | public boolean export(TableModel modal, File saveLoc) { 56 | int rowCount = modal.getRowCount(); 57 | int colCount = modal.getColumnCount(); 58 | 59 | try (BufferedWriter writer = Files.newBufferedWriter(saveLoc.toPath(), StandardCharsets.UTF_8)) { 60 | for (int col = 0; col < colCount; col++) { 61 | writer.write(modal.getColumnName(col)); 62 | writer.write("\t"); 63 | } 64 | writer.newLine(); 65 | for (int row = 0; row < rowCount; row++) { 66 | for (int col = 0; col < colCount; col++) { 67 | writer.write((String) modal.getValueAt(row, col)); 68 | writer.write("\t"); 69 | } 70 | writer.newLine(); 71 | } 72 | logger.info("Export to TSV successful!"); 73 | return true; 74 | } catch (IOException ex) { 75 | logger.debug("Exception Occured during export to TSV.", ex); 76 | } 77 | return false; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/core/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.core; 17 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/ChromeForensicsGui.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.gui; 17 | 18 | import java.awt.Dimension; 19 | import java.awt.Toolkit; 20 | import java.awt.event.WindowAdapter; 21 | import java.awt.event.WindowEvent; 22 | import javax.swing.JFrame; 23 | import javax.swing.JOptionPane; 24 | import javax.swing.JPanel; 25 | import javax.swing.SwingUtilities; 26 | import javax.swing.UIManager; 27 | import javax.swing.UnsupportedLookAndFeelException; 28 | import net.letshackit.chromeforensics.core.Utils; 29 | import org.apache.logging.log4j.LogManager; 30 | import org.apache.logging.log4j.Logger; 31 | 32 | public class ChromeForensicsGui extends JFrame { 33 | 34 | private static final ChromeForensicsGui cfGui = new ChromeForensicsGui(); 35 | 36 | private final int WIDTH; 37 | private final int HEIGHT; 38 | 39 | final static Logger logger = LogManager.getLogger(ChromeForensicsGui.class); 40 | 41 | private ChromeForensicsGui() { 42 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 43 | WIDTH = screenSize.width - 100; 44 | HEIGHT = screenSize.height - 100; 45 | 46 | try { 47 | for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { 48 | if ("Nimbus".equals(info.getName())) { 49 | UIManager.setLookAndFeel(info.getClassName()); 50 | break; 51 | } 52 | } 53 | UIManager.setLookAndFeel("com.jtattoo.plaf.graphite.GraphiteLookAndFeel"); 54 | } catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) { 55 | e.printStackTrace(); 56 | } 57 | 58 | JPanel mainPanel = MainPanel.getInstance(); 59 | 60 | setTitle("Chrome Forensics v1.0"); 61 | setResizable(false); 62 | setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 63 | setPreferredSize(new Dimension(WIDTH, HEIGHT)); 64 | setContentPane(mainPanel); 65 | setJMenuBar(new MainMenuBar()); 66 | setIconImage(Utils.createImageIcon("images/chrome_forensics.png", "Chrome Forensics").getImage()); 67 | addWindowListener(new WindowAdapter() { 68 | 69 | @Override 70 | public void windowClosing(WindowEvent e) { 71 | int confirmed = JOptionPane.showConfirmDialog(null, "Are you sure you want to exit the program?", 72 | "Exit ChromeForensics ?", JOptionPane.YES_NO_OPTION); 73 | if (confirmed == JOptionPane.YES_OPTION) { 74 | dispose(); 75 | } 76 | } 77 | }); 78 | pack(); 79 | } 80 | 81 | public static ChromeForensicsGui getInstance() { 82 | return cfGui; 83 | } 84 | 85 | public static void main(String[] args) { 86 | SwingUtilities.invokeLater(new Runnable() { 87 | 88 | public void run() { 89 | getInstance().setVisible(true); 90 | } 91 | }); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/ExportDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ChromeForensics v1.0 3 | * Copyright (C) 2016 Psycho_Coder . 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package net.letshackit.chromeforensics.gui; 18 | 19 | import java.awt.Dimension; 20 | import java.awt.Font; 21 | import java.awt.event.ActionEvent; 22 | import java.awt.event.ActionListener; 23 | import java.io.File; 24 | import java.util.ArrayList; 25 | import javax.swing.JButton; 26 | import javax.swing.JCheckBox; 27 | import javax.swing.JDialog; 28 | import javax.swing.JFileChooser; 29 | import javax.swing.JLabel; 30 | import javax.swing.JPanel; 31 | import javax.swing.JScrollPane; 32 | import javax.swing.JTextArea; 33 | import javax.swing.JTextField; 34 | import net.letshackit.chromeforensics.core.export.ExportType; 35 | import net.letshackit.chromeforensics.core.export.TSVExport; 36 | 37 | /** 38 | * 39 | * @author Psycho_Coder 40 | */ 41 | public class ExportDialog extends JDialog { 42 | 43 | private final ExportType exportType; 44 | private ArrayList chkGrp; 45 | private boolean allSelected; 46 | 47 | private final JPanel panel; 48 | private JButton close, exportBut, browse, selectAll; 49 | private JTextArea txtArea; 50 | private JScrollPane scrollPane; 51 | private JLabel choose, loc; 52 | private JTextField locField; 53 | private JCheckBox exKST, exBM, exCookies, exFav, exCSQ, exSDB, exVS, exMVS, 54 | exAllUrls, exLogins, exDown; 55 | private JFileChooser fc; 56 | 57 | public ExportDialog(ExportType type) { 58 | this.exportType = type; 59 | panel = new JPanel(); 60 | allSelected = false; 61 | MainPanel.getInstance().getTabbedPaneComponentDetails(); 62 | initDialog(); 63 | } 64 | 65 | private void initDialog() { 66 | setSize(new Dimension(650, 400)); 67 | setLocationRelativeTo(null); 68 | setResizable(false); 69 | setModalityType(ModalityType.TOOLKIT_MODAL); 70 | setTitle("Data Export Dialog"); 71 | setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); 72 | setContentPane(panel); 73 | 74 | panel.setLayout(null); 75 | 76 | choose = new JLabel("Choose what to export"); 77 | choose.setBounds(30, 15, 200, 25); 78 | choose.setFont(new Font("Calibri", Font.PLAIN, 18)); 79 | panel.add(choose); 80 | 81 | chkGrp = new ArrayList<>(); 82 | exKST = new JCheckBox("Keyword Searches", false); 83 | exKST.setBounds(50, 50, 150, 20); 84 | panel.add(exKST); 85 | chkGrp.add(exKST); 86 | exBM = new JCheckBox("Bookmarks", false); 87 | exBM.setBounds(50, 80, 150, 20); 88 | panel.add(exBM); 89 | chkGrp.add(exBM); 90 | exCookies = new JCheckBox("Cookies", false); 91 | exCookies.setBounds(50, 110, 150, 20); 92 | panel.add(exCookies); 93 | chkGrp.add(exCookies); 94 | exFav = new JCheckBox("Favicons", false); 95 | chkGrp.add(exFav); 96 | exCSQ = new JCheckBox("Custom Queries", false); 97 | exCSQ.setBounds(50, 140, 150, 20); 98 | panel.add(exCSQ); 99 | chkGrp.add(exCSQ); 100 | exAllUrls = new JCheckBox("URLs", false); 101 | exAllUrls.setBounds(50, 170, 150, 20); 102 | panel.add(exAllUrls); 103 | chkGrp.add(exAllUrls); 104 | exSDB = new JCheckBox("Data Browser", false); 105 | exSDB.setBounds(50, 200, 150, 20); 106 | panel.add(exSDB); 107 | chkGrp.add(exSDB); 108 | exVS = new JCheckBox("Visited Sites", false); 109 | exVS.setBounds(50, 230, 150, 20); 110 | panel.add(exVS); 111 | chkGrp.add(exVS); 112 | exMVS = new JCheckBox("Most Visited Sites", false); 113 | exMVS.setBounds(50, 260, 150, 20); 114 | panel.add(exMVS); 115 | chkGrp.add(exMVS); 116 | exLogins = new JCheckBox("Logins", false); 117 | exLogins.setBounds(50, 290, 150, 20); 118 | panel.add(exLogins); 119 | chkGrp.add(exLogins); 120 | exDown = new JCheckBox("Downloads", false); 121 | exDown.setBounds(50, 320, 150, 20); 122 | panel.add(exDown); 123 | chkGrp.add(exDown); 124 | 125 | loc = new JLabel("Browse directory to save the exports"); 126 | loc.setBounds(250, 30, 350, 30); 127 | loc.setFont(new Font("Calibri", Font.PLAIN, 16)); 128 | panel.add(loc); 129 | 130 | locField = new JTextField(20); 131 | locField.setEditable(false); 132 | locField.setBounds(250, 60, 320, 25); 133 | panel.add(locField); 134 | 135 | browse = new JButton("..."); 136 | browse.setBounds(580, 60, 40, 25); 137 | browse.addActionListener(new ActionListener() { 138 | 139 | @Override 140 | public void actionPerformed(ActionEvent ae) { 141 | fc = new JFileChooser(); 142 | fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); 143 | int retVal = fc.showOpenDialog(panel); 144 | if (retVal == JFileChooser.APPROVE_OPTION) { 145 | File file = fc.getSelectedFile(); 146 | locField.setText(file.toString()); 147 | } 148 | } 149 | }); 150 | panel.add(browse); 151 | 152 | txtArea = new JTextArea(); 153 | scrollPane = new JScrollPane(txtArea); 154 | scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 155 | scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 156 | scrollPane.setBounds(250, 90, 370, 180); 157 | panel.add(scrollPane); 158 | 159 | selectAll = new JButton("Select All"); 160 | selectAll.setBounds(250, 280, 100, 40); 161 | selectAll.addActionListener(new ActionListener() { 162 | 163 | @Override 164 | public void actionPerformed(ActionEvent ae) { 165 | if (allSelected) { 166 | selectAll.setText("Select All"); 167 | allSelected = false; 168 | for (JCheckBox cb : chkGrp) { 169 | cb.setSelected(false); 170 | } 171 | } else { 172 | selectAll.setText("Select None"); 173 | allSelected = true; 174 | for (JCheckBox cb : chkGrp) { 175 | cb.setSelected(true); 176 | } 177 | } 178 | } 179 | }); 180 | panel.add(selectAll); 181 | 182 | exportBut = new JButton("Begin Export"); 183 | exportBut.setBounds(370, 280, 100, 40); 184 | exportBut.addActionListener(new ActionListener() { 185 | 186 | @Override 187 | public void actionPerformed(ActionEvent ae) { 188 | if (exportType == ExportType.TSV) { 189 | TSVExport tsv = new TSVExport(); 190 | for (JCheckBox cb : chkGrp) { 191 | if (cb.isSelected()) { 192 | 193 | } 194 | } 195 | } 196 | if (exportType == ExportType.HTML) { 197 | 198 | } 199 | } 200 | }); 201 | panel.add(exportBut); 202 | 203 | close = new JButton("Close"); 204 | close.setBounds(490, 280, 100, 40); 205 | close.addActionListener(new ActionListener() { 206 | 207 | @Override 208 | public void actionPerformed(ActionEvent ae) { 209 | dispose(); 210 | } 211 | }); 212 | panel.add(close); 213 | 214 | } 215 | 216 | } 217 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/MainMenuBar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.gui; 17 | 18 | import java.awt.event.ActionEvent; 19 | import java.awt.event.ActionListener; 20 | import javax.swing.JMenu; 21 | import javax.swing.JMenuBar; 22 | import javax.swing.JMenuItem; 23 | import javax.swing.JSeparator; 24 | import net.letshackit.chromeforensics.core.Utils; 25 | 26 | public class MainMenuBar extends JMenuBar { 27 | 28 | protected JMenu file; 29 | protected JMenu tools; 30 | protected JMenu export; 31 | protected JMenu help; 32 | protected JMenu filter; 33 | 34 | protected JMenuItem fileLoadData; 35 | protected JMenuItem fileExit; 36 | protected JMenuItem fileAutoSearch; 37 | protected JMenuItem exportCsv; 38 | protected JMenuItem exportHtml; 39 | protected JMenuItem helpGetHelp; 40 | protected JMenuItem helpAbout; 41 | protected JMenuItem filterGoogle; 42 | protected JMenuItem filterBing; 43 | protected JMenuItem filterYahoo; 44 | protected JMenuItem filterDuckDuckgo; 45 | protected JMenuItem filterSearchEngines; 46 | protected JMenuItem executeQuery; 47 | protected JMenuItem dataBrowser; 48 | protected JMenuItem clearQuery; 49 | 50 | protected JSeparator fileSep; 51 | protected JSeparator toolsSep, toolsSep2, toolsSep3; 52 | protected JSeparator exportSep; 53 | protected JSeparator helpSep; 54 | 55 | public MainMenuBar() { 56 | file = new JMenu("File"); 57 | tools = new JMenu("Tools"); 58 | export = new JMenu("Export"); 59 | help = new JMenu("Help"); 60 | filter = new JMenu("Filter by"); 61 | filter.setIcon(Utils.createImageIcon("images/filter_small.png", "Filter Data")); 62 | 63 | add(file); 64 | add(tools); 65 | add(export); 66 | add(help); 67 | 68 | fileSep = new JSeparator(); 69 | fileSep.setOrientation(JSeparator.HORIZONTAL); 70 | fileLoadData = new JMenuItem("Manually Load Chrome Data"); 71 | fileLoadData.setIcon(Utils.createImageIcon("images/loaddata_small.png", "Load Data")); 72 | fileLoadData.setToolTipText("Manually locate the chrome data files folder."); 73 | file.add(fileLoadData); 74 | fileAutoSearch = new JMenuItem("AutoSearch Chrome Data"); 75 | fileAutoSearch.setIcon(Utils.createImageIcon("images/autosearch_small.png", "Auto Search andLoad Data")); 76 | fileAutoSearch.setToolTipText("Automatically search and load chrome files."); 77 | file.add(fileAutoSearch); 78 | file.add(fileSep); 79 | fileExit = new JMenuItem("Exit"); 80 | fileExit.setIcon(Utils.createImageIcon("images/exit_small.png", "Exit")); 81 | fileExit.setToolTipText("Exit Application."); 82 | file.add(fileExit); 83 | 84 | tools.add(filter); 85 | filterBing = new JMenuItem("Bing"); 86 | filterBing.setIcon(Utils.createImageIcon("images/bing_small.png", "Bing")); 87 | filter.add(filterBing); 88 | filterGoogle = new JMenuItem("Google"); 89 | filterGoogle.setIcon(Utils.createImageIcon("images/google_small.png", "Google")); 90 | filter.add(filterGoogle); 91 | filterYahoo = new JMenuItem("Yahoo"); 92 | filterYahoo.setIcon(Utils.createImageIcon("images/yahoo_small.png", "Yahoo")); 93 | filter.add(filterYahoo); 94 | filterDuckDuckgo = new JMenuItem("DuckDuckgo"); 95 | filterDuckDuckgo.setIcon(Utils.createImageIcon("images/duckduckgo_small.png", "DuckDuckgo")); 96 | filter.add(filterDuckDuckgo); 97 | filterSearchEngines = new JMenuItem("Search Engines"); 98 | filterSearchEngines.setIcon(Utils.createImageIcon("images/searchengine_small.png", "Other Search Engines")); 99 | filter.add(filterSearchEngines); 100 | toolsSep = new JSeparator(); 101 | toolsSep.setOrientation(JSeparator.HORIZONTAL); 102 | tools.add(toolsSep); 103 | executeQuery = new JMenuItem("Custom SQL Query"); 104 | executeQuery.setIcon(Utils.createImageIcon("images/sql_small.png", "Custom SQL Query.")); 105 | executeQuery.setToolTipText("Run Custom SQL Query."); 106 | tools.add(executeQuery); 107 | toolsSep2 = new JSeparator(); 108 | toolsSep2.setOrientation(JSeparator.HORIZONTAL); 109 | tools.add(toolsSep2); 110 | dataBrowser = new JMenuItem("Data Browser"); 111 | dataBrowser.setIcon(Utils.createImageIcon("images/databrowse_small.png", "SQLite Data Browser")); 112 | dataBrowser.setToolTipText("SQLite Data Browser"); 113 | tools.add(dataBrowser); 114 | toolsSep3 = new JSeparator(); 115 | toolsSep3.setOrientation(JSeparator.HORIZONTAL); 116 | tools.add(toolsSep3); 117 | clearQuery = new JMenuItem("Clear Query"); 118 | clearQuery.setIcon(Utils.createImageIcon("images/clear_small.png", "Clear result set.")); 119 | clearQuery.setToolTipText("Clear the result set."); 120 | tools.add(clearQuery); 121 | 122 | exportSep = new JSeparator(); 123 | exportSep.setOrientation(JSeparator.HORIZONTAL); 124 | exportCsv = new JMenuItem("Export As CSV"); 125 | exportCsv.setIcon(Utils.createImageIcon("images/csv_small.png", "Export results to CSV")); 126 | exportCsv.setToolTipText("Export Results to CSV"); 127 | export.add(exportCsv); 128 | export.add(exportSep); 129 | exportHtml = new JMenuItem("Export As HTML"); 130 | exportHtml.setIcon(Utils.createImageIcon("images/html_small.png", "Export results to HTML")); 131 | exportHtml.setToolTipText("Export results to HTML."); 132 | export.add(exportHtml); 133 | 134 | helpSep = new JSeparator(); 135 | helpSep.setOrientation(JSeparator.HORIZONTAL); 136 | helpGetHelp = new JMenuItem("Get Help!"); 137 | helpGetHelp.setIcon(Utils.createImageIcon("images/help_small.png", "Get Help!")); 138 | helpGetHelp.setToolTipText("Get help!"); 139 | help.add(helpGetHelp); 140 | help.add(helpSep); 141 | helpAbout = new JMenuItem("About ChromeForensics!"); 142 | helpAbout.setIcon(Utils.createImageIcon("images/about_small.png", "About this tool")); 143 | help.add(helpAbout); 144 | 145 | fileExit.addActionListener(new ActionListener() { 146 | 147 | public void actionPerformed(ActionEvent actionEvent) { 148 | ChromeForensicsGui.getInstance().dispose(); 149 | } 150 | }); 151 | 152 | dataBrowser.addActionListener(new ActionListener() { 153 | 154 | public void actionPerformed(ActionEvent actionEvent) { 155 | MainPanel.getInstance().setSelectedTabIndex(6); 156 | } 157 | }); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/MainPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.gui; 17 | 18 | import java.awt.BorderLayout; 19 | import java.awt.Color; 20 | import java.awt.Dimension; 21 | import java.awt.Toolkit; 22 | import java.awt.event.ActionEvent; 23 | import java.awt.event.ActionListener; 24 | import java.util.HashMap; 25 | import java.util.Map; 26 | import javax.swing.JButton; 27 | import javax.swing.JPanel; 28 | import javax.swing.JTabbedPane; 29 | import javax.swing.JTable; 30 | import javax.swing.JToolBar; 31 | import javax.swing.SwingConstants; 32 | import net.letshackit.chromeforensics.core.ChromeForensics; 33 | import net.letshackit.chromeforensics.core.Utils; 34 | import net.letshackit.chromeforensics.core.export.ExportType; 35 | import net.letshackit.chromeforensics.gui.tools.FileViewer; 36 | import net.letshackit.chromeforensics.gui.tools.SQLiteDataBrowser; 37 | import org.apache.logging.log4j.LogManager; 38 | import org.apache.logging.log4j.Logger; 39 | 40 | public class MainPanel extends JPanel { 41 | 42 | private static final MainPanel mainPanel = new MainPanel(); 43 | 44 | protected JToolBar toolBar; 45 | protected JButton autoLoadData; 46 | protected JButton manuallyLoadData; 47 | protected JButton exitButton; 48 | protected JButton exportTSV; 49 | protected JButton exportHTML; 50 | protected JButton helpButton; 51 | protected JButton aboutButton; 52 | protected JPanel visits; 53 | protected JPanel mostVisitedSites; 54 | protected JPanel urls; 55 | protected JPanel logins; 56 | protected JPanel downloads; 57 | protected JPanel keywords; 58 | protected JPanel bookmarks; 59 | protected JPanel cookies; 60 | protected JPanel preferences; 61 | protected JPanel favicons; 62 | protected JPanel customQuery; 63 | protected JTable visitsTable; 64 | protected JTabbedPane tabbedPane; 65 | 66 | final static Logger logger = LogManager.getLogger(MainPanel.class); 67 | 68 | protected ChromeForensics cf; 69 | 70 | private int WIDTH = 1000; 71 | private int HEIGHT = 600; 72 | 73 | private Map tabbedPanelDetails; 74 | 75 | /** 76 | * MainPanel constructor to initialize the components. 77 | */ 78 | private MainPanel() { 79 | initComponents(); 80 | } 81 | 82 | /** 83 | * Single instance of this MainPanel. The MainPanel uses the Singleton 84 | * pattern. 85 | * 86 | * @return returns a singleton instance of this Component 87 | */ 88 | public static MainPanel getInstance() { 89 | return mainPanel; 90 | } 91 | 92 | /** 93 | * Function that initializes the components and other functionality. 94 | */ 95 | private void initComponents() { 96 | /* Base Initialization */ 97 | setLayout(new BorderLayout()); 98 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 99 | WIDTH = screenSize.width; 100 | HEIGHT = screenSize.height - 40; 101 | setPreferredSize(new Dimension(WIDTH, HEIGHT)); 102 | cf = new ChromeForensics(); 103 | 104 | /* Toolbar Code Started */ 105 | initToolBar(); 106 | add(toolBar, BorderLayout.NORTH); 107 | /*Toolbar Code ends*/ 108 | 109 | /* JTabbedPane Code Started*/ 110 | initTabbedPane(); 111 | add(tabbedPane, BorderLayout.CENTER); 112 | /* JTabbedPane Code Ended*/ 113 | 114 | add(new StatusBar(), BorderLayout.SOUTH); 115 | } 116 | 117 | private void initToolBar() { 118 | toolBar = new JToolBar(); 119 | toolBar.setOrientation(JToolBar.HORIZONTAL); 120 | toolBar.setFloatable(false); 121 | toolBar.setPreferredSize(new Dimension(getWidth(), 40)); 122 | 123 | manuallyLoadData = new JButton(); 124 | manuallyLoadData.setIcon(Utils.createImageIcon("images/loaddata.png", "Load Data")); 125 | manuallyLoadData.setToolTipText("Manually locate the chrome data files folder."); 126 | toolBar.add(manuallyLoadData); 127 | 128 | autoLoadData = new JButton(); 129 | autoLoadData.setIcon(Utils.createImageIcon("images/autosearch.png", "Auto Search and Load Data")); 130 | autoLoadData.setToolTipText("Automatically search and load chrome files."); 131 | toolBar.add(autoLoadData); 132 | 133 | toolBar.add(new JToolBar.Separator()); 134 | 135 | exportTSV = new JButton("Export to"); 136 | exportTSV.setIcon(Utils.createImageIcon("images/csv.png", "Export results to CSV")); 137 | exportTSV.setToolTipText("Export Results to CSV"); 138 | exportTSV.setHorizontalTextPosition(SwingConstants.LEFT); 139 | exportTSV.addActionListener(new ActionListener() { 140 | 141 | public void actionPerformed(ActionEvent ae) { 142 | ExportDialog export = new ExportDialog(ExportType.TSV); 143 | export.setVisible(true); 144 | } 145 | }); 146 | toolBar.add(exportTSV); 147 | 148 | exportHTML = new JButton("Export to"); 149 | exportHTML.setIcon(Utils.createImageIcon("images/html.png", "Export results to HTML")); 150 | exportHTML.setToolTipText("Export results to HTML."); 151 | exportHTML.setHorizontalTextPosition(SwingConstants.LEFT); 152 | toolBar.add(exportHTML); 153 | 154 | toolBar.add(new JToolBar.Separator()); 155 | 156 | helpButton = new JButton(); 157 | helpButton.setIcon(Utils.createImageIcon("images/help.png", "Need Help? Click Me!")); 158 | helpButton.setToolTipText("Need Help? Click Me!"); 159 | toolBar.add(helpButton); 160 | 161 | aboutButton = new JButton(); 162 | aboutButton.setIcon(Utils.createImageIcon("images/about.png", "About this tool!")); 163 | aboutButton.setToolTipText("About this tool!"); 164 | toolBar.add(aboutButton); 165 | 166 | toolBar.add(new JToolBar.Separator()); 167 | 168 | exitButton = new JButton(); 169 | exitButton.setIcon(Utils.createImageIcon("images/exit.png", "Exit Application.")); 170 | exitButton.setToolTipText("Exit Application"); 171 | exitButton.addActionListener(new ActionListener() { 172 | 173 | public void actionPerformed(ActionEvent actionEvent) { 174 | ChromeForensicsGui.getInstance().dispose(); 175 | } 176 | }); 177 | toolBar.add(exitButton); 178 | } 179 | 180 | private void initTabbedPane() { 181 | visits = new JPanel(); 182 | mostVisitedSites = new JPanel(); 183 | urls = new JPanel(); 184 | logins = new JPanel(); 185 | downloads = new JPanel(); 186 | keywords = new JPanel(); 187 | bookmarks = new JPanel(); 188 | cookies = new JPanel(); 189 | preferences = new JPanel(); 190 | favicons = new JPanel(); 191 | customQuery = new JPanel(); 192 | 193 | SQLiteDataBrowser dbBrowser = new SQLiteDataBrowser(); 194 | FileViewer fileViewer = FileViewer.getInstance(); 195 | 196 | tabbedPane = new JTabbedPane(); 197 | tabbedPane.addTab("Visited Sites", visits); 198 | tabbedPane.addTab("Most Visited Sites", mostVisitedSites); 199 | tabbedPane.addTab("All Urls", urls); 200 | tabbedPane.addTab("Logins", logins); 201 | tabbedPane.addTab("Downloads", downloads); 202 | tabbedPane.addTab("Keyword Search Terms", keywords); 203 | tabbedPane.addTab("Bookmarks", bookmarks); 204 | tabbedPane.addTab("Cookies", cookies); 205 | tabbedPane.addTab("Preferences", preferences); 206 | tabbedPane.addTab("Favicons", favicons); 207 | tabbedPane.addTab("Custom SQL Query", customQuery); 208 | tabbedPane.addTab("SQLite Data Browser", dbBrowser); 209 | tabbedPane.addTab("File Viewer", fileViewer); 210 | 211 | tabbedPanelDetails = new HashMap<>(); 212 | tabbedPanelDetails.put(0, visits); 213 | tabbedPanelDetails.put(1, mostVisitedSites); 214 | tabbedPanelDetails.put(2, urls); 215 | tabbedPanelDetails.put(3, logins); 216 | tabbedPanelDetails.put(4, downloads); 217 | tabbedPanelDetails.put(5, keywords); 218 | tabbedPanelDetails.put(6, bookmarks); 219 | tabbedPanelDetails.put(7, cookies); 220 | tabbedPanelDetails.put(8, preferences); 221 | tabbedPanelDetails.put(9, favicons); 222 | tabbedPanelDetails.put(10, customQuery); 223 | tabbedPanelDetails.put(11, dbBrowser); 224 | tabbedPanelDetails.put(12, fileViewer); 225 | } 226 | 227 | /** 228 | * Get the Width of the MainPanel. 229 | * 230 | * @return returns the height of the Component. 231 | */ 232 | @Override 233 | public final int getWidth() { 234 | return WIDTH; 235 | } 236 | 237 | /** 238 | * Get the Height of the MainPanel. 239 | * 240 | * @return returns the height of the Component. 241 | */ 242 | @Override 243 | public final int getHeight() { 244 | return HEIGHT; 245 | } 246 | 247 | /** 248 | * Returns the selected index of the tab. 249 | * 250 | * @return int 251 | */ 252 | public int getSelectedTabIndex() { 253 | return tabbedPane.getSelectedIndex(); 254 | } 255 | 256 | /** 257 | * Focuses the tab at index i 258 | * 259 | * @param i sets the current selected tab. 260 | */ 261 | public void setSelectedTabIndex(int i) { 262 | tabbedPane.setSelectedIndex(i); 263 | } 264 | 265 | /** 266 | * @return 267 | */ 268 | public Map getTabbedPaneComponentDetails() { 269 | return tabbedPanelDetails; 270 | } 271 | 272 | /** 273 | * Status Bar to be added to the Main Panel 274 | * 275 | * @author Psycho_Coder 276 | */ 277 | final class StatusBar extends JPanel { 278 | 279 | public StatusBar() { 280 | setPreferredSize(new Dimension(getWidth(), 30)); 281 | setBackground(Color.DARK_GRAY); 282 | } 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.gui; 17 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/tools/FileViewer.java: -------------------------------------------------------------------------------- 1 | package net.letshackit.chromeforensics.gui.tools; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.Color; 5 | import java.awt.Dimension; 6 | import java.awt.FlowLayout; 7 | import java.awt.Font; 8 | import java.awt.event.ActionEvent; 9 | import java.awt.event.ActionListener; 10 | import java.io.BufferedReader; 11 | import java.io.File; 12 | import java.io.IOException; 13 | import java.nio.charset.StandardCharsets; 14 | import java.nio.file.Files; 15 | import javax.swing.BorderFactory; 16 | import javax.swing.JButton; 17 | import javax.swing.JFileChooser; 18 | import javax.swing.JLabel; 19 | import javax.swing.JPanel; 20 | import javax.swing.JScrollPane; 21 | import javax.swing.JTable; 22 | import javax.swing.JTextArea; 23 | import javax.swing.JTextField; 24 | import javax.swing.SwingWorker; 25 | import javax.swing.border.LineBorder; 26 | import javax.swing.border.TitledBorder; 27 | import javax.swing.table.DefaultTableModel; 28 | import net.letshackit.chromeforensics.core.Utils; 29 | 30 | public final class FileViewer extends JPanel { 31 | 32 | private static final FileViewer fileViewer = new FileViewer(); 33 | 34 | private JPanel loadPanel; 35 | private JPanel fileMetadata; 36 | private JLabel loadFileLabel; 37 | private JTextField loadedFileLoc; 38 | private JTextArea textArea; 39 | private JScrollPane scrollPane; 40 | private JScrollPane metadataScroller; 41 | private JButton browseDb; 42 | private JFileChooser fc; 43 | private JTable metadataTable; 44 | 45 | private File lastFolderLocation; 46 | 47 | private FileViewer() { 48 | initComponents(); 49 | } 50 | 51 | public static FileViewer getInstance() { 52 | return fileViewer; 53 | } 54 | 55 | public void initComponents() { 56 | setLayout(new BorderLayout()); 57 | 58 | fileMetadata = new JPanel(new BorderLayout()); 59 | fileMetadata.setPreferredSize(new Dimension(getWidth(), 150)); 60 | fileMetadata.setBackground(Color.BLACK); 61 | 62 | final DefaultTableModel tableModel = new DefaultTableModel() { 63 | 64 | @Override 65 | public boolean isCellEditable(int row, int column) { 66 | return true; 67 | } 68 | }; 69 | 70 | metadataTable = new JTable(tableModel); 71 | 72 | metadataScroller = new JScrollPane(metadataTable); 73 | metadataScroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 74 | metadataScroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 75 | metadataScroller.setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.WHITE), 76 | "File Metadata Attributes", TitledBorder.CENTER, TitledBorder.TOP, 77 | new Font("Cambria", Font.ITALIC, 14), Color.WHITE)); 78 | 79 | fileMetadata.add(metadataScroller, BorderLayout.CENTER); 80 | add(fileMetadata, BorderLayout.SOUTH); 81 | 82 | loadPanel = new JPanel(new FlowLayout()); 83 | loadPanel.setBackground(new Color(0xe8e8e8)); 84 | 85 | loadFileLabel = new JLabel("Load File: "); 86 | loadFileLabel.setToolTipText("Reads file as it would in a text editor."); 87 | 88 | loadedFileLoc = new JTextField("Click browse to choose the file.", 60); 89 | loadedFileLoc.setForeground(Color.GRAY); 90 | loadedFileLoc.setFont(new Font("Times New Roman", Font.ITALIC, 13)); 91 | loadedFileLoc.setEditable(false); 92 | 93 | textArea = new JTextArea(10, 20); 94 | textArea.setLineWrap(false); 95 | textArea.setEditable(false); 96 | 97 | scrollPane = new JScrollPane(textArea); 98 | scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 99 | scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 100 | 101 | lastFolderLocation = new File(Utils.getUserHome()); 102 | fc = new JFileChooser(lastFolderLocation); 103 | 104 | browseDb = new JButton("Browse"); 105 | browseDb.addActionListener(new ActionListener() { 106 | 107 | @Override 108 | public void actionPerformed(ActionEvent actionEvent) { 109 | int retVal = fc.showOpenDialog(FileViewer.this); 110 | if (retVal == JFileChooser.APPROVE_OPTION) { 111 | 112 | final File fileLoc = fc.getSelectedFile(); 113 | loadedFileLoc.setText(fileLoc.toString()); 114 | lastFolderLocation = fc.getCurrentDirectory(); 115 | 116 | new SwingWorker() { 117 | 118 | @Override 119 | protected Void doInBackground() throws Exception { 120 | String line; 121 | try (BufferedReader reader = Files.newBufferedReader(fileLoc.toPath(), 122 | StandardCharsets.ISO_8859_1)) { 123 | textArea.setText(""); 124 | //reader.lines().map(s -> s + "\n").forEach(textArea::append); 125 | while ((line = reader.readLine()) != null) { 126 | textArea.append(line); 127 | textArea.append("\n"); 128 | } 129 | Object[][] dataVector = Utils.to2DObjectArray(Utils.getFileMetadata(fileLoc.toPath())); 130 | tableModel.setDataVector(dataVector, new Object[]{"Attribute Name", "Value"}); 131 | } catch (IOException e) { 132 | e.printStackTrace(); 133 | } 134 | return null; 135 | } 136 | }.execute(); 137 | } 138 | } 139 | }); 140 | 141 | loadPanel.add(loadFileLabel); 142 | loadPanel.add(loadedFileLoc); 143 | loadPanel.add(browseDb); 144 | 145 | add(loadPanel, BorderLayout.NORTH); 146 | add(scrollPane, BorderLayout.CENTER); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/tools/SQLiteDataBrowser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Psycho_Coder . 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.gui.tools; 17 | 18 | import java.awt.BorderLayout; 19 | import java.awt.Color; 20 | import java.awt.Cursor; 21 | import java.awt.Dimension; 22 | import java.awt.FlowLayout; 23 | import java.awt.Font; 24 | import java.awt.event.ActionEvent; 25 | import java.awt.event.ActionListener; 26 | import java.awt.event.MouseAdapter; 27 | import java.awt.event.MouseEvent; 28 | import java.io.File; 29 | import java.sql.ResultSet; 30 | import java.sql.SQLException; 31 | import java.util.Vector; 32 | import java.util.regex.PatternSyntaxException; 33 | import javax.swing.BorderFactory; 34 | import javax.swing.JButton; 35 | import javax.swing.JCheckBox; 36 | import javax.swing.JFileChooser; 37 | import javax.swing.JLabel; 38 | import javax.swing.JList; 39 | import javax.swing.JOptionPane; 40 | import javax.swing.JPanel; 41 | import javax.swing.JScrollPane; 42 | import javax.swing.JTable; 43 | import javax.swing.JTextField; 44 | import javax.swing.ListSelectionModel; 45 | import javax.swing.RowFilter; 46 | import javax.swing.ScrollPaneConstants; 47 | import javax.swing.SwingWorker; 48 | import javax.swing.border.LineBorder; 49 | import javax.swing.event.DocumentEvent; 50 | import javax.swing.event.DocumentListener; 51 | import javax.swing.table.DefaultTableModel; 52 | import javax.swing.table.TableModel; 53 | import javax.swing.table.TableRowSorter; 54 | import net.letshackit.chromeforensics.core.Utils; 55 | import net.letshackit.chromeforensics.core.db.DBConnectionPool; 56 | import net.letshackit.chromeforensics.core.db.SQLiteDbModel; 57 | import org.apache.logging.log4j.LogManager; 58 | import org.apache.logging.log4j.Logger; 59 | 60 | public final class SQLiteDataBrowser extends JPanel { 61 | 62 | private final DefaultTableModel tableModel; 63 | private JList showTablesList; 64 | private JLabel loadDbLabel; 65 | private JLabel loadDbRecords; 66 | private JLabel loadDbRecordsCount; 67 | private JTextField loadedDbPath; 68 | private JPanel loadDbPanel; 69 | private JScrollPane showTablesListScroller; 70 | private JScrollPane tableScrollPane; 71 | private JButton browseDb; 72 | private JTable table; 73 | private JFileChooser fc; 74 | private File lastFolderLocation; 75 | 76 | private SQLiteDbModel dbModel; 77 | 78 | final static Logger logger = LogManager.getLogger(SQLiteDataBrowser.class); 79 | 80 | public SQLiteDataBrowser() { 81 | final DBConnectionPool dbConnPool = DBConnectionPool.getInstance(); 82 | setLayout(new BorderLayout()); 83 | 84 | showTablesList = new JList(); 85 | showTablesList.setLayoutOrientation(JList.VERTICAL_WRAP); 86 | showTablesList.setSelectedIndex(ListSelectionModel.SINGLE_SELECTION); 87 | showTablesList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 88 | showTablesList.setFont(new Font("Times New Roman", Font.PLAIN, 13)); 89 | showTablesList.setDragEnabled(false); 90 | showTablesList.setFixedCellWidth(150); 91 | showTablesList.setVisibleRowCount(-1); 92 | showTablesList.setEnabled(false); 93 | 94 | showTablesListScroller = new JScrollPane(showTablesList); 95 | showTablesListScroller.setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.BLACK), 96 | "List of Tables")); 97 | showTablesListScroller.setPreferredSize(new Dimension(160, this.getHeight())); 98 | 99 | add(showTablesListScroller, BorderLayout.EAST); 100 | 101 | loadDbPanel = new JPanel(new FlowLayout()); 102 | loadDbPanel.setBackground(new Color(0xe8e8e8)); 103 | loadDbPanel.setPreferredSize(new Dimension(getWidth(), 40)); 104 | 105 | loadDbLabel = new JLabel("Load SQLite Database: "); 106 | loadDbLabel.setToolTipText("Possible extensions being .sqlite|.sqlite3|.db|.db3"); 107 | 108 | loadedDbPath = new JTextField("Click browse to choose the database file.", 40); 109 | loadedDbPath.setForeground(Color.GRAY); 110 | loadedDbPath.setFont(new Font("Times New Roman", Font.ITALIC, 13)); 111 | loadedDbPath.setEditable(false); 112 | 113 | lastFolderLocation = new File(Utils.getUserHome()); 114 | fc = new JFileChooser(lastFolderLocation); 115 | 116 | browseDb = new JButton("Browse"); 117 | browseDb.addActionListener(new ActionListener() { 118 | 119 | @Override 120 | public void actionPerformed(ActionEvent ae) { 121 | int retVal = fc.showOpenDialog(SQLiteDataBrowser.this); 122 | if (retVal == JFileChooser.APPROVE_OPTION) { 123 | File dbPath = fc.getSelectedFile(); 124 | 125 | if (!dbConnPool.isConnectionOpened(dbPath)) { 126 | dbModel = new SQLiteDbModel(); 127 | dbConnPool.add(dbPath, dbModel); 128 | dbModel.setDbPath(dbPath.toString()); 129 | dbModel.initialize(); 130 | } else { 131 | dbModel = dbConnPool.getConnection(dbPath); 132 | } 133 | 134 | if (Utils.isSQLiteDb(dbPath)) { 135 | loadedDbPath.setText(dbPath.toString()); 136 | lastFolderLocation = fc.getCurrentDirectory(); 137 | new SwingWorker() { 138 | 139 | @Override 140 | protected Void doInBackground() throws Exception { 141 | try { 142 | Vector tableList = dbModel.getTables(); 143 | if (tableList != null) { 144 | showTablesList.setListData(tableList); 145 | } else { 146 | JOptionPane.showMessageDialog(SQLiteDataBrowser.this, 147 | "No tables are present in the selected database", 148 | "No Records fetched", JOptionPane.WARNING_MESSAGE); 149 | } 150 | showTablesList.setEnabled(true); 151 | } catch (SQLException e) { 152 | System.err.println(e.getMessage()); 153 | } 154 | 155 | return null; 156 | } 157 | }.execute(); 158 | } else { 159 | JOptionPane.showMessageDialog(SQLiteDataBrowser.this, "The Selected file is not in SQLite Format", 160 | "File Format Error", JOptionPane.ERROR_MESSAGE); 161 | loadedDbPath.setText("Click browse to choose the database file."); 162 | } 163 | } 164 | } 165 | }); 166 | 167 | loadDbPanel.add(loadDbLabel); 168 | loadDbPanel.add(loadedDbPath); 169 | loadDbPanel.add(browseDb); 170 | 171 | loadDbRecords = new JLabel("Records Fetched (Rows x Cols): "); 172 | loadDbRecords.setFont(new Font("Times New Roman", Font.ITALIC, 12)); 173 | loadDbPanel.add(loadDbRecords); 174 | 175 | loadDbRecordsCount = new JLabel(); 176 | loadDbRecordsCount.setFont(new Font("Times New Roman", Font.ITALIC, 12)); 177 | loadDbPanel.add(loadDbRecordsCount); 178 | 179 | tableModel = new DataBrowserTableModal(); 180 | 181 | table = new JTable(); 182 | table.setModel(tableModel); 183 | 184 | showTablesList.addMouseListener(new MouseAdapter() { 185 | @Override 186 | public void mouseClicked(MouseEvent evt) { 187 | JList list = (JList) evt.getSource(); 188 | if (evt.getClickCount() == 2) { 189 | final String tableName = list.getSelectedValue().toString(); 190 | 191 | new SwingWorker() { 192 | 193 | @Override 194 | protected Void doInBackground() throws Exception { 195 | try { 196 | Vector columnNames; 197 | Vector> tableData; 198 | try (ResultSet rs = dbModel.executeQuery("SELECT * from " + tableName)) { 199 | columnNames = dbModel.getColumnNames(rs); 200 | tableData = new Vector<>(); 201 | while (rs.next()) { 202 | Vector vector = new Vector<>(); 203 | 204 | for (int i = 1; i <= columnNames.size(); i++) { 205 | vector.add(rs.getObject(i)); 206 | } 207 | tableData.add(vector); 208 | } 209 | } 210 | tableModel.setDataVector(tableData, columnNames); 211 | } catch (SQLException e) { 212 | System.err.println(e.getMessage()); 213 | } 214 | 215 | loadDbRecordsCount.setText(tableModel.getRowCount() + " x " 216 | + tableModel.getColumnCount()); 217 | 218 | if (tableModel.getColumnCount() <= 5) { 219 | table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); 220 | } else { 221 | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 222 | } 223 | 224 | return null; 225 | } 226 | }.execute(); 227 | } 228 | } 229 | }); 230 | 231 | tableScrollPane = new JScrollPane(table); 232 | tableScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); 233 | tableScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); 234 | tableScrollPane.setPreferredSize(new Dimension(getWidth(), getHeight())); 235 | add(tableScrollPane, BorderLayout.CENTER); 236 | 237 | add(loadDbPanel, BorderLayout.NORTH); 238 | 239 | DBTableFilterPanel filterPanel = new DBTableFilterPanel(); 240 | table.setRowSorter(filterPanel.getRowSorter()); 241 | add(filterPanel, BorderLayout.SOUTH); 242 | } 243 | 244 | public JTable getDataTable() { 245 | return table; 246 | } 247 | 248 | /** 249 | * TableModel to be used for the Browser JTable. 250 | */ 251 | final class DataBrowserTableModal extends DefaultTableModel { 252 | 253 | public DataBrowserTableModal() { 254 | } 255 | 256 | public DataBrowserTableModal(Object[][] tableData, Object[] colNames) { 257 | super(tableData, colNames); 258 | } 259 | 260 | @Override 261 | public void setDataVector(Object[][] tableData, Object[] colNames) { 262 | super.setDataVector(tableData, colNames); 263 | } 264 | 265 | @Override 266 | public boolean isCellEditable(int row, int column) { 267 | return false; 268 | } 269 | } 270 | 271 | /** 272 | * Filter Panel to enable searching and 273 | */ 274 | final class DBTableFilterPanel extends JPanel { 275 | 276 | private TableRowSorter rowSorter; 277 | 278 | private JLabel label; 279 | 280 | private JTextField filterField; 281 | 282 | private JCheckBox regexEnabled; 283 | 284 | public DBTableFilterPanel() { 285 | initComponents(); 286 | } 287 | 288 | public void initComponents() { 289 | setPreferredSize(new Dimension(getWidth(), 60)); 290 | setBackground(Color.LIGHT_GRAY); 291 | setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.BLACK), "Filter Panel")); 292 | setLayout(new FlowLayout()); 293 | 294 | rowSorter = new TableRowSorter<>((TableModel) tableModel); 295 | rowSorter.setSortsOnUpdates(true); 296 | 297 | label = new JLabel("Enter Query: "); 298 | label.setFont(new Font("Times New Roman", Font.PLAIN, 14)); 299 | add(label); 300 | 301 | regexEnabled = new JCheckBox("Use Regex"); 302 | regexEnabled.setFont(new Font("Times New Roman", Font.PLAIN, 14)); 303 | regexEnabled.setBorderPaintedFlat(true); 304 | 305 | filterField = new JTextField(50); 306 | filterField.setForeground(Color.GRAY); 307 | filterField.setFont(new Font("Times New Roman", Font.ITALIC, 13)); 308 | 309 | filterField.getDocument().addDocumentListener(new DocumentListener() { 310 | 311 | @Override 312 | public void insertUpdate(DocumentEvent documentEvent) { 313 | String data = filterField.getText().trim(); 314 | if (data.isEmpty()) { 315 | rowSorter.setRowFilter(null); 316 | } else { 317 | try { 318 | if (regexEnabled.isSelected()) { 319 | rowSorter.setRowFilter(RowFilter.regexFilter(data)); 320 | } else { 321 | rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + data)); 322 | } 323 | } catch (PatternSyntaxException e) { 324 | System.err.println(e.getMessage()); 325 | } 326 | } 327 | } 328 | 329 | @Override 330 | public void removeUpdate(DocumentEvent documentEvent) { 331 | String data = filterField.getText().trim(); 332 | if (data.isEmpty()) { 333 | rowSorter.setRowFilter(null); 334 | } else { 335 | try { 336 | if (regexEnabled.isSelected()) { 337 | rowSorter.setRowFilter(RowFilter.regexFilter(data)); 338 | } else { 339 | rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + data)); 340 | } 341 | } catch (PatternSyntaxException e) { 342 | System.err.println(e.getMessage()); 343 | } 344 | } 345 | } 346 | 347 | @Override 348 | public void changedUpdate(DocumentEvent documentEvent) { 349 | throw new UnsupportedOperationException("Not supported yet."); 350 | } 351 | }); 352 | 353 | add(filterField); 354 | add(regexEnabled); 355 | } 356 | 357 | public TableRowSorter getRowSorter() { 358 | return rowSorter; 359 | } 360 | } 361 | } 362 | -------------------------------------------------------------------------------- /src/main/java/net/letshackit/chromeforensics/gui/tools/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Animesh Shaw ( a.k.a. Psycho_Coder). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package net.letshackit.chromeforensics.gui.tools; 17 | -------------------------------------------------------------------------------- /src/main/resources/JTattoo-1.6.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/JTattoo-1.6.11.jar -------------------------------------------------------------------------------- /src/main/resources/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/about.png -------------------------------------------------------------------------------- /src/main/resources/images/about_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/about_small.png -------------------------------------------------------------------------------- /src/main/resources/images/autosearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/autosearch.png -------------------------------------------------------------------------------- /src/main/resources/images/autosearch_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/autosearch_small.png -------------------------------------------------------------------------------- /src/main/resources/images/bing_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/bing_small.png -------------------------------------------------------------------------------- /src/main/resources/images/chrome_forensics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/chrome_forensics.png -------------------------------------------------------------------------------- /src/main/resources/images/clear_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/clear_small.png -------------------------------------------------------------------------------- /src/main/resources/images/csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/csv.png -------------------------------------------------------------------------------- /src/main/resources/images/csv_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/csv_small.png -------------------------------------------------------------------------------- /src/main/resources/images/databrowse_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/databrowse_small.png -------------------------------------------------------------------------------- /src/main/resources/images/duckduckgo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/duckduckgo_small.png -------------------------------------------------------------------------------- /src/main/resources/images/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/exit.png -------------------------------------------------------------------------------- /src/main/resources/images/exit_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/exit_small.png -------------------------------------------------------------------------------- /src/main/resources/images/filter_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/filter_small.png -------------------------------------------------------------------------------- /src/main/resources/images/google_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/google_small.png -------------------------------------------------------------------------------- /src/main/resources/images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/help.png -------------------------------------------------------------------------------- /src/main/resources/images/help_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/help_small.png -------------------------------------------------------------------------------- /src/main/resources/images/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/html.png -------------------------------------------------------------------------------- /src/main/resources/images/html_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/html_small.png -------------------------------------------------------------------------------- /src/main/resources/images/loaddata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/loaddata.png -------------------------------------------------------------------------------- /src/main/resources/images/loaddata_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/loaddata_small.png -------------------------------------------------------------------------------- /src/main/resources/images/searchengine_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/searchengine_small.png -------------------------------------------------------------------------------- /src/main/resources/images/sql_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/sql_small.png -------------------------------------------------------------------------------- /src/main/resources/images/yahoo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimeshShaw/ChromeForensics/1382ccf1dcd86cba371290d97df15769e5fd28e2/src/main/resources/images/yahoo_small.png -------------------------------------------------------------------------------- /src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | %d{dd/MMM/yyyy HH:mm:ss,SSS}- %c{1}: %m%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | --------------------------------------------------------------------------------