what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

mfp_chksrc.c

mfp_chksrc.c
Posted Nov 8, 2003
Authored by m4rc3l0

Mfp_chksrc.c checks C source code for commonly insecure functions like gets, fgets, strcpy, strcat, setenv, getenv, scanf, sscanf, fscanf, sprintf, fprintf, snprintf, syslog, system, popen, vsprintf, and vsnprintf.

systems | unix
SHA-256 | b11bc6cba21b894b2793849cea3b08c208c819a5d7cf1ea30677aa35c7bed1f4

mfp_chksrc.c

Change Mirror Download
/* mfp_chksrc.c (c)oded by m4rc3l0 in 102003 *
* *
* Baseado no srcsec.c feito por bob@dtors *
* Checa o source atras d funcoes bugadas do *
* tipo(strcpy, gets, ...) entendes feosos ? *
* *
* Greetz: Julie(T AMO LINDA), BashX, akabr, *
* eSc2, tuv8, habeas, brun3rz, r0ot, qwq, *
* acubidu, deadsckt, decodi(minha putana), *
* volfi, reignu, unistd, baalcefas, morfis, *
* fingulino, sinner, japex, joshua, anjin, *
* #dnh #binaryrebels #linuxarena *
* AT BRasnet *
* *
* www.binaryrebels.cjb.net *
* www.m4rc3l0rlz.hpg.ig.com.br *
* *
* Mail-eu: m4rc3l0rlz@yahoo.com.br */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define TAG "\x6d\x66\x70"
#define UND "\x5f"

#define MAX 100


void banner();

FILE *fp;

struct {
int t; // tipo, 0x1=BOF, 0x2=FMT
char *strs; // Str Search
} listun[] = {
{0x1, "gets"}, {0x1, "fgets"}, {0x1, "strcpy"},
{0x1, "strcat"}, {0x1, "setenv"}, {0x1, "getenv"},
{0x1, "scanf"}, {0x1, "sscanf"}, {0x1, "fscanf"},
{0x2, "sprintf"}, {0x2, "fprintf"}, {0x2, "snprintf"},
{0x2, "syslog"}, {0x2, "system"}, {0x2, "popen"},
{0x2, "vsprintf"}, {0x2, "vsnprintf"},
};

int main(int argc, char *argv[]) {
int fv=0; // Flag Verbose
int x, afu;
char bufi[100];
char *arq = (char *)malloc(MAX * sizeof(char));

if(argc!=2) {
banner();
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
exit(-1);
}
strncpy(arq, argv[1], strlen(argv[1]));

if((fp=fopen(arq, "r")) == NULL) {
fprintf(stderr, "Error opening file: %s\n", arq);
exit(-1);
}

printf("File: %s\n\n", arq);

fseek(fp, 0, SEEK_SET);

do {
afu = fscanf(fp, "%s\n", bufi);
for(x=0; x<17; x++) {
if((strstr(bufi, listun[x].strs)) != NULL) {
if(listun[x].t == 1) {
printf("%s():%db:BOF\n", listun[x].strs,
(ftell(fp)) - strlen(listun[x].strs)); // Valor qse certo
}
else
printf("%s():%db:FMT\n", listun[x].strs,
(ftell(fp)) - strlen(listun[x].strs)); // Valor qse certo
}
}
} while (afu != EOF);

fclose(fp);
return(0);
}


void banner(void) {
printf("%s%schksrc.c (c)oded by m4rc3l0\n", TAG, UND);
}
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close