Sie sind auf Seite 1von 57

1.

INTRODUCTION

The project entitled “Net Informer and Privacy keeper” performs the system
security on network. This project handles critical skill set for any organization that wants
to monitor incoming traffic as well as monitor outgoing. The inference of information
from observation of traffic flow; for example, analysis of the presence, absence, amount,
direction, and frequency of traffic are maintained.

To optimize network infrastructure for application performance, user need


complete, enterprise-wide visibility into the composition of traffic on every link. With
this insight quickly identify the source of any performance problems, validate the impact
of planned and unplanned changes within the network, and avoid unnecessary WAN
costs.

The Host name, IP Address is received for the computers stayed on the network.
The Process name, the responding Id, Session Id are retrieved on the monitoring
resources. This allows the processes to start and stop. The Navigation of the system found
on the network can be possible. The Messages can be sent to the systems which are
roaming in the network. The Host name is selected and a message window is appeared
and the message typed and sends to the target system

The server is used to listen from the client requests and to response the client. The
client is to request the server. The administrator to view the remote explorer, to upload,
download and delete, run and create folder in remote machine from the local Pc, to
capture the remote desktop instantly.

The administrator to view the remote tasks from the local PC and to control the
hardware of the client machines like CD Controller, Mouse controller, and Display
controller.

1
ADVANTAGES

1. It is the bidirectional communication so the client and server can chat with each other.
2. By using this project we can lock the client desktop. So the client can do nothing
without remove the lock using password.
3. If we know the correct path we can open the server applications in the client side.
4. You can view client’s desktop from the server side.
5. File transfer and windows explorer functions available.
6. Server also views their client face through webcam.
7. By using this project you can control the client like shutdown, restart and logoff.

The project “Net Informer and Privacy Keeper” can be done with the help of
Visual Basic .Net and O.S of windows XP or later. This project will be very much useful for
small scale industries where the MD or the manager can watch their staffs and control them
through the Winsock network programming concept.

2
SYSTEM SPECIFICATION

System Specification is a description of a software and Hardware requirements to be


developed. It lays out functional and non-functional requirements, and may include a set of
use cases that describe user interactions that the software and hardware details are must
provide.

HARDWARE CONFIGURATION

Processor : Core2 Duo

RAM : 1 GB

Hard disk : 80 GB

CD drive : 52x DVD Drive

Monitor : 15” LCD

Keyboard : PS/2 Normal Keyboard

Mouse : PS/2 Optical Mouse

SOFTWARE SPECIFICATION

Operating System : Windows XP

Language used : Visual Basic .NET

Others : Winsock control

3
SOFTWARE FEATURES

VISUAL BASIC.NET

Visual Baic.Net has revolutionized windows programming windows programming


and with an object based, event driven approach to software designs. Visual basic.Net
applications act as a front end to the database. Visual basic.Net application provides the
interface between the user and the database. Sophisticated features that make the language
truly object oriented and interfaces it with the latest in the database technology.

.NET provides a new, object-oriented API as a set of classes that will be accessible
from any programming language. This book describes this framework of classes and provides
a reference to what is available and how you can use this framework to write Windows
applications in the brave new world of .NET.

Microsoft .NET Framework is a computing platform for developing distributed


applications for the Internet. Following are the design goals of Microsoft .NET Framework:

1. To provide a very high degree of language interoperability

2. To provide a runtime environment that completely manages code execution

3. To provide a very simple software deployment and versioning model

4. To provide high-level code security through code access security and strong type
checking

5. To provide a consistent object-oriented programming model

6. To facilitate application communication by using industry standards such as SOAP


and XML.

7. To simplify Web application development

4
THE COMMON LANGUAGE RUNTIME

The CLR is the mechanism through which .NET code is executed. It is built upon a
single, common language—IL—into which source languages are compiled and includes
mechanisms for executing the compiled code. This includes code verification and just-in-time
(JIT) compilation, garbage collection and enforcement of security policies, and the provision
of profiling and debugging services.

The CLR provides a lot of added value to the programs it supports. Because it
controls how a .NET program executes and sits between the program and the operating
system, it can implement security, versioning support, automatic memory management
through garbage collection, and provide transparent access to system services

IMPORTANT FEATURES
 The application is a graphical user interface.
 Client-Server architecture benefits picture and image box can be easily
handled using bit mapped files and icons.
 Bit mapped files and icons are used as simple debugging tools.
 With the advent of .NET, Microsoft has introduced many new
technologies that make writing component-based distributed systems
easier, more flexible, and more powerful than ever before.
 It is now easier than it has ever been to write components in any
programming language that can interoperate with components on other
machines, which may not be Windows-based at all.

5
2. SYSTEM STUDY

EXISTING SYSTEM

The existing system in a LAN based environment is a manual one where the
administrator does not have an efficient way of monitoring the Client machines, does not
provide an efficient system of communicant of chatting and instant messages between the
nodes connected in the client and no way the administrator can control the remote clients as
he expected. In order to provide an efficient system of communication between the nodes the
project is proposed to be developed.

DRAWBACK IN THE EXISTING SYSTEM

1. No tool for the clients to have an interactive way of communication between


themselves connected in a LAN.

2. No tool for the administrator to have control over the remote Desktop Clients, their
tasks, their hardware, and the Remote Explorer.

6
PROPOSED SYSTEM
The proposed system is developed due to the problems faced in the existing system in
the form of irregular and inefficient communication and no kind of absolute tool available for
administrators to have a control on the existing client’s activities.

Thus the proposed system is developed due to the following reasons:

1. Need for a better way of communication between the clients themselves and the
administrator and the clients
2. Necessity for the administrator to have a better control on the clients Desktop.
3. Necessity for the administrator to watch the remote explorer.
4. Necessity for the administrator to watch the remote desktop
5. Necessity for the administrator to watch the remote Tasks
6. Necessity for the administrator to control the Remote Control panel

ADVANTAGES OF PROPOSED SYSTEM

1. The proposed system is to be developed with the motive of having an efficient


tool system for the administrator and the clients connected in a LAN.
2. The tool provides the administrator an option to watch the remote desktops,
remote explorer, and remote task managing and remote control panel

7
FEASIBILITY STUDY
Preliminary investigation examine project feasibility, the likelihood the system will be
useful to the organization. The main objective of the feasibility study is to test the Technical,
Operational and Economical feasibility for adding new modules and debugging old running
system. All system is feasible if they are unlimited resources and infinite time. There are
aspects in the feasibility study portion of the preliminary investigation:

 Technical Feasibility
 Operational Feasibility
 Economical Feasibility

 TECHNICAL FEASIBILITY

Earlier no system existed to cater to the needs of ‘Secure Infrastructure Implementation


System’. The current system developed is technically feasible. It is a web based user interface
for audit workflow at NIC-CSD. Thus it provides an easy access to the users. The database’s
purpose is to create, establish and maintain a workflow among various entities in order to
facilitate all concerned users in their various capacities or roles. Permission to the users
would be granted based on the roles specified.

Therefore, it provides the technical guarantee of accuracy, reliability and security. The
software and hard requirements for the development of this project are not many and are
already available in-house at NIC or are available as free as open source. The work for the
project is done with the current equipment and existing software technology. Necessary
bandwidth exists for providing a fast feedback to the users irrespective of the number of users
using the system.

8
OPERATIONAL FEASIBILITY

Proposed projects are beneficial only if they can be turned out into information system.
That will meet the organization’s operating requirements. Operational feasibility aspects of
the project are to be taken as an important part of the project implementation.

This system is targeted to be in accordance with the above-mentioned issues.


Beforehand, the management issues and user requirements have been taken into
consideration. So there is no question of resistance from the users that can undermine the
possible application benefits. The well-planned design would ensure the optimal utilization of
the computer resources and would help in the improvement of performance status.

ECONOMICAL FEASIBILITY

A system can be developed technically and that will be used if installed must still be a
good investment for the organization. In the economic feasibility, the development cost in
creating the system is evaluated against the ultimate benefit derived from the new systems.
Financial benefits must equal or exceed the costs.

The system is economically feasible. It does not require any addition hardware or
software. Since the interface for this system is developed using the existing resources and
technologies available at NIC, There is nominal expenditure and economic feasibility for
certain.

9
3. SYSTEM DESIGN AND DEVELOPMENT
SYSTEM DESIGN
System design is the process of planning a new system to complement or altogether
replace the old system. The purpose of the design phase is the first step in moving from the
problem domain to the solution domain. The design of the system is the critical aspect that
affects the quality of the software. System design is also called top-level design. The design
phase translates the logical aspects of the system into physical aspects of the system.

INPUT DESIGN
Input design is one of the most important phase of the system design. Input design is
the process where the input received in the system are planned and designed, so as to get
necessary information from the user, eliminating the information that is not required. The aim
of the input design is to ensure the maximum possible levels of accuracy and also ensures that
the input is accessible that understood by the user.

The input design is the part of overall system design, which requires very careful
attention. if the data going into the system is incorrect then the processing and output will
magnify the errors.

The objectives considered during input design are:


 Nature of input processing.
 Flexibility and thoroughness of validation rules.
 Handling of properties within the input documents.
 Screen design to ensure accuracy and efficiency of the input
relationship with files.
 Careful design of the input also involves attention to error handling,
controls, batching and validation procedures. Input design features can
ensure the reliability of the system and produce result from accurate
data or they can result in the production of erroneous information. The
input design of the system includes the following

10
OUTPUT DESIGN

The output is designed to search and retrieve the documents, video, audio, image,
software, code and all files/folders in peer to peer system in a network. Copy the searched file
to local system and also view that files. The results are displayed based on the keyword, the
option chose, and also upon the file size specified.

