Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API custom widget addition #407

Merged
merged 4 commits into from
Oct 10, 2023
Merged

Python API custom widget addition #407

merged 4 commits into from
Oct 10, 2023

Conversation

p4p1
Copy link
Contributor

@p4p1 p4p1 commented Oct 10, 2023

Started work on a PyWidget python API class that would allow you to create custom widgets inside of havoc.

added features:

  • the havocui.widget class
  • Methods to the class:
    • exec -> run the window
    • close -> close the window
    • addButton -> add a button to the window
    • addCheckbox -> add a checkbox to the window
    • addCombobox -> adds a combo box dropdown to the window
    • addLineedit -> adds a input area to get user input

Testing code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Made by papi
# Created on: Di 10 Okt 2023 01:54:42  CEST
# havoc.py
# Description:

import havocui

win = havocui.Widget("main title")

def call_in_widget():
    print("in here")
    win.close()
def call_checkbox():
    print("checked")

def combo_box(num):
    print(num)

def process_line(string):
    print(string)

win.addLabel("This is a popup dialodjsaklfjdslkajfdlakfjdkslafjdskalfjdsaklfjsa'f;sadf;saj;fsjaklf;dsaj;fssg")
win.addCheckbox("check me!", call_checkbox)
win.addButton("click me!", call_in_widget)
win.addCombobox(combo_box, "test", "test1", "test2")
win.addLineedit("placeholder ...", process_line)

def call_btn():
    win.exec()

havocui.createtab("Widget testing", "open widget", call_btn)

Screenshot:

image

@S4ntiagoP
Copy link
Contributor

I love this 😄

@S4ntiagoP S4ntiagoP merged commit 2627c88 into HavocFramework:dev Oct 10, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants