mysqlmysql注入工具bsql-hackerbsql hacker manual_第1页
mysqlmysql注入工具bsql-hackerbsql hacker manual_第2页
mysqlmysql注入工具bsql-hackerbsql hacker manual_第3页
mysqlmysql注入工具bsql-hackerbsql hacker manual_第4页
mysqlmysql注入工具bsql-hackerbsql hacker manual_第5页
已阅读5页,还剩33页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、BSQL HackerFerruh Mavituna ()BSQL HACKER1BSQL HACKER5Quick Start5BSQL Hacker for Anyone5BSQL Hacker for Advanced Users6Some Action6Example:7Supported Databases for SQL Injection Wizard8SQL Injection Wizard8Injection in Querystring10Injection from Raw Request10Finish SQL Injection12

2、Using Attack Files and Attack File Templates12What is an Attack File?12What is an Attack File Template?12How to use Attack Files?13Attack File Features13Key Features14Requirements15Security Issues Related with BSQL1638Update Repository16GUI Functions17Automated Attacks17Case Sensitive17Magic Variabl

3、es18Generic Part:18X18INJECTION18Blind SQL Injection Related:18CHAR18POSITION18OPERATION18Error Based SQL Injection:18ERROR_POSITION18ERROR_BUFFER18Full Blind SQL Injection Related19SECONDS19Other19TOKEN19BSQL HACKER CONSOLE20Request Related Parameters20Post Request20Add Post Data -ap, -addpost20Add

4、 Post Data File -apf, -addpostfile20Add Post Request File -aprf, -addpostrequestfile20Get Request21Query -q, -query21Cookies21Add Cookie -ac, -addcookie21Add Cookie Request File -acrf, -addcookierequestfile21Headers22Add Header -ah, -addheader22Connection Related Parameters23Threading23Thread Count

5、-t, -threadcount23Start Delay -sd, -startdelay23Miscellaneous23Enable Automatic Redirects -ar, -allowredirect23Request Timeout -rt, -requesttimeout24Proxy Related24Enable Proxy -ep, -enableproxy24Proxy URL -p, -proxy25Authentication Related25Default Network Credentials -dc, -defaultcredentials25User

6、name -u, -username25Password -pwd, -password25Domain Name -m, -domain26Error Handling27Error Retry -er, -errorretry27Error Retry Sleep -ers, -errorretrysleep27Injection Related27Magic Variables27Disable Confirm Found Char -dcfc, -dconfirmfoundchar28Length -l, -length29Start Position -sp, -startposit

7、ion29Detection Related29Detection Mode -dm, -detectionmode time| search | deep29Detection Time -dt, -detectiontime30Search String True -sst, -searchstringtrue31Search String False -ssf, -searchstringfalse31RegEx Support for Search -rx, -regex31Session Token Support Related Parameters33Token URL -tur

8、l, -tokenurl34Token Extract RegEx -tex, -tokenregex34Disable Token Session Share -dtss, -disabletokensessionshare34-tsr, -tokensamerequest34BSQLHacker Related Parameters35Silent (ALPHA) -s -silent35Output (ALPHA) -o -output35Matrix Sucks (ALPHA) -msux, -matrixsucks36Help (ALPHA) -h, -help, -?36Examp

9、les37Known Issues38BSQL HackerBSQL (Blind SQL) Hacker is an automated SQL Injection Framework / Tool designed to exploit blind SQL injection vulnerabilities virtually in any database.BSQL Hacker aims for experienced users as well as beginners who want to automate Blind SQL Injections.If you dont wan

10、t read lots of stuff stic k with Quick Start guide and Videos.Quick StartIf you already good with SQL Injections and just looking for a new tool to automate your attacks, you may just dive into “Attack Files” and understand the whole automation system, if you are not, you can try “Attack File” templ

