From 7dec235a69aa9617f7ec5d049c7a0318a03b0ca4 Mon Sep 17 00:00:00 2001 From: Yoav Ast <98748304+Yoavast@users.noreply.github.com> Date: Thu, 4 Jan 2024 12:10:34 +0200 Subject: [PATCH] Delete src directory --- src/Login.java | 54 ---------------------------- src/xss.java | 88 --------------------------------------------- src/xss_blank1.java | 6 ---- src/xss_blank2.java | 7 ---- src/xss_blank3.java | 7 ---- src/xss_blank4.java | 6 ---- src/xss_blank5.java | 6 ---- 7 files changed, 174 deletions(-) delete mode 100644 src/Login.java delete mode 100644 src/xss.java delete mode 100644 src/xss_blank1.java delete mode 100644 src/xss_blank2.java delete mode 100644 src/xss_blank3.java delete mode 100644 src/xss_blank4.java delete mode 100644 src/xss_blank5.java diff --git a/src/Login.java b/src/Login.java deleted file mode 100644 index 2c2cabf..0000000 --- a/src/Login.java +++ /dev/null @@ -1,54 +0,0 @@ -import javax.servlet.*; -import javax.servlet.http.*; -import javax.servlet.jsp.*; -import cnt.Security.*; - -import java.lang.StringBuffer; -import java.sql; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.ResultSet; - -import javax.servlet.http.HttpServletRequest; - -// Class Declaration -class Login -{ - public static void main(String[] args) - { - try { - String email = request.getParameter("email"); - String token = request.getParameter("password"); - - String sql = "select * from users where (email ='" + email +"' and password ='" + token + "')"; - - Connection connection = pool.getConnection(); - Statement statement = connection.createStatement(); - - HttpSession session = request.getSession(); - String role = (String)session.getAttribute("role"); - if (role.equals(ADMIN)) { - ResultSet result = statement.executeQuery(sql); - statement.close(); - connection.close(); - } - - if (result.next()) { - loggedIn = true; - // Successfully logged in and redirect to user profile page - - } else { - // Auth failure - Redirect to Login Page - } - } - catch (SQLException ex) { - handleExceptions(ex); - } - finally { - statement.close(); - connection.close(); - } - } -} diff --git a/src/xss.java b/src/xss.java deleted file mode 100644 index 865fd23..0000000 --- a/src/xss.java +++ /dev/null @@ -1,88 +0,0 @@ -import javax.servlet.*; -import javax.servlet.http.*; -import javax.servlet.jsp.*; -import cnt.Security.*; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; - -public class BookDetail_jsp extends HttpJspBase { - - private static void printSanitizedName (String str) { - - String sanitizedUserData = Security.validName(str); - out.println (sanitizedUserData); - } - - public static void loadData () { - - String userData = request.getParameter("Data"); - out.println (userData); - printSanitizedName(userData); - } - public static void loadName () { - - String userName = request.getParameter("Name"); - out.println (userName); - - printSanitizedName(userName); - } - - public static void loadAccount () { - - String userAccount = request.getParameter("Account"); - - printSanitizedName(userAccount); - } - - public static void loadNumber () { - - String userNumber = request.getParameter("Number"); - - //printSanitizedName(userNumber); - } - - public static void loadField () { - - String userField = request.getParameter("Field"); - - printSanitizedName(userField); - } - - public static void loadComments () { - - String userComment = request.getParameter("Comment"); - - printSanitizedName(userComment); - } - - public static void loadLink () { - - String userLink = request.getParameter("Link"); - - printSanitizedName(userLink); - } - - public static void loadProfile () { - - String userProfile = request.getParameter("Profile"); - - printSanitizedName(userProfile); - } - - public static void loadReport () { - - String userReport = request.getParameter("Report"); - - printSanitizedName(userReport); - } - - public static void loadInfo () { - - String userInfo = request.getParameter("Info"); - - printSanitizedName(userInfo); - } -} diff --git a/src/xss_blank1.java b/src/xss_blank1.java deleted file mode 100644 index c5d7bd5..0000000 --- a/src/xss_blank1.java +++ /dev/null @@ -1,6 +0,0 @@ - -class xss_blank1 { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} diff --git a/src/xss_blank2.java b/src/xss_blank2.java deleted file mode 100644 index 0cff151..0000000 --- a/src/xss_blank2.java +++ /dev/null @@ -1,7 +0,0 @@ - - -class xss_blank2 { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} diff --git a/src/xss_blank3.java b/src/xss_blank3.java deleted file mode 100644 index 34341e8..0000000 --- a/src/xss_blank3.java +++ /dev/null @@ -1,7 +0,0 @@ - - -class xss_blank3 { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} diff --git a/src/xss_blank4.java b/src/xss_blank4.java deleted file mode 100644 index d09cc50..0000000 --- a/src/xss_blank4.java +++ /dev/null @@ -1,6 +0,0 @@ - -class xss_blank4 { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} diff --git a/src/xss_blank5.java b/src/xss_blank5.java deleted file mode 100644 index 08aea75..0000000 --- a/src/xss_blank5.java +++ /dev/null @@ -1,6 +0,0 @@ - -class xss_blank5 { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -}