@@ -28,12 +28,18 @@ def parser_arguments(cls):
2828 '--ssh-injector-enable-mirror' ,
2929 dest = 'ssh_injector_enable_mirror' ,
3030 action = "store_true" ,
31- help = 'disables host session mirroring for the injector shell'
31+ help = 'enables host session mirroring for the injector shell'
3232 )
3333 cls .parser ().add_argument (
3434 '--ssh-injectshell-key' ,
3535 dest = 'ssh_injectshell_key'
3636 )
37+ cls .parser ().add_argument (
38+ '--ssh-injector-super-stealth' ,
39+ dest = 'ssh_injector_super_stealth' ,
40+ action = 'store_true' ,
41+ help = 'enables stealth injector operation (best used with session mirror)'
42+ )
3743
3844 def __init__ (self , session ):
3945 super (SSHInjectableForwarder , self ).__init__ (session )
@@ -125,11 +131,16 @@ class InjectorShell(threading.Thread):
125131
126132 BUF_LEN = 1024
127133 STEALTH_WARNING = """
128- [NOTE]\r \n
129- This is a hidden shell injected into the secure session the original host created.\r \n
130- Any commands issued CAN affect the environment of the user BUT will not be displayed on their terminal!\r \n
131- Exit the hidden shell with CTRL+C\r \n
132- """
134+ [NOTE]\r \n
135+ This is a hidden shell injected into the secure session the original host created.\r \n
136+ Any commands issued CAN affect the environment of the user BUT will not be displayed on their terminal!\r \n
137+ Exit the hidden shell with CTRL+C\r \n
138+ """
139+ SUPER_STEALTH = """
140+ [SUPERSTEALTH]\r \n
141+ Commands from the injected shell will only be executed if they do not interfere with normal operation of the original host!
142+ \r \n
143+ """
133144
134145 def __init__ (self , remote , client_channel , forwarder ):
135146 super (InjectorShell , self ).__init__ ()
@@ -139,7 +150,9 @@ def __init__(self, remote, client_channel, forwarder):
139150 self .client_channel = client_channel
140151
141152 def run (self ) -> None :
142- self .client_channel .sendall (self .STEALTH_WARNING )
153+ self .client_channel .sendall (
154+ self .STEALTH_WARNING + self .SUPER_STEALTH if self .forwarder .args .ssh_injector_super_stealth else ""
155+ )
143156 try :
144157 while not self .forwarder .session .ssh_channel .closed :
145158 if self .client_channel .recv_ready ():
0 commit comments