11、ates and SQL Injection Wizards.BSQL Hacker for AnyoneIf you just want to exploit it by pressing “play” button keep reading, if not try BSQL Hacker for Advanced Users to understand how you can write your very own injections.There are 3 ways to launch an exploit:1. SQL Injection Wizard (no-brainermode

12、)2. Loading an Attack Templates oran Exploit (easy)3. Supplying custom injection (requires good SQL Injection knowledge)In most of the common cases Templates and Wizard should be enough but you may want to do some advanced tricks or bypass some strange restriction. Then you need to supply your very

13、own injections. After you come up with a new injection you can save / share it as Attack File Template.You can always start by trying SQL Injection Wizard. It allows you to start a new attack from Raw Request or a simple URL. Itll test your injection for supported databases (see Supported Databases

14、for SQL Injection Wizard). After you get it work you can modify settings and resume it.If it doesnt work and you know the reason you can just fix it in the GUI and start the attackagain.If you are confident about it tead Wizard you may want to load a related Attack Template and just run it.BSQL Hack

15、er for Advanced UsersAs you know Blind SQL Injection is all about True and False responses. To able to write your very own attack files or handling some strange attacks you need to know following subjects quiet well: Blind SQL Injection Your target database functions Using Binary Search in Blind SQL

16、 InjectionIf you dont know these, you can still use BSQL Hacker by wizards and templates. Please refer toBSQL Hacker for Anyone.Some ActionBSQL Hacker relies on Magic Variables to automate attacks. In a Blind SQL Injection you have got couple of dynamic parameters: Position: POSITION Comparison Oper

17、ator : OPERATION Char to Compare: CHARThese magic variables will be replaced on the fly by BSQL Hacker before sending the server. This allows automating lots of attacks easily.Example:A sample Blind SQL Injection attack for MSSQL:CHAROPERATION/default.asp?p=1 AND ISNULL(ASCII(SU

18、BSTRING(CAST(USER)AS varchar(8000),POSITION,1),0)-When you give this input to BSQL Hacker it will replace POSITION, OPERATION and CHAR with required values in the real time.Following injections will send to the server:Getting one character;1 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),1,1)

