Beispiel #1
0
class gtkhex:
    def __init__(self):
        #Set the Glade file
        gladefile = os.path.join(current_folder, "gtkhex.glade")
        builder = gtk.Builder()
        builder.add_from_file(gladefile)
        # get objects
        window = builder.get_object(CONST.WINDOW_NAME)
        sb = builder.get_object(CONST.STATUSBAR_NAME)
        nb = builder.get_object(CONST.NOTEBOOK_NAME)
        # init
        sb.push(CONST.STATUSBAR_TEXT_IDX, "Ln 1, Col: 0, 0%")
        # system tray
        tray = gtk.StatusIcon()
        tray.set_from_stock(gtk.STOCK_EDIT) 
        tray.connect('popup-menu', self.on_right_click)
        tray.set_tooltip((window.get_title()))
        # connect handlers
        self.handlers = Handlers(builder)
        window.add_accel_group(self.handlers.get_AccelGroup())
        builder.connect_signals(self.handlers)

        # Show the window
        window.show_all()

    def on_right_click(self, icon, event_button, event_time):
		self.make_menu(event_button, event_time)

    def make_menu(self, event_button, event_time):
        menu = gtk.Menu()
        # show/hide window
        showhide = gtk.MenuItem("Hide")
        showhide.show()
        menu.append(showhide)
        showhide.connect('activate', self.handlers.show_hide_window)
        # show about dialog
        about = gtk.MenuItem("About")
        about.show()
        menu.append(about)
        about.connect('activate', self.Handlers.on_about)
        # add quit item
        quit = gtk.MenuItem("Quit")
        quit.show()
        menu.append(quit)
        quit.connect('activate', self.handlers.on_quit)
        menu.popup(None, None, gtk.status_icon_position_menu,
                   event_button, event_time, self.tray)

    def loadFile(self, filename):
        self.handlers.open_file(filename)

    def main(self):
        gtk.gdk.threads_enter()
        gtk.main()
        gtk.gdk.threads_leave()
    def __init__(self):
        self.builder.connect_signals(Handlers(self))

        window = self.builder.get_object("window1")
        window.show_all()

        #Message de bienvenue
        welcomeMessage = "Bienvenue dans The Web Application Tester\n\n[+] Pour utiliser cet outil vous avez le choix entre 2 modes :\n\t- Soit en entrant une URL (le test se fera alors en blackbox),\n\t- Soit en entrant un fichier (le test se fera en whitebox).\n\n[+] Choisissez les différentes vulnérabilités que vous voulez tester en cochant les cases.\n\n[+] Pour tester les paramètres GET en url, donnez leur la valeur TEST\n\tExemple : localhost/votre_site/index.php?page=TEST\n\n[+] Pour avoir un meilleur résultat, utilisez le fichier de configuration PHP fourni.\n\n[+] Pendant vos tests, pour repérer au mieux les injections SQL, affichez les erreurs des vos requêtes.\n\tPar exemple avec MySQL : $result = mysql_query($requete, $connexion) or die(mysql_error());\n\n[+] Pensez à retirer cet affichage des erreurs à la mise en production de vos pages web !"
        self.setMessage(welcomeMessage)
Beispiel #3
0
    def __init__(self):
        #Set the Glade file
        gladefile = os.path.join(current_folder, "gtkhex.glade")
        builder = gtk.Builder()
        builder.add_from_file(gladefile)
        # get objects
        window = builder.get_object(CONST.WINDOW_NAME)
        sb = builder.get_object(CONST.STATUSBAR_NAME)
        nb = builder.get_object(CONST.NOTEBOOK_NAME)
        # init
        sb.push(CONST.STATUSBAR_TEXT_IDX, "Ln 1, Col: 0, 0%")
        # system tray
        tray = gtk.StatusIcon()
        tray.set_from_stock(gtk.STOCK_EDIT) 
        tray.connect('popup-menu', self.on_right_click)
        tray.set_tooltip((window.get_title()))
        # connect handlers
        self.handlers = Handlers(builder)
        window.add_accel_group(self.handlers.get_AccelGroup())
        builder.connect_signals(self.handlers)

        # Show the window
        window.show_all()
Beispiel #4
0
def addMeasurementType():
    return Handlers.measurementTypeAddHandler(request)
Beispiel #5
0
def showMeasurementTypes():
    return Handlers.measurementTypeShowHandler(request)
Beispiel #6
0
def removeDeivce(id):
    return Handlers.deviceRemoveHandler(request, id)
Beispiel #7
0
def addDevice():
    return Handlers.deviceAddHandler(request)
Beispiel #8
0
def removeMeasurementType(id):
    return Handlers.measurementTypeRemoveHandler(request, id)
Beispiel #9
0
def editUser(id = 0):
    return Handlers.userEditHandler(request, id)
Beispiel #10
0
def logoutUser(id):
    return Handlers.userLogoutHandler(request, id)
Beispiel #11
0
def showUsers():
    return Handlers.userShowHandler(request)
Beispiel #12
0
def login():
    return Handlers.loginHandler(request)
Beispiel #13
0
def addMeasurementSingle():
    return Handlers.addMeasurementSingle(request)
Beispiel #14
0
def addMeasurementJson(data):
    return Handlers.addMeasurementJSON(request, data)
Beispiel #15
0
def index():
    return Handlers.dashboardHandler(request)
Beispiel #16
0
def removeUser(id = 0):
    return Handlers.userRemoveHandler(request, id)
Beispiel #17
0
import os
import sys

import Handlers
import configparser

config = configparser.ConfigParser()
config.read('/etc/thinkpad_tools/config.ini')

trackpoint_sensitivity = config['TRACKPOINT']['SENSITIVITY']
trackpoint_speed = config['TRACKPOINT']['SPEED']

bat1_start_threshold = config['BATTERY']['BAT1_START_THRESHOLD']
bat1_stop_threshold = config['BATTERY']['BAT1_STOP_THRESHOLD']

bat2_start_threshold = config['BATTERY']['BAT2_START_THRESHOLD']
bat2_stop_threshold = config['BATTERY']['BAT2_STOP_THRESHOLD']

euid = os.geteuid()
if euid != 0:
    print("service_runner.pys not started as root. Requesting root access...")
    args = ['sudo', sys.executable] + sys.argv + [os.environ]
    # the next line replaces the currently-running process with the sudo
    os.execlpe('sudo', *args)

Handlers.Trackpoint(trackpoint_sensitivity, trackpoint_speed).setValues()
Handlers.Battery(bat1_start_threshold, bat2_start_threshold,
                 bat1_stop_threshold,
                 bat2_stop_threshold).setBatteryThreshold()
Beispiel #18
0
def showDevices():
    return Handlers.deviceShowHandler(request)
Beispiel #19
0
#!/usr/bin/env python

# This is the binary to be placed in /usr/local/bin

import Handlers

print(Handlers.Battery().getBatteryHealth())
Beispiel #20
0
 def __init__(self):
     self.__commands = Handlers.get_handlers()
     self.__api = dependency.group_api