The output of the system, if it differs from what was required, it is due to an error.
This output can be some numeric or alphabetic value, some formatted report, or some specific
behaviour from the system. In case of an error there may be change in the format of out, some
unexpected behaviour from system, or some value different from the expected is obtained.
These errors can due to wrong analysis, wrong design, or some fault on developer's part. All
these errors need to be discovered before the system is implemented at the customer's site.

The Major Activities

 User sends requests for getting general reports.


 User can monitor all systems using video interface.
 Admin can finding, sending, monitoring all computers

11
SYSTEM DEVELOPMENT

Description of Modules

Server Module

This server module is used to listen from the client requests and to response the client.
This module has been divided into further sub modules:

A) Server Start:
Starting listening for the client requests to respond to them

Client Module

The client module is to request the server and is sub-divided as follows:

A) Remote Explorer
Remote Explorer helps the administrator to view the remote explorer.
This module helps the administrator to upload, download and delete,
run and create folder in remote machine from the local Pc

B) Remote Desktop Capture


Remote Desktop Capture helps the administrator to capture the
remote desktop instantly.

C) Remote Task Manager


Remote Task Manager helps the administrator to view the
Remote tasks from the local PC.
D) Remote Control Panel
Remote Control Panel helps the administrator to control the
hardware of the client machines like CD Controller, Mouse
controller, and Display controller.

12
SYSTEM TESTING

TESTING

Testing is a series of different tests that whose primary purpose is to fully exercise
the computer based system. Although each test has a different purpose, all work should verify
that all system element have been properly integrated and performed allocated function.
Testing is the process of checking whether the developed system works according to the
actual requirement and objectives of the system.

The philosophy behind testing is to find the errors. A good test is one that has a
high probability of finding an undiscovered error. A successful test is one that uncovers the
undiscovered error. Test cases are devised with this purpose in mind. A test case is a set of
data that the system will process as an input. However the data are created with the intent of
determining whether the system will process them correctly without any errors to produce the
required output.

TYPES OF TESTING

 Unit testing
 Integration testing
 Validation testing
 Output testing
 User acceptance testing

 System Testing
Unit Testing

Unit testing focuses verification effort on the smallest unit of software i.e. the module.
Using the detailed design and the process specifications testing is done to uncover errors
within the boundary of the module. All modules must be successful in the unit test before the
start of the integration testing begins. In this project each service can be thought of a module.
There are so many modules like fault ip address, client request mismatch. Each module has
been tested by giving different sets of inputs when developing the module as well as finishing
the development so that each module works without any error. The inputs are validated when
accepting from the user.

13
Integration Testing

The entire project was split into small program; each of these single programs
gives a frame as an output. These programs were tested individually; at last all these
programs where combined together by creating another program where all these constructors
were used. It give a lot of problem by not functioning is an integrated manner.

The user interface testing is important since the user has to declare that the
arrangements made in frames are convenient and it is satisfied. When the frames where given
for the test, the end user gave suggestion. Based on their suggestions the frames where
modified and put into practice.

Validation Testing

At the culmination of the black box testing software is completely assembled as a


package. Interfacing errors have been uncovered and corrected and a final series of test i.e.,
Validation succeeds when the software function in a manner that can be reasonably accepted
by the customer.

Output Testing

After performing the validation testing the next step is output testing of the proposed
system. Since the system cannot be useful if it does not produce the required output. Asking
the user about the format in which the system is required tests the output displayed or
generated by the system under consideration. Here the output format is considered in two
ways. one is on screen and another one is printed format. The output format on the screen is
found to be corrected as the format was designed in the system phase according to the user
needs. And for the hardcopy the output comes according to the specifications requested by
the user.

Acceptance Testing

Acceptance Test is performed with realistic data of the client to demonstrate


that the software is working satisfactorily. Testing here is focused on external behavior of the
system; the internal logic of program is not emphasized. I have collected some data and tested
whether project is working correctly or not.

14
  Test cases should be selected so that the largest number of attributes of an
equivalence class is exercised at once. The testing phase is an important part of software
development. It is the process of finding errors and missing operations and also a complete
verification to determine whether the objectives are met and the user requirements are
satisfied.

Performance Testing

Modules are interdependent with the other modules, so the testing cannot be done
module by module. So the unit testing is not possible in the case of this driver. So the system
is checked only with their performance to check their quality.

System Testing

Here the entire software system is tested. The reference document for this process is
the requirements document, and the goal is to see if software meets its requirements.

Here entire ‘Communication Media’ has been tested against requirements of project
and it is checked whether all requirements of project have been satisfied or not.

15
IMPLEMENTATION
Once the system is successfully developed the next important step is to ensure that
the administrators are well trained and implement to handle the system. This is because the
success of a system invariably depends on how they are operated and used. The
implementation depends upon the right people being at the right place at the right time.
Education involves creating the right atmosphere and motivating the user. The administrators
are familiarized with the run procedures of the system, working through the sequence of
activities on an ongoing basis.

Implementation is the state in the project where the theoretical design is turned into
a working system. By this, the users get the confidence that the system will work effectively.
The system can be implemented only after through testing.

