1 頁 (共 1 頁)

[問題] rpg的骰子有bug

發表於 : 2005-09-20 01:45
233062306
骰子中.....
輸入100+100000000000
就算輸了= =......都有100000000000到你手上= =


自己找了方法...

dice.php
找\r
."<input type=\"text\" name=\"pay_money\" value=\"100\" size=\"6\" > "[/code]

代替\r

代碼: 選擇全部

."<input type=\"text\" name=\"pay_money\" value=\"100\" size=\"4\" maxlength=\"4\"> "
找\r

代碼: 選擇全部

	if ($mony<100 || $mony>10000)
	{
		$rpg_dice_result .="對不起,您的下注金額不在規定的範圍內!!";
		$rpg_dice_result .="<br />".$returnurl;
	}
代替\r

代碼: 選擇全部

	if ($mony<100 || $mony>9999)
	{
		$rpg_dice_result .="對不起,您的下注金額不在規定的範圍內!!";
		$rpg_dice_result .="<br />".$returnurl;
	}

rpg_dice

找\r

代碼: 選擇全部

最小賭注:1,00 元。<br />
最大賭注:10,000 元。</span></td>
代替\r

代碼: 選擇全部

最小賭注:1,00 元。<br />
最大賭注:9,999 元。</span></td>
這跟i-stock一樣......
快快修改.....不然會被攻擊= =

我修改的方法會令最大投注減了1元........但好過被一些壞人大量的惡意攻擊= =
我就是一個例子 :evil: :evil:

發表於 : 2005-09-20 02:16
小竹子
可不可以麻煩您一下,不要隨便"建議",因為這些外掛問題請直接聯絡開發者,謝謝! :oops:

發表於 : 2005-09-20 16:04
~倉木麻衣~
不需要那麼麻煩\r
採用跟虛擬股市一樣的修正方式即可\r

以骰子為例
#
#--------[ OPEN ]----------------
#

代碼: 選擇全部

rpg/dice.php
#
#--------[ FIND ]----------------
#
#這行也有可能是\r
#$mony = trim(addslashes($HTTP_POST_VARS['pay_money']);

