Enable WIFI ADAPTER Monitor Mode in Kali Linux

Connect the WIFI adapter and add it in VirtualBox USB Settings TP-Link TL-WN725N 150Mbps Wireless N Nano USB Adapter https://www.amazon.in/gp/product/B008IFXQFU Check the Adapter Chippet lsusb Bus 001 Device 002 : ID 2357 : 0109 TP-Link TL-WN823N v2 / v3 [Realtek RTL8192EU] Bus 001 Device 001 : ID 1 d6b: 0002 Linux Foundation 2 . 0 root hub Bus 002 Device 002 : ID 80 ee: 0021 VirtualBox USB Tablet Bus 002 Device 001 : ID 1 d6b: 0001 Linux Foundation 1 . 1 root hub Find Appropriate Driver for Realtek RTL8192EU from GitHub https://github.com/clnhub/rtl8192eu-linux Install the dependencies sudo apt install linux-headers-generic build-essential dkms git Clone the Driver git clone https://github.com/clnhub/rtl8192eu-linux.git Configure the Architecture and Monitor Mode Open MakeFile in Text Editor or Nano If you're using a different architecture than x86, the set (MakeFile) CONFIG_PLATFORM_I386_PC = n set your architecture CONFIG_PLATFORM_ARM_AARCH64...

Developing Java Servlet Web Application using Eclipse and Tomcat Server

Servlet is a Java technology used for developing Web Applications and managed by a container called a servlet engine. It generates dynamic content and interacts with the client through Request and Response. Servlet extends the functionality of a web server. Java Servlet API is available in javax.servlet package.

Web Application Architecture (Three Tier)

  • Presentation Layer
    • Client layer: to view the application)
  • Application Layer
    • Business Logic Layer : interacts with the Database layer and sends required information to the Presentation layer
  • Data Layer
    • The data is stored in this layer. The application layer communicates with the Database layer to retrieve the data

Java Servlet Life-Cycle

  • The Java Servlet Life cycle includes three stages,
    • init() : gets invoked is when the servers are fired up
    • service() : the service requests from the client end
    • destroy() : Servlet performs the cleanup activities

Creating Dynamic Web Project using Eclipse

  • Download eclipse from the following link (For Windows 64 Bit)
    • https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2022-03/R/eclipse-jee-2022-03-R-win32-x86_64.zip
  • After downloading extract into local folder(E.g. C:/Users/Anthoniraj/Documents/)
    • Eclipse Path => C:/Users/Anthoniraj/Documents/eclipse/eclipse
  • Open the Eclipse and Choose the workspace for saving your project
  • Create a “Dynamic Web Project” in New Menu

  • Type a Project Name and Choose the run time environment as “Apache=>Tomcat Version 9”
  • Choose the tomcat directory from local disk
    • TOmcat can be downloaded from https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.62/bin/apache-tomcat-9.0.62-windows-x64.zip
  • Enable web.xml in the next page 


  • Click Finish for creating project

  • Now create a new package by right clicking on the /src/main/java folder (E.g. org.vit.web)

  • Now create a Java Class by right clicking on the org.vit.web package and add the following content

package org.vit.web;

import java.io.IOException;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

public class GreetUser extends HttpServlet{
  public void service(ServletRequest request, ServletResponse response) throws IOException {
      response.setContentType("text/html");
      response.getWriter().println("Welcome to Java Servlet");
  }
}
  • Right click on the project and the Choose “Run As-> Run On Server” Option
  • In Next Popup window, choose Local Server as TOmcat and click Finish
  • Point the http://localhost:8080/Demo/welcome URL in Web Browser for output.

Deployment Descriptor (web.xml)

  • web.xml is used for defining name of the servlet and URL mapping
  • It is under src->main->webapp->WEB-INF Folder
  • welcome-file tag is used for specifying landing or home page
  • Sample Snippet
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="4.0">
    <servlet>
        <servlet-name>greet</servlet-name>
        <servlet-class>org.vit.web.GreetUser</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>greet</servlet-name>
        <url-pattern>/welcome</url-pattern>
    </servlet-mapping>
    <welcome-file-list>  
          <welcome-file>test.jsp</welcome-file>  
      </welcome-file-list>  
</web-app>

Comments

Popular posts from this blog

Enable WIFI ADAPTER Monitor Mode in Kali Linux

Setting up the Java, JavaFX, and Servlet Environment

Installing Kali Linux in Windows 11 using WSL2