2020-07-16 17:03:46 -07:00
2020-06-29 17:25:19 -07:00
2020-06-29 17:25:19 -07:00

SQL injection example

Setup and sample run

  # Use a simple headline prompt 
  PS1='
  \033[32m---- SQL injection demo ----\[\033[33m\033[0m\]
  $?:$ '


  # Build
  ./build.sh

  # Prepare db
  ./admin create-db
  ./admin show-db

  # Add regular user interactively
  ./add-user 2>> users.log
  ./admin show-db

  # Regular user via "external" process
  echo "sample user" | ./add-user 2>> users.log
  ./admin show-db

  # Add Johnny Droptable 
  ./add-user 2>> users.log
  Johnny'); DROP TABLE users; --

  # And the problem:
  ./admin show-db
Description
sql injection sample in C using sqlite
Readme 4.2 MiB
Languages
Shell 44.1%
C 30.9%
CodeQL 25%