forked from c0ll3cti0n/exploitpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashScreen.java
More file actions
251 lines (230 loc) · 10.1 KB
/
Copy pathSplashScreen.java
File metadata and controls
251 lines (230 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
package exploitpack;
import java.awt.Color;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.border.LineBorder;
import java.awt.Color;
import java.awt.Toolkit;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.awt.Color;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import org.fife.ui.autocomplete.*;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
import org.fife.ui.rtextarea.RTextScrollPane;
/**
*
* @author jsacco
*/
public class SplashScreen extends javax.swing.JFrame {
public boolean checkVersion = false;
List<String> config = new ArrayList<>();
/**
* Creates new form SplashScreen
*/
public SplashScreen() throws IOException {
System.out.println("Exploit Pack is running.. Happy hacking! :-)");
System.out.println("Pull the latest version from: https://github.com/juansacco/exploitpack ");
System.out.println("Questions? <jsacco@exploitpack.com>");
// Read config file
FileReader fstream = null;
try {
fstream = new FileReader("output/" + "config" + ".ep");
} catch (FileNotFoundException ex) {
Logger.getLogger(SplashScreen.class.getName()).log(Level.SEVERE, null, ex);
}
BufferedReader in = new BufferedReader(fstream);
String stringToAppend;
while ((stringToAppend = in.readLine()) != null) {
config.add(stringToAppend);
}
String proxy = config.get(7);
String proxyPort = config.get(8);
if (!proxy.equals("")) {
System.out.println("Using Proxy Server: " + proxy + ":" + proxyPort);
System.setProperty("http.proxyHost", proxy);
System.setProperty("http.proxyPort", proxyPort);
}
initComponents();
setLocationRelativeTo(null);
getContentPane().setBackground(Color.WHITE);
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/exploitpack/resources/bug.png")));
getRootPane().setBorder(new LineBorder(Color.black));
if (new File("exploits/rockyou").exists()) {
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/exploitpack/resources/demon.png"))); // NOI18N
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jProgressBar1 = new javax.swing.JProgressBar();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Exploit Pack");
setType(java.awt.Window.Type.POPUP);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/exploitpack/resources/demon.png"))); // NOI18N
jLabel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
public class paintProgress implements Runnable {
@Override
public void run() {
try {
for (int i = 0; i < 601; i++) {
jProgressBar1.setValue(i);
jProgressBar1.repaint();
Thread.sleep(5);
}
try {
//
// Remove files and directories
if (!Files.exists(new File("exploits").toPath())) {
String zipName = "data/" + File.separator + "exploits.zip";
ZipFile zipFile = new ZipFile(zipName);
zipFile.setPassword("90909090");
zipFile.extractAll(".");
}
if (config.get(4).equals("Anonymous")) {
ConfigWizard1.main(null);
}
// Create a URL to check app version
URL url = new URL(
"http://www.exploitpack.com/changelog/appversion");
// Read all the text returned by the server
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
String appversion;
while ((appversion = in.readLine()) != null) {
if (appversion.contains(">") || appversion.contains("<")) {
throw new IOException();
}
if (appversion.equals("9.0")) {
System.out.println("You have the latest version");
dispose();
MainFrame.main(null);
} else {
dispose();
NewVersion.main(null);
}
}
in.close();
} catch (IOException ex) {
System.out.println("Exploit Pack cannot check for updates..");
System.out.println("Warning: No internet access for this instance");
dispose();
MainFrame.main(null);
}
checkVersion = true;
} catch (Exception e) {
// No log.
}
}
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
jProgressBar1.setMaximum(600);
new Thread(new paintProgress()).start();
}//GEN-LAST:event_formWindowOpened
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(SplashScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SplashScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SplashScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SplashScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
new SplashScreen().setVisible(true);
} catch (IOException ex) {
Logger.getLogger(SplashScreen.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JProgressBar jProgressBar1;
// End of variables declaration//GEN-END:variables
}