Advertisement
Guest User

Untitled

a guest
May 10th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.90 KB | None | 0 0
  1. package com.teamlixo.eggcrack;
  2.  
  3. import com.teamlixo.eggcrack.crack.CrackJob;
  4. import java.awt.Adjustable;
  5. import java.awt.Color;
  6. import java.awt.Dialog.ModalityType;
  7. import java.awt.Frame;
  8. import java.awt.event.ActionEvent;
  9. import java.awt.event.ActionListener;
  10. import java.awt.event.AdjustmentEvent;
  11. import java.awt.event.AdjustmentListener;
  12. import java.io.BufferedReader;
  13. import java.io.File;
  14. import java.io.FileNotFoundException;
  15. import java.io.FileReader;
  16. import java.io.IOException;
  17. import java.io.PrintStream;
  18. import java.util.ArrayList;
  19. import java.util.Arrays;
  20. import javax.swing.JButton;
  21. import javax.swing.JCheckBox;
  22. import javax.swing.JComboBox;
  23. import javax.swing.JDialog;
  24. import javax.swing.JFileChooser;
  25. import javax.swing.JFormattedTextField;
  26. import javax.swing.JLabel;
  27. import javax.swing.JOptionPane;
  28. import javax.swing.JPanel;
  29. import javax.swing.JProgressBar;
  30. import javax.swing.JRadioButton;
  31. import javax.swing.JScrollBar;
  32. import javax.swing.JScrollPane;
  33. import javax.swing.JSpinner;
  34. import javax.swing.JTabbedPane;
  35. import javax.swing.JTable;
  36. import javax.swing.SpinnerNumberModel;
  37. import javax.swing.UIManager;
  38. import javax.swing.UIManager.LookAndFeelInfo;
  39. import javax.swing.table.DefaultTableModel;
  40.  
  41. public class Main
  42. extends JDialog
  43. {
  44. private JPanel contentPane;
  45. private JSpinner maxthreads;
  46. private JSpinner interval;
  47. private JTable table1;
  48. private JButton start;
  49. private JScrollPane scroll;
  50. private JScrollPane scroll2;
  51. private JLabel thdcount;
  52. private JLabel crackedcnt;
  53. private JLabel failedcnt;
  54. private JLabel tps;
  55. private JProgressBar progress;
  56. private JTabbedPane tabs;
  57. private JButton ul;
  58. private JFormattedTextField usernamesFile;
  59. private JButton pl;
  60. private JButton hl;
  61. private JButton sl;
  62. private JFormattedTextField socksProxies;
  63. private JFormattedTextField httpProxies;
  64. private JFormattedTextField passwordsFile;
  65. private JButton ol;
  66. private JFormattedTextField outputFile;
  67. private JButton exit;
  68. private JComboBox api;
  69. private JCheckBox skipNonPremiumAccountsCheckBox;
  70. private JCheckBox autoSort;
  71. private JLabel attemptcnt;
  72. private JLabel eta;
  73. private JRadioButton cracking;
  74. private JRadioButton checking;
  75. private JLabel ulbl;
  76. private JLabel plbl;
  77. private JCheckBox sc;
  78. private JFormattedTextField submiturl;
  79. private JCheckBox oc;
  80. private JCheckBox threadClock;
  81. private JSpinner proxyTimeout;
  82. private JCheckBox checkProxies;
  83. private JLabel checkLbl;
  84. private JPanel pnl;
  85. private CrackJob currentJob;
  86.  
  87. public Main()
  88. {
  89. super((Frame)null, Dialog.ModalityType.TOOLKIT_MODAL);
  90.  
  91. $$$setupUI$$$();setContentPane(this.contentPane);
  92. setModal(true);
  93. setResizable(false);
  94. setTitle("EggCrack by Manevolent");
  95. setName("EggCrack by Manevolent");
  96.  
  97. this.maxthreads.setModel(new SpinnerNumberModel(32, 1, 10240000, 2));
  98. this.interval.setModel(new SpinnerNumberModel(5, 0, 60000, 5));
  99. this.proxyTimeout.setModel(new SpinnerNumberModel(5000, 1, 300000, 1000));
  100. this.proxyTimeout.setVisible(false);
  101. this.checkLbl.setVisible(false);
  102.  
  103. String[] columnNames = { "Username", "Password", "Requests", "Status" };
  104.  
  105. this.table1.setRowHeight(35);
  106. this.table1.setModel(new DefaultTableModel(columnNames, 0));
  107. this.start.addActionListener(new ActionListener()
  108. {
  109. public void actionPerformed(ActionEvent e)
  110. {
  111. if (Main.this.start.getText().equals("Stop"))
  112. {
  113. if (Main.this.currentJob != null) {
  114. Main.this.currentJob.setRunning(false);
  115. }
  116. Main.this.start.setText("Start");
  117. return;
  118. }
  119. if ((Main.this.currentJob != null) && (Main.this.currentJob.isAlive()))
  120. {
  121. JOptionPane.showMessageDialog(null, "You already have a cracking job running. Please wait for it to finish.");
  122. return;
  123. }
  124. String[] usernames = Main.this.readAllLines(Main.this.usernamesFile.getText());
  125. PasswordSourceFile passwords = null;
  126. try
  127. {
  128. if (Main.this.api.getSelectedIndex() > 2) {
  129. passwords = new PasswordSourceFileStreamed(new File(Main.this.passwordsFile.getText()));
  130. } else {
  131. passwords = new PasswordSourceFileBuffered(new File(Main.this.passwordsFile.getText()));
  132. }
  133. }
  134. catch (FileNotFoundException e1) {}catch (IOException e1) {}
  135. String[] phttp = Main.this.readAllLines(Main.this.httpProxies.getText());
  136. String[] psocks = Main.this.readAllLines(Main.this.socksProxies.getText());
  137. if (usernames == null)
  138. {
  139. JOptionPane.showMessageDialog(null, "There was a problem opening the usernames file.");
  140. return;
  141. }
  142. if ((Main.this.cracking.isSelected()) && (passwords == null))
  143. {
  144. JOptionPane.showMessageDialog(null, "There was a problem opening the password file.");
  145. return;
  146. }
  147. if ((phttp == null) && (psocks == null) &&
  148. (passwords == null))
  149. {
  150. JOptionPane.showMessageDialog(null, "No proxies are loaded! Please choose a proxy list.");
  151. return;
  152. }
  153. if (phttp == null) {
  154. phttp = new String[0];
  155. }
  156. if (psocks == null) {
  157. psocks = new String[0];
  158. }
  159. String ourl = Main.this.oc.isSelected() ? Main.this.outputFile.getText() : null;
  160. String curl = Main.this.sc.isSelected() ? Main.this.submiturl.getText() : null;
  161.  
  162. Main.this.currentJob = CrackJob.fromSettings(Main.this.table1, Main.this.failedcnt, Main.this.crackedcnt, Main.this.thdcount, Main.this.attemptcnt, Main.this.start, Main.this.tps, Main.this.eta, Main.this.progress, usernames, passwords, phttp, psocks, ((Integer)Main.this.maxthreads.getValue()).intValue(), ((Integer)Main.this.interval.getValue()).intValue(), ourl, Main.this.api.getSelectedIndex(), Main.this.skipNonPremiumAccountsCheckBox.isSelected(), Main.this.autoSort.isSelected(), Main.this.cracking.isSelected(), curl, Main.this.threadClock.isSelected(), ((Integer)Main.this.proxyTimeout.getValue()).intValue(), Main.this.checkProxies.isSelected());
  163.  
  164. DefaultTableModel model = (DefaultTableModel)Main.this.table1.getModel();
  165. while (model.getRowCount() > 0) {
  166. model.removeRow(0);
  167. }
  168. if (Main.this.currentJob != null)
  169. {
  170. Main.this.start.setText("Stop");
  171. Main.this.currentJob.updateFormNumbers();
  172. Main.this.currentJob.setETA();
  173.  
  174. Main.this.currentJob.beginJob();
  175. Main.this.tabs.setSelectedIndex(1);
  176. }
  177. else
  178. {
  179. Main.this.start.setText("Start");
  180. }
  181. }
  182. });
  183. this.scroll.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener()
  184. {
  185. public void adjustmentValueChanged(AdjustmentEvent e)
  186. {
  187. if ((Main.this.currentJob != null) && (Main.this.currentJob.isAlive())) {
  188. e.getAdjustable().setValue(e.getAdjustable().getMaximum());
  189. }
  190. }
  191. });
  192. final JFileChooser chooser = new JFileChooser();
  193. this.ul.addActionListener(new ActionListener()
  194. {
  195. public void actionPerformed(ActionEvent e)
  196. {
  197. int returnVal = chooser.showOpenDialog(Main.this);
  198. if (returnVal == 0)
  199. {
  200. File file = chooser.getSelectedFile();
  201. Main.this.usernamesFile.setText(file.getAbsolutePath());
  202. }
  203. }
  204. });
  205. this.pl.addActionListener(new ActionListener()
  206. {
  207. public void actionPerformed(ActionEvent e)
  208. {
  209. int returnVal = chooser.showOpenDialog(Main.this);
  210. if (returnVal == 0)
  211. {
  212. File file = chooser.getSelectedFile();
  213. Main.this.passwordsFile.setText(file.getAbsolutePath());
  214. }
  215. }
  216. });
  217. this.hl.addActionListener(new ActionListener()
  218. {
  219. public void actionPerformed(ActionEvent e)
  220. {
  221. int returnVal = chooser.showOpenDialog(Main.this);
  222. if (returnVal == 0)
  223. {
  224. File file = chooser.getSelectedFile();
  225. Main.this.httpProxies.setText(file.getAbsolutePath());
  226. }
  227. }
  228. });
  229. this.sl.addActionListener(new ActionListener()
  230. {
  231. public void actionPerformed(ActionEvent e)
  232. {
  233. int returnVal = chooser.showOpenDialog(Main.this);
  234. if (returnVal == 0)
  235. {
  236. File file = chooser.getSelectedFile();
  237. Main.this.socksProxies.setText(file.getAbsolutePath());
  238. }
  239. }
  240. });
  241. this.ol.addActionListener(new ActionListener()
  242. {
  243. public void actionPerformed(ActionEvent e)
  244. {
  245. int returnVal = chooser.showOpenDialog(Main.this);
  246. if (returnVal == 0)
  247. {
  248. File file = chooser.getSelectedFile();
  249. Main.this.outputFile.setText(file.getAbsolutePath());
  250. }
  251. }
  252. });
  253. this.exit.addActionListener(new ActionListener()
  254. {
  255. public void actionPerformed(ActionEvent e)
  256. {
  257. if ((Main.this.currentJob != null) && (Main.this.currentJob.isAlive())) {
  258. Main.this.currentJob.endJob();
  259. }
  260. System.exit(0);
  261. }
  262. });
  263. this.checking.addActionListener(new ActionListener()
  264. {
  265. public void actionPerformed(ActionEvent e)
  266. {
  267. Main.this.passwordsFile.setEnabled(false);
  268. Main.this.pl.setEnabled(false);
  269. Main.this.pl.setVisible(false);
  270. Main.this.passwordsFile.setVisible(false);
  271. Main.this.plbl.setVisible(false);
  272. Main.this.ulbl.setText("User:Pass:");
  273. }
  274. });
  275. this.cracking.addActionListener(new ActionListener()
  276. {
  277. public void actionPerformed(ActionEvent e)
  278. {
  279. Main.this.passwordsFile.setEnabled(true);
  280. Main.this.pl.setEnabled(true);
  281. Main.this.pl.setVisible(true);
  282. Main.this.passwordsFile.setVisible(true);
  283. Main.this.plbl.setVisible(true);
  284. Main.this.ulbl.setText("Usernames:");
  285. }
  286. });
  287. this.checkProxies.addActionListener(new ActionListener()
  288. {
  289. public void actionPerformed(ActionEvent e)
  290. {
  291. Main.this.proxyTimeout.setVisible(Main.this.checkProxies.isSelected());
  292. Main.this.checkLbl.setVisible(Main.this.checkProxies.isSelected());
  293. System.out.println(Main.this.pnl.size());
  294. }
  295. });
  296. }
  297.  
  298. private String[] readAllLines(String text)
  299. {
  300. File f = new File(text);
  301. try
  302. {
  303. FileReader fr = new FileReader(f);
  304. BufferedReader br = new BufferedReader(fr);
  305. ArrayList<String> arr = new ArrayList();
  306. while (br.ready()) {
  307. arr.add(br.readLine());
  308. }
  309. Object[] objectArray = arr.toArray();
  310. String[] stringArray = (String[])Arrays.copyOf(objectArray, objectArray.length, String[].class);
  311. objectArray = null;
  312. return stringArray;
  313. }
  314. catch (FileNotFoundException e)
  315. {
  316. return null;
  317. }
  318. catch (IOException e)
  319. {
  320. e.printStackTrace();
  321. }
  322. return null;
  323. }
  324.  
  325. public static void main(String[] args)
  326. {
  327. try
  328. {
  329. UIManager.put("nimbusBase", new Color(10, 10, 10));
  330. UIManager.put("nimbusBlueGrey", new Color(200, 200, 210));
  331. UIManager.put("control", new Color(150, 150, 150));
  332. for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
  333. if ("Nimbus".equals(info.getName()))
  334. {
  335. UIManager.setLookAndFeel(info.getClassName());
  336. break;
  337. }
  338. }
  339. }
  340. catch (Exception e)
  341. {
  342. try
  343. {
  344. UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
  345. }
  346. catch (Exception ex) {}
  347. }
  348. Main dialog = new Main();
  349.  
  350. dialog.pack();
  351. dialog.setLocationRelativeTo(null);
  352. dialog.setVisible(true);
  353.  
  354. System.exit(0);
  355. }
  356.  
  357. private void createUIComponents() {}
  358. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement