• Stars
    star
    39
  • Rank 689,875 (Top 14 %)
  • Language
  • Created almost 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WriteUp of sqli-labs (GitBook : https://www.gitbook.com/book/wangyihang/sqli-labs/details)

Introduction


###sqli-labs简介 对于想要学习web安全的同学 , 这是一个非常好的学习有关SQL注入的学习资料 类似于闯关的模式 , 每一个关卡都有非常多的思路和利用方式 这些关卡包含了各种常见的SQL注入姿势 :

  • 明注
  • 盲注
  • 基于bool
  • 基于时间
  • 基于报错

Github地址


环境要求 : php mysql web服务器(Aapche或者其他)

注 : 这里笔者使用操作系统是ubuntu16.04 , 如果大家使用的操作系统是Widnows的话 区别只是在如何去安装和配置php/mysql/apache服务器 这些百度/Google上已经有很多很详细的教程了 , 就不再赘述 大家可以直接使用例如xampp / wamp 这样的服务器套件


部署流程 :

  1. 搭建lamp环境
  2. 从github上克隆最新的sqli-labs仓库
  3. 将克隆的仓库移动到apache的web目录下
  4. 配置php文件(数据库密码)
  5. 浏览器访问启动页面进行安装

部署教程 :

  1. 搭建lamp环境 :
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo apt-get install mysql-server

注 : 如果你的ubuntu是16.* , 在安装php的时候可能会出现找不到php5的情况 , 这个是因为ubuntu16以后对php5不再进行支持 , 如果你使用apt-get install php的话 , 安装的默认为php7 , 但是这个问题是可以通过添加php5的第三方源来解决的 , 可以使用下面这条几条命令 :

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
  1. 启动apache和mysql
sudo service apache2 start
sudo service mysql start
  1. 测试php是否安装成功 , 使用php探针 在web目录下编写php代码保存为phpinfo.php
<?php
        phpinfo();
?>

访问 http://127.0.0.1/phpinfo.php , 如果出现php的基本信息则说明php已经安装成功 , 这个时候就可以把这个探针文件删除 3. 测试php连接数据库是否成功 在web目录下编写php代码保存为 : database.php

<?php
        $con = mysql_connect("localhost","root","password"); 
        // 这里填写数据库的地址(由于是本机因此localhost或者127.0.0.1都可以)/用户名/密码
        if ($con) {
                echo "OK!";
        }else {
                die('Could not connect: ' . mysql_error());
        }
?>

然后访问http://127.0.0.1/database.php , 如果数据库配置正确的话 , 页面会显示OK! , 同理也可以删除这个文件 否则会显示错误信息 , 可以根据这个错误信息去寻找解决方案 2. 安装git

apt-get install git
  1. 从github上克隆sqli-labs仓库
git clone https://github.com/Audi-1/sqli-labs.git

如果只是为了练习sql注入的话 , 这一步还有上面的安装git的那一步其实可以省略 , 因为github提供了一个直接下载仓库源码压缩包的功能 , 下载解压之后也是相同的效果 4. 进入sqli-labs目录, 修改数据库配置文件 : sqli-labs/sql-connections/db-creds.inc

<?php
//give your mysql connection username n password
$dbuser ='root';
$dbpass ='';
$dbname ="security";
$host = 'localhost';
$dbname1 = "challenges";
?>
  1. 复制这个目录到apache的web目录(默认为 : /var/www/html/)
sudo cp -r ./sqli-labs /var/www/html/
  1. 然后在浏览器中访问 : http://127.0.0.1/ , 就可以看到启动的页面了
  2. 点击页面中的Setup/reset Database for labs链接 , 让其进行安装(这个过程其实就是创建必要的数据库和表 , 并插入一些测试数据)

参考资料 :

  1. ubuntu 搭建lamp
  2. 如何使用git
  3. 如何使用github
  4. 如何安装配置apache服务器
  5. 如何安装php
  6. 如何安装mysqle

More Repositories

1

Platypus

🔨 A modern multiple reverse shell sessions manager written in go
Go
1,469
star
2

GitHacker

🕷️ A `.git` folder exploiting tool that is able to restore the entire Git repository, including stash, common branches and common tags.
Python
1,351
star
3

Webshell-Sniper

🔨 Manage your website via terminal
Python
422
star
4

SourceLeakHacker

🐛 A multi threads web application source leak scanner
Python
380
star
5

ccupp

基于社会工程学的弱口令密码字典生成工具
Python
329
star
6

UsbKeyboardDataHacker

USB键盘流量包取证工具 , 用于恢复用户的击键信息
Python
305
star
7

Reverse-Shell-Manager

🔨 A multiple reverse shell session/client manager via terminal
Python
237
star
8

USB-Mouse-Pcap-Visualizer

USB mouse traffic packet forensic tool, mainly used to draw mouse movements and dragging trajectories
JavaScript
216
star
9

Exploit-Framework

🔥 An Exploit framework for Web Vulnerabilities written in Python
Python
169
star
10

Apache-HTTP-Server-Module-Backdoor

👺 A Backdoor For Apache HTTP Server Written in C
C
151
star
11

MIT-6.031-Readings-zh-cn

麻省理工大学-18年春季学期-软件构造(6.031)课程阅读中文版
82
star
12

awesome-web-security

📓 Some notes and impressive articles of Web Security
75
star
13

Codiad-Remote-Code-Execute-Exploit

A simple exploit to execute system command on codiad
Python
65
star
14

Find-PHP-Vulnerabilities

🐛 A plug-in of sublime 2/3 which is able to find PHP vulnerabilities
Python
56
star
15

PwnMe

二进制渗透题目汇总
Python
54
star
16

IdiomsSolitaire

成语接龙
Python
47
star
17

12306

12306网站抢票Python脚本
Python
27
star
18

WebShellCracker

WebShell密码爆破工具
Python
19
star
19

LinuxShellScript

LinuxShell编程笔记
Shell
15
star
20

SQL-Hacker

简单SQL注入工具
Python
14
star
21

Subdomain-Crawler

A program for collecting subdomains of a list of given second-level domains (SLD)
Go
12
star
22

XorShellcode

Shellcode异或加密工具
Python
12
star
23

ShellcodeSpider

Shellcode Spider of Exploit-DB
C
11
star
24

HIT-Courses-Calendar

哈尔滨工业大学教务处课表Excel转换iCal脚本
Python
9
star
25

Proxy-Verifier

A set of tools designed to efficiently and effectively locate publicly available proxy server resources.
Go
9
star
26

PPT-Generator

Generate PPT via a simple summary
Python
9
star
27

tplayer

一个Linux终端播放器 , 使用字符绘制图片/视频 , 并按照帧率播放
Python
8
star
28

Presentations

8
star
29

gojob

Go(od) Job is a simple job scheduler that supports task retries, logging, and task sharding.
Go
7
star
30

t3sec-network-flow-analysis

6
star
31

SimpleEncrypter

简单shellcode加密工具(存在 0 字节)
Python
5
star
32

Docker-Container-Exposer

Expose docker containers to public network
Shell
5
star
33

pickle-pickle

A arbitary python code executer via python pickle
Python
5
star
34

CrackMe

CrackMe 汇总
Python
5
star
35

Platypus-Python

Python
5
star
36

DBLP-Spider

A spider tool for downloading the DBLP search results into local BibTeX files.
Python
4
star
37

Markdown-URL-to-Title

Python
3
star
38

MovieSearcher

电影资源搜索工具
Python
3
star
39

Image-LSB-Stego

Python
3
star
40

http-grab

Go
2
star
41

tranco-go-package

Go
2
star
42

acw-sc-v2.js

`acw_sc__v2` cookie generator
HTML
2
star
43

dns-grab

Go
2
star
44

PrintableShellcodeCreator

可打印shellcode生成工具
C
2
star
45

DBAPPSecurity-Unified-Security-Management-Python-Connector

Python Connector for DBAPPSecurity Unified Security Management | 明御®运维审计与风险控制系统(堡垒机)
Python
1
star
46

bgphenet

Go
1
star
47

ModifyHeadersForChrome

ModifyHeadersForChrome
JavaScript
1
star
48

JBrowserWithPulgins

Java实现的一个简单的Web浏览器 , 提供了插件功能 , 目前插件有下载地址分析器
Java
1
star
49

ProcessInjector

C
1
star