代碼: 選擇全部

	$mony = trim(addslashes($_POST['pay_money']);
#
#--------[ REPLACE WITH ]----------------
#
#或是改成這樣\r
#$mony = intval(trim(addslashes($HTTP_POST_VARS['pay_money']));

代碼: 選擇全部

	$mony = intval(trim(addslashes($_POST['pay_money']));
#
#--------[ SAVE/CLOSE FILE ]----------------
#
# EoM


PS.
其實不只骰子有問題, 賽馬也有相同的狀況

發表於 : 2005-09-21 01:09
233062306
倉大~
我也有試過用i-stock的方法....
但我試的時候出錯= =....可能我差勁吧......
現在再去trytry~

發表於 : 2005-09-21 01:24
233062306
小竹子 寫:可不可以麻煩您一下,不要隨便"建議",因為這些外掛問題請直接聯絡開發者,謝謝! :oops:
對不起對不起....
忘了作者= =....
竹大可以把文章移回去嗎??
因為這算得上一個嚴重問題= =
我認識有裝rpg的論壇都被人惡意用bug賺錢....
希望未出事的朋友們可能留意一下 :cry: :cry:

發表於 : 2005-09-21 16:41
心靈捕手
以下是 ~倉木麻衣~ 兄給我的建議:
哦, 對了, 提醒你一件事
無用文章區裡有一個關於水怪骰子bug的文章, 建議你去看一看
賽馬的部份是因為有限制可輸入的長度, 所以暫時還沒什麼問題
不過, 若是遇到較進階的使用者, 就會變成另一個漏洞了
只要另存並修改表單action的提交路徑, 以及移除HTML裡的長度限制就會破功了

PS.
我身上多出來的400萬(應該沒記錯)就是這樣子來的
--
以下是參考 ~倉木麻衣~ 兄的修正後, 所做的修改:

代碼: 選擇全部

# 
#-----[ OPEN ]----- 
# 
rpg/dice.php 

# 
#-----[ FIND ]----- 
# 
$mony=trim(addslashes($_POST['pay_money'])); 

# 
#-----[ REPLACE WITH ]----- 
# 
$mony=intval(trim(addslashes($_POST['pay_money']))); 

# 
#-----[ OPEN ]----- 
# 
rpg/race.php 

# 
#-----[ FIND ]----- 
# 
$mony=trim(addslashes($_POST['mon'])); 

# 
#-----[ REPLACE WITH ]----- 
# 
$mony=intval(trim(addslashes($_POST['mon']))); 
修正後, 經 ~倉木麻衣~ 兄再度測試, 已經修補此一漏洞.

ps.
這個修正, 的確應該提醒有安裝水怪外掛者, 好好參考.
我會將此文移動回去. ;-)

發表於 : 2005-09-21 23:16
233062306
感謝^^
還是要高手出招.....看來我還有很多東西需要學習 :mrgreen: :mrgreen: :mrgreen:

剛剛試了...(不知是否我自己改錯了)
<-- 按下這裡開始!!
按下了之後沒有反應= =

還有....
$mony=trim(addslashes($_POST['pay_money']));<-------我找不到...
我只有
$mony=trim(addslashes($pay_money));

是我的版本有問題嗎....

發表於 : 2005-09-23 10:43
心靈捕手
233062306 寫:感謝^^
還是要高手出招.....看來我還有很多東西需要學習 :mrgreen: :mrgreen: :mrgreen:

剛剛試了...(不知是否我自己改錯了)
<-- 按下這裡開始!!
按下了之後沒有反應= =

還有....
$mony=trim(addslashes($_POST['pay_money']));<-------我找不到...
我只有
$mony=trim(addslashes($pay_money));

是我的版本有問題嗎....
您難道都沒有做過任何修正? :-?
http://phpbb-tw.net/phpbb/viewtopic.php?p=155348#155348

發表於 : 2005-09-23 20:35
233062306
心靈捕手 寫:您難道都沒有做過任何修正? :-?
http://phpbb-tw.net/phpbb/viewtopic.php?p=155348#155348
天呀@o@....
我真的從未見過這文章....
好自卑唷...

發表於 : 2005-09-23 23:37
233062306
水怪大陸銀行 也有bug= =...
正常存款100元
之後輸入100*99999999999.....
就......不用多說了= =
十分危險唷~

發表於 : 2005-09-24 09:18
w2812451
所以說,把RPG的銀行改成虛擬股市的銀行是一定要的~
正積極改變RPG中><

應該說已經弄好了--

發表於 : 2005-10-19 17:04
join
233062306 寫:水怪大陸銀行 也有bug= =...
正常存款100元
之後輸入100*99999999999.....
就......不用多說了= =
十分危險唷~

代碼: 選擇全部


# 
#-----[ OPEN ]----- 
# 
rpg/bank.php

# 
#-----[ FIND ]----- 
# 
$deposits = $HTTP_POST_VARS['deposits'];

# 
#-----[ REPLACE WITH ]----- 
# 
$deposits = intval($HTTP_POST_VARS['deposits']);

# 
#-----[ FIND ]----- 
# 
$withdraws = $HTTP_POST_VARS['withdraws'];

# 
#-----[ REPLACE WITH ]----- 
# 
$withdraws = intval($HTTP_POST_VARS['withdraws']);

# 
#-----[ FIND ]----- 
# 
$remits = $HTTP_POST_VARS['remits'];

# 
#-----[ REPLACE WITH ]----- 
# 
$remits = intval($HTTP_POST_VARS['remits']);

代碼: 選擇全部

# 
#-----[ OPEN ]----- 
# 
templates/subSilver/rpg_bank.tpl

# 
#-----[ FIND ]----- 
# 
<input type="text" class="post" name="deposits" size="12" maxlength="10" value="0" /> 元&nbsp;
# 
#-----[ REPLACE WITH ]----- 
# 
<input type="int" class="post" name="deposits" size="12" maxlength="10" value="0" /> 元&nbsp;

# 
#-----[ FIND ]----- 
# 
<input type="text" class="post" name="withdraws" size="12" maxlength="10" value="0" /> 元&nbsp;
# 
#-----[ REPLACE WITH ]----- 
# 
<input type="int" class="post" name="withdraws" size="12" maxlength="10" value="0" /> 元&nbsp;

# 
#-----[ FIND ]----- 
# 
金額: <input type="text" class="post" name="remits" size="12" maxlength="10" value="0" /> 元&nbsp;&nbsp;&nbsp;
# 
#-----[ REPLACE WITH ]----- 
# 
金額: <input type="int" class="post" name="remits" size="12" maxlength="10" value="0" /> 元&nbsp;&nbsp;&nbsp;

發表於 : 2005-10-21 00:40
233062306
@o@....原來tpl都要改的 :-o :-o :-o :-o
我只是用i-sm的方法改php= =....
要立即去改tpl了!!!