feat: Add base files
This commit is contained in:
29
frontend/src/pages/SQLInjection.jsx
Normal file
29
frontend/src/pages/SQLInjection.jsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
export default function SQLInjection() {
|
||||
const [username, setUsername] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [msg, setMsg] = useState('');
|
||||
|
||||
const handleLogin = async () => {
|
||||
const res = await fetch('http://localhost:5000/api/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ username, password })
|
||||
});
|
||||
|
||||
const text = await res.text();
|
||||
setMsg(text);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>SQL Injection Demo</h2>
|
||||
<p>Try: <code>admin' --</code> as username</p>
|
||||
<input placeholder="Username" onChange={e => setUsername(e.target.value)} />
|
||||
<input placeholder="Password" type="password" onChange={e => setPassword(e.target.value)} />
|
||||
<button onClick={handleLogin}>Login</button>
|
||||
<p>{msg}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user