t3l3machus / Villain

Villain is a high level stage 0/1 C2 framework that can handle multiple TCP socket & HoaxShell-based reverse shells, enhance their functionality with additional features (commands, utilities) and share them among connected sibling servers (Villain instances running on different machines).
Other
3.64k stars 590 forks source link

[t3l3machus/Villain#106] add custom callback for every new connection resolve #107

Open BlueBeret opened 1 year ago

BlueBeret commented 1 year ago

resolve #106

Add a callback feature

user can easily add python script as callback which will be executed. For example, I use this with discord webhook to get noification for every new backdoor connection.

usage: python3 Villain.py -cb "/tmp/cb.py"

cb.py

import requests
import os
import json
def callback(sess):
    # send discord message
    url = "#redacted"

    data = {
        "content": f"""```{sess}
    """
}
headers = {
    "Content-Type": "application/json"
}
response = requests.post(url, data=json.dumps(data), headers=headers)
if response.status_code == 204:
    return 1
else:
    return 0