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

Added feature to spawn conptyshell inside tmux session #116

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Villain.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


import argparse
import os
from subprocess import check_output
from Core.common import *
from Core.settings import Hoaxshell_Settings, Core_Server_Settings, TCP_Sock_Handler_Settings, File_Smuggler_Settings
Expand Down Expand Up @@ -1285,7 +1286,12 @@ def main():
villain_cmd['issuer'] = 'self'

# Start listener
os.system(f'gnome-terminal -- bash -c "stty raw -echo; (stty size; cat) | nc -lvnp {lport}"')
# Will spawn in TMUX instead of gnome-terminal if available.
if os.getenv("TMUX") is not None:
os.system(f'tmux split-window -h "bash -c \'stty raw -echo; (stty size; cat) | nc -lvnp {lport}\'"')
else:
os.system(f'gnome-terminal -- bash -c "stty raw -echo; (stty size; cat) | nc -lvnp {lport}"')

sleep(0.2)
Hoaxshell.command_pool[session_id].append(villain_cmd)

Expand Down