drop user pxf cascade; create user pxf identified by pxf; grant create session to pxf; grant create table to pxf; grant create procedure to pxf; grant unlimited tablespace to pxf; connect pxf/pxf@oradwp create table customers ( customer_forname varchar2(30), customer_surname varchar2(30), customer_phone varchar2(30), customer_fax varchar2(30), customer_type number(10) ) tablespace users; -- -- insert three records to test with -- insert into customers ( customer_forname, customer_surname, customer_phone, customer_fax, customer_type ) values ( 'Fred', 'Clark', '999444888', '999444889', 3 ) / insert into customers ( customer_forname, customer_surname, customer_phone, customer_fax, customer_type ) values ( 'Bill', 'Jones', '999555888', '999555889', 2 ) / insert into customers ( customer_forname, customer_surname, customer_phone, customer_fax, customer_type ) values ( 'Jim', 'Clark', '999777888', '999777889', 1 ) / -- -- create a sample PL/SQL procedure to SQL Inject -- create or replace procedure get_cust (pv_surname in varchar2) is type cv_typ is ref cursor; cv cv_typ; lv_phone customers.customer_phone%type; lv_stmt varchar2(32767):='select customer_phone'|| ' from customers '|| 'where customer_surname='''|| pv_surname||''''; begin dbms_output.put_line('debug:'||lv_stmt); open cv for lv_stmt; loop fetch cv into lv_phone; exit when cv%notfound; dbms_output.put_line('::'||lv_phone); end loop; close cv; exception when others then dbms_output.put_line(sqlcode||sqlerrm); end get_cust; / sho err