그누보드 RCE 취약점 수정 adm1nkyj(김용진, http://adm1nkyj.kr) 님 제보

This commit is contained in:
thisgun
2017-10-10 11:26:11 +09:00
parent 8ed85a5fb4
commit ebad7240cc
2 changed files with 13 additions and 1 deletions

View File

@ -125,6 +125,7 @@ if($is_admin != 'super')
<p>프로그램을 실행하시려면 그누보드4의 config.php 파일 경로를 입력하신 후 확인을 클릭해 주십시오.</p>
<form name="fimport" method="post" action="./g4_import_run.php" onsubmit="return fimport_submit(this);">
<input type="hidden" name="token" value="" >
<div id="g4_import_frm">
<label for="file_path">config.php 파일 경로</label>
<input type="text" name="file_path" id="file_path" required class="frm_input required">
@ -142,6 +143,10 @@ if($is_admin != 'super')
<script>
function fimport_submit(f)
{
var token = get_write_token('g4_import');
f.token.value = token;
return confirm('그누보드4의 DB 데이터를 이전하시겠습니까?');
}
</script>

View File

@ -17,6 +17,13 @@ echo '<link rel="stylesheet" href="'.G5_URL.'/g4_import.css">';
if(empty($_POST))
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
if (!preg_match("/^http['s']?:\/\/".$_SERVER['HTTP_HOST']."/", $_SERVER['HTTP_REFERER'])){
alert("제대로 된 접근이 아닌것 같습니다.", G5_URL);
}
// 토큰체크
check_write_token('g4_import');
if(get_session('tables_copied') == 'done')
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
@ -165,7 +172,7 @@ document.onkeydown = noRefresh ;
flush();
// g4의 confing.php
require($g4_config_file);
require('./'.$g4_config_file);
if(preg_replace('/[^a-z]/', '', strtolower($g4['charset'])) == 'euckr')
$is_euckr = true;