Suspicious Email
Suspicious Email
INTRODUCTION
1.1 SCOPE
In this project, suspicious users are identified by determining the keywords used by
him/her. The keywords such as bomb, sex, terrorist, RDX etc. are found in the mails which
are sent by the user. All these blocked mails are checked by the administrator and identify the
users who sent such mails. This is very useful in real-time scenario in which you can resume
the anti-social activities.
The purpose of the project is to suspect the E-mails which consist of offensive, anti-
social elements and block them which help in identifying the suspicious user.
2) Registration Module
3) Encryption Module
4) User Module
5) Mailing Module
This module is used by administrator and users (who are authenticated) to login into
the Colors mail. The login details of the specified person will be entered and hence can enter
into the Colors mail.
This module is used by the unauthenticated users who are unregistered. The users
must register themselves such that they can login into the Colors mail.
This module is used by the administrator to perform the functions like encryption of
the words. The encrypted words are sent to the database and hence managed by the
administrator.
This module is used by the users to do operations like composing mail, checking out
the mails in inbox and finally sending the mails to the authenticated users by attaching a
message.
This module is used by the users perform mailing system. The mailing system
consists of composing the mails, sending the mails and checking out the mails in inbox.
This module allows employees to register and manage patient details. When a request
is made, an employee immediately dispatches an ambulance with available doctor and other
attendants. Employee keeps track of patient status and in case of emergency consults a
hospital for admitting the patient.
User
SERVER
Request Response
Dat
a
Bas
e
Presentatio
n Layer
Response URL
sent from Request
the servlet sent
through the
SERVLETS
browser
AT THE
SERVER
Reply from SIDE Verifying or
the database updating the
according to database
the through a
statement statement
DATABASE
URL pattern represents how the requests are flowing through one layer to another layer
and how the responses are getting by other layers to presentation layer through server in
architecture diagram.
Initially the language was called as “oak” but it was renamed as “java” in 1995.The
primary motivation of this language was the need for a platform-independent (i.e. architecture
neutral) language that could be used to create software to be embedded in various consumer
electronic devices.
Initially the language was called as “oak” but it was renamed as “java” in 1995.The
primary motivation of this language was the need for a platform-independent (i.e. architecture
neutral) language that could be used to create software to be embedded in various consumer
electronic devices.
Java has had a profound effect on the Internet. This is because; java expands the
Universe of objects that can move about freely in Cyberspace. In a network, two categories of
objects are transmitted between the server and the personal computer. They are passive
information and Dynamic active programs. in the areas of Security and probability. But Java
addresses these concerns and by doing so, has opened the door to an exciting new form of
program called the Applet.
An application is a program that runs on our Computer under the operating system of
that computer. It is more or less like one creating using C or C++ .Java’s ability to create
Applets makes it important. An Applet I san application, designed to be transmitted over the
Internet and executed by a Java-compatible web browser. An applet I actually a tiny Java
program, dynamically downloaded across the network, just like an image. But the difference
is, it is an intelligent program, not just a media file. It can be react to the user input and
dynamically change.
When you compile the code, the Java compiler creates machine code (called byte code)
for a hypothetical machine called Java Virtual Machine (JVM). The JVM is supposed t
executed the byte code. The JVM is created for the overcoming the issue of probability.
The code is written and compiled for one machine and interpreted on all machines .This
machine is called Java Virtual Machine.
Java
Pc Java Byte interpreter
compiler code
Java
Macintosh
interpreterm
compiler
Platform acintosh
Source independ
code ent
SPARC Java
Compiler interpreter(
SPARC)
Fig. 3.1
During run-time the Java interpreter tricks the byte code file into thinking that it is running
on a Java Virtual Machine. In reality this could be an Intel Pentium windows 95 or sun SPARCstation
running Solaris or Apple Macintosh running system and all could receive code from any computer
through internet and run the Applets.
1.5.1.6 SIMPLE
Java was designed to be easy for the Professional programmer to learn and to use
)))
effectively. If you are an experienced C++ Programmer. Learning Java will oriented features
of C++ . Most of the confusing concepts from C++ are either left out of Java or implemented
in a cleaner, more approachable manner. In Java there are a small number of clearly defined
ways to accomplish a given task.
Java virtually eliminates the problems of memory management and deal location, which is
completely automatic. In a well-written Java program, all run-time errors can and should be
managed by your program.
1.5.2 SERVLET
1.5.2.1 INTRODUCTION
A Servlet is a generic server extension. a Java class that can be loaded Dynamically
to expand the functionality of a server. Servlets are commonly used with web servers.Where
they can take the place CGI scripts.
A servlet is similar to proprietary server extension, except that it runs inside a Java
Virtual Machine (JVM) on the server, so it is safe and portable Servlets operate solely within
the domain of the server.
Unlike CGI and Fast CGI, which use multiple processes to handle separate program or
separate requests, separate threads within web server process handle all servlets. This means
that servlets are all efficient and scalable. Servlets are portable; both across operating systems
and also across web servers. Java Servlets offer the best possible platform for web application
development.
Servlets are used as replacement for CGI scripts on a web server,they can extend any
sort of server such as a mail server that allows servlets extend its functionality perhaps by
performing a virus scan on all attached documents or handling mail filtering tasks.
Servlets provide a Java-based solution used to address the problems currently associated
with doing server-side programming including inextensible scripting solutions platform-
specific API’s and incomplete interface.Servlets are objects that conform to a specific
interface that can be plugged into a Java-based server.
They are many features of servlets that make them easy and attractive to use these
include:
Easily configure using the GUI-based Admin tool
Can be Loaded and Invoked from a local disk or remotely across the network.
Can be linked together or chained, so that on servlet can call another servlet or
several servlets in sequence.
Can be called dynamically from within HTML, pages using server-side include-tags.
Are secure-even when downloading across the network, the servlet security model
and servlet and box protect your system from unfriendly behavior.
Servlets are persistent.Servlet are loaded only by the web server and can maintain
services between requests.
Servlets are fast. Since servlets only need to be l\loaded once, they offer much better
performance over their CGI counterparts.
Servlets are platform independent.
Servlets are extensible Java is a robust, object-oriented programming language, which
easily can be extended to suit your needs.
Servlets are secure
Servlets are used with a variety of client.
Servlets are classes and interfaces from tow packages,javax .servlet and
javax.servlet.http.The java.servlet package contains classes t support generic, protocol-
independent servlets.The classes in the javax.servelt.http package To and HTTP specific
functionality extend these classes
Every servlet must implement the javax.servelt interface. Most servlets implement it by
extending oneoftwo classes.javax.servlet.GenericServlet or javax.servlet.http.HttpServlet. A
protocol-independent servlet should subclass Generic-Servlet.while an Http servlet should
subclass HttpServlet, which is itself a subclass of Generic-servlet with added HTTP-specific
functionality.
Unlike a java program, a servlet does not have a main() method,Instead the server in the
process of handling requests invoke certain methods of a servlet.Each time the server
dispatches a request to a servlet, it invokes the servelts Service() method,
1.5.3 JSP
The first JavaServer Pages specification was released in 1999. Originally JSP was
modeled after other server-side template technologies to provide a simple method of
embedding dynamic code with static markup. When a request is made for the content of a
JSP, a container interprets the JSP, executes any embedded code, and sends the results in a
response. At the time this type of functionality was nothing terribly new, but it was and still is
a helpful enhancement to Servlets.
JSP has been revised several times since the original release, each adding functionality,
and is currently in version 2.0. The JSP specifications are developed alongside the Servlet
specifications and can be found on Sun Microsystems’
JavaServer Pages product information page,http://java.sun.com/products/jsp.The
functionality defined by the JSP 2.0 specifications can be broken down as follows:
JSP
JavaBeans
JavaBeans are not defined by the JSP specifications, but JSP does provide support for
easily using and manipulating them. Often objects used on the server-side of a Web
Application are in the form of what is commonly called a JavaBean.
Custom Tags and JSP Fragments
JSP provides a mechanism for linking what would normally be static markup to
custom Java code. This mechanism is arguably one of the strong points of JSP and can be
used in place of or to complement embedded scripts of Java code.
Expression Language
JSP includes a mechanism for defining dynamic attributes for custom tags. Any
scripting language can be used for this purpose; usually Java is implemented, but the JSP
specification defines a custom expression language designed specifically for the task. Often
the JSP EL is a much simpler and more flexible solution, especially when combined with JSP
design patterns that do not use embedded scripts.
Discussing the basics of JSP is the focus of this chapter. JavaBeans, Custom Tags, and the
JSP Expression Language are all fully discussed in later chapters after a proper foundation of
JSP is established.
1.5.4 ORACLE
Oracle is a relational database management system, which organizes data in the form
of tables. Oracle is one of many database servers based on RDBMS model, which manages a
seer of data that attends three specific things-data structures, data integrity and data
manipulation.
With oracle cooperative server technology we can realize the benefits of open,
relational systems for all the applications. Oracle makes efficient use of all systems resources,
on all hardware architecture; to deliver unmatched performance, price performance and
scalability. Any DBMS to be called as RDBMS has to satisfy Dr.E.F.Codd’s rules.
COMPATIBLE
Oracle commands can be used for communicating with IBM DB2 mainframe
RDBMS that is different from Oracle, which is Oracle compatible with DB2. Oracle RDBMS
is a high performance fault tolerant DBMS, which is specially designed for online transaction
processing and for handling large database applications.
The Unified Modeling Language allows the software engineer to express an analysis
model using the modeling notation that is governed by a set of syntactic semantic and
pragmatic rules.A UML system is represented using five different views that describe the
system from distinctly different perspective. Each view is defined by a set of diagram, which
is as follows.
In this the structural and behavioral aspects of the environment in which the system
is to be implemented are represented.
UML is specifically constructed through two different domains they are:
UML Analysis modeling, this focuses on the user model and structural model views
of the system.
UML design modeling, which focuses on the behavioral modeling, implementation
modeling and environmental model views.
Use case Diagrams represent the functionality of the system from a user’s point of
view. Use cases are used during requirements elicitation and analysis to represent the
functionality of the system. Use cases focus on the behavior of the system from external point
of view.
Actors are external entities that interact with the system. Examples of actors include
users like administrator, bank customer …etc., or another system like central database.
2.2.1 ADMIN
2.3.1 ADMIN
Keywords
Manage Keywords
Add Keywords()
Display Keywords()
Admin
Keywords
Alert Mails
Informative
Block List
Enter keywords() Alert Mails
check mails() Informative Mails
check mails()
2.3.2USER
Compose Mails
composing the mail
Sent Mails
User
Sent items
Mails
check the sent items()
Compose()
send()
Inbox
Received mails
2.4.1 ADMIN
Manage Keywords
2.4.2 USER
2.5.1 ADMIN
Admin Alert
Mails
Informativ
e Mails
2.5.2 USER
Compos
e Mail
User Inbox
Sent
Items
2.6.1 ADMIN
2.6.2 USER
2.7.1 ADMIN
Alert Mails
Admin
Informative Mails
2.7.2 USER
Compose Mail
Inbox
User
Sent Items
2.8.1 ADMIN
Informative
Mails
2.8.2 USER
Compose
Mail
User Inbox
Sent Items
2.9.1 ADMIN
Compos
e Mails
User Inbox
Sent
Items
3. IMPLEMENTATION REQUIREMENTS
Technology : Java
Database : MySql
JDK Version : JDK1.5
4.1 CODING
Login.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* login.java
*
* Created on 22 Apr, 2017, 5:55:32 PM
*/
package regt;
/**
*
* @author DELL
*/
import java.awt.Toolkit;
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class login extends javax.swing.JFrame {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
jButton1.setText("Close");
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(300, 170, -1, -1));
jButton2.setText("Registration");
jButton2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(100, 170, -1, -1));
jButton3.setText("Login");
jButton3.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, -1, -1));
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SplashScreen splash = new SplashScreen();
Thread.sleep(3000);
splash.setVisible(false);
// for sending value
// method 1
// String uname[]=new String[1];
// uname[0]=t1.getText();
// menu.main(uname);
// this.setVisible(false);
//method 2
String loginuser = t1.getText();
menu frameOne = new menu();
frameOne.setUser(loginuser);
//end of sending
// menu mm= new menu();
frameOne.setVisible(true);
cc=1;
}
}
if(cc==0)
{
JOptionPane.showMessageDialog(rootPane, "Password is not
Correct/Empty Fields");
}
}catch(Exception ex)
{
JOptionPane.showMessageDialog(rootPane,ex.getMessage());
}//GEN-LAST:event_jButton3ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new login().setVisible(true);
}
});
}
Regis.java
package regt;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
pack();
}// </editor-fold>
}catch(Exception ex)
{
JOptionPane.showMessageDialog(rootPane, ex.getMessage());
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new regis().setVisible(true);
}
Inbox.java
package regt;
import java.awt.Toolkit;
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author DELL
*/
public class inbox extends javax.swing.JFrame {
private String userField;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null}
},
new String [] {
"Receive Name", "Subject", "Msg"
}
));
jScrollPane1.setViewportView(jTable1);
getContentPane().add(jScrollPane1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(60, 60, -1, 190));
jButton1.setText("Show Inbox");
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Close");
jButton2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(240, 260, -1, -1));
jButton3.setText("Close");
jButton3.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(240, 260, -1, -1));
pack();
}// </editor-fold>
//String sn=this.userField;
void load_inbox()
{
str = con.createStatement();
rs= str.executeQuery("select * from email where
trim(rname)='"+this.userField.trim()+"'");
// System.out.println(rs.getRow());
while(rs.next())
{
String sct=rs.getString("rname");
String stn=rs.getString("sub");
String stc=rs.getString("msg");
mm.addRow(new Object[]{sct,stn,stc});
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null, ex.getMessage());
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new inbox().setVisible(true);
}
});
}
4.2 SNAPSHOT
CONCLUSION
Email has been an efficient and popular communication mechanism as the number of
Internet user's increase. In many security informatics applications it is important to detect
deceptive communication in email. In this application the mails are classified as suspicious
or normal using the key words and encrypted keywords. The mails containing these keywords
and encrypted keywords are classified as suspicious mails and they can be blocked and
verified by the administrator. The proposed work will be helpful for identifying the
suspicious email and also assist the investigators to get the information in time to take
effective actions to reduce the criminal activities.
FUTURE ENHANCEMENTS
The present application when implemented on internet requires a large database as the
backend; this can be done by using the MySql database as the backend.
REFERENCES
References for the project development were taken from the following books and web
sites
9.1 BOOKS REFERED
9.1.1 HTML
Holzner, HTML Black Book
Larne Pekowsley, JAVA Server Pages
9.1.2 JAVA TECHNOLOGIES
Larne Pekowsley, JAVA Server Pages
Nick Todd, JAVA Server Pages
Pistoria, JAVA2 Networking
Scott oaks, JAVA Security
Shadab siddiqui, J2EE Professional