The systems personnel check the feasibility of the system. The actual data were
inputted to the system and the working of the system was closely monitored. The master
option was selected from the main menu and the actual data were input through the
corresponding input screens. The data movement was studied and found to be correct queries
option was then selected and this contains various reports. Utilities provide various data
needed for inventory was input and the module was test run. Satisfactory results were
obtained. Reports related to these processes were also successfully generated. Various input
screen formats are listed in the appendix.

Implementation walkthroughs ensure that the completed system actually solves the
original problem. This walkthrough occurs just before the system goes into use, and it should
include careful review of all manuals, training materials and system documentation. Again,
users, the analyst and the members of the computer services staff may attend this meeting.

16
5. CONCLUSION

The “Net Informer and Privacy Keeper” has been developed to satisfy all proposed
requirements. The system is highly scalable and user friendly. Almost all the system
objectives have been met. The system has been tested under all criteria. The system
minimizes the problem arising in the existing manual system and it eliminates the human
errors to zero level.

The software executes successfully by fulfilling the objectives of the project. Further
extensions to this system can be made required with minor modifications. The invention can
be implemented in network systems. Apparatus of the invention can be implemented in a
computer program product tangibly embodied in a machine-readable device for execution by
a programmable processor; and method steps of the invention can be performed by a
programmable processor executing a program of instructions to perform functions of the
invention by operating on input data and generating output

SCOPE OF FUTURE ENHANCEMENT

The scope includes all computing systems and network infrastructure owned or
managed by Middlebury. Server logs may be monitored for malicious activity on a routine
schedule. Other network traffic may be logged as necessary for troubleshooting and
resolution of network issues. Only malicious or extraordinary activity is to be logged. These
measures are not to be used for tracking and/or monitoring an individual’s network activity.

17
6. BIBLIOGRAPHY
BOOKS

 Elias Awath, “SYSTEM ANALYSIS AND DESIGN”, Tata Mc Graw Hill

Publication, Sixth Edition,2003

 S.Ramachandran, “COMPUTER AIDED DESIGN”, Air Walk Publication, Third

Edition,2003

 Richard Fairley, “SOFTWARE ENGINEERING CONCEPTS”, Tata Mc Graw Hill

Publication, Second Edition,1997

 Distributed .NET Programming in VB .NET by Tom Barnaby

 Professional VB.NET, 2nd Edition by Fred Barwell, et al

 The .NET Languages: A Quick Translation Guide by Brian Bisch of

 Programming VB.NET: A Guide for Experienced Programmers

by Gary Cornell, Jonathan Morrison

 Learning Visual Basic.NET Through Applications by Clayton Crooks II

 Visual Basic .NET How to Program (2nd Edition) by Harvey M. Deitel, Paul J.

Deitel, Tem R. Nieto

WEBSITES

 www.google.com
 www.microsoft.com
 www.codeproject.com
 www.programmersheaven.com
 www.w3schools.com

18
19
7. APPENDICES
A. DATA FLOW DIAGRAM

Start

Server
(Installed as Client
Service in Clients) (Administrators)

Remote Explorer

Server Start
Remote Desktop

Remote Task
Manager

Remote Control
Panel

Stop
Stop

20
B. SAMPLE CODING

Server Form

Imports System
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Imports System.Threading
Imports System.Drawing
Imports System.IO
Public Class Form1
Dim handler As Socket
Public th As Thread
Public th1 As Thread
Public Data As String
Public fname As String
Public ext As String
Dim i As Integer
Public msg As Byte()
Dim apppath As String
Dim cap As Integer
Public f As Integer
Public _crypto As CryptoLib.Crypto
Delegate Sub SetDisplay(ByVal [Text] As String)
Public Sub Connect()
Try
ipHostinfo = Dns.Resolve(Dns.GetHostName())
ipAdd = ipHostinfo.AddressList(0)
localEndPoint = New IPEndPoint(ipAdd, 11000)
listner.Bind(localEndPoint)
listner.Listen(10)
th = New System.Threading.Thread(AddressOf Acceptstart)
th.Start()
i=1

21
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As


