Skip to content

commonUtils.prepData() breaks compatibility with certain transports that require batch encoding of data #13

@Und3rf10w

Description

@Und3rf10w

In cases where a transport needs to encode data in batches, commonUtils.prepData() prevents them from working. An example usecase for this can be seen with #12, where we can't build an array of encoded data (e.g. extremely large images) BEFORE uploading it, because we would potentially have to store GBs worth of data in memory; which as can be seen in the photo below, can quickly over-consume resources on the system.

image

Workaround

Until this is resolved, a simple workaround exists by modifying the sendData() and retrieveData() functions in commonUtils.prepData(), as shown below:

def sendData(data):
	# This will upload the data via the covert channel
	# returns a confirmation that the data has been sent

	if config.debug:
		print (color("RAW DATA TO BE SENT: ", status=False, yellow=True) + "%s") % (data)
	# Prepares the data to be sent via the covert channel
	# preped_data = prepData(data) # < --- Commented this line out

        transport.sendData(data) # < ---- Added this line in

def retrieveData():
	# This will retireve data via the covert channel
	# Returns unencoded data

	data = transport.retrieveData()

	if config.debug:
		print (color("RAW RETRIEVED DATA: ", status=False, yellow=True) + "%s") % (data)

	# Prepare the recieved data by running it through the decoder
	# preped_data = decodeData(data)  # < --- Commented this line out

	# return preped_data # < --- Commented this line out
	return data # < ---- Added this line in

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions