-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
115 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
import json | ||
import base64 | ||
import platform | ||
|
||
''' | ||
{ | ||
"protocol": "ssh", | ||
"username": "laoguang", | ||
"token": "xxx", // 认证 授权 | ||
"config": "full address:s:rdjumpserver.fit2cloud.com:33390" | ||
} | ||
''' | ||
BASE_DIR = os.path.dirname(__file__) | ||
|
||
|
||
class Rouse(object): | ||
def __init__(self, data): | ||
self.protocol = data['protocol'] | ||
self.config = data['config'] | ||
|
||
def handle_ssh(self): | ||
pass | ||
|
||
def handle_rdp(self): | ||
file_path = os.path.join(BASE_DIR, 'client.rdp') | ||
with open(file_path, 'w') as f: | ||
f.write(self.config) | ||
if platform.system().lower() == 'windows': | ||
os.system('mstsc.exe {0}'.format(file_path)) | ||
else: | ||
os.system('open {0}'.format(file_path)) | ||
|
||
def run(self): | ||
getattr(self, 'handle_' + self.protocol)() | ||
|
||
|
||
if __name__ == '__main__': | ||
# d = 'eyJwcm90b2NvbCI6ICJyZHAiLCAidXNlcm5hbWUiOiAibGFvZ3VhbmciLCAidG9rZW4iOiAieHh4IiwgImNvbmZpZyI6ICJmdWxsIGFkZHJlc3M6czp5eS5maXQyY2xvdWQuY29tOjMzMzg5XG51c2VybmFtZTpzOmZlbmdxaWFuZ3xTNEY2RUZzTVo3TjZVTVBZcFRWdzJQSFVSZ3dKVkpNcHAzZEZcbnNjcmVlbiBtb2RlIGlkOmk6MFxudXNlIG11bHRpbW9uOmk6MVxuc2Vzc2lvbiBicHA6aTozMlxuYXVkaW9tb2RlOmk6MFxuZGlzYWJsZSB3YWxscGFwZXI6aTowXG5kaXNhYmxlIGZ1bGwgd2luZG93IGRyYWc6aTowXG5kaXNhYmxlIG1lbnUgYW5pbXM6aTowXG5kaXNhYmxlIHRoZW1lczppOjBcbmFsdGVybmF0ZSBzaGVsbDpzOlxuc2hlbGwgd29ya2luZyBkaXJlY3Rvcnk6czpcbmF1dGhlbnRpY2F0aW9uIGxldmVsOmk6MlxuY29ubmVjdCB0byBjb25zb2xlOmk6MFxuZGlzYWJsZSBjdXJzb3Igc2V0dGluZzppOjBcbmFsbG93IGZvbnQgc21vb3RoaW5nOmk6MVxuYWxsb3cgZGVza3RvcCBjb21wb3NpdGlvbjppOjFcbnJlZGlyZWN0cHJpbnRlcnM6aTowXG5wcm9tcHQgZm9yIGNyZWRlbnRpYWxzIG9uIGNsaWVudDppOjBcbmF1dG9yZWNvbm5lY3Rpb24gZW5hYmxlZDppOjFcbmJvb2ttYXJrdHlwZTppOjNcbnVzZSByZWRpcmVjdGlvbiBzZXJ2ZXIgbmFtZTppOjBcbnNtYXJ0IHNpemluZzppOjEifQ==' | ||
|
||
args = sys.argv | ||
if len(args) != 1: | ||
d = args[1].replace('jms://', '') | ||
d = json.loads(base64.b64decode(d).decode()) | ||
instance = Rouse(d) | ||
instance.run() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Windows Registry Editor Version 5.00 | ||
|
||
[HKEY_CLASSES_ROOT\jms] | ||
"URL Protocol"="" | ||
@="jms" | ||
|
||
[HKEY_CLASSES_ROOT\jms\shell] | ||
[HKEY_CLASSES_ROOT\jms\shell\open] | ||
[HKEY_CLASSES_ROOT\jms\shell\open\command] | ||
@="jms.exe \"%1\"" | ||
|
||
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client] | ||
"AuthenticationLevelOverride"=dword:00000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
import json | ||
import base64 | ||
import platform | ||
|
||
''' | ||
{ | ||
"protocol": "ssh", | ||
"username": "laoguang", | ||
"token": "xxx", // 认证 授权 | ||
"config": "full address:s:rdjumpserver.fit2cloud.com:33390" | ||
} | ||
''' | ||
BASE_DIR = os.path.dirname(__file__) | ||
|
||
|
||
class Rouse(object): | ||
def __init__(self, data): | ||
self.protocol = data['protocol'] | ||
self.config = data['config'] | ||
|
||
def handle_ssh(self): | ||
pass | ||
|
||
def handle_rdp(self): | ||
file_path = os.path.join(BASE_DIR, 'client.rdp') | ||
with open(file_path, 'w') as f: | ||
f.write(self.config) | ||
if platform.system().lower() == 'windows': | ||
os.system('mstsc.exe {0}'.format(file_path)) | ||
else: | ||
os.system('open {0}'.format(file_path)) | ||
|
||
def run(self): | ||
getattr(self, 'handle_' + self.protocol)() | ||
|
||
|
||
if __name__ == '__main__': | ||
# d = 'eyJwcm90b2NvbCI6ICJyZHAiLCAidXNlcm5hbWUiOiAibGFvZ3VhbmciLCAidG9rZW4iOiAieHh4IiwgImNvbmZpZyI6ICJmdWxsIGFkZHJlc3M6czp5eS5maXQyY2xvdWQuY29tOjMzMzg5XG51c2VybmFtZTpzOmZlbmdxaWFuZ3xTNEY2RUZzTVo3TjZVTVBZcFRWdzJQSFVSZ3dKVkpNcHAzZEZcbnNjcmVlbiBtb2RlIGlkOmk6MFxudXNlIG11bHRpbW9uOmk6MVxuc2Vzc2lvbiBicHA6aTozMlxuYXVkaW9tb2RlOmk6MFxuZGlzYWJsZSB3YWxscGFwZXI6aTowXG5kaXNhYmxlIGZ1bGwgd2luZG93IGRyYWc6aTowXG5kaXNhYmxlIG1lbnUgYW5pbXM6aTowXG5kaXNhYmxlIHRoZW1lczppOjBcbmFsdGVybmF0ZSBzaGVsbDpzOlxuc2hlbGwgd29ya2luZyBkaXJlY3Rvcnk6czpcbmF1dGhlbnRpY2F0aW9uIGxldmVsOmk6MlxuY29ubmVjdCB0byBjb25zb2xlOmk6MFxuZGlzYWJsZSBjdXJzb3Igc2V0dGluZzppOjBcbmFsbG93IGZvbnQgc21vb3RoaW5nOmk6MVxuYWxsb3cgZGVza3RvcCBjb21wb3NpdGlvbjppOjFcbnJlZGlyZWN0cHJpbnRlcnM6aTowXG5wcm9tcHQgZm9yIGNyZWRlbnRpYWxzIG9uIGNsaWVudDppOjBcbmF1dG9yZWNvbm5lY3Rpb24gZW5hYmxlZDppOjFcbmJvb2ttYXJrdHlwZTppOjNcbnVzZSByZWRpcmVjdGlvbiBzZXJ2ZXIgbmFtZTppOjBcbnNtYXJ0IHNpemluZzppOjEifQ==' | ||
|
||
args = sys.argv | ||
if len(args) != 1: | ||
d = args[1].replace('jms://', '') | ||
d = json.loads(base64.b64decode(d).decode()) | ||
instance = Rouse(d) | ||
instance.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Windows Registry Editor Version 5.00 | ||
[-HKEY_CLASSES_ROOT\cdr] | ||
[-HKEY_CLASSES_ROOT\jms] | ||
|
||
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client] | ||
"AuthenticationLevelOverride"=- |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.