library/src/utility/BP-StringUtilities.cc
// Selects a random buffer encoder from all of the available php encoders, and encodes
// the string using that.
Selects a random buffer encoder from all of the available php encoders, and encodes
the string using that.
Selects a random buffer encoder from all of the available php encoders and encodes the string using that .
char * BP_GenPHPGadgetEncodeBufferAsRandomEncode(unsigned char * buff, size_t buff_size, P_BP_LINKL tq)
{
	if(!buff || !buff_size)
		return NULL;
	size_t selector = BP_GenRandomUnsignedLong(1,6);
	switch(selector)
	{
		case 1:
			return BP_GenPHPGadgetEncodeBufferAsPack(buff, buff_size, BP_PHP_GADGET_BUFFER_ENCODE_RANDOM_HEX_DECIMAL, tq);
			break;
		case 2:
			return BP_GenPHPGadgetEncodeBufferAsImplodingArray(buff, buff_size, tq);
			break;
		case 3:
			return BP_GenPHPGadgetEncodeBufferAsImplodingSScanf(buff, buff_size, tq);
			break;
		case 4:
			return BP_GenPHPGadgetEncodeBufferAsSprintf(buff, buff_size, tq);
			break;
		case 5:
			return BP_GenPHPGadgetEncodeBufferAsDotJoinedChars(buff, buff_size, tq);
			break;
		case 6:
			return BP_GenPHPGadgetEncodeBufferAsBase64Decode(buff, buff_size, tq);
			break;
		default:
			break;
	}
	return NULL;
}
char * BP_GenPHPGadgetEncodeBufferAsRandomEncode ( unsigned char * buff , size_t buff_size , P_BP_LINKL tq ) { if ( ! buff || ! buff_size ) return NULL ; size_t selector = BP_GenRandomUnsignedLong ( 1 , 6 ) ; switch ( selector ) { case 1 : return BP_GenPHPGadgetEncodeBufferAsPack ( buff , buff_size , BP_PHP_GADGET_BUFFER_ENCODE_RANDOM_HEX_DECIMAL , tq ) ; break ; case 2 : return BP_GenPHPGadgetEncodeBufferAsImplodingArray ( buff , buff_size , tq ) ; break ; case 3 : return BP_GenPHPGadgetEncodeBufferAsImplodingSScanf ( buff , buff_size , tq ) ; break ; case 4 : return BP_GenPHPGadgetEncodeBufferAsSprintf ( buff , buff_size , tq ) ; break ; case 5 : return BP_GenPHPGadgetEncodeBufferAsDotJoinedChars ( buff , buff_size , tq ) ; break ; case 6 : return BP_GenPHPGadgetEncodeBufferAsBase64Decode ( buff , buff_size , tq ) ; break ; default : break ; } return NULL ; }
Selects a random buffer encoder from all of the available php encoders, and encodes
the string using that.
Selects a random buffer encoder from all of the available php encoders and encodes the string using that .
// generate random // generates a set of pack('c*', 0xval, dec) values // generates a set of implode(array(chr(dec),chr(dec2)) values // generates a imploding scanf with hex encoding // generates a sprintf statement with hex encoding // generates a randomly selected buff // generates a base64_decode("base64_string") statement