Exemplo n.º 1
0
def main(stdscr):
    set_screen_defaults(stdscr)

    # Add initial tab
    tab.add_new_tab()
    globvar.redraw = True

    key = ''

    while key != ord('q') and globvar.quitting is False:
        if globvar.redraw:
            draw_screen(stdscr)
            globvar.redraw = False

        key = stdscr.getch()
        if key == curses.ERR:
            continue

        if key == ord('a'):
            tab.add_new_tab()
        if key == ord('d'):
            tab.delete_tab()
        if key == ord('f'):
            popup.set_grep_word(stdscr)
        if key == ord('h'):
            help.show_help(stdscr)
        if key == ord('s'):
            # Save profile
            profile.save_profile(stdscr)
        if key == ord('l'):
            # Load profile
            profile.load_profile(stdscr)
        if key == ord('*'):
            # highlight another word
            popup.highlight(stdscr)
        if key == ord('?'):
            # highlight another word
            goto.goto_backward(stdscr)
        if key == ord('p'):
            tab.get_current_tab().toggle_pause()
        if key == curses.KEY_LEFT:
            move.move_left()
        if key == curses.KEY_RIGHT:
            move.move_right()
        if key == curses.KEY_UP:
            set_scroll(1)
        if key == curses.KEY_DOWN:
            set_scroll(-1)
        if key == curses.KEY_PPAGE:
            set_scroll(10)
        if key == curses.KEY_NPAGE:
            set_scroll(-10)
        if key == curses.KEY_HOME:
            # size of the window
            goto.scroll_to_top()
        KEY_ENTER = 10
        if key == KEY_ENTER or key == curses.KEY_END:
            goto.scroll_to_bottom()

    globvar.quitting = True
Exemplo n.º 2
0
def main():
    args = sys.argv

    if len(args) >= 3:
        ip = None
        port = None
        scan_multiple_ports = False
        no_warnings = False

        for idx in range(0, len(args) - 1):
            option = args[idx]

            if option == "-ip":
                ip = args[idx + 1]

            if option == "-p":
                port = args[idx + 1]

            if option == "-nw":
                no_warnings = True

            if option == "-ps":
                scan_multiple_ports = True
                port = args[idx + 1]

            else:
                continue

        if not ip or not port:
            show_help()
        else:
            scan(ip, port, scan_multiple_ports, no_warnings)

    else:
        show_help()
Exemplo n.º 3
0
def display_help():
    show_help()
Exemplo n.º 4
0
 def show_help(self, info, control=None):
     """ Shows the help associated with the view.
     """
     if control is None:
         control = info.ui.control
     show_help(info, control)
Exemplo n.º 5
0
 def show_help ( self, info, control = None ):
     """ Shows the help associated with the view.
     """
     if control is None:
         control = info.ui.control
     show_help( info, control )
Exemplo n.º 6
0
 def help(self, user_input=[]):
     show_help()