Esempio n. 1
0
 def __init__(self):
     QSData.__init__(self)
     Path.set_umit_conf(os.path.dirname(sys.argv[0]))
     Path.set_running_path(os.path.abspath(os.path.dirname(sys.argv[0])))
     data = QSData()
     self.recent_scans = data.get_recent_scans()
     self.profiles = data.get_profiles()
     self.target_list = data.get_target_list
     self.nmap_options = data.get_nmap_options()
     self.nmap_command_option = data.get_nmap_command_option()
     self.db_data = data.get_from_db()
Esempio n. 2
0
 def __init__(self):
     QSData.__init__(self)
     Path.set_umit_conf(os.path.dirname(sys.argv[0]))
     Path.set_running_path(os.path.abspath(os.path.dirname(sys.argv[0])))
     data = QSData()
     self.recent_scans = data.get_recent_scans()
     self.profiles = data.get_profiles()
     self.target_list = data.get_target_list
     self.nmap_options = data.get_nmap_options()
     self.nmap_command_option = data.get_nmap_command_option()
     self.db_data = data.get_from_db()
def setup_homedir(usethis, force=False):
    """
    Setting umit home directory.
    """
    if force:
        Path.force_set_umit_conf(usethis)
    else:
        Path.set_umit_conf(usethis)

    global HOME_CONF, RUNNING_FILE

    HOME_CONF = os.path.split(Path.get_umit_conf())[0]
    RUNNING_FILE = os.path.join(HOME_CONF, 'qsrunning')
Esempio n. 4
0
def setup_homedir(usethis, force=False):
    """
    Setting umit home directory.
    """
    if force:
        Path.force_set_umit_conf(usethis)
    else:
        Path.set_umit_conf(usethis)

    global HOME_CONF, RUNNING_FILE

    HOME_CONF = os.path.split(Path.get_umit_conf())[0]
    RUNNING_FILE = os.path.join(HOME_CONF, 'schedrunning')
    def __init__(self, nmap_path, command, host):
        Path.set_umit_conf(os.path.dirname(sys.argv[0]))
        Path.set_running_path(os.path.abspath(os.path.dirname(sys.argv[0])))
        self.nmap_path = nmap_path
        self.command = command
        #add option for ipv6 address by checking the host
        #
        #
        #check for ipv6 address and -6 to command option 

        
        if Ipv6.is_ipv6(host):
            	command = command +" -6"
        self.host = host
Esempio n. 6
0
"""
Simple python script to replace update.sh
"""

import os
import sys
import glob
import os.path

cwd = os.getcwd()
root = os.path.dirname(cwd)
sys.path.insert(0, root)

from umit.core.Paths import Path
Path.set_umit_conf(os.path.split(sys.argv[0])[0])

plug_dir = os.path.join(Path.config_dir, "plugins")

sys.path.pop(0)
os.environ["PYTHONPATH"] = root

def build_in(dir_entry):
    os.chdir(os.path.join(cwd, dir_entry))

    if os.name =="nt":
        os.system("C:\\python25\\python.exe setup.py build_ext -c mingw32 install")
    else:
        os.system("python setup.py install")

    for plugin in glob.glob("*.ump"):
Esempio n. 7
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import unittest

# Setting up Paths so UmitConf can be correctly loaded
from os.path import join
import os
import sys
from umit.core.Paths import Path
Path.set_umit_conf(os.path.dirname(sys.argv[0]))

# Loading Host Discovery
from umit.inventory.HostDiscovery import tryto_detect_networks, _darwin_get_addresses
from umit.inventory.HostDiscovery import NetIface


class TestGetIPv4(unittest.TestCase):
    
    def testGetIP(self):
        ifaces = tryto_detect_networks() # No Loopback

        # Get Real IP address
        import subprocess
        import tempfile
        
Esempio n. 8
0
 def __init__(self):
     Path.set_umit_conf(os.path.dirname(sys.argv[0]))
     Path.set_running_path(os.path.abspath(os.path.dirname(sys.argv[0])))
Esempio n. 9
0

"""
import gtk
import cairo
import gobject

from higwidgets.higboxes import HIGHBox
from higwidgets.higscrollers import HIGScrolledWindow

from umit.preferences.widgets.IconToggleWidget import IconToggleWidget

import os.path
from umit.core.Paths import Path
# Develpment step
Path.set_umit_conf("umit")


class TabStruct:
    """ Struct of tab """
    def __init__(self):
        """ Constructor """
        self.__list = {}
        self.__first_k = None
    ### Interface - Public Functions ###
    def add_item(self, name, image=None, image_bw=None, widget=None):
        """
        @param name name of item
        @param image image selected
        @param image_bw imae black and white - unselected
        @param widget widget associated
Esempio n. 10
0
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import unittest

# Setting up Paths so UmitConf can be correctly loaded
from os.path import join
from umit.core.Paths import Path
Path.set_umit_conf([join("share", "umit", "config", "umit.conf")])

# Loading UmitConf files
from umit.core.UmitConf import *


class TestUmitConf(unittest.TestCase):
    def setUp(self):
        self.umit_conf = UmitConf()

    def tearDown(self):
        del self.umit_conf

    def testGetColoredDiff(self):
        self.umit_conf.colored_diff
Esempio n. 11
0

"""
import gtk
import cairo
import gobject

from higwidgets.higboxes import HIGHBox
from higwidgets.higscrollers import HIGScrolledWindow

from umit.preferences.widgets.IconToggleWidget import IconToggleWidget

import os.path
from umit.core.Paths import Path
# Develpment step
Path.set_umit_conf("umit")


class TabStruct:
    """ Struct of tab """
    def __init__(self):
        """ Constructor """
        self.__list = {}
        self.__first_k = None

    ### Interface - Public Functions ###
    def add_item(self, name, image=None, image_bw=None, widget=None):
        """
        @param name name of item
        @param image image selected
        @param image_bw imae black and white - unselected