System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
If i = 1 Then
th.Abort()
End If
If i = 2 Then
th.Abort()
th1.Abort()
End If
If handler IsNot Nothing Then
handler.Shutdown(SocketShutdown.Both)
handler.Close()
End If
Dim p1 As Process = Process.GetCurrentProcess()
p1.Kill()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
List1.Items.Add("Waiting For Connection")
Me.listner = New
System.Net.Sockets.Socket(Net.Sockets.AddressFamily.InterNetwork,
Net.Sockets.SocketType.Stream, Net.Sockets.ProtocolType.Tcp)
apppath = System.Windows.Forms.Application.StartupPath.ToString()
RText.Text = apppath
f=2
End Sub
22
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Connect()
End Sub
Public Sub Acceptstart()
handler = listner.Accept()
th1 = New System.Threading.Thread(AddressOf Receive)
th1.Start()
i=2
MessageBox.Show("Connected")
End Sub
Public Sub Proccessdata(ByVal str As String)
If Me.List.InvokeRequired Then
Dim d As New SetDisplay(AddressOf Proccessdata)
Me.Invoke(d, New Object() {str})
Else
Me.List.Items.Add(str)
If (cap = 0) Then
Button4.Enabled = True
End If
If str = "ok" Then
Me.Button1.Visible = True
Label1.Visible = True
List1.Visible = True
Label4.Visible = False
Button3.Visible = False
RText.Visible = False
RText.Text = apppath
Me.Size = New System.Drawing.Size(920, 673)
End If
If f = 0 Then
Button1.Visible = True
Label1.Visible = True
23
List1.Visible = True
Label4.Visible = False
Button3.Visible = False
RText.Visible = False
RText.Text = apppath
Me.Size = New System.Drawing.Size(920, 673)
End If
If str.Length > 12 Then
If str.Substring(0, 12).ToString() = "FileTransfer" Then

Dim i As Integer
Dim j As Integer
j = str.IndexOf(".") + 1
i = str.IndexOf(":") + 1
ext = str.Substring(j, str.Length - j)
fname = str.Substring(i, str.Length - i)

If (MessageBox.Show("Select Path For Receiving File-->" + fname + " Format",


"File Received Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK) Then
Me.Button1.Visible = False
Label1.Visible = False
List1.Visible = False
Label4.Visible = True
Button3.Visible = True
RText.Visible = True
RText.Text = RText.Text + "\" + fname
Me.Size = New System.Drawing.Size(410, 138)
End If
End If
End If
End If
End Sub
Public Sub Receive()
24
Try
Dim bytes(100000) As Byte
Dim bytesRec As Integer
bytes = New Byte(100000) {}
A: While True
bytesRec = handler.Receive(bytes)
If bytesRec > 0 Then
Data = Encoding.ASCII.GetString(bytes, 0, bytesRec)
Exit While
End If
End While
If cap = 1 Then
cap = 0
Try
Dim path As String
path = System.Windows.Forms.Application.StartupPath.ToString() + "\T1.Bmp"
Dim fli As New FileStream(path, FileMode.OpenOrCreate, FileAccess.Write)
fli.Write(bytes, 0, bytesRec)
fli.Close()
Dim s As New FileStream(path, FileMode.Open, FileAccess.Read)
Picture.Image = Image.FromStream(s)
s.Close()
Catch ex As Exception
msg = Encoding.ASCII.GetBytes("stop")
cap = 0
handler.Send(msg)
GoTo C
End Try
End If
If f = 1 Then
Dim fl As New FileStream(RText.Text, FileMode.Create, FileAccess.Write)
fl.Write(bytes, 0, bytesRec)
fl.Close()
Try
25
msg = Encoding.ASCII.GetBytes("Done")
handler.Send(msg)
f=0

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
C: Proccessdata(Data)

GoTo A
Catch ex As Exception
MessageBox.Show("Server Problem:" + ex.Message.ToString())
End Try

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Try
msg = Encoding.ASCII.GetBytes(Txtmsg.Text)
handler.Send(msg)
Txtmsg.Text = ""
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
If RText.Text = "" Then
MessageBox.Show("Fill Receive Path")

26
Else
Dim i As Integer
i = RText.Text.IndexOf(".") + 1
If RText.Text.Substring(i, RText.Text.Length - i) <> ext Then
MessageBox.Show("Invalid File Extension,Receive File in " + ext)
Else
Try
msg = Encoding.ASCII.GetBytes("Ack")
f=1
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End If
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Try
msg = Encoding.ASCII.GetBytes("ICapturing")
handler.Send(msg)
cap = 1
Button4.Enabled = False
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Try
msg = Encoding.ASCII.GetBytes("LogOff")
handler.Send(msg)
27
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button6.Click
Try
msg = Encoding.ASCII.GetBytes("ShutDown")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button7.Click
Try
msg = Encoding.ASCII.GetBytes("Restart")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button8.Click
Try
msg = Encoding.ASCII.GetBytes("Mlock")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
28
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.Click
Try
msg = Encoding.ASCII.GetBytes("MRel")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button23.Click

Try
If cmb_ope.Text = "SOLITAIRE" Then
msg = Encoding.ASCII.GetBytes("SOL")
handler.Send(msg)
ElseIf cmb_ope.Text = "DISPLAY PROPERTIES" Then
msg = Encoding.ASCII.GetBytes("DISPLAY")
handler.Send(msg)
ElseIf cmb_ope.Text = "MULTIMEDIA PROPERTIES" Then
msg = Encoding.ASCII.GetBytes("SOUND")
handler.Send(msg)
ElseIf cmb_ope.Text = "ACCESSIBILITY PROPERTIES" Then
msg = Encoding.ASCII.GetBytes("ACCESSIBILITY")
handler.Send(msg)
ElseIf cmb_ope.Text = "DATE/TIME PROPERTIES" Then
msg = Encoding.ASCII.GetBytes("TIMEDATE")
handler.Send(msg)
ElseIf cmb_ope.Text = "MOUSE PROPERTIES" Then
msg = Encoding.ASCII.GetBytes("MOUSE")

29
handler.Send(msg)
ElseIf cmb_ope.Text = "ADD/REMOVE PROGRAM" Then
msg = Encoding.ASCII.GetBytes("ADDREMOVE")
handler.Send(msg)
ElseIf cmb_ope.Text = "CONTROL PANEL" Then
msg = Encoding.ASCII.GetBytes("CONTROLPANEL")
handler.Send(msg)
ElseIf cmb_ope.Text = "INTERNET SETTINGS" Then
msg = Encoding.ASCII.GetBytes("INTERNET")
handler.Send(msg)
ElseIf cmb_ope.Text = "MODEM OPTIONS" Then
msg = Encoding.ASCII.GetBytes("MODEM")
handler.Send(msg)
ElseIf cmb_ope.Text = "GAME CONTROLLER" Then
msg = Encoding.ASCII.GetBytes("GAME")
handler.Send(msg)
ElseIf cmb_ope.Text = "ODBC DATASOURCE" Then
msg = Encoding.ASCII.GetBytes("ODBC")
handler.Send(msg)
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button20.Click
Try
msg = Encoding.ASCII.GetBytes("WORD")
handler.Send(msg)
Catch ex As Exception

30
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button11.Click
Try
msg = Encoding.ASCII.GetBytes("EXCEL")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button19.Click
Try
msg = Encoding.ASCII.GetBytes("POWERPOINT")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button14.Click

Try
msg = Encoding.ASCII.GetBytes("ACCESS")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

31
End Sub

Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button18.Click
Try
msg = Encoding.ASCII.GetBytes("PAINT")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button17.Click
Try
msg = Encoding.ASCII.GetBytes("NOTEPAD")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button16.Click
Try
msg = Encoding.ASCII.GetBytes("UP")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button12.Click
32
Try
msg = Encoding.ASCII.GetBytes("DOWN")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button15.Click
Try
msg = Encoding.ASCII.GetBytes("LEFT")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button13.Click
Try
msg = Encoding.ASCII.GetBytes("RIGHT")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button21.Click
Try
msg = Encoding.ASCII.GetBytes("CDOPEN")
handler.Send(msg)
33
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button22.Click

Try
msg = Encoding.ASCII.GetBytes("CDCLOSE")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button24.Click
Try
msg = Encoding.ASCII.GetBytes("NORMAL")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button10.Click
Try
msg = Encoding.ASCII.GetBytes("REMOTE")
handler.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)

34
End Try
End Sub

Private Sub Picture_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Picture.Click

End Sub
End Class

35
Client Form

Imports System
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Imports System.Threading
Imports System.Drawing
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Text.Encoder

Public Class Conn


Public msg As Byte()
Public th As Thread
Public cap As Thread
Public Data As String
Dim i As Integer
Declare Function SetCursorPos Lib "user32" (ByVal x As Integer, ByVal y As Integer) As
Integer
Declare Function GetCursorPos Lib "User32" (ByRef lpPoint As Point) As Long
Delegate Sub SetDisplay(ByVal [Text] As String)
Public a, b, c, d As Integer

Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName
As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As
String) As Integer

