-
Notifications
You must be signed in to change notification settings - Fork 9
/
pentesting-multitool.py
87 lines (61 loc) · 5.02 KB
/
pentesting-multitool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#! /usr/bin/env python3
import argparse, sys, logging
# With this we can hide the scapy's warning message about IPv6
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from utility_scripts import dns_utility, whois_utility, shodan_utility, bannergrab_utility, flooder_utility, fuzzing_utility, mitm_utility
def main():
parser = argparse.ArgumentParser(description='Pentesting-Multitool project arises from the need to gather some pentesting tools into one tool.'
' It will be developed using Python3 adding some external libraries as DNSPython, pythonwhois or scapy.')
# Argument for DNS function
parser.add_argument('-d', metavar='--DNS', type=str, help='Using it you can get information about a DNS record of a specific domain.\n'
'Usage: <domain> -r <record> options: <-f --file>')
# Argument for whois function
parser.add_argument('-w', metavar='--whois', type=str, help='Using it you can get information about a domain. '
'Usage: <domain> options: <-f --file>.')
# Argument for shodan search function
parser.add_argument('-s', metavar='--shodan', type=str, help='Using it you can get information about the devices and services connected in a network.'
'Usage: <search> (separating search arguments by \"-\") options: <-f --file, -u >')
# Argument for banner grabber function
parser.add_argument('-b', metavar='--bgrabber', type=str, help='Using it you can get information about some services in the specified ports and IP.'
'Usage: <ip> -p <ports>(separated by \":\") options: <-file --file>.')
# Argument for flooder function
parser.add_argument('-o', metavar='--flooder', type=int, help='Using it you can do a DOS Attack (Ping of death) or generate the PCAP file for do it.'
'Usage: <number of packets (generator mode) or sends(flooder mode)> -f <filename> options: <-g --generator>.')
#Argument for fuzzer function
parser.add_argument('-z', metavar='--fuzzer', type=str, help='Using it you can do a fuzzing test and write a PCAP with results. Please read documentation for know about the PCAP format.'
'Usage:<ip> -ng <number of generations> -n <number of packets> -l <layer (UDP, TCP, ICMP)> -f <PCAP file name>')
#Argument for man-in-the-middle function
parser.add_argument('-m', metavar='--mitm', type=str, help='Using it you can do a mitm attack test. Please read documentation.'
'Usage: <interface> -v <victim IP> -a <gateway IP>')
# Optionals
parser.add_argument('-a', metavar='--gateway', type=str, required='-m' in sys.argv or '--mitm' in sys.argv, help='AP Gateway IP.')
parser.add_argument('-v', metavar='--victim', type=str, required='-m' in sys.argv or '--mitm' in sys.argv, help='Victim IP.')
parser.add_argument('-l', metavar='--layer', required='-z' in sys.argv or '--fuzzer' in sys.argv, help='Layer that you want to use.')
parser.add_argument('-n', metavar='--number', required='-z' in sys.argv or '--fuzzer' in sys.argv, type=int, help='Number of packets.')
parser.add_argument('-ng', metavar='--ngenerations', required='-z' in sys.argv or '--fuzzer' in sys.argv, type=int, help='Number of generations.')
parser.add_argument('-g', action='store_true', help='Specify if you want to generate the file.')
parser.add_argument('-p', metavar='--ports', required='-b' in sys.argv or '--bgrabber' in sys.argv, type=str, help='Specify ports.')
parser.add_argument('-u', action='store_true', help='Specify if you want the complete information or just the IP on shodan search.')
parser.add_argument('-r', metavar='--record', required='-d' in sys.argv or '--DNS' in sys.argv, type=str, help='Record of a specific domain.')
parser.add_argument('-f', metavar='--file', required='-o' in sys.argv or '--flooder' in sys.argv, type=str, help='Filename where you want to save the result.')
#Defining args
args = parser.parse_args()
#Calls
if args.d is not None:
dns_utility.dns_scan(args.d, args.r, args.f)
elif args.w is not None:
whois_utility.whois_scan(args.w, args.f)
elif args.s is not None:
shodan_utility.shodan_search(args.s, args.f, args.u)
elif args.b is not None:
bannergrab_utility.banner_grabbing(args.b, args.p, args.f)
elif args.o is not None:
flooder_utility.flooder_attack(args.o, args.g, args.f)
elif args.z is not None:
fuzzing_utility.fuzzing_attack(args.z, args.ng, args.n, args.l, args.f)
elif args.m is not None:
mitm_utility.mitm_attack(args.m, args.v, args.a)
else:
print('Wrong argument specified, please use -h or --help. \n')
if __name__ == '__main__':
main()