########## boafi Pentest script
########## - Perform various pentests automatically and save reports for further study
########## - Features/TODOs: Ipv6,DHCP,DNS,exploits,mitm..


###  Author: Yessou Sami 
###  Project Boafi



import os,time,argparse


parser = argparse.ArgumentParser()


parser.add_argument('-RA', action='store', dest='ipv6ra', default=False,
                    help='Flood ipv6 router advertisements for given minutes')


parser.add_argument('-file', action='store', dest='output', default=False,
                    help='File output for scans')


parser.add_argument('-scan', action='store', dest='scan', default=False,
                    help='Scan the given network address or host')


parser.add_argument('--syn', action='store_true', dest='syn', default=False,
                    help='SYN Scan enabled')



results = parser.parse_args()


if not(results.output):
        output=os.popen("date").read()

output=results.output
syn=""
scantype="-sn" #basic ping scan
if(results.scan):
        ipaddr=str(results.scan)
        print ipaddr
        if(results.syn):
                scantype="-sS -O" #syn and
        scancmd="sudo nmap "+scantype+" -oX "+output+" "+ipaddr   #writes xml output so later we can convert it into html
        print scancmd
        print os.popen(scancmd).read() #ping scan to know online hosts



if(results.ipv6ra): 
        minutes=results.ipv6ra
        #run ipv6 RA flooding for N minutes
        while (i <= minutes):
                print "Firing RAs everywhere"
                # do RA FLOOD
                #Recall from scapy or do it with thc?




# TODO
## ipv6 attacks via scapy? or thc suite?
## mitm --> interact with SDS to get realtime data for visualization
## metasploit attacks?
## if connected to internet send info on "cloud"(site db)
## save data on xml,csv for webGUI visualization

Create boafiPenTest.py