Private Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hDC As Integer) As


Integer

Private Declare Function CreateCompatibleBitmap Lib "GDI32" (ByVal hDC As Integer,


ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer

36
Private Declare Function GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hdc
As Integer, ByVal nIndex As Integer) As Integer

Private Declare Function SelectObject Lib "GDI32" (ByVal hDC As Integer, ByVal
hObject As Integer) As Integer

Private Declare Function BitBlt Lib "GDI32" (ByVal srchDC As Integer, ByVal srcX As
Integer, ByVal srcY As Integer, ByVal srcW As Integer, ByVal srcH As Integer, ByVal
desthDC As Integer, ByVal destX As Integer, ByVal destY As Integer, ByVal op As Integer)
As Integer

Private Declare Function DeleteDC Lib "GDI32" (ByVal hDC As Integer) As Integer

Private Declare Function DeleteObject Lib "GDI32" (ByVal hObj As Integer) As Integer
Declare Function BlockInput Lib "User32" _
(ByVal fBlockIt As Boolean) As Boolean
Const SRCCOPY As Integer = &HCC0020

Private oBackground As Bitmap


Public _crypto As CryptoLib.Crypto
Private FW, FH As Integer

Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal


lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As
Integer, ByVal hwndCallback As Integer) As Integer
Public Sub CaptureScreen()
Dim hSDC, hMDC As Integer
Dim hBMP, hBMPOld As Integer
Dim r As Integer
hSDC = CreateDC("DISPLAY", "", "", "")
hMDC = CreateCompatibleDC(hSDC)
FW = GetDeviceCaps(hSDC, 8)
FH = GetDeviceCaps(hSDC, 10)
hBMP = CreateCompatibleBitmap(hSDC, FW, FH)
37
hBMPOld = SelectObject(hMDC, hBMP)
r = BitBlt(hMDC, 0, 0, FW, FH, hSDC, 0, 0, 13369376)
hBMP = SelectObject(hMDC, hBMPOld)
r = DeleteDC(hSDC)
r = DeleteDC(hMDC)
oBackground = Image.FromHbitmap(New IntPtr(hBMP))
DeleteObject(hBMP)
End Sub
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Connect()
If i = 1 Then
Pmsg.Visible = True

