Cyber X Force java

download Cyber X Force java

of 55

Transcript of Cyber X Force java

  • 8/7/2019 Cyber X Force java

    1/55

    1. INTRODUCTION

    1.1 ABSTRACT

    The objective of cyber X-Force includes protection of information and property

    from theft, corruption, or natural disaster, while allowing the information and property

    to remain accessible and productive to its intended users. Cyber Police may be defined

    in a general way as an unlawful act wherein the computer is either a tool or a target or

    both.

    An E-mail threat is any threat that uses the internet to facilitate cyber crime. E-

    mail threats use multiple types of malware and fraud, all of which utilize HTTP or

    HTTPS protocols, but may also employ other protocols and components, such as links

    in email or IM, or malware attachments or on servers that access the Web. They benefit

    cyber criminals by stealing information for subsequent sale and help absorb infected

    PCs into botnets.

    E-mail threats pose a broad range of risks, including financial damages, identity

    theft, loss of confidential information/data, theft of network resources, damaged

    brand/personal reputation.

    E-mail threats can be divided into two primary categories, based on delivery

    method push and pull. Push-based threats use spam, phishing, or other fraudulent

    means to lure a user to a malicious (often spoofed) website which then collects

    information and/or injects malware. Push attacks use phishing, DNS poisoning (or

    pharming), and other means to appear to originate from a trusted source.

    Dept of CSE, PDCE 2010-11 1

  • 8/7/2019 Cyber X Force java

    2/55

    1.2PROBLEM DEFINITION:

    As producers and users of cyber security, our investments in cyber

    security technology Products and processes are constrained by available resources,

    usually expressed as time and money, so we often use an economic argument to justify

    which investments to make, in what order, at what cost, and for what current and future

    benefits. Consequently, researchers have generated hundreds of different economic

    models to support our decision-making. In most cases, the models are intended to help

    find the optimal level of investment in security, but the available options take many

    different forms and apply to widely different scenarios. How do we decide which to

    use? Our earlier work1,2 examined the data available to inform modeling and decision-

    making, as well as the types of models available. We produced a framework,

    summarized in Table 1, for evaluating a given model, providing potential users and

    model developers with a systematic, consistent way to analyze and compare different

    models assumptions, properties, and applicability.

    Dept of CSE, PDCE 2010-11 2

  • 8/7/2019 Cyber X Force java

    3/55

    2.SYSTEM ANALYSIS

    2.1 EXIXTING SYSTEM

    Email is a useful tool for technology savvy criminals

    thanks to the relative anonymity offered by it. It becomes fairly easy for anyone with

    even a basic knowledge of computers to become a blackmailer by threatening someone

    via e-mail. Individual who received E-Mail should report to the police authority, then

    the police will trace IP address of sender then they will trace the location. Sometimes

    sender may not be trapped.

    2.2PROPOSED SYSTEM

    In the Proposed System software can be extend to prevent

    high-tech crimes and cyber terrorism, and keep them from spreading, by quickly

    providing information gathered by the police on information security to Internet users,

    and increasing security awareness All banking institutions and businesses today runtheir business online. Hackers can hack your computer system and misuse our personal

    information and pictures. Various other dangers associated with cyber crimes are entry

    of virus into your system, altering your files, change of passwords, stealing credit card

    information and make unauthorized purchases.

    Dept of CSE, PDCE 2010-11 3

  • 8/7/2019 Cyber X Force java

    4/55

    3. REQUIRMENT SPECIFICATIONS

    3.1HARDWARE ENVIRONMENT

    Main Processor : Intel Pentium IV

    CPU Clock : 667 MHz

    Base Memory Size : 128 MB

    Hard Disk Capacity : 10 GB (Mini)

    Monitor : COMPAQ Color monitor

    Keyboard : COMPAQ 104 keys

    3.2SOFTWARE ENVIRONMENT

    Operating System : Windows XP

    Application Development tool : Java swings

    Database : MY SQL

    Issue tracking : Global hook demo

    Project planning and tracking : MS Project 2000

    Dept of CSE, PDCE 2010-11 4

  • 8/7/2019 Cyber X Force java

    5/55

    4.SYSTEM DESIGN

    4.1 MODULE DESCRIPTION

    Modules:

    1: Registration

    2: Admin

    3: Threat Words

    4: Comparison

    5: Alert

    6: Key logging

    7: Encryption and Decryption

    8: Key Generation

    Modules Description:

    1. Registration

    In this module, the new user can login by entering their e-mail and password. The

    user name must be a valid mail id and password should be in at least 6 to 8 characters.

    If unregistered user try to login or user forget their username or password, then it

    displays only the login error message.

    Dept of CSE, PDCE 2010-11 5

  • 8/7/2019 Cyber X Force java

    6/55

    2. Admin

    Once the user registered their detail, they will ask to conform it by accepting the

    link in mail. After that only, the user details will store in the database. Then the

    registered user can login by simply typing their username and password.

    3. Threat Words:

    This means through which the ability or intent of a threat agent to adversely

    affect an automated system, facility, or operation can be manifest. A potential violationof security, In this module, administrator stores threat words in database by using SQL

    server.

    Threat word is an indication of imminent danger, harm, evil, etc. the threat of war

    or a potential source of this. Some threat words are terrorism, bomb, murder, kill etc.

    Methods and things used to exploit a vulnerability in an information system, operation,

    or facility; fire, natural disaster and so forth.

    4. Comparison

    In this module, one key identifier program written in asp.net is used. This

    program detects whether a user has pressed or released a key on the keyboard.

    Therefore if anyone sends mail with threat word, then this project matches the threat

    word in mail with the threat words that we are already stored in database. This will

    compare the key which is generated from the below modules.

    Dept of CSE, PDCE 2010-11 6

  • 8/7/2019 Cyber X Force java

    7/55

    5. Alert

    In this module, if no threat words are found then mail will send successfully.

    Otherwise it will alert the administrator by SMS without having the knowledge of mail

    sending user. The SMS contain the threat word, IP address of the PC, date and time.

    The SMS technology has facilitated the development and growth of text messaging.

    The connection between the phenomenon of text messaging and the underlying

    technology is so great that in parts of the world the term "SMS" is used as a synonym

    for a text message or the act of sending a text message, even when a different protocol

    is being used.

    6. Key Logging

    This module is used to read the each and every word, who is typing on the

    system. It will read all the data from the system while typing on keyboard without the

    knowledge of the user. User can type the threat word in our application or in a notepad

    or in any application it will detect the threat word if the user typed in his system. As a

    hardware device, a key logger is a small battery-sized plug that serves as a connector

    between the user's keyboard and computer. Because the device resembles an ordinary

    keyboard plug, it is relatively easy for someone who wants to monitor a user's behavior

    to physically hide such a device "in plain sight."

    7. Encryption and Decryption

    This module deals with an encryption and decryption of the found threat

    message. Once the threat word is found, the typed message will encrypt and stored in

    the database. This encrypted message was viewed by an Admin by the below module

    Dept of CSE, PDCE 2010-11 7

  • 8/7/2019 Cyber X Force java

    8/55

    process. If the key given by the admin is matched our criteria, the encrypted message

    was decrypted and make it ready to view. One of the most common uses of encryption

    is encrypting emails. Sending sensitive messages, documents and files over the Internet

    is like sending a postcard as all emails are transmitted in an unsecured form. It doesn't

    depend on if you send emails via public and private networks. Your message is totally

    open to interception by anyone along the way - so anybody - your ISP, your boss, etc.

    can read your emails. Even if you connect to your server and send your emails via SSL,

    it only means that your emails can't be seen while transmitting between you and your

    server. When your email reaches your server, it can be seen by your email service

    provider. Then your server usually sends your email to the recipient in an unsecured

    way and your email can also be easily seen by anyone.

    8. Key Generation:

    This module deals with the public and private key generation by using key

    generation technique. The public key is used by the admin who are all this application;

    he is an admin for that concern. But the private key is used only the software

    developing concern who developed this application. The combination of these two keywill matched means, admin can able to view the threat message stored in the database.

    is the process of generating keys for cryptography. A key is used to encrypt and decrypt

    whatever data is being encrypted/decrypted. In computer cryptography keys are

    integers. In some cases keys are randomly generated using a random number generator

    (RNG) or pseudorandom number generator (PRNG), the latter being a computer

    algorithm that produces data which appears random under analysis. Of the PRNGs

    those which use system entropy to seed data generally produce better results, since this

    makes the initial conditions of the PRNG much more difficult for an attacker to guess.

    In other situations, the key is created using a passphrase and a key generation

    algorithm, usually involving a cryptographic hash function.

    Dept of CSE, PDCE 2010-11 8

  • 8/7/2019 Cyber X Force java

    9/55

    4.2DATA FLOW DIAGRAM

    Dept of CSE, PDCE 2010-11

    GenerateKey

    Keyinput

    Decryptmessage

    Admin Threat Mailer

    Registeruser

    Threatwords

    GenerateKey

    Viewmessage

    TypewordiApplication

    Thread

    wordcomparision

    Encryptword

    MessageAlret

    E-mailAlret

    Main

    9

  • 8/7/2019 Cyber X Force java

    10/55

    4.3USE CASE DIAGRAM

    Dept of CSE, PDCE 2010-11

    Admin User

    Registration

    Add threatwords

    Send mailAlert SMSand E Mail

    Find threatword

    Database

    DecryptMail

    10

  • 8/7/2019 Cyber X Force java

    11/55

    4.4ACTIVITY DIAGRAM

    Dept of CSE, PDCE 2010-11

    View msg,key

    input,decrypt,

    Registeruser,Threatwords,keygeneration

    Threadmailer

    Typeword,compare,encrypt

    Type

    word,compare,encrypt

    Sending msgend mail

    Main

    Admin

    11

  • 8/7/2019 Cyber X Force java

    12/55

    5.ARCHITECUURE DETAILS

    Application Layer: The presentation layer contains components needed to interact

    with the user of the application. Examples of such components are web pages, rich-

    client forms, user interaction process components etc.

    Analysis Layer: Analysis layer contains processing where the process of application

    layer taken place. In tins layer application analysis process will taken place.

    Data Analysis Layer: The data access layer provides a simple API for accessing and

    manipulating data. The components in this layer abstract the semantics of the

    underlying data access technology thus allowing the business layer to focus on business

    logic. Each component typically provides methods to perform Create, Read, Update,

    and Delete (CRUD) operations for a specific business entity.

    Data Stores: Enterprise applications store their data in one or more data stores.

    Databases and file systems are two very common types of data stores.

    Process Layer:

    A process flow Layer (PFL) is a diagram commonly used in chemical and

    process engineering to indicate the general flow of plant processes and equipment.

    The PFL displays the relationship between major equipment of a plant facility and does

    not show minor details such as piping details and designations. Another commonly-

    used term for a PFL is a flow sheet.

    Dept of CSE, PDCE 2010-11 12

  • 8/7/2019 Cyber X Force java

    13/55

    ARCHITECUURE DIAGRAM

    Dept of CSE, PDCE 2010-11 13

    Monitor threatwords

    Deduct threat words Send Alert MGS

    THREATWORDS

    ALERT

    DATA WARE HOUSE

    Mail encryption Mail decryption

    Applicati

    on Layer

    ANALYSISLAYER

    DATAANALYSIS

    PROCESSLAYER

  • 8/7/2019 Cyber X Force java

    14/55

    6.TESTNG

    Software testing is an investigation conducted to providestakeholders with information about the quality of the product or service under test.

    Software Testing also provides an objective, independent view of the software to allow

    the business to appreciate and understand the risks at implementation of the software.

    Test techniques include, but are not limited to, the process of executing a program or

    application with the intent of finding software bugs. Software Testing can also be stated

    as the process of validating and verifying that a software program/application/product:

    meets the business and technical requirements that guided its design and development;

    works as expected; and can be implemented with the same characteristics. Software

    Testing, depending on the testing method employed can be implemented at any time in

    the development process. However, most of the test effort occurs after the requirements

    have been defined and the coding process has been completed. As such, the

    methodology of the test is governed by the Software Development methodology

    adopted. Different software development models will focus the test effort at different

    points in the development process. Newer development models, such as Agile, often

    employ test driven development and place an increased portion of the testing in the

    hands of the developer, before it reaches a formal team of testers. In a more traditional

    model, most of the test execution occurs after the requirements have been defined and

    the coding process has been completed.

    Dept of CSE, PDCE 2010-11 14

  • 8/7/2019 Cyber X Force java

    15/55

    TEXT PLAN

    TESTING OBJECTIVES

    Establishing Software testing Objectives is a critical part of planning the Softwaretesting process. Defining testing objectives is also one of the most difficult test planning

    activities. It is difficult because humans frequently do not have a clear idea of what they

    want to do until they begin to do it. This means the best laid test plans change during

    test process execution. This is a problem without a solution, but there are some actions

    testers can take which will improve test planning.

    The establishment of clear testing objectives goes a long way toward offsetting future

    execution problems. Before the tester can do this s/he must understand what we mean

    by the word objective.

    STAGES IN THE TESTING PROCESS

    Errors in each module identified and modification are done to eliminate them.

    Each level of testing done is different in nature and has different objective. Product

    work under normal conditions and it should be checked for its robustness.

    Software Testing Strategies:

    Black box testing takes an external perspective of the test object to derive test

    cases. These tests can be functional or non-functional, though usually functional. The

    test designer selects valid and invalid input and determines the correct output. There is

    no knowledge of the test object's internal structure.

    This method of test design is applicable to all levels of software testing: unit,

    integration, functional testing, system and acceptance. The higher the level, and hence

    Dept of CSE, PDCE 2010-11 15

  • 8/7/2019 Cyber X Force java

    16/55

    the bigger and more complex the box, the more one is forced to use black box testing to

    simplify. While this method can uncover unimplemented parts of the specification, one

    cannot be sure that all existent paths are tested.

    Equivalence Partitioning:

    Equivalence partitioning is a method for deriving test cases. In this method,

    classes of input conditions called equivalence classes are identified such that each

    member of the class causes the same kind of processing and output to occur. In this

    method, the tester identifies various equivalence classes for partitioning. A class is a set

    of input conditions that are is likely to be handled the same way by the system. If the

    system were to handle one case in the class erroneously, it would handle all cases

    erroneously.

    Error Guessing:

    Ad-hoc method to identify tests likely to expose errors based on experience and

    intuition. Some areas to guess are Empty or null strings, Zero instances, occurrences,

    Blank or null characters in strings, Negative numbers

    Boundary Value Analysis

    Boundary value analysis is software testing design technique to determine test

    cases covering off-by-one errors. The boundaries of software component input ranges

    are areas of frequent problems.

    Dept of CSE, PDCE 2010-11 16

  • 8/7/2019 Cyber X Force java

    17/55

    Unit Testing

    In computer programming, unit testing is a procedure used to validate that

    individual units of source code are working properly. A unit is the smallest testable part

    of an application. In procedural programming a unit may be an individual program,

    function, procedure, web page, menu etc, while in object-oriented programming, the

    smallest unit is always a Class; which may be a base/super class, abstract class or

    derived/child class. Units are distinguished from modules in that modules are typically

    made up of units.

    Ideally, each test case is independent from the others; mock objects and test

    harnesses can be used to assist testing a module in isolation. Unit testing is typically

    done by the developers and not by end-users.

    The goal of unit testing is to isolate each part of the program and show that the

    individual parts are correct. A unit test provides a strict, written contract that the piece

    of code must satisfy.

    This project is implement the following validations are carried through all over

    the project till the end. The validations include range validation for the mobile number

    which restricts the number only for ten digits and not more or less. The date and time

    validation also done in which the first day must be minimal than the second day. The

    data type validation which checks whether the entry matches the user input. In case of

    mismatch the alert messages will be displayed. The empty fields are also validated andare not allowed to redirect page without entry for all the fields.

    Dept of CSE, PDCE 2010-11 17

  • 8/7/2019 Cyber X Force java

    18/55

    Integration testing

    Its sometimes called Integration and Testing, (abbreviated I&T) is the phase of

    software testing in which individual software modules are combined and tested as a

    group. It follows unit testing and precedes system testing.

    Integration testing takes as its input modules that have been unit tested, groups

    them in larger aggregates, applies tests defined in an integration test plan to those

    aggregates, and delivers as its output the integrated system ready for system testing.

    In this project maintain the test cases are constructed to test that all components

    within assemblages interact correctly, for example across procedure calls or process

    activations, and this is done after testing individual modules, i.e. unit testing

    System Testing:

    Generally, testing is performed to ensure that the software does not fail and it is

    carried out with the explicit intention of finding errors in the program. After the

    development of the system, the next step would be test the system. So that the system

    could be subjected to different tests at a stretch, to determine the reliability of the

    system.

    Testing of debugged programs that worked correctly that is performing the

    specified operations correctly, the system will never produces the output for which it

    was designed and hence, the objective could not be reached.

    Dept of CSE, PDCE 2010-11 18

  • 8/7/2019 Cyber X Force java

    19/55

    White Box Testing

    The purpose of any security testing method is to ensure the robustness of a

    system in the face of malicious attacks or regular software failures. White box testing is

    performed based on the knowledge of how the system is implemented. White box

    testing includes analyzing data flow, control flow, information flow, coding practices,

    and exception and error handling within the system, to test the intended and unintended

    software behavior. White box testing can be performed to validate whether code

    implementation follows intended design, to validate implemented security functionality,

    and to uncover exploitable vulnerabilities

    White box testing requires access to the source code. Though white box testing can be

    performed any time in the life cycle after the code is developed, it is a good practice to

    perform white box testing during the unit testing phase.

    White box testing requires knowing what makes software secure or insecure, how to

    think like an attacker, and how to use different testing tools and techniques. The first

    step in white box testing is to comprehend and analyze source code, so knowing what

    makes software secure is a fundamental requirement. Second, to create tests that exploit

    software, a tester must think like an attacker. Third, to perform testing effectively,

    testers need to know the different tools and techniques available for white box testing.

    The three requirements do not work in isolation, but together.

    Dept of CSE, PDCE 2010-11 19

  • 8/7/2019 Cyber X Force java

    20/55

    Top-Down Testing

    In Top-Down Testing, higher level modules are tested. If lower modules

    required to make up the system are not yet available then, Stubs are used to simulate

    their activity. (Stub: Small software placed in to a program that provides a common

    function.)

    Bottom-Up Testing

    In Bottom-Up Testing, lower level modules are tested. If higher modules

    required to make up the system are not yet available then, Drivers are used to simulate

    their activity. (Driver: Drivers are simple program designed specially for testing that

    makes calls to these lower layers.)

    Sandwich Testing

    Sandwich Testing is a hybrid between Top-Down and Bottom-Up testing. It will test the

    user interface in isolation using stubs and test the very lowest functions using drivers.

    This is also called as Hybrid Testing.

    Dept of CSE, PDCE 2010-11 20

  • 8/7/2019 Cyber X Force java

    21/55

    TEST CASE REPORT

    Test case No 1

    Module Alert

    User form Receive message from

    Input Treat word

    Expected Result Receive SMS to Admin Mobile

    number

    Test Result Tested ok

    Test case No 2

    Module Alert

    User form Email form

    Input Treat word

    Expected Result Receive Email to admin and

    software concern

    Test Result Tested ok

    7.SYSTEM IMPLEMENTATION AND MAINTENCE

    Dept of CSE, PDCE 2010-11 21

  • 8/7/2019 Cyber X Force java

    22/55

  • 8/7/2019 Cyber X Force java

    23/55

    b)Process of Documentation:

    There are two important things one is the system documentation and another one

    is the user documentation.

    c)Two audiences for Documentation:

    The information systems personnel who will maintain the system

    throughout its productive life

    The people who will use the system as part of their daily lives

    d)Process of Maintenance:

    Development of a new version of the software, new versions of all design

    documents and training materials created or modified during the maintenance effort. Its

    making sure that the application is understandable and accessible at any point of time

    and at any place.

    Backup is carefully maintained.

    In order to avoid illegal access, the software must be password

    protected.

    Care must be taken while given inputs that is input must be in proper

    format.

    8.PERFORMANCE AD LIMITATIONS

    Dept of CSE, PDCE 2010-11 23

  • 8/7/2019 Cyber X Force java

    24/55

    During this first conceptual phase of a program or project, critical business processes

    are identified. Typically they are classified as critical based upon revenue value, cost

    savings, or other assigned business value. This classification is done by the business

    unit, not the IT organization.

    High level risks that may impact system performance are identified and described at this

    time. An example might be known performance risks for a particular vendor system.

    Finally performance activities, roles, and deliverables are identified for the Elaboration

    phase. Activities and resource loading are incorporated into the Elaboration phase

    project plans.

    Limitation

    It can be executed within LAN only.

    Cost oriented.

    9.APPENDICES

    9.1SCREEN SHOT

    Dept of CSE, PDCE 2010-11 24

  • 8/7/2019 Cyber X Force java

    25/55

    Login Form:

    Dept of CSE, PDCE 2010-11 25

  • 8/7/2019 Cyber X Force java

    26/55

    Home Page:

    Dept of CSE, PDCE 2010-11 26

  • 8/7/2019 Cyber X Force java

    27/55

  • 8/7/2019 Cyber X Force java

    28/55

    Change Password:

    Dept of CSE, PDCE 2010-11 28

  • 8/7/2019 Cyber X Force java

    29/55

    Key Generation:

    Dept of CSE, PDCE 2010-11 29

  • 8/7/2019 Cyber X Force java

    30/55

    Treat Word:

    Dept of CSE, PDCE 2010-11 30

  • 8/7/2019 Cyber X Force java

    31/55

    Key Validate:

    Dept of CSE, PDCE 2010-11 31

  • 8/7/2019 Cyber X Force java

    32/55

    View Message:

    Dept of CSE, PDCE 2010-11 32

  • 8/7/2019 Cyber X Force java

    33/55

    Print Message:

    Dept of CSE, PDCE 2010-11 33

  • 8/7/2019 Cyber X Force java

    34/55

  • 8/7/2019 Cyber X Force java

    35/55

    Main Form:

    /** To change this template, choose Tools | Templates

    * and open the template in the editor.

    */

    /** Frmmain.java

    ** Created on Mar 19, 2010, 3:29:02 PM

    */

    package crberxforce;

    import java.awt.AWTException;import java.awt.Dimension;

    import java.awt.SystemTray;

    import java.awt.Toolkit;import java.awt.TrayIcon;

    import java.awt.event.MouseEvent;

    import java.awt.event.MouseListener;

    import java.awt.event.MouseMotionListener;import java.io.BufferedReader;

    import java.io.File;

    import java.io.FileInputStream;import java.io.FileNotFoundException;

    import java.io.IOException;

    import java.io.InputStreamReader;

    import java.net.InetAddress;import java.sql.PreparedStatement;

    import java.sql.ResultSet;

    import java.sql.Statement;import java.util.Calendar;

    import java.util.StringTokenizer;

    import java.util.logging.Level;import java.util.logging.Logger;

    import javax.swing.ImageIcon;

    /**

    *

    * @author user*/

    public class Frmmain extends javax.swing.JFrame implements Runnable {

    /** Creates new form Frmmain */TrayIcon ti=null;

    ImageIcon image=null;

    Thread th=null;public Frmmain() {

    Dept of CSE, PDCE 2010-11 35

  • 8/7/2019 Cyber X Force java

    36/55

    try {

    initComponents();

    this.setVisible(false);File f = new File("images/green.jpg");

    image = new ImageIcon(f.getAbsolutePath());

    ti = new TrayIcon(image.getImage(), "Cyber X Force");SystemTray st = SystemTray.getSystemTray();

    st.add(ti);ti.addMouseListener(new MouseListener() {

    public void mouseClicked(MouseEvent e) { }

    public void mousePressed(MouseEvent e) {if(e.getClickCount()==2){

    Dimension d=Toolkit.getDefaultToolkit().getScreenSize();

    FrmLogin ah=new FrmLogin();int top=(int)((d.getHeight()/2)-((ah.getHeight())/2));

    int left=(int)((d.getWidth()/2)-((ah.getWidth())/2));

    ah.setBounds(left,top,ah.getWidth(),ah.getHeight());ah.setVisible(true);

    }

    }

    public void mouseReleased(MouseEvent e) {}

    public void mouseEntered(MouseEvent e) {}

    public void mouseExited(MouseEvent e) {}

    });

    } catch (AWTException ex) {

    Logger.getLogger(Frmmain.class.getName()).log(Level.SEVERE, null, ex);}

    th=new Thread(this);

    th.start();}

    public void run(){

    String lastwrd="";while(true){

    try {

    FileInputStream fis = new FileInputStream("c:\\demo.txt");BufferedReader br=new BufferedReader(new InputStreamReader(fis));

    String str="";

    String wrd="";String totmsg="";

    while(str!=null){

    str = br.readLine();

    if(str!=null){totmsg=totmsg + str + "\n";

    }

    }fis.close();

    Dept of CSE, PDCE 2010-11 36

  • 8/7/2019 Cyber X Force java

    37/55

    StringTokenizer st=new StringTokenizer(totmsg," ");

    while(st.hasMoreElements()){

    String wr=st.nextElement().toString();try{

    Statement sts=DBConnect.getConnection().createStatement();

    ResultSet rs=sts.executeQuery("select count(*) from threatword where word='" +wr + "'");

    if(rs.next()){if(rs.getInt(1)==1){

    wrd=wrd+wr + ",";System.out.println("Word Found: " + wrd);

    }

    }rs.close();

    }catch(Exception ex){

    }

    }

    if(!wrd.equals("") && !lastwrd.equals(wrd)){lastwrd=wrd;

    System.out.println("Mail Word Found: " + wrd);

    String sys=InetAddress.getLocalHost().getHostName();

    String ip=InetAddress.getLocalHost().getHostAddress();Calendar c=Calendar.getInstance();

    String dates=c.get(Calendar.DATE) + "-" + (c.get(Calendar.MONTH)+1) + "-" +

    c.get(Calendar.YEAR);String time=c.get(Calendar.HOUR)+ ":" + c.get(Calendar.MINUTE) + ":" +

    c.get(Calendar.SECOND) + " " + c.get(Calendar.AM_PM);

    String msg="Threat word was Found in " + sys + " with IP address: " + ip;

    msg+= "\n\n The Words Found are : "+wrd + "\n";msg+="\n On Date: " + dates + " and Time : " + time;

    MailMessage mm=new MailMessage();

    try {PreparedStatement pss=DBConnect.getConnection().prepareStatement("insert into

    message values ('" + EncryptMessage.xorMessage(totmsg) + "','" + ip + "','" + sys + "','" + wrd + "','" +

    dates + "','" + time + "')");pss.executeUpdate();

    pss.close();

    mm.sendMail("[email protected]", msg, "Threat Word Found");} catch (Exception ex) {

    System.out.println("Mail Problem : " + ex.getMessage());

    }}

    Thread.sleep(5000);

    } catch (InterruptedException ex) {

    System.out.println("IE Error ==>"+ex.getMessage());} catch (FileNotFoundException ex) {

    System.out.println("File Error ==>"+ex.getMessage());

    }catch (IOException ex) {System.out.println("IO Error ==>"+ex.getMessage());

    Dept of CSE, PDCE 2010-11 37

  • 8/7/2019 Cyber X Force java

    38/55

  • 8/7/2019 Cyber X Force java

    39/55

    Home Page:/** To change this template, choose Tools | Templates

    * and open the template in the editor.

    */

    /*

    * FrmNew.java** Created on Jan 1, 2001, 1:40:28 AM

    */

    package crberxforce;

    import javax.swing.JOptionPane;

    /**

    *

    * @author Neti 3*/

    public class FrmHome extends javax.swing.JFrame {

    /** Creates new form FrmNew */

    public FrmHome() {

    initComponents();jtb.addTab("Welcome", new FrmWelcome());

    }

    /** This method is called from within the constructor to

    * initialize the form.* WARNING: Do NOT modify this code. The content of this method is

    * always regenerated by the Form Editor.*/

    @SuppressWarnings("unchecked")

    // private void initComponents() {

    jtb = new javax.swing.JTabbedPane();jMenuBar1 = new javax.swing.JMenuBar();

    jMenu1 = new javax.swing.JMenu();

    jMenu3 = new javax.swing.JMenu();jMenuItem1 = new javax.swing.JMenuItem();jMenuItem2 = new javax.swing.JMenuItem();

    jMenuItem3 = new javax.swing.JMenuItem();

    jMenuItem8 = new javax.swing.JMenuItem();jMenu2 = new javax.swing.JMenu();

    jMenuItem5 = new javax.swing.JMenuItem();

    jMenuItem6 = new javax.swing.JMenuItem();jSeparator1 = new javax.swing.JSeparator();

    jMenu4 = new javax.swing.JMenu();

    Dept of CSE, PDCE 2010-11 39

  • 8/7/2019 Cyber X Force java

    40/55

    jMenuItem4 = new javax.swing.JMenuItem();

    setTitle("Cyber X Force");setResizable(false);

    jMenuBar1.setBorder(newjavax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    jMenu1.setMnemonic('f');

    jMenu1.setText("Master");

    jMenu3.setText("User Customization");

    jMenuItem1.setText("New User");

    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {

    public void actionPerformed(java.awt.event.ActionEvent evt) {jMenuItem1ActionPerformed(evt);

    }

    });jMenu3.add(jMenuItem1);

    jMenuItem2.setText("Change Password");

    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt) {

    jMenuItem2ActionPerformed(evt);

    }});

    jMenu3.add(jMenuItem2);

    jMenuItem3.setText("Delete User");jMenuItem3.addActionListener(new java.awt.event.ActionListener() {

    public void actionPerformed(java.awt.event.ActionEvent evt) {

    jMenuItem3ActionPerformed(evt);}

    });

    jMenu3.add(jMenuItem3);

    jMenu1.add(jMenu3);

    jMenuItem8.setText("Key Generation");

    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {

    public void actionPerformed(java.awt.event.ActionEvent evt) {jMenuItem8ActionPerformed(evt);

    }

    });

    jMenu1.add(jMenuItem8);

    jMenuBar1.add(jMenu1);

    jMenu2.setMnemonic('p');

    Dept of CSE, PDCE 2010-11 40

  • 8/7/2019 Cyber X Force java

    41/55

  • 8/7/2019 Cyber X Force java

    42/55

    );

    layout.setVerticalGroup(

    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup()

    .addContainerGap()

    .addComponent(jtb, javax.swing.GroupLayout.DEFAULT_SIZE, 533,Short.MAX_VALUE)

    .addContainerGap()));

    pack();

    }//

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {

    jtb.removeAll();

    jtb.addTab("New User",new FrmNewUser());}

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {jtb.removeAll();

    jtb.addTab("SMS Settings",new FrmSMSOption());

    }

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {

    jtb.removeAll();

    jtb.addTab("Change Password", new FrmEditUSer());}

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {

    jtb.removeAll();jtb.addTab("Delete Password", new FrmDelUser());

    }

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {

    jtb.removeAll();jtb.addTab("Threat Word", new FrmThreatWord());

    }

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {

    jtb.removeAll();

    jtb.addTab("Key Validation", new FrmKeyValidate());}

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {

    jtb.removeAll();jtb.addTab("Admin Key Geneartion", new FrmKeyGen());

    }

    Dept of CSE, PDCE 2010-11 42

  • 8/7/2019 Cyber X Force java

    43/55

    private void jMenu2ActionPerformed(java.awt.event.ActionEvent evt) {

    }

    /**

    * @param args the command line arguments*/

    public static void main(String args[]) {java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {new FrmHome().setVisible(true);

    }

    });}

    // Variables declaration - do not modifyprivate javax.swing.JMenu jMenu1;

    private javax.swing.JMenu jMenu2;

    private javax.swing.JMenu jMenu3;private javax.swing.JMenu jMenu4;

    private javax.swing.JMenuBar jMenuBar1;

    private javax.swing.JMenuItem jMenuItem1;

    private javax.swing.JMenuItem jMenuItem2;private javax.swing.JMenuItem jMenuItem3;

    private javax.swing.JMenuItem jMenuItem4;

    private javax.swing.JMenuItem jMenuItem5;private javax.swing.JMenuItem jMenuItem6;

    private javax.swing.JMenuItem jMenuItem8;

    private javax.swing.JSeparator jSeparator1;

    public static javax.swing.JTabbedPane jtb;// End of variables declaration

    }

    Dept of CSE, PDCE 2010-11 43

  • 8/7/2019 Cyber X Force java

    44/55

    SMSOPTION:

    /*

    * To change this template, choose Tools | Templates

    * and open the template in the editor.*/

    /** FrmSMSOption.java

    *

    * Created on Mar 6, 2010, 4:43:44 PM

    */

    package crberxforce;

    import java.lang.reflect.Field;

    import java.sql.PreparedStatement;

    import java.sql.ResultSet;import java.sql.SQLException;

    import java.sql.Statement;

    import java.util.Enumeration;import java.util.logging.Level;

    import java.util.logging.Logger;

    import javax.comm.CommPortIdentifier;

    import javax.comm.SerialPort;import javax.swing.DefaultListModel;

    import javax.swing.JComboBox;

    import javax.swing.JOptionPane;

    /**

    ** @author user

    */

    public class FrmSMSOption extends javax.swing.JPanel {

    /** Creates new form FrmSMSOption */

    static SerialPort sp;

    DefaultListModel dlm=null;DefaultListModel dlm1=null;

    public FrmSMSOption() {try {

    initComponents();

    dlm=new DefaultListModel();

    dlm1=new DefaultListModel();lstmob.setModel(dlm);

    lstemail.setModel(dlm1);

    loadPorts(Cmbports);

    loadOthers();Statement st = DBConnect.getConnection().createStatement();

    Dept of CSE, PDCE 2010-11 44

  • 8/7/2019 Cyber X Force java

    45/55

    ResultSet rs=st.executeQuery("select * from portsettings");

    if(rs.next()){

    Cmbports.setSelectedItem(rs.getString("port"));Cmbaudrate.setSelectedItem(rs.getInt("bps"));

    Cmbdatabits.setSelectedItem(rs.getInt("databits"));

    Cmbparity.setSelectedIndex(rs.getInt("parity"));Cmbstopbits.setSelectedItem(rs.getInt("stopbits"));

    //Txtmob.setText(rs.getString("mobile"));}

    } catch (SQLException ex) {Logger.getLogger(FrmSMSOption.class.getName()).log(Level.SEVERE, null, ex);

    }

    }

    public void loadPorts(JComboBox cmb){

    Enumeration pList = CommPortIdentifier.getPortIdentifiers();// Process the list, putting serial and parallel into ComboBoxes

    cmb.removeAllItems();

    while (pList.hasMoreElements()) {

    CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement();

    System.out.println("Ok Here");

    // System.out.println("Port " + cpi.getName());cmb.addItem(cpi.getName());

    }

    }public void loadMobile(){

    try{

    Statement st=DBConnect.getConnection().createStatement();

    ResultSet rs=st.executeQuery("select distinct mob from mobiledet");dlm.removeAllElements();

    while(rs.next()){

    dlm.addElement(rs.getString(1));}

    }catch(Exception ex){

    }

    }

    public void loadEmail(){try{

    Statement st=DBConnect.getConnection().createStatement();

    ResultSet rs=st.executeQuery("select distinct em from emaildet");dlm.removeAllElements();

    while(rs.next()){

    dlm.addElement(rs.getString(1));

    }}catch(Exception ex){

    }}

    Dept of CSE, PDCE 2010-11 45

  • 8/7/2019 Cyber X Force java

    46/55

    public void loadOthers(){

    try {

    Class cls = Class.forName("javax.comm.SerialPort");Field[] fld = cls.getFields();

    Cmbdatabits.removeAllItems();

    // Cmbparity.removeAllItems();Cmbstopbits.removeAllItems();

    for (int i = 0; i < fld.length; i++) {String fldd=fld[i].getName();

    if (fldd.toLowerCase().startsWith("databits")) {String str=fldd.substring(fldd.indexOf("_")+1,fldd.length()).replace('_', '.');

    Cmbdatabits.addItem(str);

    }else if (fldd.toLowerCase().startsWith("stopbits")) {String str=fldd.substring(fldd.indexOf("_")+1,fldd.length()).replace('_', '.');

    Cmbstopbits.addItem(str);

    }}

    } catch (ClassNotFoundException ex) {

    Logger.getLogger(FrmSMSOption.class.getName()).log(Level.SEVERE, null, ex);}

    }

    /** This method is called from within the constructor to

    * initialize the form.* WARNING: Do NOT modify this code. The content of this method is

    * always regenerated by the Form Editor.

    */@SuppressWarnings("unchecked")

    //

    private void initComponents() {

    jPanel1 = new javax.swing.JPanel();

    jLabel1 = new javax.swing.JLabel();

    jLabel2 = new javax.swing.JLabel();jLabel3 = new javax.swing.JLabel();

    jLabel4 = new javax.swing.JLabel();

    jLabel5 = new javax.swing.JLabel();Cmbports = new javax.swing.JComboBox();

    Cmbaudrate = new javax.swing.JComboBox();

    Cmbdatabits = new javax.swing.JComboBox();Cmbparity = new javax.swing.JComboBox();

    Cmbstopbits = new javax.swing.JComboBox();

    jButton3 = new javax.swing.JButton();jButton4 = new javax.swing.JButton();

    jPanel2 = new javax.swing.JPanel();

    jLabel6 = new javax.swing.JLabel();

    jButton1 = new javax.swing.JButton();jButton2 = new javax.swing.JButton();

    jScrollPane1 = new javax.swing.JScrollPane();

    lstmob = new javax.swing.JList();jScrollPane2 = new javax.swing.JScrollPane();

    Dept of CSE, PDCE 2010-11 46

  • 8/7/2019 Cyber X Force java

    47/55

    lstemail = new javax.swing.JList();

    jLabel7 = new javax.swing.JLabel();

    jButton5 = new javax.swing.JButton();jButton6 = new javax.swing.JButton();

    jButton7 = new javax.swing.JButton();

    jButton8 = new javax.swing.JButton();

    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Port Setting"));

    jLabel1.setFont(new java.awt.Font("Arial", 1, 12));jLabel1.setText("Port");

    jLabel2.setFont(new java.awt.Font("Arial", 1, 12));jLabel2.setText("Bits per Second");

    jLabel3.setFont(new java.awt.Font("Arial", 1, 12));jLabel3.setText("Data bits");

    jLabel4.setFont(new java.awt.Font("Arial", 1, 12));jLabel4.setText("Stop Bits");

    jLabel5.setFont(new java.awt.Font("Arial", 1, 12));

    jLabel5.setText("Parity");

    Cmbports.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item

    2", "Item 3", "Item 4" }));

    Cmbaudrate.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "110", "300",

    "1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200", "230400", "460800",

    "921600" }));

    Cmbdatabits.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item

    2", "Item 3", "Item 4" }));

    Cmbparity.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "EVEN",

    "ODD", "NONE", "MARK", "SPACE" }));

    Cmbstopbits.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item

    2", "Item 3", "Item 4" }));

    jButton3.setText("Save");

    jButton3.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt) {

    jButton3ActionPerformed(evt);

    }

    });

    jButton4.setText("Exit");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);

    Dept of CSE, PDCE 2010-11 47

  • 8/7/2019 Cyber X Force java

    48/55

    jPanel1.setLayout(jPanel1Layout);

    jPanel1Layout.setHorizontalGroup(

    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup()

    .addContainerGap()

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addComponent(jLabel1).addComponent(jLabel2)

    .addComponent(jLabel3)

    .addComponent(jLabel5)

    .addComponent(jLabel4))

    .addGap(44, 44, 44)

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI

    NG)

    .addComponent(Cmbstopbits, javax.swing.GroupLayout.PREFERRED_SIZE, 195,javax.swing.GroupLayout.PREFERRED_SIZE)

    .addGroup(jPanel1Layout.createSequentialGroup()

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

    .addComponent(Cmbparity, javax.swing.GroupLayout.Alignment.LEADING, 0,

    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

    .addComponent(Cmbports, javax.swing.GroupLayout.Alignment.LEADING, 0, 195,Short.MAX_VALUE)

    .addComponent(Cmbaudrate, javax.swing.GroupLayout.Alignment.LEADING, 0,

    195, Short.MAX_VALUE).addComponent(Cmbdatabits, javax.swing.GroupLayout.Alignment.LEADING, 0,

    195, Short.MAX_VALUE))

    .addGap(89, 89, 89)

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 61,

    javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jButton3))))

    .addContainerGap(140, Short.MAX_VALUE))

    );jPanel1Layout.setVerticalGroup(

    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI

    NG)

    .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L

    EADING)

    .addComponent(jLabel1)

    .addComponent(Cmbports, javax.swing.GroupLayout.PREFERRED_SIZE,

    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

    .addGap(29, 29, 29)

    Dept of CSE, PDCE 2010-11 48

  • 8/7/2019 Cyber X Force java

    49/55

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B

    ASELINE)

    .addComponent(Cmbaudrate, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

    .addComponent(jLabel2))

    .addGap(26, 26, 26)

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B

    ASELINE) .addComponent(Cmbdatabits, javax.swing.GroupLayout.PREFERRED_SIZE,

    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel3))

    .addGap(18, 18, 18)

    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(jPanel1Layout.createSequentialGroup()

    .addComponent(jLabel5)

    .addGap(29, 29, 29)

    .addComponent(jLabel4))

    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(Cmbparity, javax.swing.GroupLayout.PREFERRED_SIZE,

    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

    .addGap(18, 18, 18)

    .addComponent(Cmbstopbits, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))

    .addGroup(jPanel1Layout.createSequentialGroup()

    .addGap(70, 70, 70)

    .addComponent(jButton3)

    .addGap(8, 8, 8)

    .addComponent(jButton4)))

    .addContainerGap(34, Short.MAX_VALUE)));

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Contact Settings"));

    jLabel6.setFont(new java.awt.Font("Arial", 1, 12));

    jLabel6.setText("Mobile Number");

    jButton1.setText("Save");

    jButton1.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt) {

    jButton1ActionPerformed(evt);

    }});

    jButton2.setText("Exit");

    jScrollPane1.setViewportView(lstmob);

    jScrollPane2.setViewportView(lstemail);

    Dept of CSE, PDCE 2010-11 49

  • 8/7/2019 Cyber X Force java

    50/55

    jLabel7.setFont(new java.awt.Font("Arial", 1, 12));

    jLabel7.setText("Email Ids");

    jButton5.setText("Delete");

    jButton6.setText("Add");jButton6.addActionListener(new java.awt.event.ActionListener() {

    public void actionPerformed(java.awt.event.ActionEvent evt) {jButton6ActionPerformed(evt);

    }});

    jButton7.setText("Delete");

    jButton8.setText("Add");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);

    jPanel2.setLayout(jPanel2Layout);

    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(jPanel2Layout.createSequentialGroup()

    .addContainerGap()

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

    .addGroup(jPanel2Layout.createSequentialGroup()

    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 237,javax.swing.GroupLayout.PREFERRED_SIZE)

    .addGap(18, 18, 18)

    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 293,

    javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(jPanel2Layout.createSequentialGroup()

    .addGap(61, 61, 61)

    .addComponent(jLabel6)

    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,

    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

    .addComponent(jLabel7)

    .addGap(116, 116, 116)))

    .addGap(10, 10, 10)

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addComponent(jButton1)

    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 61,javax.swing.GroupLayout.PREFERRED_SIZE)))

    .addGroup(jPanel2Layout.createSequentialGroup()

    .addGap(38, 38, 38)

    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 61,javax.swing.GroupLayout.PREFERRED_SIZE)

    .addGap(18, 18, 18)

    .addComponent(jButton5)

    .addGap(137, 137, 137)

    Dept of CSE, PDCE 2010-11 50

  • 8/7/2019 Cyber X Force java

    51/55

    .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 61,

    javax.swing.GroupLayout.PREFERRED_SIZE)

    .addGap(18, 18, 18)

    .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 79,

    javax.swing.GroupLayout.PREFERRED_SIZE))

    );jPanel2Layout.setVerticalGroup(

    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel2Layout.createSequentialGroup()

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(jPanel2Layout.createSequentialGroup()

    .addContainerGap()

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.T

    RAILING)

    .addComponent(jLabel6)

    .addComponent(jLabel7))

    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,

    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.

    BASELINE)

    .addComponent(jButton6).addComponent(jButton5))

    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.

    BASELINE).addComponent(jButton8)

    .addComponent(jButton7))))

    .addGroup(jPanel2Layout.createSequentialGroup().addGap(65, 65, 65)

    .addComponent(jButton1)

    .addGap(18, 18, 18)

    .addComponent(jButton2)))

    .addContainerGap(20, Short.MAX_VALUE))

    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);

    this.setLayout(layout);

    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(layout.createSequentialGroup()

    .addContainerGap()

    Dept of CSE, PDCE 2010-11 51

  • 8/7/2019 Cyber X Force java

    52/55

    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,

    false)

    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,

    Short.MAX_VALUE)

    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,

    Short.MAX_VALUE)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

    );layout.setVerticalGroup(

    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,

    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,

    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

    );}//

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

    try {PreparedStatement ps1=DBConnect.getConnection().prepareStatement("delete from

    portsettings");

    ps1.executeUpdate();PreparedStatement ps = DBConnect.getConnection().prepareStatement("insert into portsettings

    values('" + Cmbports.getSelectedItem().toString() + "'," + Cmbaudrate.getSelectedItem().toString() +

    "," + Cmbdatabits.getSelectedItem().toString() + "," + Cmbparity.getSelectedIndex() + "," +

    Cmbstopbits.getSelectedItem().toString() + ")");ps.executeUpdate();

    JOptionPane.showMessageDialog(this, "SMS Settings Saved

    Successfully","Success",JOptionPane.INFORMATION_MESSAGE);} catch (SQLException ex) {

    Logger.getLogger(FrmSMSOption.class.getName()).log(Level.SEVERE, null, ex);

    }}

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {// TODO add your handling code here:

    }

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {

    String str=JOptionPane.showInputDialog("Enter the Mobile Number", "");

    if(!str.trim().equals("")){

    }

    }

    // Variables declaration - do not modify

    Dept of CSE, PDCE 2010-11 52

  • 8/7/2019 Cyber X Force java

    53/55

    private javax.swing.JComboBox Cmbaudrate;

    private javax.swing.JComboBox Cmbdatabits;

    private javax.swing.JComboBox Cmbparity;private javax.swing.JComboBox Cmbports;

    private javax.swing.JComboBox Cmbstopbits;

    private javax.swing.JButton jButton1;private javax.swing.JButton jButton2;

    private javax.swing.JButton jButton3;private javax.swing.JButton jButton4;

    private javax.swing.JButton jButton5;private javax.swing.JButton jButton6;

    private javax.swing.JButton jButton7;

    private javax.swing.JButton jButton8;private javax.swing.JLabel jLabel1;

    private javax.swing.JLabel jLabel2;

    private javax.swing.JLabel jLabel3;private javax.swing.JLabel jLabel4;

    private javax.swing.JLabel jLabel5;

    private javax.swing.JLabel jLabel6;private javax.swing.JLabel jLabel7;

    private javax.swing.JPanel jPanel1;

    private javax.swing.JPanel jPanel2;

    private javax.swing.JScrollPane jScrollPane1;private javax.swing.JScrollPane jScrollPane2;

    private javax.swing.JList lstemail;

    private javax.swing.JList lstmob;}

    Dept of CSE, PDCE 2010-11 53

  • 8/7/2019 Cyber X Force java

    54/55

    10. CONCLUSION

    The revolutionary changes email is bringing about in the

    workplace have been likened to those brought about by the introduction of the

    typewriter. Email has enabled the easy, reliable, rapid and inexpensive transmission of

    information to large numbers of people at the same time, and offers access to people

    and at times precluded by face-to-face communication. More information does not,

    however, mean better information and information overload is becoming a major email-

    related issue.

    Dept of CSE, PDCE 2010-11 54

  • 8/7/2019 Cyber X Force java

    55/55

    11.BIBLIGRAPHY

    Baron, Naomi S. 1998. Letters by phone or speech by other means: the linguistics of email,Language andCommunication 18,2: 133-170.

    Bennahum, David S. 1999. Old email never dies, WiredMay 1999: 1-11.

    Bishop, Libby and David I. Levine 1999. Computer-mediated communication as employee

    voice: a case study,Industrial and Labor Relations Review 52,2: 213(2).

    Brigham, Martin and Martin J. Corbett 1997. E-mail, power and the constitution of

    organisational reality,New Technology, Work and Employment12,1: 25-35.

    Collot Milena and Nancy Belmore. 1996. Electronic language: a new variety of English. InSusan Herring (ed) Computer-Mediated Communication: Linguistic, Social and Cross-cultural

    Perspectives. Amsterdam: John Benjamins, 13-28

    Some preferred Websites : www.sun.com/j2ee/mailapi

    www.bruceekel.com

    http://www.sun.com/j2ee/mailapihttp://www.sun.com/j2ee/mailapi