Vulny-Code-Static-Analysis/index.py

41 lines
1.8 KiB
Python
Raw Normal View History

#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author : Swissky
# How to use : python index.py --dir test
# Educational purpose only !
# TODO afficher toutes les modifications de la variable -
2017-05-28 20:11:40 +00:00
# TODO checker recursivement les vulns dans la déclaration d'une var
# BUG color var['something']
2017-05-28 20:11:40 +00:00
# TODO serialize detection
import sys
import argparse
import os, re
2017-05-21 13:56:42 +00:00
from detection import *
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--dir', action ='store', dest='dir', help="Directory to analyse")
results = parser.parse_args()
2017-05-21 13:56:42 +00:00
if results.dir != None:
2017-05-23 22:23:05 +00:00
print " (`-') <-. (`-')_ _(`-') (`-') _"
print " _(OO ) .-> <-. \( OO) ) .-> _ .-> ( (OO ).-> ( OO).-/"
print ",--.(_/,-.\,--.(,--. ,--. ) ,--./ ,--/ ,--.' ,-.\-,-----.(`-')----. \ .'_ (,------."
print "\ \ / (_/| | |(`-') | (`-')| \ | | (`-')'.' / | .--./( OO).-. ''`'-..__) | .---'"
print " \ / / | | |(OO ) | |OO )| . '| |)(OO \ / /_) (`-')( _) | | || | ' |(| '--."
print "_ \ /_)| | | | \(| '__ || |\ | | / /) || |OO ) \| |)| || | / : | .--'"
print "\-'\ / \ '-'(_ .' | |'| | \ | `-/ /` (_' '--'\ ' '-' '| '-' / | `---."
print " `-' `-----' `-----' `--' `--' `--' `-----' `-----' `------' `------'"
print " Copyright @pentest_swissky "
2017-05-22 22:23:47 +00:00
print "\n\033[1mAnalyzing '"+results.dir+"' source code\033[0m"
2017-05-21 13:56:42 +00:00
if os.path.isfile(results.dir):
analysis(results.dir)
else:
recursive(results.dir,0)
2017-05-25 15:30:16 +00:00
else:
parser.print_help()