added support kali linux iptables nf_tables set iptables_legacy as default #140

This commit is contained in:
mh4x0f 2021-10-03 10:01:36 -03:00
parent 2cc9c490d2
commit 6c8e5a64ae
7 changed files with 52 additions and 2 deletions

View File

@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- added new command dhcpmode
- added option for settings dhcp mode pydhcpserver or dhcpd_server
- added new support to run isc_dhcp_server for dns/ dhcp
- added support kali linux iptables nf_tables set iptables_legacy as default #140
### Changed

View File

@ -28,7 +28,7 @@
- Credentials harvesting
- Transparent Proxies
- LLMNR, NBT-NS and MDNS poisoner ([Responder3](https://github.com/skelsec/Responder3))
- RestFulAPI
- RestFulAPI (disabled)
- and **more**!
### Donation

View File

@ -103,7 +103,7 @@ router=10.0.0.1
subnet=10.0.0.0
[iptables]
path_binary=/sbin/iptables
path_binary=""
iptables_0_masq=-w -P FORWARD ACCEPT
iptables_A_masq=-w -t nat -A POSTROUTING --out-interface $inet -j MASQUERADE
iptables_B_forward="-w -A FORWARD -i $inet --out-interface $wlan -j ACCEPT -m state --state RELATED,ESTABLISHED"

View File

@ -0,0 +1,6 @@
The wp3 require iptables for share and configure internet conneciton
and build somes attack of redirect traffic for plugins work fine.
Please install the iptables v1.6, or install current version of
iptables with version legacy installed. The wp3 not support nftables
by default.

View File

@ -192,6 +192,18 @@ class Linux(QtCore.QObject):
my_id = str(uuid1())
return my_id
@staticmethod
def getBinaryPath(command: str):
binary_path = popen("which {}".format(command)).read()
if not binary_path:
return ""
return binary_path.split("\n")[0]
@staticmethod
def checkIfIptablesVersion():
if "nf_tables" in Linux.getBinaryPath("iptables"):
return Linux.getBinaryPath("iptables-legacy")
return Linux.getBinaryPath("iptables")
def is_hexadecimal(text):
try:

View File

@ -3,6 +3,7 @@ from wifipumpkin3.core.common.uimodel import *
from wifipumpkin3.core.servers.proxy import *
from wifipumpkin3.core.utility.component import ControllerBlueprint
import copy
from wifipumpkin3.exceptions.errors.iptablesException import IptablesPathError
# This file is part of the wifipumpkin3 Open Source Project.
# wifipumpkin3 is licensed under the Apache 2.0.
@ -68,6 +69,14 @@ class ProxyModeController(PluginsUI, ControllerBlueprint):
if hasattr(p, "ID"):
setattr(self, p.ID, p)
self.resolverIPtablesVersion()
def resolverIPtablesVersion(self):
iptables_path = Refactor.checkIfIptablesVersion()
if not iptables_path:
raise IptablesPathError("[Error] iptables tool not found")
self.conf.set("iptables", "path_binary", iptables_path)
def isChecked(self):
return self.conf.get("plugins", self.ID, format=bool)

View File

@ -0,0 +1,22 @@
from wifipumpkin3.exceptions.base import ExceptionTemplate
# This file is part of the wifipumpkin3 Open Source Project.
# wifipumpkin3 is licensed under the Apache 2.0.
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class IptablesPathError(ExceptionTemplate):
filename = "iptables_path_not_found"