2017 © Pedro Peláez
 

library ctfdbbuilder

a database query builder for CTFer

image

phith0n/ctfdbbuilder

a database query builder for CTFer

  • Sunday, May 27, 2018
  • by phith0n
  • Repository
  • 2 Watchers
  • 24 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 50 % Grown

The README.md

DB Builder for CTFer

一个无任何防护的PHP数据库Builder,支持Mysql/Postgresql/Sqlite。, (*1)

Install

composer require phith0n/ctfdbbuilder:dev-master

Usage

<?php
include 'vendor/autoload.php';

$connect = new \CTFDBBuilder\Connection('mysql', [
    'driver'    => 'mysql', // Db driver
    'host'      => 'localhost',
    'database'  => 'your-database',
    'username'  => 'root',
    'password'  => 'your-password',
    'charset'   => 'utf8mb4', // Optional
    'options'   => [ // PDO constructor options, optional
        \PDO::ATTR_TIMEOUT => 5,
        \PDO::ATTR_EMULATE_PREPARES => false,
    ],
]);
$builder = $connect->getBuilder();

Select (SQL injection)

<?php
$article = $builder->table('articles')->where('id', '=', $_GET['id'])->first();
<?php
$article = $builder->table('users')->where('age', '>', $_GET['age'])->first();
<?php
$article = $builder->table('users')->orderBy('age', 'desc')->get();
<?php
$article = $builder->table('users')->select('COUNT() AS `cnt`')->first();
<?php
$article = $builder->table('users')->where('username', $_POST['username'])->where('password', md5($_POST['password']))->first();

The Versions

27/05 2018

dev-master

9999999-dev https://github.com/phith0n/ctfdbbuilder

a database query builder for CTFer

  Sources   Download

MIT

The Requires

 

by Avatar phith0n

database sql postgresql mysql sqlite query builder ctf

27/05 2018

0.1.1

0.1.1.0 https://github.com/phith0n/ctfdbbuilder

a database query builder for CTFer

  Sources   Download

MIT

The Requires

 

by Avatar phith0n

database sql postgresql mysql sqlite query builder ctf

24/05 2018

0.1.0

0.1.0.0 https://github.com/phith0n/ctfdbbuilder

a database query builder for CTFer

  Sources   Download

MIT

The Requires

 

by Avatar phith0n

database sql postgresql mysql sqlite query builder ctf