pwnlib.tubes.serialtube — Serial Ports

class pwnlib.tubes.serialtube.serialtube(port=None, baudrate=115200, convert_newlines=True, bytesize=8, parity='N', stopbits=1, xonxoff=False, rtscts=False, dsrdtr=False, *a, **kw)[source]
can_recv_raw(timeout) → bool[source]

Should not be called directly. Returns True, if there is data available within the timeout, but ignores the buffer on the object.

close()[source]

Closes the tube.

connected_raw(direction)[source]

connected(direction = ‘any’) -> bool

Should not be called directly. Returns True iff the tube is connected in the given direction.

fileno() → int[source]

Returns the file number used for reading.

recv_raw(numb) → str[source]

Should not be called directly. Receives data without using the buffer on the object.

Unless there is a timeout or closed connection, this should always return data. In case of a timeout, it should return None, in case of a closed connection it should raise an exceptions.EOFError.

send_raw(data)[source]

Should not be called directly. Sends data to the tube.

Should return exceptions.EOFError, if it is unable to send any more, because of a close tube.

settimeout_raw(timeout)[source]

Should not be called directly. Sets the timeout for the tube.

shutdown_raw(direction)[source]

Should not be called directly. Closes the tube for further reading or writing.