1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
<?php header("Content-type:text/html;charset=euckr"); @session_start();
function sql_injection_stop2($array){ foreach($array as $key=>$str){ $str=preg_replace("/\s{1,}1\=(.*)+/","",$str); // 공백이후 1=1이 있을 경우 제거 //$str=preg_replace("/\s{1,}(or|and|null|where|limit)/i"," ",$str); // 공백이후 or, and 등이 있을 경우 제거 //$str = preg_replace("/[\s\t\'\;\=]+/","", $str); // 공백이나 탭 제거, 특수문자 제거
$array[$key] = $str; }
return $array; }
$_GET = sql_injection_stop2($_GET); $_POST = sql_injection_stop2($_POST); $_REQUEST = sql_injection_stop2($_REQUEST); $_SERVER = sql_injection_stop2($_SERVER); $_SESSION = sql_injection_stop2($_SESSION);
@extract($_GET); @extract($_POST); @extract($_REQUEST); @extract($_SERVER); @extract($_SESSION);
foreach($_FILES as $key=>$val){ if($key=='add_file'){ $add_file = $val['tmp_name']; $add_file_name = $val['name']; } } ?>
<?php include("../../manage/category/common.php");
function filter_SQL($content){ $content = str_replace("&", "&", $content); $content = str_replace("<", "<", $content); $content = str_replace(">", ">", $content); $content = str_replace("'", "&apos", $content); $content = str_replace("\"", """, $content); $content = str_replace("\r", "", $content); $content = str_replace("'", "", $content); $content = str_replace('"', "", $content); $content = str_replace("--", "", $content); $content = str_replace(";", "", $content); $content = str_replace("%", "", $content); //$content = str_replace("+", "", $content); // 상담분야 선택에서 +가 들어가기때문에 코멘트 $content = str_replace("script", "", $content); $content = str_replace("alert", "", $content); $content = str_replace("cookie", "", $content); $content = SQL_Injection($content); return $content; }
function SQL_Injection($get_Str) { $Str = preg_replace("/(select|union|insert|update|delete|drop|\"|\'|#|\/\*|\*\/|\\\|\;)/i","", $get_Str); return $Str; }
foreach($_POST as $key => $val) { $_POST[$key] = filter_SQL($val); }
@extract($_POST);
$mobile_agent = "/(iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS)/";
if(preg_match($mobile_agent, $_SERVER['HTTP_USER_AGENT'])){ $txt = "(모바일)"; }else{ $txt = "(PC)"; }
$today = date("Y-m-d H:i:s",time()); $ip = $_SERVER['REMOTE_ADDR']; $n_fix_select2 = iconv("UTF-8","EUC-KR",$n_fix_select); $inflow = iconv("UTF-8","EUC-KR","하단유입".$txt); $sql = "insert into mBoard_install_req set smtitle = '{$n_fix_select2}', smtel = '{$n_fix_tel}', reg_date = '{$today}', ipadd = '{$ip}', inflow = '{$inflow}'"; $res = mysql_query($sql);
echo "도입상담 신청 되었습니다. *근무시간 기준 20분내 연락 드리겠습니다. *비근무 시간 신청은 근무시간에 연락 드립니다. 감사합니다."; ?>
|