nmap
nmap copied to clipboard
Zenmap run time error as root
Describe the bug
Running zenmap as root using the commands doas zenmap, sudo zenmap, or pkexec zenmap produces the error below.
/usr/lib/python3.11/site-packages/zenmapCore/I18N.py:76: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
loc, enc = locale.getdefaultlocale()
/usr/lib/python3.11/site-packages/zenmapGUI/Icons.py:116: PyGTKDeprecationWarning: Gtk.IconSet(pixbuf) has been deprecated. Please use: Gtk.IconSet.new_from_pixbuf(pixbuf)
iconset = Gtk.IconSet(pixbuf=pixbuf)
/usr/lib/python3.11/site-packages/gi/overrides/Gtk.py:1613: DeprecationWarning: Gtk.IconSet.new_from_pixbuf is deprecated
iconset = Gtk.IconSet.new_from_pixbuf(pixbuf)
/usr/lib/python3.11/site-packages/zenmapGUI/Icons.py:117: DeprecationWarning: Gtk.IconFactory.add is deprecated
iconfactory.add(key, iconset)
/usr/lib/python3.11/site-packages/zenmapGUI/Icons.py:119: DeprecationWarning: Gtk.IconFactory.add_default is deprecated
iconfactory.add_default()
Original exception was:
Traceback (most recent call last):
File "/usr/bin/zenmap", line 124, in
To Reproduce
- Open a terminal
- Run
doas zenmap,sudo zenmap, orpkexec zenmap
Expected behavior Zenmap to launch without errors.
Version info (please complete the following information):
-
OS: kernel: 6.1.53-gentoo-r1, Gentoo 2.14
-
Zenmap version from
Help->About7.94 -
Output of
nmap --version:- Nmap version 7.94 ( https://nmap.org )
- Platform: x86_64-pc-linux-gnu
- Compiled with: liblua-5.4.6 openssl-3.0.10 libz-1.2.13 libpcre-8.45 libpcap-1.10.4 nmap-libdnet-1.12
- Compiled without: libssh2 ipv6
- Available nsock engines: epoll poll select
Additional context N/A
Any updates on this issue or anyone experiencing this problem?
in zenmap.desktop :
Exec=pkexec env DISPLAY=:1 XAUTHORITY=/run/user/1000/gdm/Xauthority /home/bravo123/nmap/zenmap/zenmap %F
and :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.freedesktop.policykit.pkexec.zenmap">
<description>Run zenmap program</description>
<message>Authentication is required to run the zenmap</message>
<icon_name>nmap-logo.png</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/home/bravo123/nmap/zenmap/zenmap</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
in /usr/share/polkit-1/actions/org.freedesktop.policykit.zenmap.policy
After modifying zenmap-root.desktop, I successfully triggered the authentication dialog. However, upon entering the password, no popup windows or any other response occurred. To troubleshoot the issue, I attempted running it from the terminal and encountered the same outcome. I had to use Ctrl+C to exit the process, but I did receive the following errors in the terminal.:
File "/usr/bin/zenmap", line 110, in <module> import zenmapGUI.App File "/usr/lib/python3.11/site-packages/zenmapGUI/App.py", line 75, in <module> from gi.repository import Gtk, Gdk File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 676, in _load_unlocked File "<frozen importlib._bootstrap>", line 573, in module_from_spec File "/usr/lib/python3.11/site-packages/gi/importer.py", line 146, in create_module importlib.import_module('gi.repository.' + dep.split("-")[0]) File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 676, in _load_unlocked File "<frozen importlib._bootstrap>", line 573, in module_from_spec File "/usr/lib/python3.11/site-packages/gi/importer.py", line 147, in create_module dynamic_module = load_overrides(introspection_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gi/overrides/__init__.py", line 118, in load_overrides override_mod = importlib.import_module(override_package_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gi/overrides/Gdk.py", line 484, in <module> initialized, argv = Gdk.init_check(sys.argv) ^^^^^^^^^^^^^^^^^^^^^^^^ KeyboardInterrupt
I can’t say anything about python errors, I have python 3.10.12. and Zenmap 7.94SVN
Have you created a rule for polkit? In /usr/share/polkit-1/actions/
I can’t say anything about python errors, I have python 3.10.12. and Zenmap 7.94SVN Have you created a rule for polkit? In
/usr/share/polkit-1/actions/
Yes, of course.
i do have the same while trying to open zenmap after installation on Kali Linux throw error Git couldnt be initialized , try Gtk.init_check()