HavocFramework / Havoc

The Havoc Framework.
GNU General Public License v3.0
6.31k stars 903 forks source link

Python API custom widget addition #407

Closed p4p1 closed 9 months ago

p4p1 commented 9 months ago

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

added features:

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](https://github.com/HavocFramework/Havoc/assets/19672114/ad3c257f-8f8d-42b2-9c3a-654af3ea8d5d)
S4ntiagoP commented 9 months ago

I love this 😄