19、,0)781 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),1,1),0)541 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),1,1),0)541 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),1,1),0)661 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),1,1),0)72Next Character;1 AND ISNULL(ASCII(S

20、UBSTRING(CAST( USER)AS varchar(8000),2,1),0)781 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),2,1),0)1031 AND ISNULL(ASCII(SUBSTRING(CAST(USER)AS varchar(8000),2,1),0)114Above, you clearly see how magic variables are changing. Now if we want to port this attack toORACLE we can come up with f

21、ollowing attack:/default.asp?p=1 AND NVL(ASCII(SUBSTR(SELECT user FROM dual),POSITION,1),0)OPERATIONCHARObviously you can write similar attacks for other databases. BSQL ships with following ready to go files (Attack File Templates): PostgreSQL SQL Server MySQL ORACLEIf you writ

22、e an attack file template for another database which is not listed her e,please send it to me and itll be in the update repository quite soon for every user.Supported Databases for SQL Injection Wizard MS SQL Server 2000 / 2005 and potentially others ORACLE MySQLSQL Injection WizardTo able to use SQ

23、L Injection Wizard you should know vulnerable parameter or place.If you know the vulnerable place / parameter youve got two options; New SQL Injection from Querystring New SQL Injection from Raw RequestFigure 1 : Injection Wizard1. Run Injection Wizard (Ctrl + N)2. Choose one of the following method

24、s;a. If you can exploit it with a simple GET choose “Injection in Querystring”b. If its in POST, some HTTP Header or it does require a cookie ( like authentication cookie) then choose “From Raw Request”Injection in QuerystringNow all you need to do is paste your URL and check vulnerable parameter fr

25、om the list and click Finish.Its critical that you leave default value for vulnerable parameter. Dont put singlequote or similar stuff, just keep the original value.Figure 2 : Injection Wizard - Injection QuerystringInjection from Raw RequestIf you want to supply your injection point from HTTP Raw R

26、equest, paste your request (from your proxy or something), point your cursor to injection place and then click “ ert Injection Point” button. This will put a X magic variable to vulnerable place.You should supply the raw HTTP request done by browser to proxy which means request should include full U

27、RL of target like:POST /?p=1 HTTP/1.1tead ofPOST /?p=1 HTTP/1.1Now you need to click finish to start SQL Injection.Its critical that you leave default value for vulnerable parameter. Dont put singlequote or similar stuff, just keep the original value.This is a good example of correc

28、tly marked HTTP raw request:GET /?product_id=1X HTTP/1.1 Host: 5User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:) Gecko/20071025 Firefox/Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/p ng,*/*;q=0

29、.5Accept-Language: en-gb,en;q=0.5Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: closeProxy-Connection: closeCookie: ASPSESSIONIDQQGQGKFU=OFLJAGDCEEEJFIBPCAODLAGPPragma: no-cacheCache-Control: no-cacheFinish SQL InjectionWhen you click “Finish” BSQL Hacker will attempt to run injection an

30、d if it success it will let you know and start “auto injection” process. If you dont want auto injection you may stop the process, change settings and run it again.Figure 3 : Testing for SQL InjectionUsing Attack Files and Attack File TemplatesWhat is an Attack File?Figure 4 : Sample attack file for

31、 MySQLAttack files are like save/load files for BSQL Hacker. You can save and share your attack files. You can generate new attack files specific to vulnerability and also share them as exploit.Better than writing 50 lines of perl for every single BSQL vulnerability, eh?Attack files are plain XML an

32、d you can modify them with your favourite text editor.What is an Attack File Template?Attack File Template is an improved version of attack files. A template can ask questions to user and can fill up GUI according to answers and values in the attack file template.Attack File Templates are useful for

33、 generic attacks. tead of a starting a BSQL attack for MSSQL from the scratch you can load up a working template, customize and run it.How to use Attack Files?1) Load an attack file “File Load” or “Ctrl + O”2) Answer question in the GUI (if any)3) Customize Settings if required4) Test Injection “Inj

34、ection Test Injection” or “Ctrl + T”5) If test wet well, Start it. “F5”Figure 5: Attack Settings WindowAttack File FeaturesAttack Files can carry almost everything presented in GUI, and you may also ask for variables. Asking for variables to user when it comes to exploit vulnerabilities.Assume you a

35、re writing an exploit for BSQL which requires authentication. You may want to ask user for their active cookies. Or you may want to ask user_id which you want to read password hash, and so on.Also you can Attack File for personal usage. Lets say you exploit an SQL Injection then you cansave it and u

36、se it later or share with someone with the exact same settings as you.Key Features Easy Modeo SQL Injection Wizard Generalo Fast and Multithreadedo 4 Different SQL InjectionSupport Blind SQL Injection Time Based Blind SQL Injection Deep Blind (based on advanced time delays) SQL Injection Error Based

37、 SQL Injectiono Can automate most of the new SQL Injection methods those relies on Blind SQL Injectiono RegEx Signature supporto Console and GUI Supporto Load / Save Supporto Token / Nonce / ViewState etc. Supporto Session Sharing Supporto Advanced Configuration Supporto Automated Attack mode, Autom

38、atically extract all database schema and data mode GUI Featureso Load and Saveo Template and Attack File Support (Users can save sessions and share them. Some sections like username, password or cookie in the templates can be show to the user in a GUI)o Visually view true and false responses as well

39、 as full HTML response, including time and stats Connection Relatedo Proxy Support (Authenticated Proxy Support)o NTLM, Basic Auth Support, use default credentials of current user/applicationo SSL (also invalid certificates) Supporto Custom Header Support Injection Points (only one of them orcombina

40、tion)o Query Stringo Posto HTTP Headerso Cookies Othero Post Injection data can be stored in a separated fileo XML Output (not stable)o CSRF protection supportone time session tokens or viewstate ort similar can be used for separated logessions, bypassing proxy pages etc.Requirements .NET Fr

41、amework 2 Not working on Mono (hopefully it will)Security Issues Related with BSQL BSQL does support self-signed, not valid, expired, and weak, invalidate certificates and wont warn you! So you are vulnerable to MITM attacks for SSL connections during your attacks. Auto-Update feature relies on SSL

42、and wont connect invalid certificated servers. This is a security feature; if you want to force BSQL Hacker to your own server for Auto-update you can force it from configuration files with your ownrisk. Attack Templates should be considered as secure but they may force BSQL Hacker to connect “unwan

43、ted” servers. Its recommended to read attack files before use. They are plain XML files, open in your text editor and check whats going on.Update RepositoryTODOGUI FunctionsAutomated AttacksNot supported by console version yet.Automated attack can automate a supplied SQL Query or can go fully automa

44、ted and extract tables, columns, database name, database version, database user and data from database automatically.For full automated attacks currently supports MSSQL and ORACLE.Case SensitiveNot supported by console version yet.Try to get results in not case sensitive way to make it a bit faster.

45、 This will improve performance slightly.Deep Blind SQL Injections are always case-sensitive.Magic VariablesCurrent list of magic variables:Generic Part:XMarks injection point. This will be replaced with a full SQL Injection sentence.INJECTIONMarker for Automated Attacks. This will be replaced with c

46、urrent attack sentence.Blind SQL Injection Related:CHARCharacter to compare. This will be replaced with integer representation of character that we are checking.POSITIONPosition of character that we are getting. This will be replaced with current position of string.Start up value for this magic vari

47、able can be controlled from GUI “Detection Start Position”OPERATIONOperation character for Binary Search / Blind SQL Injection. While running this can be equal, bigger or smaller.Error Based SQL Injection:ERROR_POSITIONStart position of current buffer to read. Will be replaced with position.ERROR_BU

48、FFERHow many characters to read at a time from a Error Based SQL Injection.Full Blind SQL Injection RelatedSECONDSHow many seconds to wait. You can configure this from the GUI “Detection Time Based Seconds to Wait”OtherTOKENThis variable is used for nonce, viewstate similar stuff. It will be replace

49、d with exctracted token in the actual request.Currently The GUI doesnt support this. Only console version supports this parameter.BSQL Hacker ConsoleBSQL Hacker Console Parameters.Request Related ParametersThese parameters are related with HTTP requests.Post RequestAdd PostData-ap, -addpostAdds new

50、post data to the request. You can use more than once. Post data will be encoded, supply not encoded post data.Syntax: -ap “name=value”Add Post Data File-apf, -addpostfileAdds new post data from text file. You can use more than once. Post data will be encoded, supply not encoded post data.Syntax: -ap

51、f “name=c:case001postinj.txt”Add Post Request File-aprf, -addpostrequestfilePost data from text file. You can use more than once. Post data should be encoded, supply encoded post data.Syntax: -aprf “c:case001rawpostdata.txt”Sample post data file:- -name=value&name2=value2- -Get RequestQuery-q, -quer

52、yQuery part of the request. Query string should be encoded. If you do not supply any query parameter application assumes “/” as query. You can not combine query with host URL. You should supply query with this parameter.Syntax: -q “id=10&document=test”CookiesAdd Cookie-ac, -addcookieAdd new cookie t

53、o the request. You can use more than once. Post data will be encoded, supply not encoded post data.Syntax: -q “id=10&document=test”Add Cookie Request File-acrf, -addcookierequestfileAdd several cookies from text file. You can use more than once.Cookie data should not include reserved characters and

54、should be separated by “;”.Syntax: -acrf “c:case001cookiedata.txt”Sample cookie data file:- -name=value&name2=value2- -HeadersAdd Header-ah, -addheaderAdd new header to the request. You can use more than once. Header name should not include reserved characters.Syntax: -ah “HTTP_X_FORWARDED_FOR=INJECTION”-ah “HTTP_X_F

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论