本文来源吾爱破解论坛
本帖最后由 vsyour 于 2019-4-16 11:14 编辑 1234.png (62.22 KB, 下载次数: 3)
下载附件
保存到相册
[Python] 纯文本查看 复制代码
# coding:utf-8 import win32crypt import binascii def genRdp(ip, username, passwd, rdpFileName): pwdHash = win32crypt.CryptProtectData(passwd, u'psw', None, None, None, 0) pwdHash_ok = binascii.hexlify(pwdHash) rdpFileStr = u'''screen mode id:i:1 desktopwidth:i:1280 desktopheight:i:750 session bpp:i:24 winposstr:s:2,3,188,8,1062,721 full address:s:{ip} compression:i:1 keyboardhook:i:2 audiomode:i:0 redirectdrives:i:0 redirectprinters:i:0 redirectcomports:i:0 redirectsmartcards:i:0 displayconnectionbar:i:1 autoreconnection enabled:i:1 username:s:{username} domain:s:MyDomain alternate shell:s: shell working directory:s: password 51:{pwdHash_ok} disable wallpaper:i:1 disable full window drag:i:1 disable menu anims:i:1 disable themes:i:0 disable cursor setting:i:0 bitmapcachepersistenable:i:1 '''.format(ip=ip, username=username, pwdHash_ok=pwdHash_ok) # print(rdpFileStr) with open(rdpFileName, 'w',encoding='utf-8') as f: f.write(rdpFileStr) if __name__ == '__main__': ip = u'127.0.0.1:33892' # ip地址加端口 username = u'administrator' # 用户名 passwd = b'test' # 密码 rdpFileName = 'aaa.rdp' # 保存文件名 genRdp(ip, username, passwd, rdpFileName)
rdp 的加密解密参考:https://www.remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/
版权声明:
本站所有资源均为站长或网友整理自互联网或站长购买自互联网,站长无法分辨资源版权出自何处,所以不承担任何版权以及其他问题带来的法律责任,如有侵权或者其他问题请联系站长删除!站长QQ754403226 谢谢。