Me.Size = New System.Drawing.Size(972, 680)


End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Public Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Try
msg = Encoding.ASCII.GetBytes(Txtmsg.Text)
Me.sender.Send(msg)
Txtmsg.Text = ""
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
''If (OFD.ShowDialog() = Windows.Forms.DialogResult.OK) Then
'' Me.sender.SendFile(OFD.FileName.ToString())
''End If
38
End Sub
Public Sub Connect()
Try
ipHostinfo = Dns.Resolve(Txtserver.Text)
ipAdd = ipHostinfo.AddressList(0)
remoteEP = New IPEndPoint(ipAdd, 11000)
sender.Connect(remoteEP)
th = New System.Threading.Thread(AddressOf Receive)
th.Start()
i=1
MessageBox.Show("Client Connected With Server->" + Txtserver.Text)
Catch ex As Exception
MessageBox.Show(ex.Message)

End Try

End Sub
Public Sub Proccessdata(ByVal str As String)
If Me.List.InvokeRequired Then
Dim d As New SetDisplay(AddressOf Proccessdata)
Me.Invoke(d, New Object() {str})
Else
Me.List.Items.Add(str)
If (str = "Ack") Then
Me.Button2.Enabled = False
Me.Button10.Enabled = True
End If
If (str = "ICapturing") Then
startcap()
End If
If (str = "stop") Then
T1.Enabled = False
End If
If (str = "UP") Then
39
Timer1.Enabled = True
Timer2.Enabled = False
Timer3.Enabled = False
Timer4.Enabled = False
End If
If (str = "DOWN") Then
Timer1.Enabled = False
Timer2.Enabled = True
Timer3.Enabled = False
Timer4.Enabled = False
End If
If (str = "LEFT") Then
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = True
Timer4.Enabled = False
End If
If (str = "RIGHT") Then
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer4.Enabled = True
End If
If (str = "NORMAL") Then
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer4.Enabled = False
End If

If (str = "Done") Then


Me.Button2.Enabled = True
Me.Button10.Enabled = False

40
Try
msg = Encoding.ASCII.GetBytes("ok")
Me.sender.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End If
End Sub
Public Sub startcap()
T1.Enabled = True
End Sub

Public Sub Receive()


Dim bytes(100000) As Byte
Dim bytesRec As Integer
A: While True
bytes = New Byte(100000) {}
bytesRec = sender.Receive(bytes)
If bytesRec > 0 Then
Data = Encoding.ASCII.GetString(bytes, 0, bytesRec)
Exit While
End If
End While
'List.Items.Add(Data)
'MessageBox.Show(Data)
Proccessdata(Data)
ActionData(Data)
GoTo A
End Sub

