Nov-01-2019, 06:54 PM
(Nov-01-2019, 05:45 PM)Gribouillis Wrote: Try to output the same thing from within your program, just before the with statement because obviously a strange object is created by your call to socket.socket() in the with statement.
Good call, obviously *something* has changed, __exit__ is no longer there:
Output:(pagesniff) [a-ptrivino@insecpydev pagesniff]$ sudo python sniffsms.py server
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', '_sock', 'accept', 'bind', 'close', 'connect', 'connect_ex', 'dup', 'family', 'fileno', 'getpeername', 'getsockname', 'getsockopt', 'gettimeout', 'listen', 'makefile', 'proto', 'recv', 'recv_into', 'recvfrom', 'recvfrom_into', 'send', 'sendall', 'sendto', 'setblocking', 'setsockopt', 'settimeout', 'shutdown', 'type']
Traceback (most recent call last):
File "sniffsms.py", line 28, in <module>
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as transfer:
AttributeError: __exit__
(pagesniff) [a-ptrivino@insecpydev pagesniff]$
So I'm guessing somehow the socket() in the program is somehow being overridden since it's different from the one I tried in the interpreter.