mirror of
https://github.com/hohn/codeql-lab.git
synced 2025-12-16 18:03:08 +01:00
Rename directories to include language. Also update files
This commit is contained in:
committed by
=Michael Hohn
parent
fe1baf7dc1
commit
102c18cce5
27
codeql-dataflow-sql-injection-c/add-user.sh
Executable file
27
codeql-dataflow-sql-injection-c/add-user.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
get-user-info () {
|
||||
echo "*** Welcome to sql injection ***"
|
||||
read -r -p "Please enter name: " NAME
|
||||
}
|
||||
|
||||
get-new-id () {
|
||||
ID=$(/bin/bash -c 'echo $$')
|
||||
}
|
||||
|
||||
add-user-info () {
|
||||
echo "
|
||||
INSERT INTO users VALUES ($ID, '$NAME')
|
||||
" | sqlite3 users.sqlite
|
||||
}
|
||||
|
||||
show-user-info () {
|
||||
echo "We have the following information for you:"
|
||||
echo "
|
||||
select * FROM users where user_id=$ID
|
||||
" | sqlite3 users.sqlite
|
||||
}
|
||||
|
||||
get-user-info
|
||||
get-new-id
|
||||
add-user-info
|
||||
show-user-info
|
||||
Reference in New Issue
Block a user