Vulny-Code-Static-Analysis/index.py

43 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-22 22:23:47 +00:00
# BUG variable multiple (check en recursif dans vuln)
# BUG color var['something']
2017-05-22 22:23:47 +00:00
# BUG detection include
2017-05-23 22:23:05 +00:00
# BUG SQLi 2 ligne 17 not found
# TODO print help if no dir in arg
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-23 22:23:05 +00:00
# else print help