Error in dog customization and cropping logic, leading to csrf pants Removal

Source: Internet
Author: User

Error in dog customization and cropping logic, leading to csrf pants Removal

The system interaction degree of csrf trousers caused by a custom cropping logic error of the dog is relatively large.

View the Code directly:
 

db.mod.php:(576-620):$f = str_replace(array('/', '\\', '.'), '', $filename);$f = dir_safe($f);$backupdir = 'db/' . $f;$backupfilename = './data/backup/'.$backupdir.'/'.$f;if (!is_dir(($d = dirname($backupfilename)))) {jio()->MakeDir($d);}if($usezip) {require_once ROOT_PATH . 'include/func/zip.func.php';}if($method == 'multivol') {$sqldump = '';$tableid = intval(get_param('tableid'));$startfrom = intval(get_param('startfrom'));$complete = TRUE;for(; $complete && $tableid < count($tables) && strlen($sqldump) + 500 < $sizelimit * 1000; $tableid++) {$sqldump .= $this->_sql_dump_table($tables[$tableid], $startfrom, strlen($sqldump));if($complete) {$startfrom = 0;}}$dumpfile = $backupfilename."-%s".'.sql';!$complete && $tableid--;if(trim($sqldump)) {$sqldump = "$idstring"."# <?php exit(); ?>\n"."# JishiGou Multi-Volume Data Dump Vol.$volume\n"."# Version: JishiGou ".SYS_VERSION."\n"."# Time: $time\n"."# Type: $type\n"."# Table Prefix: $tablepre\n"."#\n"."# JishiGou Home: http:\/\/www.jishigou.net\n"."# Please visit our website for newest infomation about JishiGou\n"."# --------------------------------------------------------\n\n\n"."$setnames".$sqldump;$dumpfilename = sprintf($dumpfile, $volume);

We can see that the database name without the final backup comes from two places. Let's refine it:
 

$f = str_replace(array('/', '\\', '.'), '', $filename);$f = dir_safe($f);$backupdir = 'db/' . $f;$backupfilename = './data/backup/'.$backupdir.'/'.$f;$dumpfile = $backupfilename."-%s".'.sql';$dumpfilename = sprintf($dumpfile, $volume);


We can see that none of these parameters are completely controllable from the url. We send the url:

Http: // 192.168.10.70/archiver-jishigou.4.7.4.20140922.utf8/admin. php? Mod = db & code = doexport & type = all_tables & saveto = server & filename = 201409261043_xxxx & method = multivol & sizelimit = 2048 & volume = 2 & tableid = 1 & startfrom = 0 & extendins = 1 & sqlcharset = & sqlcompat = & exportsubmit = yes & usehex = 1 & usezip = 0



Filename and volume control the name of the backup file.

Please visit
 




 





This is a get request, and without csrf, you can share a link on your website to the Administrator. You can also embed images in Weibo.
 

Solution:

Filter
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.