EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


JavaBo

By: ishkur88  -  Date Submitted: 2008-09-13 12:57:38

  1. package ircbot;
  2.  
  3. /**
  4.  * JavaBot (version 1.2)
  5.  *
  6.  * MIT License, dydx (Josh Sandlin) <dydx@thenullbyte.org>
  7.  *
  8.  */
  9.  
  10. import java.io.*;
  11. import java.net.*;
  12. import java.util.regex.*;
  13. import java.util.Date;
  14.  
  15. public class Main
  16. {
  17. public static void main( String[] args ) throws IOException
  18. {
  19. //connection variables
  20. String server = "irc.snappeh.com";
  21. String nick = "JavaBot";
  22. String login = "JavaBot";
  23. String channel = "#enigmagroup";
  24. int port = 6667;
  25.  
  26. //for security
  27. String owner = "dydx";
  28.  
  29. try {
  30.  
  31. //our socket we're connected with
  32. Socket irc = new Socket( server, port );
  33. //out output stream
  34. BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( irc.getOutputStream() ) );
  35. //our input stream
  36. BufferedReader br = new BufferedReader( new InputStreamReader( irc.getInputStream() ) );
  37.  
  38. //authenticate with the server
  39. bw.write( "NICK " + nick + "\n" );
  40. bw.write( "USER " + login + " thenullbyte.org JB: Java Bot\n" );
  41. bw.flush();
  42.  
  43. //join a channel
  44. bw.write( "JOIN " + channel + "\n" );
  45. bw.write( "PRIVMSG " + channel + " :Whats up everybody?\n" );
  46. bw.flush();
  47. System.out.println( "Successfully connected to IRC" );
  48.  
  49. String currLine = null;
  50. while( ( currLine = br.readLine() ) != null )
  51. {
  52. //checks for PING, if one is found; return a PONG
  53. Pattern pingRegex = Pattern.compile( "^PING", Pattern.CASE_INSENSITIVE );
  54. Matcher ping = pingRegex.matcher( currLine );
  55. if( ping.find() )
  56. {
  57. bw.write( "PONG " + channel + "\n" );
  58. bw.flush();
  59. }
  60.  
  61.  
  62. //check for ownership
  63. Pattern checkOwner = Pattern.compile( "^:"+owner, Pattern.CASE_INSENSITIVE );
  64. Matcher ownership = checkOwner.matcher( currLine );
  65.  
  66. //!exit - quit current irc room
  67. Pattern exitRegex = Pattern.compile( "!exit", Pattern.CASE_INSENSITIVE );
  68. Matcher exit = exitRegex.matcher( currLine );
  69. if( exit.find() && ownership.find() )
  70. {
  71. bw.write( "PRIVMSG " + channel + " :Bye Bye\n" );
  72. bw.write( "PART " + channel + "\n" );
  73. bw.flush();
  74. irc.close();
  75. }
  76.  
  77. //!time - return current time
  78. Pattern timeRegex = Pattern.compile( "!time", Pattern.CASE_INSENSITIVE );
  79. Matcher time = timeRegex.matcher( currLine );
  80. if( time.find() && ownership.find() )
  81. {
  82. Date d = new Date();
  83. bw.write( "PRIVMSG " + channel + " :" + d +"\n" );
  84. bw.flush();
  85. }
  86.  
  87. //!sayhi - shows a little message saying hello
  88. Pattern helloRegex = Pattern.compile( "!sayhi", Pattern.CASE_INSENSITIVE );
  89. Matcher hello = helloRegex.matcher( currLine );
  90. if( hello.find() && ownership.find() )
  91. {
  92. bw.write( "PRIVMSG " + channel + " :Hi, I'm a JavaBot. I was coded by dydx in Java!\n");
  93. bw.flush();
  94. }
  95.  
  96. //!join <room> - changes to a new room and sets the variables accordingly
  97. Pattern joinRegex = Pattern.compile( "!join", Pattern.CASE_INSENSITIVE );
  98. Matcher join = joinRegex.matcher( currLine );
  99. if( join.find() && ownership.find() )
  100. {
  101. String[] token = currLine.split( " " );
  102. bw.write( "PRIVMSG " + channel + " :Im going over to " + token[4] + "\n" );
  103. bw.write( "PART " + channel + "\n" );
  104. channel = token[4];
  105. bw.write( "JOIN " + channel + "\n" );
  106. bw.flush();
  107. }
  108.  
  109. //just to be mean ;)
  110. Pattern howDoI = Pattern.compile( "how do i", Pattern.CASE_INSENSITIVE );
  111. Matcher how = howDoI.matcher( currLine );
  112. if( how.find() )
  113. {
  114. bw.write( "PRIVMSG " + channel + " :just fucking google it...\n" );
  115. bw.flush();
  116. }
  117.  
  118. Pattern whyRegex = Pattern.compile( "why", Pattern.CASE_INSENSITIVE );
  119. Matcher why = whyRegex.matcher( currLine );
  120. if( why.find() )
  121. {
  122. bw.write( "PRIVMSG " + channel + " :DONT ASK QUESTIONS!\n" );
  123. bw.flush();
  124. }
  125.  
  126. }
  127. } catch ( UnknownHostException e ) {
  128. System.err.println( "No such host" );
  129. } catch ( IOException e ) {
  130. System.err.println( "There was an error connecting to the host" );
  131. }
  132. }
  133. }
Return to java category list

Who Visited EnigmaGroup Today?

1563 Guests, 265 Users (178 Spiders)
TheHarrisonW, lonely.connection, IvanDimitriev, 2142, CloverCipher, 2345, Hessesian, vnd, suetekh, Distorted, aurena, Rex_Mundi, m0rt, 3ntr0py, rospark, valy1177, whisperer, Blavatsky, lotato, nmobin27, learning, st3alth, Partisan, hackaday, K0gller, fitz, DrOptix, Jayjay, JohnMalkovitzch, psychomarine, whoami, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, BillTuer, Psiber_Syn, Klosse, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, GothicLogic, strudels, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, trueorfalse, Sir D. Naut, zach, batsbargy, Rik, Macabre, ellisp, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, limited, Nikhil, evjfvir967nj, blackknight911, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, riesenjoe, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, m4f10, Vengeance987, avacraft, Bumpadjuppy, becool, thecoder, ddxc, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, RomeoG, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, advilapyday, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz, MSI52, twink gay cam dUi8D, temoJessy
 
Enigma Group