Nmap

Questions and comments specific to a particular plugin should go here.
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Nmap

Post by topix » Sat Nov 11, 2017 10:03 am

I've made the changes needed. Basically it's as simple as moving some lines. AddGrowableCol/AddGrowableRow has to be called after the widgets were added to the sizer. So instead of

Code: Select all

        Sizer = wx.GridBagSizer(5, 10)
        Sizer.AddGrowableCol(1)
        Sizer.AddGrowableRow(5, namedSizer.GetSize()[1])
        Sizer.AddGrowableRow(6, groupSizer.GetSize()[1])
        Sizer.Add(label_0, (0, 0), flag = wx.TOP|ACV)
        Sizer.Add(namedSizer, (5, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
        Sizer.Add(groupSizer, (6, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
it has to be

Code: Select all

        Sizer = wx.GridBagSizer(5, 10)
        Sizer.Add(label_0, (0, 0), flag = wx.TOP|ACV)
        Sizer.Add(namedSizer, (5, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
        Sizer.Add(groupSizer, (6, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
        Sizer.AddGrowableCol(1)
        Sizer.AddGrowableRow(5, namedSizer.GetSize()[1])
        Sizer.AddGrowableRow(6, groupSizer.GetSize()[1])
Attachments
__init__.py
Nmap plugin version 1.0.1 (same as 1.0 but with compatibility changes for EG 0.5)
(101.52 KiB) Downloaded 96 times

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Nmap

Post by Pako » Sat Nov 11, 2017 10:53 am

topix wrote:
Sat Nov 11, 2017 10:03 am
I've made the changes needed.
Thank you for your support !

Pako

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun » Mon Nov 13, 2017 1:07 am

topix wrote:
Sat Nov 11, 2017 10:03 am
I've made the changes needed.
Works perfectly, thank you.

Edit:

Spoke too soon. Now the configuration dialog opens, but I am getting more errors.

Code: Select all

Error starting plugin: Nmap
Traceback (most recent call last) (0.5.0-rc4):
  File "H:\Home Theatre\EventGhost\eg\Classes\PluginInstanceInfo.py", line 192, in Start
    self.instance.__start__(*self.args)
  File "H:\Home Theatre\EventGhost\plugins\nMap\__init__.py", line 1652, in __start__
    if self.evtFilter[4]:
IndexError: list index out of range

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Nmap

Post by topix » Mon Nov 13, 2017 6:22 pm

I didn't had nmap installed and didn't click on all buttons :roll: but now it should do it's job. I installed nmap and did a short test with EG 0.4 and 0.5.
Attachments
__init__.py
Plugin: nmap 1.0.2
(fixes for EG 0.5)
(101.67 KiB) Downloaded 108 times

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun » Tue Nov 14, 2017 12:10 am

Thanks, but I'm still getting the exact same error with your new version.

Code: Select all

   Error starting plugin: Nmap
   Traceback (most recent call last) (0.5.0-rc4):
     File "H:\Home Theatre\EventGhost\eg\Classes\PluginInstanceInfo.py", line 192, in Start
       self.instance.__start__(*self.args)
     File "H:\Home Theatre\EventGhost\plugins\nMap\__init__.py", line 1652, in __start__
       if self.evtFilter[4]:
   IndexError: list index out of range

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Nmap

Post by topix » Tue Nov 14, 2017 5:25 am

Hmm, strange. Can you remove the plugin from config tree, save config, restart EG and add the plugin again? If that doesn't help then replace lines 1652+1653 with this code:

Code: Select all

        try:
            if self.evtFilter[4]:
                self.TriggerEvent(self.text.dataUn)
        except IndexError:
            pass

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun » Wed Nov 15, 2017 12:05 am

I removed and reinstalled the plugin and it now works correctly. Unfortunately I lost all my configured devices and had to delete all the actions I had created with nMap, but at least now it works.

Thank you very much!

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Nmap

Post by HTPCanwender » Thu Jun 28, 2018 4:11 pm

The Profile Manager does not open anymore. I get the following message:

17:53:53 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
17:53:53 File "wx\_core.pyc", line 16766, in <lambda>
17:53:53 File "C:\Program Files (x86)\EventGhost\plugins\Nmap\__init__.py", line 406, in ShowProfileDialog
17:53:53 max = 99,
17:53:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 58, in __init__
17:53:53 **kwargs
17:53:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 115, in __init__
17:53:53 raise MaxValueError(value, max_val)
17:53:53 MaxValueError: The set value 15 is higher then the maximum of 99

Is it a problem with the WIP Version of EG? I am using the Nmap plugin 1.02

User avatar
kgschlosser
Site Admin
Posts: 5440
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser » Sat Jun 30, 2018 6:25 pm

I will take a look at the plugin code as well as the spinnumctrl in EG and see what is going on. we have been fighting issues with this control to find the best possible way to handle problems with it. the problems are in the core of wxPython and a bug report was submitted 10 years ago about this problem and it is still not foxed even in the latest beta builds they have. every time we think we are good to go with the fix. it breaks something else we didn't account for.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5440
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser » Sat Jun 30, 2018 6:38 pm

well this is a very very very strange issue

the lines of code that trigger that exception read as follows

Code: Select all

            if value > max_val:
                raise MaxValueError(value, max_val)


the set max value is 99 and the set value is 15. so according to this logic it should have never passed. Unless the data being passed is in fact not an integer but it is a string instead. which would be the fault of the plugin.

if you modify line 404 of the plugins __init__.py file from

Code: Select all

            data[0][1],

to

Code: Select all

            int(data[0][1]),

be sure to preserve the spacking before the text.
see if that solves the issue.
If you like the work I have been doing then feel free to Image

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Nmap

Post by HTPCanwender » Sun Jul 01, 2018 5:09 am

After replacing the variable for the security factor in line 404

data[0][1],
with
int(data[0][1]),

i got a similar message for the scanning period

06:42:49 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
06:42:49 File "wx\_core.pyc", line 16766, in <lambda>
06:42:49 File "C:\Program Files (x86)\EventGhost\plugins\Nmap\__init__.py", line 415, in ShowProfileDialog
06:42:49 max = 600,
06:42:49 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 58, in __init__
06:42:49 **kwargs
06:42:49 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 115, in __init__
06:42:49 raise MaxValueError(value, max_val)
06:42:49 MaxValueError: The set value 30 is higher then the maximum of 600

So I replaced in line 413

data[0][2],
with
int(data[0][2]),

Now the profile manager is ok. I have attached the modyfied plugin as version 1.0.3
Attachments
__init__.py
Nmap 1.0.3
(101.78 KiB) Downloaded 75 times

User avatar
kgschlosser
Site Admin
Posts: 5440
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser » Sun Jul 01, 2018 9:13 pm

check that out!

Good deal. I thought i was going mental with this SpinNumCtrl. Then again one would think that the author would be passing the proper data type to the SpinNumCtrl. The error didn't show before because the person that wrote the control was doing type conversions in it (which shouldn't be done) in order to work around a bug.

The issue with the way they did it was it would only fix the bug when using the eg.SpinNumCtrl and not if a user directly accessed the underlying control in wxPython. The correct way was to monkey patch the underlying control so it would work as advertised if it was used directly or through the use of eg.SpinNumCtrl. when topic2k and I put this into place we were able to remove all of the code in eg.SpinNumCtrl that was associated with working around the problem. I guess we removed a type conversion that was in that work around that allowed this plugin to work.

Sorry for the inconvenience. and TY for repairing the plugin and posting an updated version of it.
If you like the work I have been doing then feel free to Image

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun » Sun Dec 08, 2019 11:49 pm

Would someone be kind enough to post a version that is working with the latest Eventghost and Windows 10? All the links are dead it seems.

User avatar
kgschlosser
Site Admin
Posts: 5440
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser » Mon Dec 09, 2019 7:13 am

See if this will work for ya.
Attachments
Nmap-1.0.1.egplugin
(24.17 KiB) Downloaded 34 times
If you like the work I have been doing then feel free to Image

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun » Wed Dec 11, 2019 8:51 am

Thank you very much. I shall test it asap.

Post Reply