Private Sub Conn_FormClosed(ByVal sender As Object, ByVal e As


System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
If i = 1 Then
41
th.Abort()
Me.sender.Shutdown(SocketShutdown.Both)
Me.sender.Close()
End If
Dim p1 As Process
Dim p As Process() = Process.GetProcessesByName("client.exe")
For Each p1 In p
p1.Kill()
Next
End Sub

Private Sub Conn_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Me.Size = New System.Drawing.Size(445, 378)
Me.sender = New
System.Net.Sockets.Socket(Net.Sockets.AddressFamily.InterNetwork,
Net.Sockets.SocketType.Stream, Net.Sockets.ProtocolType.Tcp)
a=0
b=0
c=0
d=0
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button8.Click
If (OFD.ShowDialog() = Windows.Forms.DialogResult.OK) Then
FileT.Text = OFD.FileName.ToString()
End If
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button9.Click
Try
42
Dim str As String
Dim i As Integer
Dim j As Integer
i = OFD.FileName.LastIndexOf(("\")) + 1
j = OFD.FileName.LastIndexOf((".")) + 1

' If Ch1.Checked = True Then


'str = "FileTransfer:" + OFD.FileName.Substring(i, j - i - 1).ToString() + ".XXX"
'Else
str = "FileTransfer:" + OFD.FileName.Substring(i, OFD.FileName.Length - i)
'End If
MessageBox.Show(str)
msg = Encoding.ASCII.GetBytes(str)
Me.sender.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button10.Click
Dim fl As New FileStream(OFD.FileName, FileMode.OpenOrCreate, FileAccess.Read)
Dim b(100000) As Byte
Dim l As Integer
l = fl.Read(b, 0, fl.Length)
Me.sender.Send(b, l, SocketFlags.None)
Me.sender.SendFile(OFD.FileName.ToString())
fl.Close()
End Sub

Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles T1.Tick
CaptureScreen()
Dim b(10000000) As Byte
43
Dim path As String
path = System.Windows.Forms.Application.StartupPath.ToString() + "\T1.bmp"
oBackground.Save(path)
Dim fl As New FileStream(path, FileMode.Open, FileAccess.Read)
Dim l As Integer
l = fl.Read(b, 0, fl.Length)
fl.Close()
Me.sender.Send(b, l, SocketFlags.None)
File.Delete(path)
T1.Enabled = False

End Sub

Public Sub ActionData(ByVal str As String)

Select Case str


Case "LogOff"
System.Diagnostics.Process.Start("Shutdown", "/l")
Case "ShutDown"
System.Diagnostics.Process.Start("Shutdown", "/s")
Case "Restart"
System.Diagnostics.Process.Start("Shutdown", "/r")
Case "Mlock"
BlockInput(True)
Case "MRel"
BlockInput(False)
Case "CDOPEN"
mciSendString("set CDAudio door open", "", 0, 0)
Case "CDCLOSE"
mciSendString("set CDAudio door closed", "", 0, 0)
Case "WORD"

44
Shell("C:\Program Files\Microsoft Office\OFFICE12\WINWORD.exe",
AppWinStyle.MaximizedFocus)
Case "EXCEL"
Shell("C:\Program Files\Microsoft Office\OFFICE12\EXCEL.exe",
AppWinStyle.MaximizedFocus)
Case "POWERPOINT"
Shell("C:\Program Files\Microsoft Office\OFFICE12\POWERPNT.exe",
AppWinStyle.MaximizedFocus)
Case "ACCESS"
Shell("C:\Program Files\Microsoft Office\OFFICE12\MSACCESS.exe",
AppWinStyle.MaximizedFocus)
Case "REMOTE"
Shell("C:\WINDOWS\system32\mstsc")
Case "NOTEPAD"
Shell("notepad.exe", AppWinStyle.MaximizedFocus)
Case "PAINT"
Shell("mspaint.exe", AppWinStyle.MaximizedFocus)
Case "SOL"
Shell("sol.exe")
Case "CONTROLPANEL"
Shell("rundll32 shell32,Control_RunDLL", vbNormalFocus)
Case "ACCESSIBILITY"
Shell("rundll32 shell32,Control_RunDLL access.cpl", vbNormalFocus)
Case "ADDREMOVE"
Shell("rundll32 shell32,Control_RunDLL appwiz.cpl", vbNormalFocus)
Case "GAME"
Shell("rundll32 shell32,Control_RunDLL joy.cpl", vbNormalFocus)
Case "DISPLAY"
Shell("rundll32 shell32,Control_RunDLL desk.cpl", vbNormalFocus)
Case "MOUSE"
Shell("rundll32 shell32,Control_RunDLL Main.cpl", vbNormalFocus)
Case "INTERNET"
Shell("rundll32 shell32,Control_RunDLL inetcpl.cpl", vbNormalFocus)
Case "SOUND"
45
Shell("rundll32 shell32,Control_RunDLL mmsys.cpl", vbNormalFocus)
Case "MODEM"
Shell("rundll32 shell32,Control_RunDLL modem.cpl", vbNormalFocus)
Case "ODBC"
Shell("rundll32 shell32,Control_RunDLL ODBCcp32.cpl", vbNormalFocus)
Case "TIMEDATE"
Shell("rundll32 shell32,Control_RunDLL timedate.cpl", vbNormalFocus)
End Select
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer1.Tick
Dim pos As Point
GetCursorPos(pos)
SetCursorPos(pos.X, pos.Y - 30) 'UP
End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer2.Tick
Dim pos As Point
GetCursorPos(pos)
SetCursorPos(pos.X, pos.Y + 30) 'DOWN
End Sub

46
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Timer3.Tick
Dim pos As Point
GetCursorPos(pos)
SetCursorPos(pos.X - 30, pos.Y) 'LEFT
End Sub

Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer4.Tick
Dim pos As Point
GetCursorPos(pos)
SetCursorPos(pos.X + 30, pos.Y) 'RIGHT
End Sub

End Class

47
C.SAMPLE INPUT

SERVER

48
CONNECT TO CLIENT SYSTEM

49
CLENT SYSTEM

50
D.SAMPLE OUTPUT

SERVER TESTING FORM

51
CLIENT CAPTURE SCREEN FROM SERVER

52
FILE TRANSFERRED TO SERVER SYSTEM

53
LET SERVER SYSTEM FOR FILE TRANSFERRED FROM CLIENT SYSTEM

54
OPEN THE CLIENT FILE IN SERVER SYSTEM

55
MESSAGE RECEIVING FROM SERVER SYSTEM

56
Window Process

57

Das könnte Ihnen auch gefallen