rtoss

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/freestyle riaf PTE @ 202  →  /freestyle riaf PTE @ 224
/freestyle riaf PTE/fstyle.tpl
@@ -75,7 +75,7 @@
A:active {color:blue;text-decoration:none;}
A:hover {color:#000080;background-color:#fafad2;}
.input {border:solid 1;background-color:white;}
.submit {border:solid 1 #122173;font-family:Tahoma,Osaka,Verdana;font-size:8pt;color:white;background-color:7281C3; height=18px}
.submit {border:solid 1 #122173;font-family:Tahoma,Osaka,Verdana;font-size:8pt;color:white;background-color:#7281C3; height:18px}
-->
</style>
</head>
@@ -92,12 +92,10 @@
</tr>
<tr>
<td bgcolor="EFF5FF">
<font color="#004080" size="+2">{$tit}</font><blockquote><font color="green">{$rmes}<br>{$tmes}</font></blockquote>
<form method="post" action="./bbs.php"><font size="-1">名前&nbsp; <input type="text" name="nick" size="20" class="input" value="">  メール <input type="text" name="mail" size="30" class="input" value=""><br>
題名&nbsp; <input type="text" name="subject" class="input" maxlength="80" size="50"> <input type="submit" value="新規投稿"> <b><a href="?">リロード</a> </b><br>
本文&nbsp; <textarea name="content" rows="5" class="input" cols="70"></textarea></font>
<span style="display:none;"> URL(省略必要)<input type="text" value="" name="url" size="19" class="input"></span>
</form>
<font color="#004080" size="+2">{$tit}</font>
<blockquote><font color="green">{$rmes}<br>{$tmes}
</font></blockquote>
<!--&NEWFORM/-->
</td>
</tr>
<tr>
@@ -123,12 +121,13 @@
</tr>
</tbody>
</table>
<small><a href="subback.php">スレッド一覧はこちら</a></small> </font></td>
<small><!--&PAGES/-->&emsp;<a href="subback.php">スレッド一覧はこちら</a></small> </font></td>
</tr>
</tbody>
</table>
<br>
<!--&FOREACH($oya,'THREAD')-->
<!--&IF($PAGEBAR,'<!--&PAGEBAR/-->','')-->
<hr>
<div align="right"><a href="http://php.s3.to" target="_blank">freeStyle bbs byレッツPHP!</a> + <a href="http://riaf.org/f_style/">riaf web</a> + PTE</div>
</center>
@@ -215,3 +214,27 @@
</tr>
</form>
<!--/&RESFORM-->
 
<!--&PAGEBAR-->
<!--&PAGES/-->
<!--/&PAGEBAR-->
 
<!--&PAGES-->
<!--&IF($PREVPAGE,'<a href="page.php?page={$PREVPAGE}"><<前のページ</a> ','')-->
<!--&FOREACH($PAGES,'PAGE')-->
<!--&IF($NEXTPAGE,'<a href="page.php?page={$NEXTPAGE}">次のページ>></a> ','')-->
<!--/&PAGES-->
 
<!--&PAGE-->
<!--&IF($THISPAGE,'<b>[{$PAGE}]</b> ','<a href="page.php?page={$PAGE}">[{$PAGE}]</a> ')-->
<!--/&PAGE-->
 
<!--&NEWFORM-->
<span id="newform">
<form method="post" action="./bbs.php"><font size="-1">名前&nbsp; <input type="text" name="nick" size="20" class="input" value="">  メール <input type="text" name="mail" size="30" class="input" value=""><br>
題名&nbsp; <input type="text" name="subject" class="input" maxlength="80" size="50"> <input type="submit" value="新規投稿"> <b><a href="?">リロード</a> </b><br>
本文&nbsp; <textarea name="content" rows="5" class="input" cols="70"></textarea></font>
<span style="display:none;"> URL(省略必要)<input type="text" value="" name="url" size="19" class="input"></span>
</form>
</span>
<!--/&NEWFORM-->
/freestyle riaf PTE/2ch.tpl
@@ -1,12 +1,10 @@
<!--&MAIN-->
<html>
<!--&MAIN--><html>
<head>
<title>{$tit}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<link rel="alternate" type="application/rss+xml" title="RSS" href="backend.php">
</head>
<head><script language="JavaScript"><!--
<script language="JavaScript"><!--
function l(e){var N=loadCookie("NAME"),M=loadCookie("MAIL"),P=loadCookie("PASS"),i;with(document)for(i=0;i<forms.length;i++)if(forms[i].nick&&forms[i].mail)with(forms[i]){nick.value=N;mail.value=M;forms[i].delk?delk.value=P:P=P;} li();}onload=l;
/* Function Equivalent to URLDecoder.decode(String, "UTF-8")
Copyright (C) 2002 Cresc Corp. http://www.cresc.co.jp/
@@ -81,22 +79,15 @@
<a name="menu" /><table border=1 cellspacing=7 cellpadding=3 width=95% bgcolor=#ccffcc><tr><td><small>
<!--&FOREACH($head,'HEAD')-->
<!--&FOREACH($over,'HEADOVER')-->
<br><div align="right"><a href="subback.php">スレッド一覧はこちら</a></div></small></td>
<br><div style="float:left"><!--&PAGES/--></div><div align="right"><a href="subback.php">スレッド一覧はこちら</a></div></small></td>
</tr>
</table>
<br>
<!--&FOREACH($oya,'THREAD')-->
<form method="post" action="./bbs.php"><a name="new"></a>
<table border=1 cellspacing=7 cellpadding=3 width=95% bgcolor=#ccffcc><tr><td><table border=0 width=100%><tr><td><div align="right" style="float:right"><a href="#top">■</a></div>
<font size=-1>名前&nbsp; <input type="text" name="nick" size="20" class=input value=""> 
メール <input type="text" name="mail" size="30" class=input value=""><br>
題名&nbsp; <input type="text" name="subject" class=input maxlength="80" size="50">
<input type="submit" value="新規スレッド作成">
<b><a href="?">リロード</a> </b><br>
本文&nbsp; <textarea name="content" rows="5" class=input cols="70"></textarea>
<span style="display:none;"> URL:(省略必要)<input type="text" value="" name="url" size="19" class="input"></span>
</font>
</td></tr></table></td></tr></table></form>
<!--&IF($PAGEBAR,'<!--&PAGEBAR/-->','')-->
 
<!--&NEWFORM/-->
 
<center>- <a href="http://php.s3.to" target="_blank">freeStyle bbs byレッツPHP!</a> + <a href="http://riaf.org/f_style/">riaf web</a> + PTE -</center>
</center>
</body>
@@ -148,3 +139,35 @@
<ul><textarea rows=5 cols=64 wrap=off name="content"></textarea><br>
</form>
<!--/&RESFORM-->
 
<!--&PAGEBAR-->
<table border=1 cellspacing=7 cellpadding=3 bgcolor=#ccffcc align=center>
<tr><td>
<!--&PAGES/-->
</td></tr></table><br/>
<!--/&PAGEBAR-->
 
<!--&PAGES-->
<!--&IF($PREVPAGE,'<a href="page.php?page={$PREVPAGE}"><<前のページ</a> ','')-->
<!--&FOREACH($PAGES,'PAGE')-->
<!--&IF($NEXTPAGE,'<a href="page.php?page={$NEXTPAGE}">次のページ>></a> ','')-->
<!--/&PAGES-->
 
<!--&PAGE-->
<!--&IF($THISPAGE,'<b>[{$PAGE}]</b> ','<a href="page.php?page={$PAGE}">[{$PAGE}]</a> ')-->
<!--/&PAGE-->
 
<!--&NEWFORM-->
<form method="post" action="./bbs.php"><a name="new"></a>
<div id="newform">
<table border=1 cellspacing=7 cellpadding=3 width=95% bgcolor=#ccffcc><tr><td><table border=0 width=100%><tr><td><div align="right" style="float:right"><a href="#top">■</a></div>
<font size=-1>名前&nbsp; <input type="text" name="nick" size="20" class=input value=""> 
メール <input type="text" name="mail" size="30" class=input value=""><br>
題名&nbsp; <input type="text" name="subject" class=input maxlength="80" size="50">
<input type="submit" value="新規スレッド作成">
<b><a href="?">リロード</a> </b><br>
本文&nbsp; <textarea name="content" rows="5" class=input cols="70"></textarea>
<span style="display:none;"> URL:(省略必要)<input type="text" value="" name="url" size="19" class="input"></span>
</font>
</td></tr></table></td></tr></table></div></form>
<!--/&NEWFORM-->
/freestyle riaf PTE/admin.php
@@ -40,7 +40,74 @@
';
exit();
}
function HTMLize($no) {
global $ddir,$ext,$kdir,$kext;
$log = file($ddir . $no . $ext);
list($fname, $femail, $fdate, $fcom, $fsub) = explode(",", $log[0]); //親
$fcom = bb2html($fcom);
$kako = "<title>$fsub</title><body><dl><b><font size=+1 color=red>$fsub</font></b>";
$kako .= "<dt>1 <font color=\"forestgreen\"><b>$fname</b></font> [ $fdate ]<dt><dd>$fcom<br><br><br>";
for($i = 2; $i < count($log) + 1; $i++) {
list($name, $email, $date, $com) = explode(",", $log[$i-1]);
$com = bb2html($com);
$kako .= "<dt>$i <font color=forestgreen><b>$name</b></font> [ $date ]<dd>$com<br><br>";
}
$kako .= "</dl><hr size=1></body>";
 
$fp = fopen($kdir . $no . $kext, "w");
fputs($fp, $kako);
fclose($fp);
echo "<a href=\"$kdir$no$kext\"> $fsub </a>HTML化完了<br>";
}
function DelThreads($key){
global $sub_back,$ext,$ext_cgi,$ddir;
$flag = false;
$sub = file($sub_back);
for($j = 0; $j < count($sub); $j++) {
$old = explode(",", $sub[$j]);
foreach($key as $val) {
if ($old[0] == $val.$ext) {
$sub[$j] = "";
$flag = true;
}
}
}
if ($flag) {
$sp = fopen($sub_back, "w");
flock($sp, LOCK_EX);
fputs($sp, implode('', $sub));
fclose($sp);
 
$sf = fopen($subj_file, "w");
flock($sf, LOCK_EX);
for($i = 0; $i < $thre_def; $i++) {
fputs($sf, $sub[$i]);
}
fclose($sf);
}
foreach($key as $val) {
if (file_exists($ddir . $val . $ext)) {
unlink($ddir . $val . $ext);
echo "$ddir$val$ext を削除しました<br>";
}
if (file_exists($ddir . $val . $ext_cgi)) {
unlink($ddir . $val . $ext_cgi);
echo "$ddir$val$ext_cgi を削除しました<br>";
}
}
}
function StopThread($dat){
global $ddir,$ext,$st_name,$st_date,$st_com;
$fp = fopen($ddir . $dat . $ext, "a");
flock($fp, LOCK_EX);
$data = "$st_name,,$st_date,$st_com\n";
fputs($fp, $data);
fclose($fp);
 
@chmod($ddir . $dat . $ext, 0444);
echo "$ddir$dat$ext を書き込み禁止にしました<br>";
}
 
$mode = $_GET['mode'];
 
if ($mode == "remake") {
@@ -91,35 +158,7 @@
}
if ($err == "" && is_array($key)) { // スレッドの削除
check_login();
$sub = file($sub_back);
for($j = 0; $j < count($sub); $j++) {
$old = explode(",", $sub[$j]);
foreach($key as $val) {
if ($old[0] == $val.$ext) {
$sub[$j] = "";
$flag = true;
}
}
}
if ($flag) {
$sp = fopen($sub_back, "w");
flock($sp, LOCK_EX);
fputs($sp, implode('', $sub));
fclose($sp);
 
$sf = fopen($subj_file, "w");
flock($sf, LOCK_EX);
for($i = 0; $i < $thre_def; $i++) {
fputs($sf, $sub[$i]);
}
fclose($sf);
}
foreach($key as $val) {
if (file_exists($ddir . $val . $ext)) {
unlink($ddir . $val . $ext);
echo "$ddir$val$ext を削除しました<br>";
}
}
DelThreads($key);
}
include("./index.inc");
}
@@ -127,40 +166,44 @@
if (isset($_POST['act_stop'])) {
check_login();
if ($err == "" && isset($dat)) {
$fp = fopen($ddir . $dat . $ext, "a");
flock($fp, LOCK_EX);
$data = "$st_name,,$st_date,$st_com\n";
fputs($fp, $data);
fclose($fp);
 
@chmod($ddir . $dat . $ext, 0444);
echo "$ddir$dat$ext を書き込み禁止にしました<br>";
StopThread($dat);
}
if ($err == "" && is_array($key)) { // スレスト
check_login();
foreach($key as $dat){
StopThread($dat);
}
}
include("./index.inc");
}
// HTML化
if (isset($_POST['act_html'])) {
check_login();
if ($err == "" && isset($dat)) {
$log = file($ddir . $dat . $ext);
list($fname, $femail, $fdate, $fcom, $fsub) = explode(",", $log[0]); //親
$fcom = bb2html($fcom);
$kako = "<title>$fsub</title><body><dl><b><font size=+1 color=red>$fsub</font></b>";
$kako .= "<dt>1 <font color=\"forestgreen\"><b>$fname</b></font> [ $fdate ]<dt><dd>$fcom<br><br><br>";
for($i = 2; $i < count($log) + 1; $i++) {
list($name, $email, $date, $com) = explode(",", $log[$i-1]);
$com = bb2html($com);
$kako .= "<dt>$i <font color=forestgreen><b>$name</b></font> [ $date ]<dd>$com<br><br>";
}
$kako .= "</dl><hr size=1></body>";
 
$fp = fopen($kdir . $dat . $kext, "w");
fputs($fp, $kako);
fclose($fp);
 
echo "<a href=\"$kdir$dat$kext\"> $fsub </a>HTML化完了<br>";
HTMLize($dat);
}
if ($err == "" && is_array($key)) { // HTML化
check_login();
foreach($key as $dat){
HTMLize($dat);
}
}
}
// HTML化のあと削除
if (isset($_POST['act_htmlndel'])) {
check_login();
if ($err == "" && isset($dat)) {
HTMLize($dat);
DelThreads(array($dat));
}
if ($err == "" && is_array($key)) { // HTML化のあと削除
check_login();
foreach($key as $dat){
HTMLize($dat);
}
DelThreads($key);
}
}
}
echo '
<html><head><title>'.$tit.'</title>
@@ -180,6 +223,7 @@
$del = (int)$_GET['del'];
$mode = $_GET['mode'];
 
$stop = " <input type=submit name=act_stop value='スレッド停止'><input type=submit name=act_html value='HTML化'><input type=submit name=act_htmlndel value='HTML化&削除'>";
if ($del) {
echo "<dl>";
$delfile = $ddir . $del . $ext;
@@ -201,7 +245,6 @@
echo "$n <font color=\"forestgreen\"><b>$name</b></font> [ $now ]<dd>$com<br><br>\n";
}
echo "</dl><input type=hidden name=dat value=$del>";
$stop = " <input type=submit name=act_stop value='スレッド停止'><input type=submit name=act_html value='HTML化'>";
$backup = isset($_POST['viewcgi'])?"<input type=submit name=viewdat value=\" ログ本体を見る \">":"<input type=submit name=viewcgi value=\" バックアップを見る \">";
} else {
$filename = ($mode == "all") ? $sub_back : $subj_file;
New file
/freestyle riaf PTE/kako/html2index.php
@@ -0,0 +1,32 @@
<?php
 
$f=glob('[0-9]*.html');
 
sort($f);
 
if(isset($_GET['direct']))
 
$buf='';
foreach($f as $i){
$l=file_get_contents($i);
preg_match('#<title>(.*)</title>#sm',$l,$m);
$title=rtrim($m[1]);
preg_match('#(\d{4}/\d{2}/\d{2}\(.*?\) \d{2}\:\d{2})#',$l,$m);
$ctime=$m[1];
$lastdt=strrpos($l,'<dt>');
$lastnospace=strpos($l,' ',$lastdt);
$lastno=max(1,intval(substr($l,$lastdt+4,$lastnospace-$lastdt-4)));
$buf.="<a href='$i'>$title ($lastno) [$ctime]</a><br>";
}
 
if(isset($_GET['direct'])){
echo $buf;
}else{
$fp=fopen('index.html','w');
flock($fp,LOCK_EX);
fwrite($fp,$buf);
flock($fp,LOCK_UN);
fclose($fp);
echo 'OK';
}
 

Property changes:

Name: bugtraq:number
+ true

/kako
/freestyle riaf PTE/bbs.php
@@ -19,7 +19,7 @@
function getREMOTE_ADDR(){
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
$tmp = preg_split('/[ ,]+/', $_SERVER['HTTP_X_FORWARDED_FOR']);
return $tmp[0];
return (!strncmp($tmp[0],'10.',3)||!strncmp($tmp[0],'192.168.',8)||matchCIDR($tmp[0],'172.16.0.0/12'))?$_SERVER['REMOTE_ADDR']:$tmp[0];
}
return $_SERVER['REMOTE_ADDR'];
}
@@ -109,15 +109,17 @@
if(preg_match($kill, $HOST) || ($checkTwice && preg_match($kill, $IP))){ $IsBanned = true; break; }
}
}
if($IsBanned) error("投稿が禁止されています (x1)", $FROM, $mail, $HOST, $MESSAGE);
if($IsBanned) {nglog_append($IP,time(),"badip\t$kill\t$FROM|$mail|".str_replace("\r\n",'<br>',$MESSAGE)); error("投稿が禁止されています (x1)", $FROM, $mail, $HOST, $MESSAGE);}
 
if(count($ngfiles)) {
foreach($ngfiles as $ngfile) {
if(is_file($ngfile)) {
$ngwords=explode(',',rtrim(implode('',file($ngfile))));
foreach($ngwords as $value){
if($value!="" && (strpos($MESSAGE, $value)!==false || strpos($subject ,$value)!==false || strpos($FROM, $value)!==false || strpos($mail,$value)!==false))
if($value!="" && (strpos($MESSAGE, $value)!==false || strpos($subject ,$value)!==false || strpos($FROM, $value)!==false || strpos($mail,$value)!==false)){
nglog_append($IP,time(),"ngword\t$value\t$FROM|$mail|".str_replace("\r\n",'<br>',$MESSAGE));
error("投稿が禁止されています (x2)", $FROM, $mail, $HOST, $MESSAGE);
}
}
}
}
@@ -128,8 +130,10 @@
$value = trim($value);
if($value){
$value="/$value/";
if((preg_match($value,$MESSAGE) || preg_match($value,$subject) || preg_match($value,$FROM) || preg_match($value,$mail)))
if((preg_match($value,$MESSAGE) || preg_match($value,$subject) || preg_match($value,$FROM) || preg_match($value,$mail))){
nglog_append($IP,time(),"rengword\t$value\t$FROM|$mail|".str_replace("\r\n",'<br>',$MESSAGE));
error("投稿が禁止されています (x3)", $FROM, $mail, $HOST, $MESSAGE);
}
}
}
}
@@ -143,9 +147,12 @@
if (!empty($mail)) {
$id = " ID:???";
} else*/ if($idtag) {
/*
$idnum = substr(strtr($_SERVER['REMOTE_ADDR'], '.', ''), 8);
$bbscrypt = ord($_SERVER['PHP_SELF'][3]) + ord($_SERVER['PHP_SELF'][4]);
$idcrypt = substr(crypt(($bbscrypt + $idnum), gmdate('Ymd', time() + $TZ * 3600)), -8);
$idcrypt = substr(crypt(($bbscrypt + $idnum),gmdate('Ymd', time() + $TZ * 3600),'id'), -8);*/
$rawstr=pack('N',ip2long($_SERVER['REMOTE_ADDR'])).pack('N',gmdate('Ymd', time() + $TZ * 3600));
$idcrypt=substr(crypt($rawstr,'id'),-8);;
$id = ' ID:' . $idcrypt;
} else {
// IP
@@ -155,7 +162,7 @@
$qcnt=$exflg=0;
if($extipq && $IP != "127.0.0.1" && strpos($FROM,"fusianasan")===false && strpos($FROM,"mokorikomo")===false) {
$rev = implode('.', array_reverse(explode('.', $IP)));
$queries = array( 'list.dsbl.org','bbx.2ch.net','dnsbl.ahbl.org','niku.2ch.net','virus.rbl.jp','ircbl.ahbl.org','tor.ahbl.org' );
$queries = array( /*'list.dsbl.org',*/'bbx.2ch.net','dnsbl.ahbl.org','niku.2ch.net','list.blogspambl.com','virus.rbl.jp','ircbl.ahbl.org','tor.ahbl.org' );
foreach ( $queries as $query ) {
$qres=gethostbyname($rev.'.'.$query);
if($rev.'.'.$query!=$qres){ $exflg=1; break; }
@@ -163,7 +170,7 @@
if($qcnt>=$extipq) break;
}
}
if($exflg) error("投稿が禁止されています (#".$qcnt.')', $FROM, $mail, $HOST, $MESSAGE);
if($exflg) {nglog_append($IP,time(),"extipq\t$query($qres)\t$FROM|$mail|".str_replace("\r\n",'<br>',$MESSAGE)); error("投稿が禁止されています (#".$qcnt.')<!--'.$rev.'.'.$query.', '.$qres.'-->', $FROM, $mail, $HOST, $MESSAGE);}
 
 
$FROM = str_replace("fusianasan", "</b>" . $HOST . "<b>", $FROM); //fusianasan?
/freestyle riaf PTE/conf.php
@@ -24,15 +24,16 @@
$page_def = 10; //1ページに何スレッド?
$res_def = 7; //1スレッドに何個レス?
$thre_def = 45; //ヘッドライン表示最大数
$read_def = 50; //最新何個レス
$extag = 1; //独自タグを使う?
$imgtag = 1; //上記1の場合、imgタグ使う?
$nanasi = '名無しさん'; //無記名時の名前
$thre_cut = 26; //スレ表示文字数(追加
 
$viewline = 15; //表示時の最大行数(これ以上はリンク)
$viewbyte = 1200; //表示時の最大バイト数(これ以上はリンク)
$postline = 25; //投稿時の最大行数
$postbyte = 3000; //投稿時の最大バイト数
$viewline = 25; //表示時の最大行数(これ以上はリンク)
$viewbyte = 3000; //表示時の最大バイト数(これ以上はリンク)
$postline = 45; //投稿時の最大行数
$postbyte = 4000; //投稿時の最大バイト数
$numlimit = 1000; //レス最大投稿数(これ以上は書き込めない)
$taborn = 2; //透明あぼーん
 
@@ -70,6 +71,7 @@
$ngfiles=array('./spamdata.cgi','./ngwords.cgi');
$rengfile='./rengwords.cgi';
$extipq=7;
$faillog='./nglog.log';
 
if(isset($_SERVER['ORIG_PATH_INFO'])) $_SERVER['PATH_INFO']=$_SERVER['ORIG_PATH_INFO']; //PHP5 workaround
 
@@ -109,4 +111,12 @@
exit();
}
 
?>
function nglog_append($ip,$tim,$msg){
global $faillog;
$fp = fopen($faillog,'ab') or fopen($faillog,'wb');
flock($fp,2);
fputs($fp,"$ip\t$tim\t$msg\n");
fclose($fp);
}
 
?>