@extract($_POST);
@extract($_GET);
$set_und = $_COOKIE["SET_UND"];
$set_id = $_COOKIE["SET_ID"];
$set_name = $_COOKIE["SET_NAME"];
$set_level = $_COOKIE["SET_LEVEL"];
$set_level_name = $_COOKIE["SET_LEVEL_NAME"];
$set_input_time = $_COOKIE["SET_INPUT_TIME"];
$set_agency_und = $_COOKIE["SET_AGENCY_UND"];
$set_general_und = $_COOKIE["SET_GENERAL_UND"];
$set_company = $_COOKIE["SET_COMPANY"];
$set_sort_code = $_COOKIE["SET_SORT_CODE"];
$set_main_area = $_COOKIE["SET_MAIN_AREA"];
$set_sub_area = $_COOKIE["SET_SUB_AREA"];
$set_gmark = $_COOKIE["SET_GMARK"];
$set_store = $_COOKIE["SET_STORE"];
$set_company_size = $_COOKIE["SET_COMPANY_SIZE"];
$set_certification = $_COOKIE["SET_CERTIFICATION"];
$set_system = $_COOKIE["SET_SYSTEM"];
$set_break_point = $_COOKIE["SET_BREAK_POINT"];
$set_exceldate = $_COOKIE["SET_EXCELDATE"];
$set_excelfile = $_COOKIE["SET_EXCELFILE"];
$set_is_pay = $_COOKIE["SET_IS_PAY"];
$set_expirationdate = $_COOKIE["SET_EXPIRATIONDATE"];
$set_expiration_num = $_COOKIE["SET_EXPIRATION_NUM"];
?>
@extract($_POST);
@extract($_GET);
$dbconn = mysqli_connect("localhost","schooleat","schooleat1234", "dbschooleat");
// $dbconn = mysqli_connect("210.180.118.103","schooleat","schooleat1234", "dbschooleat");
// mysqli_select_db($dbconn, "dbschooleat");
// mysqli_query("set names UTF-8");
// mysqli_query("set names euckr");
$dbconn->set_charset("UTF-8") ;
?>
@extract($_POST);
@extract($_GET);
function alert_error ($message)
{
echo "";
echo ("
");
}
function process_msg ($message)
{
echo "";
echo ("
");
}
function ExeInjection($str){
global $deBug;
$valStr = $str; // 대소문자 원본을 살려둔다.
$str = strtolower($str); // 모든 문자를 소문자로 바꾼다.
$fn_word_Check = "";
if ( strpos($str, 'select') !== false && strpos($str, 'from') !== false) {
$fn_word_Check = 9101;
$deBug .= "Error : 9101
";
// insert ... select | insert ... values
}elseif( strpos($str, "insert") !== false && ( strpos($str, "values") !== false || strpos($str, "select") !== false ) ){
$fn_word_Check = 9102;
$deBug .= "Error : 9102
";
// update ... set
}elseif( strpos($str, "update") !== false && strpos($str, "set") !== false ){
$fn_word_Check = 9103;
$deBug .= "Error : 9103
";
// [delete|drop|deny|grant] ... [탭|엔터|공백]
}elseif ( (
strpos($str, "delete") !== false || strpos($str, "drop") !== false || strpos($str, "deny") !== false || strpos($str, "grant") !== false) && ( strpos($str, chr(9)) !== false || strpos($str, chr(10)) !== false || strpos($str, chr(13)) !== false || strpos($str, chr(32)) !== false ) ){
$fn_word_Check = 9104;
$deBug .= "Error : 9104
";
// truncate ... table
}elseif ( (strpos($str, "truncate") !== false || strpos($str, "alter") !== false) && strpos($str, "table") !== false ){
$fn_word_Check = 9105;
$deBug .= "Error : 9105
";
// exec | execute | dbcc
}elseif( (strpos($str, "exec") !== false || strpos($str, "dbcc") !== false) && (strpos($str, "(") !== false || strpos($str, "sp_") !== false || strpos($str, "xp_") !== false) ){
$fn_word_Check = 9107;
$deBug .= "Error : 9107
";
// declare @
}elseif( strpos($str, "declare") !== false && strpos($str, "@") !== false ) {
$fn_word_Check = 9108;
$deBug .= "Error : 9108
";
}elseif( strpos($str, "create") !== false && (strpos($str, "table") !== false || strpos($str, "user") !== false)) {
$fn_word_Check = 9109;
$deBug .= "Error : 9109
";
}
if($fn_word_Check){
echo "
";
// exit;
}
return $valStr; // 아무 에러가 없을시 원본을 리턴한다.
}
function SQLInjection($str){
$str = ExeInjection($str);
return
str_replace("'","''",
str_replace("--","",
str_replace("%%","",
str_replace(";", "", $str
)
)
)
);
}
?>