pupy icon indicating copy to clipboard operation
pupy copied to clipboard

Thread Authentication Error

Open Josexv1 opened this issue 5 years ago • 6 comments

I'm getting this error

Exception in thread Authentication Thread (**EXTERNAL_VPS_IP**:64157):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/pupy/pupy/network/lib/servers.py", line 113, in _setup_connection
    wrapper, credentials = self.authenticator(sock)
  File "/opt/pupy/pupy/network/transports/ssl/conf.py", line 58, in __call__
    ciphers=self.ciphers
  File "/usr/lib/python2.7/ssl.py", line 931, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 599, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 828, in do_handshake
    self._sslobj.do_handshake()
error: [Errno 0] Error

I'm testing with a VPS Windows Server 2012 RC2 as a target.

VPS pupy server have this CPU config

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              1
On-line CPU(s) list: 0
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               62
Model name:          Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz
Stepping:            4
CPU MHz:             2399.998
BogoMIPS:            4799.99
Virtualization:      VT-x
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            15360K
NUMA node0 CPU(s):   0
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl cpuid pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm pti tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms xsaveopt

It's weird because i have 8 connections, and all of them work normally, i tried to add another client in a vps and works, it's just some clients that don't work and keep sending errors... If you get 4 machines giving error it's impossible to work with the server since it's just filling the screen with the same error.

Tested on clients Linux 32 bits and Windows 32/64 bits giving error, some of them giving this error.

Josexv1 avatar May 30 '19 15:05 Josexv1

It looks like ssl error. Maybe certs were expired. You can check handshake using wireshark

alxchk avatar May 31 '19 11:05 alxchk

The weird part is that it works with some vps and not with others, 've tested adding more vps boxes after i had this error and they were added normally, just thinking maybe these vps boxes had the time and date wrong? that's the only thing i could think make the ssl cert give error.

Josexv1 avatar May 31 '19 13:05 Josexv1

I get the same error using a VPS behind a http redirector Server:

Exception in thread Authentication Thread (REDIRECTORSERVERIP:60932):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/admin/pupy/pupy/network/lib/servers.py", line 113, in _setup_connection
    wrapper, credentials = self.authenticator(sock)
  File "/home/admin/pupy/pupy/network/transports/ssl/conf.py", line 58, in __call__
    ciphers=self.ciphers
  File "/usr/lib/python2.7/ssl.py", line 943, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 611, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake
    self._sslobj.do_handshake()
error: [Errno 0] Error

The Date/Timezone cannot be the issue, same time zone with the client. Generated a new SSL cert, same error, even tried Cleartext Transport and got the error. The redirector Server is using SOCAT.

Some more ideas how to fix this?

S3cur3Th1sSh1t avatar Jan 24 '20 15:01 S3cur3Th1sSh1t

Today i did some tests without redirector, still the same error message, even if the pupy hosting server has an interface with public internet IPv4 address. I tried using the transports ssl, obfs3, rsa, http.

By cancelling the client side requests using a powershell stager i get the following Error:

Couldn't find function address.
In Zeile:2051 Zeichen:25
+                         Throw "Couldn't find function address."
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Couldn't find function address.:String) [], RuntimeException
    + FullyQualifiedErrorId : Couldn't find function address. 

I went back in the commit history to mid 2018, the error did exist there as well. Same behaviour.

I also got somewhat different errors on the pupy site now:

Exception in thread Authentication Thread (ClientIP:53372):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/root/pupy/pupy/network/lib/servers.py", line 135, in _setup_connection
    config=config
  File "/root/pupy/pupy/network/lib/connection.py", line 269, in __init__
    Connection.__init__(self, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument '_lazy'

Exception AttributeError: AttributeError("'PupyConnection' object has no attribute '_closed'",) in <object repr() failed> ignored

I get this error with several VPS providers, so far I could not identify one that does not have this error. For self-hosted systems accessible on the Internet the error does not occur.

S3cur3Th1sSh1t avatar Jan 27 '20 08:01 S3cur3Th1sSh1t

Maybe your VPS host is detecting the traffic as malicious and dropping it

It works fine from my VPS host.

Also, maybe try alxchk’s repo. This one is pretty outdated

glides avatar Jan 27 '20 14:01 glides

The alxchk’s repo throws the same exception and its definitely not a problem caused by a redirector. So ist must be a provider based problem. Most likely not to fix in the code here.

S3cur3Th1sSh1t avatar Jan 29 '20 20:01 S3cur3Th1sSh1t