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:

August 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close