You are on page 1of 77

Pr

oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

1.
INTRODUCTI
ON
OBJECTI
VE:

Onl
i
nesoci
alnet
wor
ks(
OSNs)t
hati
ntegr
atev
irt
ualcur
rencyser
veas
an appeal
i
ng pl
atf
orm f
orv
ari
ous busi
ness act
ivi
ti
es,wher
e onl
i
ne,i
nter
act
ive
pr
omot
ioni
samongt
hemostact
iveones.Speci
fi
cal
l
y,auser
,whoi
scommonl
y
r
epr
esent
edbyherOSN account
,canpossi
blygetr
ewar
dint
hef
orm ofv
irt
ual
cur
rencybypar
ti
cipat
ingonl
i
nepr
omot
ionact
ivi
ti
esor
gani
zedbybusi
nessent
it
ies.
Shecant
henusesuchr
ewar
dinv
ari
ousway
ssuchasonl
i
neshoppi
ng,
transf
err
ing
i
ttoot
her
s,andev
enexchangi
ngi
tforr
eal
cur
rency
.

PROBLEM DEFI
NITI
ON:

Onl
i
ne soci
alnet
wor
ks gr
adual
l
yint
egr
atef
inanci
alcapabi
l
iti
es by
enabl
i
ngt
heusageofr
ealandv
irt
ualcur
rency
.Theyser
veasnewpl
atf
ormst
ohost
av
ari
etyofbusi
nessact
ivi
ti
essuchasonl
i
nepr
omot
ionev
ent
s,wher
euser
scan
possi
blygetv
irt
ualcur
rencyasr
ewar
dsbypar
ti
cipat
ingsuchev
ent
s.Bot
hOSNsand
busi
nesspar
tner
sar
esi
gni
fi
cant
lyconcer
nedwhenat
tacker
sinst
rumentasetof
account
stocol
l
ectv
irt
ualcur
rencyf
rom t
heseev
ent
s,whi
chmaket
heseev
ent
s
i
nef
fect
iveandr
esul
tinsi
gni
fi
cantf
inanci
all
oss.

1
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

2.SYSTEM ANALYSI
S

EXI
SITI
NGSYSTEM:
Exi
sti
ngmet
hodsondet
ect
ingspammi
ngaccount
sinOSNs,
iti
s
f
acedwi
thnewchal
l
engest
odet
ectmal
i
ciousaccount
sthatpar
ti
cipat
einonl
i
ne
pr
omot
ionact
ivi
ti
es.Fi
rst
,di
ff
erentf
rom spammi
ngaccount
s,t
heseaccount
s
nei
therr
elyonspammi
ngmessagesnorneedmal
i
ciousnet
wor
kinf
rast
ruct
urest
o
l
aunchat
tacks.Second,
soci
alst
ruct
uresar
enotnecessar
y.Ther
efor
e,noneof
exi
sti
ngmet
hodsi
sappl
i
cabl
etodet
ect
ingmal
i
ciousaccount
sinonl
i
nepr
omot
ion
act
ivi
ti
es.

Di
sadv
ant
ages
 LessAccur
acy
.

 LessPer
for
mance.

Pr
oposedSy
stem:
Thi
s paperpr
esent
s a nov
elsy
stem,Pr
oGuar
d,t
o aut
omat
ical
l
y det
ect
mal
i
cious OSN account
sthatpar
ti
cipat
ein onl
i
ne pr
omot
ion ev
ent
s.Pr
oGuar
d
l
ever
agest
hreecat
egor
iesoff
eat
uresi
ncl
udi
nggener
albehav
ior
,vi
rt
ual
-cur
rency
col
l
ect
ion,andv
irt
ual
-cur
rencyusage.Exper
iment
alr
esul
tsbasedonl
abel
l
eddat
a
col
l
ect
edf
rom TencentQQ,agl
oball
eadi
ngOSNcompany
,hav
edemonst
rat
edt
he
det
ect
ionaccur
acyofPr
oGuar
d,whi
chhasachi
evedahi
ghdet
ect
ionr
ateof96.
67%
gi
venanext
remel
ylowf
alseposi
ti
ver
ateof0.
3%.

Adv
ant
ages
 Hi
ghAccur
acy
.

 Hi
ghPer
for
mance.

MODULE:

Pr
oGuar
d

2
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Wepr
oposeanov
elsy
stem,namel
yPr
oGuar
d,t
oaccompl
i
sht
hisobj
ect
iveby
sy
stemat
ical
l
y i
ntegr
ati
ng f
eat
ures t
hat char
act
eri
ze account
s f
rom t
hree
per
spect
ivesi
ncl
udi
ngt
hei
rgener
albehav
iour
s,t
hei
rrechar
gingpat
ter
ns,andt
he
usageoft
hei
rcur
rency
.Wehav
eper
for
medex
tensi
veexper
iment
sbasedondat
a
col
l
ect
edf
rom TencentQQ,
agl
oball
eadi
ngOSNwi
thbui
l
t-i
nfi
nanci
almanagement
act
ivi
ti
es.Her
ewef
indoutt
henumberofmal
i
cioususer
sandbeni
gnuser
s.soher
ewe can use mal
i
cious det
ect
ion based on l
ogi
n st
atus,r
echar
ge pr
omot
ion
act
ivi
ti
es,expendi
tur
eforbankandgi
ft
s.Andt
heendwecanper
for
m andf
indout
mal
i
cioususer
s.

Sy
stem Requi
rement
s:
Sof
twar
eRequi
rement
s:
 Oper
ati
ngSy
stem :Wi
ndows8
 Appl
i
cat
ionSer
ver :Tomcat7.
0
 Fr
ontEnd :HTML,
JSP,
CSS
 Scr
ipt
s :Jav
aScr
ipt
.
 BackendLanguage :Jav
a
 Dat
abase :My
SQL6.
0
 I
DE :Ecl
i
pse(
2019-
3)
Har
dwar
eRequi
rement
s:
 Pr
ocessor -I
ntel
i3
 RAM - 4GB
 Har
dDi
sk -500GB
FEASI
BILI
TYSTUDY:
Thef
easi
bil
i
tyoft
hepr
ojecti
sanal
yzedi
nthi
sphaseandbusi
nesspr
oposal
i
sputf
ort
hwi
thav
erygener
alpl
anf
ort
hepr
ojectandsomecostest
imat
es.
Dur
ingsy
stem anal
ysi
sthef
easi
bil
i
tyst
udyoft
hepr
oposedsy
stem i
stobe
car
ri
edout
.Thi
sist
oensur
ethatt
hepr
oposedsy
stem i
snotabur
dent
othe
company
.Forf
easi
bil
i
tyanal
ysi
s,someunder
standi
ngoft
hemaj
orr
equi
rement
s
f
ort
hesy
stem i
sessent
ial
.

Thr
eekeyconsi
der
ati
onsi
nvol
vedi
nthef
easi
bil
i
tyanal
ysi
sar
e

3
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

 ECONOMI
CALFEASI
BILI
TY

 TECHNI
CALFEASI
BILI
TY

 SOCI
ALFEASI
BILI
TY

ECONOMI
CALFEASI
BILI
TY

Thi
sst
udyi
scar
ri
edoutt
ocheckt
heeconomi
cimpactt
hatt
hesy
stem
wi
l
lhav
eont
heor
gani
zat
ion.Theamountoff
undt
hatt
hecompanycanpouri
nto
t
her
esear
chanddev
elopmentoft
hesy
stem i
sli
mit
ed.Theexpendi
tur
esmustbe
j
ust
if
ied.Thust
hedev
elopedsy
stem aswel
lwi
thi
nthebudgetandt
hiswasachi
eved
becausemostoft
het
echnol
ogi
esusedar
efr
eel
yav
ail
abl
e.Onl
ythecust
omi
zed
pr
oduct
shadt
obepur
chased.

TECHNI
CALFEASIBI
LITY
Thi
sstudyiscarr
ied outt
o checkt
het
echni
calf
easi
bil
i
ty,t
hati
s,t
he
t
echni
calr
equi
rement
soft
hesy
stem.Anysy
stem dev
elopedmustnothav
eahi
gh
demandont
heav
ail
abl
etechni
calr
esour
ces.Thi
swi
l
lleadt
ohi
ghdemandsont
he
av
ail
abl
etechni
calr
esour
ces.Thi
swi
l
lleadt
ohi
ghdemandsbei
ngpl
acedont
he
cl
i
ent
.Thedev
elopedsy
stem musthav
eamodestr
equi
rement
,asonl
ymi
nimalor
nul
lchangesar
erequi
redf
ori
mpl
ement
ingt
hissy
stem.

SOCI
ALFEASI
BILI
TY

Theaspectofst
udyi
stocheckt
hel
evel
ofaccept
anceoft
hesy
stem byt
he
user
.Thi
sincl
udest
hepr
ocessoft
rai
ningt
heusert
ouset
hesy
stem ef
fi
cient
ly.The
usermustnotf
eelt
hreat
enedbyt
hesy
stem,i
nst
eadmustaccepti
tasanecessi
ty.
Thel
evelofaccept
ancebyt
heuser
ssol
elydependsont
hemet
hodst
hatar
e
empl
oyedt
oeducat
etheuseraboutt
hesy
stem andt
omakehi
mfami
l
iarwi
thi
t.Hi
s
l
evel
ofconf
idencemustber
aisedsot
hathei
sal
soabl
etomakesomeconst
ruct
ive
cr
it
ici
sm,
whi
chi
swel
comed,
ashei
sthef
inal
useroft
hesy
stem.

4
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

SDLCMETHODOLOGI
ES

St
agesi
nSDLC

 Requi
rementGat
her
ing

 Anal
ysi
s

 Desi
gni
ng

 Codi
ng

5
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

 Test
ing

Requi
rement
sGat
her
ingst
age

The r
equi
rement
s gat
her
ing pr
ocess t
akes as i
tsi
nputt
he goal
s
i
dent
if
iedi
nthehi
gh-
lev
elr
equi
rement
ssect
ionoft
hepr
ojectpl
an.Eachgoalwi
l
lbe
r
efi
nedi
ntoasetofoneormor
erequi
rement
s.

Fi
g:Requi
rement
sandGat
her
ing

Anal
ysi
sSt
age

Thepl
anni
ngst
ageest
abl
i
shesabi
rd'
sey
evi
ew oft
hei
ntendedsof
twar
epr
oduct
,
andusest
hist
oest
abl
i
sht
hebasi
cpr
ojectst
ruct
ure,ev
aluat
efeasi
bil
i
tyandr
isks
associ
ated
wi
tht
he pr
oject
,and
descr
ibe
appr
opr
iat
e

managementandt
echni
cal
appr
oaches.

Fi
g:Anal
ysi
sst
age

Desi
gni
ngSt
age

6
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Thedesi
gnst
aget
akesasi
tsi
nit
iali
nputt
her
equi
rement
sident
if
iedi
nthe
appr
ovedr
equi
rement
sdocument
.Foreachr
equi
rement
,asetofoneormor
e
desi
gnel
ement
swi
l
lbepr
oduced asar
esul
tofi
nter
views,wor
kshops,and/
or
pr
otot
ypeef
for
ts.

Fi
g:Desi
gnst
age

Dev
elopment(
Codi
ng)St
age

The dev
elopmentst
age t
akes as i
ts pr
imar
yinputt
he desi
gn el
ement
s
descr
ibedi
ntheappr
oveddesi
gndocument
.Foreachdesi
gnel
ement
,asetofone
ormor
esof
twar
ear
ti
fact
swi
l
lbepr
oduced.

Fi
g:Dev
elopmentSt
age

I
ntegr
ati
on&TestSt
age

Dur
ingt
hei
ntegr
ati
onandt
estst
age,t
hesof
twar
ear
ti
fact
s,onl
i
nehel
p,and

7
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

t
estdat
a ar
e mi
grat
ed f
rom t
he dev
elopmentenv
ironmentt
o a separ
atet
est
env
ironment
.

Fi
g:I
ntegr
ati
onSt
age

I
nst
all
ati
on&Accept
anceTest

Dur
ingt
hei
nst
all
ati
onandaccept
ancest
age,t
hesof
twar
ear
ti
fact
s,onl
i
ne
hel
p,andi
nit
ial
product
iondat
aar
eloadedont
othepr
oduct
ionser
ver
.

Fi
g:I
nst
all
ati
on&Accept
anceTest

3.
SYSTEM DESI
GN

8
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Sy
stemsdesi
gni
sthepr
ocessorar
tofdef
ini
ngt
hear
chi
tect
ure,
component
s,modul
es,
i
nter
faces,
anddat
aforasy
stem t
osat
isf
yspeci
fi
edr
equi
rement
s.Onecoul
dseei
tas
t
heappl
i
cat
ionofsy
stemst
heor
ytopr
oductdev
elopment
.
DATAFLOW DI
AGRAM
TheDFDi
sal
soknow asadat
afl
ow gr
aphorabubbl
echar
t.DFDsar
ethe
modeloft
hepr
oposedsy
stem.Theycl
ear
lyshoul
dshow t
her
equi
rement
sonwhi
ch
t
henewsy
stem shoul
dbebui
l
t.
1.Pr
ocess:Peopl
e,pr
ocedur
es,
ordev
icest
hatuseorpr
oduce(
Transf
orm)Dat
a.The
phy
sical
componenti
snoti
dent
if
ied.

Pr
oces 0
s I
nfor
mati
on
pr
ocess

2.Dat
aSt
ore:
Her
edat
aar
est
oredorr
efer
encedbyapr
ocessi
ntheSy
stem.

Dat
ast
ore

3.Dat
afl
ow:
Dat
afl
owsar
epi
pel
i
nest
hroughwhi
chpacket
sofi
nfor
mat
ionf
low.Label
t
hear
rowswi
tht
henameoft
hedat
athatmov
est
hroughi
t.

4.Ext
ernalEnt
it
y: Ext
ernalent
it
iesar
eobj
ect
sout
sidet
hesy
stem,wi
thwhi
cht
he
sy
stem communi
cat
es.Ext
ernalent
it
iesar
esour
cesanddest
inat
ionsoft
hesy
stem'
s
i
nput
sandout
put
s.

Ext
ernal
Ent
ity

Cont
ext(
Lev
el0)DFD
Themaj
orobj
ect
iveofacont
extdi
agr
am i
stopr
ovi
deagr
aphi
cal
repr
esent
ati
on
oft
hewhol
esy
stem.AsIst
atedear
li
eri
tconsi
stsofal
lthesy
stem boundar
ies,
allt
he
9
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

ext
ernalent
it
iest
hati
nter
actwi
tht
hesy
stem andmaj
ordat
afl
owbet
weent
heent
it
ies
i
nthesy
stem.
DATABASEDESI
GN

E-
RDi
agr
am

The Ent
it
y-Rel
ati
onshi
p(ER)modelwas or
igi
nal
l
ypr
oposed byPet
eri
n 1976
[
Chen76]asawayt
ouni
fyt
henet
wor
kandr
elat
ional
dat
abasev
iews.Si
mpl
yst
atedt
he
ER modeli
sa concept
ualdat
a modelt
hatv
iewst
he r
ealwor
ld asent
it
iesand
r
elat
ionshi
ps.
Connect
ivi
tyandCar
dinal
i
ty
Thebasi
cty
pesofconnect
ivi
tyf
orr
elat
ionsar
e:one-
to-
one,
one-
to-
many
,andmany
-
to-
many
.
 Aone-
to-
one(
1:1)r
elat
ionshi
piswhenatmostonei
nst
anceofanent
it
yAi
s
associ
ated wi
th one i
nst
ance ofent
it
yB.Forexampl
e,"
empl
oyees i
nthe
companyar
eeachassi
gnedt
hei
rownof
fi
ce.
 Aone-
to-
many(
1:N)r
elat
ionshi
psi
swhenf
oronei
nst
anceofent
it
yA,
ther
ear
e
zer
o,one,
ormanyi
nst
ancesofent
it
yB,
butf
oronei
nst
anceofent
it
yB,
ther
eis
onl
yonei
nst
anceofent
it
yA.An exampl
eofa 1:An N r
elat
ionshi
pisa
depar
tmenthasmanyempl
oyeeseachempl
oyeei
sassi
gnedt
oonedepar
tment
.
 Amany
-to-
many(
M:N)r
elat
ionshi
p,somet
imescal
l
ednon-
speci
fi
c,i
swhenf
or
onei
nst
anceofent
it
yA,t
her
ear
ezer
o,one,ormanyi
nst
ancesofent
it
yBand
f
oronei
nst
anceofent
it
yBt
her
ear
ezer
o,one,
ormanyi
nst
ancesofent
it
yA.

ERNot
ati
on
Ther
eisnost
andar
dforr
epr
esent
ingdat
aobj
ect
sinERdi
agr
ams.Al
lnot
ati
onal
st
ylesr
epr
esentent
it
iesasr
ect
angul
arboxesandr
elat
ionshi
psasl
i
nesconnect
ing
boxes.Eachst
yleusesaspeci
alsetofsy
mbol
stor
epr
esentt
hecar
dinal
i
tyofa
connect
ion.Thenot
ati
onusedi
nthi
sdocumenti
sfr
om Mar
ti
n.
Ent
it
y:Anent
it
yisanobj
ectorconceptaboutwhi
chy
ouwantt
ost
orei
nfor
mat
ion.

Ent
it
y

WeakEnt
it
y:Aweakent
it
yisanent
it
ythatmustdef
inedbyaf
orei
gnkeyr
elat
ionshi
p
wi
thanot
herent
it
yasi
tcannotbeuni
quel
yident
if
iedbyi
tsownat
tr
ibut
esal
one.

10
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Ent
it
y

KeyAt
tri
but
e:Akeyat
tr
ibut
eist
heuni
que,di
sti
ngui
shi
ngchar
act
eri
sti
coft
heent
it
y.
Forexampl
e,an empl
oyee'
ssoci
alsecur
it
ynumbermi
ghtbet
heempl
oyee'
skey
at
tr
ibut
e.

At
tri
but
e

Mul
tiVal
uedAt
tri
but
e:A mul
tiv
aluedat
tri
but
ecanhav
emor
ethanonev
alue.For
exampl
e,anempl
oyeeent
it
ycanhav
emul
ti
pleski
l
lval
ues.

At
tri
but
e

Der
ivedAt
tri
but
e:Ader
ivedat
tri
but
eisbasedonanot
herat
tr
ibut
e.Forexampl
e,an
empl
oyee'
smont
hlysal
aryi
sbasedont
heempl
oyee'
sannual
sal
ary
.

At
tri
but
e

Rel
ati
onshi
ps:Rel
ati
onshi
ps i
l
lust
rat
e how t
wo ent
it
ies shar
einf
ormat
ion i
nthe
dat
abasest
ruct
ure.

Car
dinal
i
ty:Car
dinal
i
tys
Rep
le
atc
i
oni
f
si
eshowmanyi
nst
ancesofanent
it
yrel
atet
oonei
nst
ance
hi
p
ofanot
herent
it
y.

11
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Recur
siv
erel
ati
onshi
p:I
n some cases,ent
it
ies can be sel
f-
li
nked.Forexampl
e,
empl
oyeescansuper
viseot
herempl
oyees.

E-
Rdi
agr
am

Nor
mal
i
zat
ion

A Dat
abasei
sacol
l
ect
ionofi
nter
rel
ateddat
ast
oredwi
thami
nimum of
r
edundancyt
oser
vemanyappl
i
cat
ions.Thedat
abasedesi
gni
susedt
ogr
oupdat
a
i
ntoanumberoft
abl
esandmi
nimi
zest
hear
ti
fi
cial
i
tyembeddedi
nusi
ngsepar
ate
f
il
es.Thet
abl
esar
eor
gani
zedt
o:

Fi
rstNor
mal
For
m:

Ar
elat
ion R i
sinf
ir
stnor
malf
orm i
fand onl
yifal
lunder
lyi
ng domai
ns
cont
ainedat
omi
cval
uesonl
y.

SecondNor
mal
For
m:

12
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Ar
elat
ionRi
ssai
dtobei
nsecondnor
malf
ormi
fandonl
yifi
tisi
nfi
rstnor
mal
f
orm andev
erynon-
keyat
tri
but
eisf
ull
ydependentont
hepr
imar
ykey
.

Thi
rdNor
mal
For
m:

Ar
elat
ionRi
ssai
dtobei
nthi
rdnor
malf
ormi
fandonl
yifi
tisi
nsecondnor
mal
f
orm andev
erynonkeyat
tri
but
eisnont
ransi
ti
vel
ydependont
hepr
imar
ykey
.

UMLDI
AGRAMS
Uni
fi
edModel
i
ngLanguage:Uni
fi
edModel
i
ngLanguage 
(UML)i
sast
andar
dized
gener
al-
pur
pose 
model
i
ngl
anguagei
nthef
iel
dof
 obj
ect
-or
ient
ed 
sof
twar
eengi
neer
ing.

Fi
g:UMLdi
agr
am

UseCaseDi
agr
am

Usecasedi
agr
amsmodelt
hef
unct
ional
i
tyofasy
stem usi
ngact
orsanduse
cases.Usecasesar
eser
vicesorf
unct
ionspr
ovi
dedbyt
hesy
stem t
oit
suser
s.

Sy
stem:Dr
aw y
oursy
stem'
sboundar
iesusi
ngar
ect
angl
ethatcont
ainsusecases.
Pl
aceact
orsout
sidet
hesy
stem'
sboundar
ies.

13
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

UseCase:Dr
awusecasesusi
ngov
als.Labelwi
thov
alswi
thv
erbst
hatr
epr
esentt
he
sy
stem'
sfunct
ions.

Act
ors:Act
orsar
etheuser
sofasy
stem.Whenonesy
stem i
stheact
orofanot
her
sy
stem,l
abelt
heact
or sy
stem wi
tht
heact
orst
ereot
ype.

Rel
ati
onshi
ps:I
ll
ust
rat
erel
ati
onshi
psbet
weenanact
orandausecasewi
thasi
mpl
e
l
i
ne.Forr
elat
ionshi
psamongusecases,usear
rowsl
abel
edei
ther"
uses"or"
ext
ends.
"
A"
uses"r
elat
ionshi
pindi
cat
est
hatoneusecasei
sneededbyanot
heri
nor
dert
o
per
for
m at
ask.An"
ext
ends"r
elat
ionshi
pindi
cat
esal
ter
nat
iveopt
ionsunderacer
tai
n
usecase.

14
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

SequenceDi
agr
am

Sequence di
agr
ams descr
ibe i
nter
act
ions among cl
asses i
nter
ms ofan
exchangeofmessagesov
ert
ime.Basi
cSequenceDi
agr
am Sy
mbol
sandNot
ati
ons

15
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

ComponentDi
agr
am

Acomponentdi
agr
am descr
ibest
heor
gani
zat
ionoft
hephy
sicalcomponent
sin
asy
stem.
Component
:Acomponenti
saphy
sicalbui
l
dingbl
ockoft
hesy
stem.I
tisr
epr
esent
ed
asar
ect
angl
ewi
tht
abs.

ComponentDi
agr
am:

Fi
g:ComponentDi
agr
am

Depl
oymentDi
agr
am
Depl
oymentdi
agr
amsdepi
ctt
hephy
sical
resour
cesi
nasy
stem i
ncl
udi
ngnodes,
component
s,andconnect
ions.

Fi
g:Depl
oymentdi
agr
am

16
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Cl
assDi
agr
am

Cl
asses r
epr
esent an abst
ract
ion of ent
it
ies wi
th common char
act
eri
sti
cs.
Associ
ati
onsr
epr
esentt
her
elat
ionshi
psbet
weencl
asses.

Fi
g:Cl
assdi
agr
am

Col
l
abor
ati
onDi
agr
am
A col
l
aborati
on diagram descr
ibes i
nteracti
ons among obj ect
si nterms of
sequencedmessages.Col l
aborat
iondi
agramsr epresentacombi nati
onofinfor
mat i
on
takenfr
om class,
sequence,andusecasediagramsdescr ibingboththestat
icst
ruct
ure
and dynamic behavi
orofa sy st
em.Basic Col labor
ation Diagr
am Sy mbols and
Notati
ons.

17
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Act
ivi
tyDi
agr
am

Anact
ivi
tydi
agr
am i
l
lust
rat
est
hedy
nami
cnat
ureofasy
stem bymodel
i
ngt
he
f
low ofcont
rolf
rom act
ivi
tyt
oact
ivi
ty.Anact
ivi
tyr
epr
esent
sanoper
ati
ononsome
cl
assi
nthesy
stem t
hatr
esul
tsi
nachangei
nthest
ateoft
hesy
stem.

18
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

4.SYSTEM I
MPLEMENTATI
ON

4.
1CODI
NG
<!
DOCTYPEht
ml>
<ht
mll
ang="
en"
>
<head>
<met
achar
set
="ut
f-
8">
<meta name="
viewpor
t" cont
ent
="wi
dth=dev
ice-
widt
h, i
nit
ial
-scal
e=1, shr
ink-
to-
fi
t=no"
>
<met
aname="
descr
ipt
ion"cont
ent
=""
>
<met
aname="
aut
hor
"cont
ent
=""
>
<l
ink href="
vendor
/font
awesome-
fr
ee/
css/
all
.
min.
css" r
el="
sty
lesheet
"
ty
pe="t
ext
/css">
<li
nk href
="https://
fonts.
googl
eapi
s.com/
css?
fami
l
y=Mont
ser
rat
:400,
700"
rel
="st
ylesheet
"ty
pe="text/css">
<li
nk
href="
https:
//f
onts.
googleapis.
com/
css?
fami
l
y=Lat
o:400,
700,
400i
tal
i
c,700i
tal
i
c"
rel
="sty
lesheet"t
ype="
text/css"
>
<!
--ThemeCSS-
->
<l
i
nkhr
ef="
css/
freel
ancer
.mi
n.css"r
el="
sty
lesheet
">
<l
i
nkhr
ef="
css/
sampl
e.css"r
el="
sty
lesheet
">
<l
i
nkrel
="st
ylesheet
"
hr
ef="
htt
ps://maxcdn.
boot
str
apcdn.
com/
boot
str
ap/
3.3.
7/css/
boot
str
ap.
min.
css"
>
<l
ink r
el="st
ylesheet
" hr
ef="
htt
ps:
//maxcdn.
boot
str
apcdn.
com/
font
-
awesome/
4.7.
0/css/f
ont -
awesome.
min.
css"
>

19
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

</
head>
<bodyi
d="
page-
top"
>
<!
--Nav
igat
ion-
->
<nav class="
nav
bar nav
bar
-expand-
lg bg-
secondar
y t
ext
-upper
case f
ixed-
top"
i
d="mainNav">
<di
vcl
ass="
cont
ainer
">
<a class="
navbar-
brand j s-
scr
oll
-t
ri
gger
" hr
ef="
#page-
top"
>Aut
omat
ic BackUp
Appl
i
cationForOrganizat
ion</a>
<br
>
<butt
oncl ass="navbar-
togglernavbar-
toggler-
ri
ghttext
-uppercasefont-wei
ght
-bold
bg-pr
imary t ext-whit
e r ounded" type="butt
on" dat a-
toggle="
coll
apse" data-
tar
get="
#nav barResponsive" ari
a-contr
ols="
navbarResponsiv
e" ari
a-
expanded="fal
se"aria-
label="Toggl
enavigati
on">
Menu
<i
class="
fasf
a-bar
s"></
i>
</
but
ton>
<di
vcl
ass="
col
l
apsenav
bar
-col
l
apse"i
d="
nav
bar
Responsi
ve"
>
<ul
class="
nav
bar
-navml
-aut
o">
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a class="nav-
li
nk py-3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
request1.j
sp">Request</a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a class="
nav-l
i
nk py
-3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
view1.j
sp">Vi
ew</
a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a class="nav-l
ink py-
3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
report.
jsp">Report
s</a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a cl
ass="
nav
-li
nk py
-3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"

20
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

hr
ef="
index
.ht
ml"
>Logout</
a>
</
li
>
</
ul>
</
div
>
</
div
>
</
nav
>
<!
--Mast
head-
->
<headercl
ass="
mast
headbg-
pri
mar
ytext
-whi
tet
ext
-cent
er"
>
<di
vcl
ass="
cont
ainerd-
fl
exal
i
gn-
it
ems-
cent
erf
lex-
col
umn"
>
<!
--Mast
headAv
atarI
mage-
->
<i
mgcl
ass="
mast
head-
avat
armb-
5"sr
c="
img/
back.
png"al
t="
">
<!
--Mast
headHeadi
ng-
->
<h1cl
ass="
masthead-
headi
ngt
ext
-Capi
tal
i
zemb-
0">Aut
omat
icBackupAppl
i
cat
ion
ForOr
gani
zati
on</
h1>
<!
--I
conDi
vi
der-
->
<di
vcl
ass="
div
ider
-cust
om di
vi
der
-l
ight
">
<di
vcl
ass="
div
ider
-cust
om-
li
ne"
></
div
>
<di
vcl
ass="
div
ider
-cust
om-
icon"
>
<i
class="
fasf
a-st
ar"
></
i>
</
div
>
<di
vcl
ass="
div
ider
-cust
om-
li
ne"
></
div
>
</
div
>
<!
--Mast
headSubheadi
ng-
->
<!
-- <pcl ass="
masthead-
subheadi
ngf
ont
-wei
ght
-l
ightmb-
0">Gr
aphi
cAr
ti
st-Web
Desi
gner-I
ll
ustr
ator
</p>
-
->
</
div
>
</
header
>
<!
--Por
tfol
i
oModal
6--
>

21
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

<di
v cl ass="por
tfol
i
o-modal modal fade" id="port
fol
ioModal6" tabi
ndex="
-1"
rol
e="
dialog"ari
a-l
abell
edby
="por
tfol
i
oModal
6Label"ari
a-hi
dden="
tr
ue">
<di
vcl
ass="
modal
-di
alogmodal
-xl
"rol
e="
document
">
<di
vcl
ass="
modal
-cont
ent
">
<but
tont
ype="
but
ton"cl
ass="
close"dat
a-di
smi
ss="
modal
"ar
ia-
label
="Cl
ose"
>
<spanar
ia-
hidden="
tr
ue"
>
<i
class="
fasf
a-t
imes"
></
i>
</
span>
</
but
ton>
<di
vcl
ass="
modal
-bodyt
ext
-cent
er"
>
<di
vcl
ass="
cont
ainer
">
<di
vcl
ass="
rowj
ust
if
y-cont
ent
-cent
er"
>
<di
vcl
ass="
col
-l
g-8"
>
<!
--Por
tfol
i
oModal
-Ti
tl
e--
>
<h2 cl
ass="
por
tfol
i
o-modal
-t
it
le t
ext
-secondar
y t
ext
-upper
case mb-
0">Submar
ine</
h2>
<!
--I
conDi
vi
der-
->
<di
vcl
ass="
div
ider
-cust
om"
>
<di
vcl
ass="
div
ider
-cust
om-
li
ne"
></
div
>
<di
vcl
ass="
div
ider
-cust
om-
icon"
>
<i
class="
fasf
a-st
ar"
></
i>
</
div
>
<di
vcl
ass="
div
ider
-cust
om-
li
ne"
></
div
>
</
div
>
<!
--Por
tfol
i
oModal
-Image-
->
<i
mgcl
ass="
img-
fl
uidr
oundedmb-
5"sr
c="
img/
por
tfol
i
o/submar
ine.
png"al
t="
">
<!
--Por
tfol
i
oModal
-Text-
->
<pclass="
mb-5">Lorem ipsum dolorsitamet ,consectet
uradipi
sici
ngeli
t.Mollit
ia
nequeassumendai psam nihi
l,molest
iasmagnam,r ecusandaequosquisinventore
qui
squam v el
i
tasper i
ores,vitae?Repr ehenderi
tsoluta,eos quod consequuntur
i
taque.Nam.</p>

22
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

<but
toncl
ass="
btnbt
n-pr
imar
y"hr
ef="
#"dat
a-di
smi
ss="
modal
">
<i
class="
fasf
a-t
imesf
a-f
w"></
i>
Cl
oseWi
ndow
</
but
ton>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<!
--Boot
str
apcor
eJav
aScr
ipt-
->
<scr
iptsr
c="
vendor
/j
quer
y/j
quer
y.mi
n.j
s"></
scr
ipt
>
<scr
iptsr
c="
vendor
/boot
str
ap/
js/
boot
str
ap.
bundl
e.mi
n.j
s"></
scr
ipt
>
<!
--Pl
ugi
nJav
aScr
ipt-
->
<scr
iptsr
c="
vendor
/j
quer
y-easi
ng/
jquer
y.easi
ng.
min.
js"
></
scr
ipt
>
<!
--Cont
actFor
m Jav
aScr
ipt-
->
<scr
iptsr
c="
js/
jqBoot
str
apVal
i
dat
ion.
js"
></
scr
ipt
>
<scr
iptsr
c="
js/
cont
act
_me.
js"
></
scr
ipt
>
<!
--Cust
om scr
ipt
sfort
hist
empl
ate-
->
<scr
iptsr
c="
js/
freel
ancer
.mi
n.j
s"></
scr
ipt
>
</
body
>
</
html
>
<!
DOCTYPEht
ml>
<%@pagei
mpor
t="
jav
a.i
o.Fi
l
eReader
"%>
<%@pagei
mpor
t="
jav
a.i
o.Buf
fer
edReader
"%>
<%@pagei
mpor
t="
jav
a.ut
il
.*
"%>
<ht
mll
ang="
en"
>

23
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

<head>
<met
achar
set
="ut
f-
8">
<meta name="
viewpor
t" cont
ent
="wi
dth=dev
ice-
widt
h, i
nit
ial
-scal
e=1, shr
ink-
to-
fi
t=no"
>
<met
aname="
descr
ipt
ion"cont
ent
=""
>
<met
aname="
aut
hor
"cont
ent
=""
>
<l
ink href="
vendor
/font
awesome-
fr
ee/
css/
all
.
min.
css" r
el="
sty
lesheet
"
ty
pe="t
ext
/css">
<li
nk href
="https://
fonts.
googl
eapi
s.com/
css?
fami
l
y=Mont
ser
rat
:400,
700"
rel
="st
ylesheet
"ty
pe="text/css">
<li
nk
href="
https:
//f
onts.
googleapis.
com/
css?
fami
l
y=Lat
o:400,
700,
400i
tal
i
c,700i
tal
i
c"
rel
="sty
lesheet"t
ype="
text/css"
>
<!
--ThemeCSS-
->
<l
i
nkhr
ef="
css/
freel
ancer
.mi
n.css"r
el="
sty
lesheet
">
<l
i
nk rel
="st
ylesheet
"
hr
ef="
htt
ps:
//maxcdn.
boot
str
apcdn.
com/
boot
str
ap/
3.3.
7/css/
boot
str
ap.min.
css">
<l
ink r
el="st
ylesheet
" hr
ef="
htt
ps:
//maxcdn.
boot
str
apcdn.
com/
font
-
awesome/
4.7.
0/css/f
ont -
awesome.
min.
css"
>
</
head>
<bodyi
d="
page-
top"
>
<!
--Nav
igat
ion-
->
<nav class="
nav
bar nav
bar
-expand-
lg bg-
secondar
y t
ext
-upper
case f
ixed-
top"
i
d="mainNav">
<di
vcl
ass="
cont
ainer
">
<acl
ass="
nav
bar
-br
andj
s-scr
oll
-t
ri
gger
"hr
ef="
#page-
top"
></
a>
<br
>
<butt
oncl ass="navbar-
togglernavbar-
toggler-
ri
ghttext
-uppercasefont-wei
ght
-bold
bg-pr
imary t ext-whit
e r ounded" type="butt
on" dat a-
toggle="
coll
apse" data-
tar
get="
#nav barResponsive" ari
a-contr
ols="
navbarResponsiv
e" ari
a-
expanded="fal
se"aria-
label="Toggl
enavigati
on">
Menu
<i
class="
fasf
a-bar
s"></
i>

24
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

</
but
ton>
<di
vcl
ass="
col
l
apsenav
bar
-col
l
apse"i
d="
nav
bar
Responsi
ve"
>
<ul
class="
nav
bar
-navml
-aut
o">
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a class="nav-
li
nk py
-3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
index.ht
ml "
>Home</
a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a cl
ass="
nav-
li
nk py-
3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
upl
oad.j
sp"
>Upload</
a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a class="
nav-l
i
nk py
-3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
view.j
sp">Vi
ew</
a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a cl
ass="nav-
li
nk py
-3 px-
0 px-
lg-
3rounded j
s-scr
oll
-t
ri
gger
"hr
ef="
pre.
jsp"
>Pr
e
pr
ocessing</a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a cl
ass="nav-l
i
nk py-
3 px-0 px-l
g-3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
mali
cious.j
sp">Mal
i
ciousIdenti
fi
cati
on</a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a cl
ass="
nav-
li
nk py-
3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
sear
ch.j
sp"
>Sear
ch</
a>
</
li
>
<l
icl
ass="
nav
-it
em mx-
0mx-
lg-
1">
<a class="
nav-l
i
nk py
-3 px-
0 px-
lg-
3 r
ounded j
s-scr
oll
-t
ri
gger
"
hr
ef="
graph.j
sp">Gr
aph</
a>
</
li
>

25
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

</
ul>
</
div
>
</
div
>
</
nav
>
<h1cl
ass="
mast
head-
headi
ngt
ext
-Capi
tal
i
zemb-
0"></
h1>
<!
--I
conDi
vi
der-
->
</
div
>
<marquee><h1class="
mast head-
headi
ngt
ext-
Capit
alizemb-0"
>ProGuard:Det
ect
ing
Mali
cious Accounts in &nbsp;
Social-
Net
work-Based Onl
ine
Promotions</
h1></marquee>
</
header
>
<cent
er>
<h2Sty
le="
col
or:
red";
>Vi
ewFiles</
h2 <t
abl
ebor
der
="2"wi
dth="
100%"st
yle="
texe-
al
ignment:
cent
er"f
ont-
weight
:700;>
<t
r>
&nbsp;
<t
d><f
ontst
yle="
col
or:
red"
>Id</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Username</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Logi
nst
atus</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Emai
li
d</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Fi
ends</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Ser
vices</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Rechar
gePr
omot
ionact
ivi
ti
es</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Tot
alExpendi
tur
e</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Expendi
tur
eforbank</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Expendi
tur
eforgi
ft
s</
font
></
td>
<t
d><f
ontst
yle="
col
or:
red"
>Ipaddr
ess</
font
></
td>
</
tr>
<%
i
ntcount=0;

26
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

i
ntcount
1=0;
Ar
ray
List
<St
ri
ng>al
2=newAr
ray
List
();
Li
stal
1=newAr
ray
List
();
/
/Li
nkedHashMap<I
nteger
,St
ri
ng>l
l
=newLi
nkedHashMap(
);
Li
stl
l=newAr
ray
List
();
St
ri
ngf=(
Str
ing)sessi
on.
get
Att
ri
but
e("
fi
le"
);
Buff
eredReader br = new Buf
fer
edReader
(new
Fi
leReader
("C:
/User
s/Raj
i
ya/Deskt
op/
"+f)
);
St
ri
ngk="
";
whi
l
e((
k=br
.r
eadLi
ne(
))!
=nul
l
){
count
1=count
1+1;
St
ri
ng[
]s=k.
spl
i
t("
,"
);
%>
<t
r>
<%
f
or(
inti
=0;
i<s.
lengt
h;i
++){
%>
<t
d>
<%
out
.pr
int
ln(
s[i
])
;
%>
</
td>
<%
}
%>
</
tr>
<%
}
/
/ll
=di
s.di
s(f
);

27
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

/
*ll
=Di
stance.
mai
n(f
);
Sy
stem.
out
.pr
int
ln(
ll
);*
/
%>
</
tabl
e>
</
cent
er>
<di
v cl ass="por
tfol
i
o-modal modal fade" id="port
fol
ioModal6" tabi
ndex="
-1"
rol
e="
dialog"ari
a-l
abell
edby
="por
tfol
i
oModal
6Label"ari
a-hi
dden="
tr
ue">
<di
vcl
ass="
modal
-di
alogmodal
-xl
"rol
e="
document
">
<di
vcl
ass="
modal
-cont
ent
">
<but
tont
ype="
but
ton"cl
ass="
close"dat
a-di
smi
ss="
modal
"ar
ia-
label
="Cl
ose"
>
<spanar
ia-
hidden="
tr
ue"
>
<i
class="
fasf
a-t
imes"
></
i>
</
span>
</
but
ton>
<di
vcl
ass="
modal
-bodyt
ext
-cent
er"
>
<di
vcl
ass="
cont
ainer
">
<di
vcl
ass="
rowj
ust
if
y-cont
ent
-cent
er"
>
<di
vcl
ass="
col
-l
g-8"
>
<!
--Por
tfol
i
oModal
-Ti
tl
e--
>
<h2 cl
ass="
por
tfol
i
o-modal
-t
it
le t
ext
-secondar
y t
ext
-upper
case mb-
0">Submar
ine</
h2>
<!
--I
conDi
vi
der-
->
<di
vcl
ass="
div
ider
-cust
om"
>
<di
vcl
ass="
div
ider
-cust
om-
li
ne"
></
div
>
<di
vcl
ass="
div
ider
-cust
om-
icon"
>
<i
class="
fasf
a-st
ar"
></
i>
</
div
>
<di
vcl
ass="
div
ider
-cust
om-
li
ne"
></
div
>
</
div
>

28
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

<!
--Por
tfol
i
oModal
-Image-
->
<i
mgcl
ass="
img-
fl
uidr
oundedmb-
5"sr
c="
img/
por
tfol
i
o/submar
ine.
png"al
t="
">
<!
--Por
tfol
i
oModal
-Text-
->
<pclass="
mb-5">Lorem ipsum dolorsitamet ,consectet
uradipi
sici
ngeli
t.Mollit
ia
nequeassumendai psam nihi
l,molest
iasmagnam,r ecusandaequosquisinventore
qui
squam v el
i
tasper i
ores,vitae?Repr ehenderi
tsoluta,eos quod consequuntur
i
taque.Nam.</p>
<but
toncl
ass="
btnbt
n-pr
imar
y"hr
ef="
#"dat
a-di
smi
ss="
modal
">
<i
class="
fasf
a-t
imesf
a-f
w"></
i>
Cl
oseWi
ndow
</
but
ton>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<!
--Boot
str
apcor
eJav
aScr
ipt-
->
<scr
iptsr
c="
vendor
/j
quer
y/j
quer
y.mi
n.j
s"></
scr
ipt
>
<scr
iptsr
c="
vendor
/boot
str
ap/
js/
boot
str
ap.
bundl
e.mi
n.j
s"></
scr
ipt
>
<!
--Pl
ugi
nJav
aScr
ipt-
->
<scr
iptsr
c="
vendor
/j
quer
y-easi
ng/
jquer
y.easi
ng.
min.
js"
></
scr
ipt
>
<!
--Cont
actFor
m Jav
aScr
ipt-
->
<scr
iptsr
c="
js/
jqBoot
str
apVal
i
dat
ion.
js"
></
scr
ipt
>
<scr
iptsr
c="
js/
cont
act
_me.
js"
></
scr
ipt
>
<!
--Cust
om scr
ipt
sfort
hist
empl
ate-
->
<scr
iptsr
c="
js/
freel
ancer
.mi
n.j
s"></
scr
ipt
>
</
body
>
</
html
>

29
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

4.
2TESTI
NG
Thepur
poseoft
est
ingi
stodi
scov
erer
ror
s.Test
ingi
sthepr
ocessoft
ryi
ng
t
odi
scov
erev
eryconcei
vabl
efaul
torweaknessi
nawor
kpr
oduct
.Itpr
ovi
desaway
t
ocheckt
hef
unct
ional
i
tyofcomponent
s,subassembl
i
es,
assembl
i
esand/
ora
f
ini
shedpr
oductI
tist
hepr
ocessofexer
cisi
ngsof
twar
ewi
tht
hei
ntentofensur
ing
t
hatt
heSof
twar
esy
stem meet
sit
srequi
rement
sanduserexpect
ati
onsanddoesnot
f
ail
inanunaccept
abl
emanner
.Ther
ear
evar
ioust
ypesoft
est
.Eacht
estt
ype
addr
essesaspeci
fi
ctest
ingr
equi
rement
.

I
nor
dert
omakesur
ethatt
hesy
stem doesnothav
eer
ror
s,t
hedi
ff
erentl
evel
sof
t
est
ingst
rat
egi
est
hatar
eappl
i
edatdi
ff
eri
ngphasesofsof
twar
edev
elopmentar
e:

Uni
tTest
ing:

Uni
ttest
ingi
susual
l
yconduct
edaspar
tofacombi
nedcodeanduni
ttestphaseof
t
hesof
twar
eli
fecy
cle,
alt
houghi
tisnotuncommonf
orcodi
nganduni
ttest
ingt
obe
conduct
edast
wodi
sti
nctphases.

Eachmodul
ecanbet
est
edusi
ngt
hef
oll
owi
ngt
woSt
rat
egi
es:

Bl
ackBoxTest
ing:

Bl
ackBoxTest
ingi
stest
ingt
hesof
twar
ewi
thoutanyknowl
edgeoft
hei
nner
wor
kings,
str
uct
ureorl
anguageoft
hemodul
ebei
ngt
est
ed.Bl
ackboxt
est
s,asmost
ot
herki
ndsoft
est
s,mustbewr
it
tenf
rom adef
ini
ti
vesour
cedocument
,suchas
speci
fi
cat
ionorr
equi
rement
sdocument
,suchasspeci
fi
cat
ionorr
equi
rement
s
document
.Iti
sat
est
ingi
nwhi
cht
hesof
twar
eundert
esti
str
eat
ed,
asabl
ackbox
.
youcannot“
see”i
ntoi
t.Thet
estpr
ovi
desi
nput
sandr
espondst
oout
put
swi
thout
consi
der
inghowt
hesof
twar
ewor
ks.

Whi
teBoxt
est
ing:
Whi
teBoxTest
ingi
sat
est
ingi
nwhi
chi
nwhi
cht
hesof
twar
etest
erhasknowl
edge
oft
hei
nnerwor
kings,
str
uct
ureandl
anguageoft
hesof
twar
e,oratl
easti
tspur
pose.
I
tispur
pose.I
tisusedt
otestar
east
hatcannotber
eachedf
rom abl
ackboxl
evel
.

I
ntegr
ati
ngTest
ing:

30
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Sof
twar
eint
egr
ati
ont
est
ingi
sthei
ncr
ement
ali
ntegr
ati
ont
est
ingoft
woormor
e
i
ntegr
atedsof
twar
ecomponent
sonasi
ngl
epl
atf
ormt
opr
oducef
ail
urescausedby
i
nter
facedef
ect
s.

Thet
askoft
hei
ntegr
ati
ont
esti
stocheckt
hatcomponent
sorsof
twar
eappl
i
cat
ions,
e.
g.component
sinasof
twar
esy
stem or–onest
epup–sof
twar
eappl
i
cat
ionsat
t
hecompanyl
evel
–int
eractwi
thouter
ror
.

TestResul
ts:
All
thet
estcasesment
ionedabov
epassedsuccessf
ull
y.Nodef
ect
s
encount
ered.

Sy
stem Test
ing:

Sy
stem t
est
ingensur
est
hatt
heent
ir
eint
egr
atedsof
twar
esy
stem meet
s
r
equi
rement
s.I
ttest
saconf
igur
ati
ont
oensur
eknownandpr
edi
ctabl
eresul
ts.An
exampl
eofsy
stem t
est
ingi
stheconf
igur
ati
onor
ient
edsy
stem i
ntegr
ati
ont
est
.
Sy
stem t
est
ingi
sbasedonpr
ocessdescr
ipt
ionsandf
lows,
emphasi
zi
ngpr
e-dr
iven
pr
ocessl
i
nksandi
ntegr
ati
onpoi
nts.

Accept
anceTest
ing:

UserAccept
anceTest
ingi
sacr
it
ical
phaseofanypr
ojectandr
equi
ressi
gni
fi
cant
par
ti
cipat
ionbyt
heenduser
.Ital
soensur
est
hatt
hesy
stem meet
sthef
unct
ional
r
equi
rement
s.

TestResul
ts:
All
thet
estcasesment
ionedabov
epassedsuccessf
ull
y.Nodef
ect
s
encount
ered.

TestAppr
oach:

Fi
eldt
est
ingwi
l
lbeper
for
medmanual
l
yandf
unct
ional
test
swi
l
lbewr
it
teni
ndet
ail
.

Testobj
ect
ives
 Al
lfi
eldent
ri
esmustwor
kpr
oper
ly.
 Pagesmustbeact
ivat
edf
rom t
hei
dent
if
iedl
i
nk.
 Theent
ryscr
een,
messagesandr
esponsesmustnotbedel
ayed.
Feat
urest
obet
est
ed

31
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

 Ver
if
ythatt
heent
ri
esar
eoft
hecor
rectf
ormat
 Nodupl
i
cat
eent
ri
esshoul
dbeal
l
owed
 Al
ll
inksshoul
dtaket
heusert
othecor
rectpage.
Test
ingcanbedonei
ntwoway
s:
 Bot
tom upappr
oach
 Topdownappr
oach
Bot
tom upAppr
oach:

Test
ingcanbeper
for
medst
art
ingf
rom smal
l
estandl
owestl
evel
modul
esand
pr
oceedi
ngoneatat
ime.Foreachmodul
einbot
tom upt
est
ingashor
tpr
ogr
am
execut
est
hemodul
eandpr
ovi
dest
heneededdat
asot
hatt
hemodul
eisaskedt
o
per
for
mthewayi
twi
l
lwhenembeddedwi
thi
nthel
argersy
stem.Whenbot
tom l
evel
modul
esar
etest
edat
tent
iont
urnst
othoseont
henextl
evel
thatuset
hel
owerl
evel
onest
heyar
etest
edi
ndi
vi
dual
l
yandt
henl
i
nkedwi
tht
hepr
evi
ousl
yexami
nedl
ower
l
evel
modul
es.
Topdownappr
oach:

Thi
sty
peoft
est
ingst
art
sfr
om upperl
evelmodul
es.Si
ncet
hedet
ail
edact
ivi
ti
es
usual
l
yper
for
medi
nthel
owerl
evelr
out
inesar
enotpr
ovi
dedst
ubsar
ewr
it
ten.A
st
ubi
samodul
eshel
lcal
l
edbyupperl
evelmodul
eandt
hatwhenr
eachedpr
oper
ly
wi
l
lret
urn a message t
othe cal
l
ing modul
eindi
cat
ing t
hatpr
operi
nter
act
ion
occur
red.Noat
tempti
smadet
over
if
ythecor
rect
nessoft
hel
owerl
evel
modul
e.

Val
i
dat
ion:Thesy
stem hasbeent
est
edandi
mpl
ement
edsuccessf
ull
yandt
hus
ensur
ed t
hat al
lthe r
equi
rement
s as l
i
sted i
nthe sof
twar
erequi
rement
s
speci
fi
cat
ionar
ecompl
etel
yful
-f
il
led. I
ncaseofer
roneousi
nputcor
respondi
ng
er
rormessagesar
edi
spl
ayed.

4.
3SCREENSHOTS
HOMEPAGE:

32
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Upl
oad

Vi
ew

33
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Pr
epr
ocessi
ng

34
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Mal
i
cioususer
s

Sear
ch

35
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

36
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

37
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

38
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

5.CONCLUSI
ON
Thi
spaperpr
esent
sanov
elsy
stem,Pr
oGuar
d,t
o aut
omat
ical
l
y
det
ectmal
i
cious OSN account
sthatpar
ti
cipat
ein onl
i
ne pr
omot
ion ev
ent
s.
Pr
oGuar
dlev
eragest
hreecat
egor
iesoff
eat
uresi
ncl
udi
nggener
albehav
ior
,vi
rt
ual
-
cur
rency col
l
ect
ion,and v
irt
ual
-cur
rency usage.Exper
iment
alr
esul
ts based on
l
abel
l
ed dat
acol
l
ect
ed f
rom TencentQQ,agl
oball
eadi
ng OSN company
,hav
e
demonst
rat
ed t
he det
ect
ion accur
acyofPr
oGuar
d,whi
ch has achi
eved a hi
gh
det
ect
ionr
ateof96.
67%gi
venanext
remel
ylowf
alseposi
ti
ver
ateof0.
3%

39
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

6.FUTURESCOPE
Thi
ssy
stemhel
pst
heenduser
soft
hesy
stem i
ntr
ansact
ionst
hrought
heexi
sti
ng
dat
aandr
equi
redser
vices.Theoper
ati
onaluseri
nter
faceal
sohel
pst
heor
dinar
yuser
s
i
n managi
ng t
hei
rown i
nfor
mat
ion i
n a cust
omi
zed manneraspert
he i
ncl
uded
f
lex
ibi
l
iti
es
I
tisnotpossi
blet
odev
elopasy
stem t
hatmakesal
lther
equi
rement
soft
heuser
.
Userr
equi
rement
skeepchangi
ngast
hesy
stem i
sbei
ngused.Someoft
hef
utur
e
enhancement
sthatcanbedonet
othi
ssy
stem ar
e:

 Ast
het
echnol
ogyemer
ges,i
tispossi
blet
oupgr
adet
hesy
stem andcanbe
adapt
abl
etodesi
redenv
ironment
.
 Becausei
tisbasedonobj
ect
-or
ient
eddesi
gn,
anyf
urt
herchangescanbeeasi
l
y
adapt
abl
e.
 Basedont
hef
utur
esecur
it
yissues,secur
it
ycanbei
mpr
ovedusi
ngemer
ging

40
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

t
echnol
ogi
es.

7.APPENDI
CES
7.
1JAVA

Jav
atechnol
ogyi
sbot
hapr
ogr
ammi
ngl
anguageandapl
atf
orm.

TheJav
aPr
ogr
ammi
ngLanguage
TheJav
apr
ogr
ammi
ngl
anguagei
sahi
gh-
lev
ell
anguaget
hatcanbechar
act
eri
zed
byal
loft
hef
oll
owi
ngbuzzwor
ds:
 Si
mpl
e
 Ar
chi
tect
ureneut
ral
 Obj
ector
ient
ed
 Por
tabl
e

41
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

 Di
str
ibut
ed
 Hi
ghper
for
mance
 I
nter
pret
ed
 Mul
ti
thr
eaded
 Robust
 Dy
nami
c
 Secur
e
Wi
thmostpr
ogr
ammi
ngl
anguages,
youei
thercompi
l
eori
nter
pretapr
ogr
am sot
hat
y
oucanr
uni
tony
ourcomput
er.TheJav
apr
ogr
ammi
ngl
anguagei
sunusual
int
hat
apr
ogr
am i
sbot
hcompi
l
edandi
nter
pret
ed.Wi
tht
hecompi
l
er,
fir
sty
out
ransl
atea
pr
ogr
am i
ntoani
nter
medi
atel edJav
anguagecal
l aby
tecodes—t
hepl
atf
orm-
i
ndependentcodesi
nter
pret
edbyt
hei
nter
pret
eront
heJav
apl
atf
orm.The
i
nter
pret
erpar
sesandr
unseachJav
aby
tecodei
nst
ruct
ionont
hecomput
er.
Compi
l
ati
onhappensj
ustonce;
int
erpr
etat
ionoccur
seacht
imet
hepr
ogr
am i
s
execut
ed.Thef
oll
owi
ngf
igur
eil
l
ust
rat
eshowt
hiswor
ks.

Youcant
hinkofJav
aby
tecodesast
hemachi
necodei
nst
ruct
ionsf heJav
ort a
Vi
rt
ualMachi
ne(
Jav
aVM)
.Ev
eryJav
aint
erpr
eter
,whet
heri
t’
sadev
elopmentt
ool
or
aWebbr
owsert
hatcanr
unappl
ets,
isani
mpl
ement
ati
onoft
heJav
aVM.Jav
aby
te
codeshel
pmake“
wri
teonce,
runany
wher
e”possi
ble.Youcancompi
l
eyourpr
ogr
am
i
ntoby
tecodesonanypl
atf
ormt
hathasaJav
acompi
l
er.Theby
tecodescant
hen
ber
unonanyi
mpl
ement
ati
onoft
heJav
aVM.Thatmeanst
hatasl
ongasa
comput
erhasaJav
aVM,
thesamepr
ogr
am wr
it
teni
ntheJav
apr
ogr
ammi
ng
l
anguagecanr
unonWi
ndows2000,
aSol
ari
swor
kst
ati
on,
oronani
Mac.

42
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

TheJav
aPl
atf
orm
Apl
atf
ormi
sthehar
dwar
eorsof
twar
eenv
ironmenti
nwhi
cha
pr
ogr
am r
uns.We’
veal
readyment
ionedsomeoft
hemostpopul
arpl
atf
orms
l
i
keWi
ndows2000,
Linux
,Sol
ari
s,andMacOS.Mostpl
atf
ormscanbe
descr
ibedasacombi
nat
ionoft
heoper
ati
ngsy
stem andhar
dwar
e.TheJav
a
pl
atf
orm di
ff
ersf
rom mostot
herpl
atf
ormsi
nthati
t’
sasof
twar
e-onl
y
pl
atf
ormt
hatr
unsont
opofot
herhar
dwar
e-basedpl
atf
orms.

TheJav
apl
atf
orm hast
wocomponent
s:

 TheJav
aVi
rt
ualMachi
ne(
Jav
aVM)
 TheJav
aAppl
i
cat
ionPr
ogr
ammi
ngI
nter
face(
Jav
aAPI
)
You’
veal
readybeeni
ntr
oducedt
otheJav
aVM.I
t’
sthebasef
ort
heJav
a
pl
atf
orm andi
spor
tedont
ovar
ioushar
dwar
e-basedpl
atf
orms.

TheJav
aAPIi
sal
argecol
l
ect
ionofr
eady
-madesof
twar
ecomponent
s
t
hatpr
ovi
demanyusef
ulcapabi
l
iti
es,
suchasgr
aphi
cal
useri
nter
face(
GUI
)
wi
dget
s.TheJav
aAPIi
sgr
oupedi
ntol
i
brar
iesofr
elat
edcl
assesand
i
nter
faces;
thesel
i
brar
i eknownaspackages.Thenextsect
esar ion,
WhatCan
Jav
aTechnol
ogyDo?Hi
ghl
i
ght
swhatf
unct
ional
i
tysomeoft
hepackagesi
n
t
heJav
aAPIpr
ovi
de.
Thef
oll
owi
ngf
igur
edepi
ctsapr
ogr
am t
hat
’sr
unni
ngont
heJav
apl
atf
orm.
Ast
hef
igur
eshows,
theJav
aAPIandt
hev
irt
ual
machi
nei
nsul
atet
he
pr
ogr
am f
rom t
hehar
dwar
e.

43
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Nat
ivecodei
scodet
hataf
tery
oucompi
l
eit
,thecompi
l
edcoder
uns
onaspeci
fi
char
dwar
epl
atf
orm.Asapl
atf
orm-
independentenv
ironment
,the
Jav
apl
atf
orm canbeabi
tsl
owert
hannat
ivecode.Howev
er,
smar
tcompi
l
ers,
wel
l
-tunedi
nter
pret
ers,
andj
ust
-i
n-t
imeby
tecodecompi
l
erscanbr
ing
per
for
mancecl
oset
othatofnat
ivecodewi
thoutt
hreat
eni
ngpor
tabi
l
ity
.
WhatCanJav
aTechnol
ogyDo?
Themostcommont
ypesofpr
ogr
amswr
it
teni
ntheJav
apr
ogr
ammi
ng
l eappl
anguagear etsandappl
i
cat
ions.I
fyou’
vesur
fedt
heWeb,
you’
re
pr
obabl
yal
readyf
ami
l
iarwi
thappl
ets.Anappl
eti
sapr
ogr
am t
hatadher
est
o
cer
tai
nconv
ent
ionst
hatal
l
owi
ttor
unwi
thi
naJav
a-enabl
edbr
owser
.

Howev
er,
theJav
apr
ogr
ammi
ngl
anguagei
snotj
ustf
orwr
it
ingcut
e,
ent
ert
aini
ngappl
etsf
ort
heWeb.Thegener
al-
pur
pose,
high-
lev
elJav
a
pr
ogr
ammi
ngl
anguagei
sal
soapower
ful
sof
twar
epl
atf
orm.Usi
ngt
he
gener
ousAPI
,youcanwr
it
emanyt
ypesofpr
ogr
ams.
Anappl
i
cat
ioni
sast
andal
onepr
ogr
am t
hatr
unsdi
rect
lyont
heJav
apl
atf
orm.
Aspeci
alki
ndofappl
i
cat
ionknownasaser
verser
vesandsuppor
tscl
i
ent
son
anet
wor
k.Exampl
esofser
ver
sar
eWebser
ver
s,pr
oxyser
ver
s,mai
lser
ver
s,
andpr
intser
ver
s.Anot
herspeci
ali
zedpr
ogr saser
am i vlet
.Aser
vletcan
al
mostbet
houghtofasanappl
ett
hatr
unsont
heser
versi
de.Jav
aSer
vlet
s
ar
eapopul
archoi
cef
orbui
l
dingi
nter
act
ivewebappl
i
cat
ions,
repl
aci
ngt
he
useofCGIscr
ipt
s.Ser
vlet
sar
esi
mil
art
oappl
etsi
nthatt
heyar
erunt
ime
ext
ensi
onsofappl
i
cat
ions.I
nst
eadofwor
kingi
nbr
owser
s,t
hough,
ser
vlet
s
r
unwi
thi
nJav
aWebser
ver
s,conf
igur
ingort
ail
ori
ngt
heser
ver
.
Howdoest
heAPIsuppor
tal
ltheseki
ndsofpr
ogr
ams?I
tdoessowi
th
packagesofsof
twar
ecomponent
sthatpr
ovi
desawi
der
angeoff
unct
ional
i
ty.
Ev
eryf
ull
impl
ement
ati
onoft
heJav
apl
atf
orm gi
vesy
out
hef
oll
owi
ng

f
eat
ures:

44
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

 Theessent
ial
s:Obj
ect
s,st
ri
ngs,
thr
eads,
number
s,i
nputandout
put
,
dat
ast
ruct
ures,
syst
em pr
oper
ti
es,
dat
eandt
ime,
andsoon.
 Appl
ets:
Thesetofconv
ent
ionsusedbyappl
ets.
 Net
wor
king:
URLs,
TCP(
Transmi
ssi
onCont
rol
Prot
ocol
),UDP(
User
Dat
agr
am Pr
otocol
)socket
s,andI
P(I
nter
netPr
otocol
)addr
esses.
 I
nter
nat
ional
i
zat
ion:
Hel
pforwr
it
ingpr
ogr
amst
hatcanbel
ocal
i
zedf
or
user
swor
ldwi
de.Pr
ogr
amscanaut
omat
ical
l
yadaptt
ospeci
fi
clocal
es
andbedi
spl
ayedi
ntheappr
opr
iat
elanguage.
 Secur
it
y:Bot
hlowl
evel
andhi
ghl
evel
,i
ncl
udi
ngel
ect
roni
csi
gnat
ures,
publ
i
candpr
ivat
ekeymanagement
,accesscont
rol
,andcer
ti
fi
cat
es.
 Sof
twar
ecomponent
s: aBeansTM,
KnownasJav canpl
ugi
ntoexi
sti
ng
componentar
chi
tect
ures.
 Obj
ectser
ial
i
zat
ion:
All
owsl
i
ght
wei
ghtper
sist
enceand
communi
cat
ionv
iaRemot
eMet
hodI
nvocat
ion(
RMI
).
 Jav
aDat
abaseConnect
ivi
t JDBCTM)
y( :Pr
ovi
desuni
for
m accesst
oa
wi
der
angeofr
elat
ional
dat
abases.
TheJav
apl
atf
orm al
sohasAPI
sfor2Dand3Dgr
aphi
cs,
accessi
bil
i
ty,
ser
ver
s,
col
l
abor
ati
on,
tel
ephony
,speech,
ani
mat
ion,
andmor
e.Thef
oll
owi
ngf
igur
e
depi
ctswhati
sincl
udedi
ntheJav
a2SDK.

45
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

HowWi
l
lJav
aTechnol
ogyChangeMyLi
fe?
Wecan’
tpr
omi
sey
ouf
ame,
for
tune,
orev
enaj
obi
fyoul
ear
ntheJav
a
pr
ogr
ammi
ngl
anguage.St
il
l,
iti
sli
kel
ytomakey
ourpr
ogr
amsbet
terand
r
equi
resl
essef
for
tthanot
herl
anguages.Webel
i
evet
hatJav
atechnol
ogywi
l
l
hel
pyoudot
hef
oll
owi
ng:
 Getst
art
edqui
ckl
y:Al
thought
heJav
apr
ogr
ammi
ngl
anguagei
sa
power
ful
obj
ect
-or
ient
edl
anguage,
it’
seasyt
olear
n,especi
all
yfor
pr
ogr
ammer
sal
readyf
ami
l
iarwi
thCorC++.
 Wr
it
elesscode:
Compar
isonsofpr
ogr
am met
ri
cs(
classcount
s,
met
hodcount
s,andsoon)suggestt
hatapr
ogr
am wr
it
teni
ntheJav
a
pr
ogr
ammi
ngl
anguagecanbef
ourt
imessmal
l
ert
hant
hesame
pr
ogr
am i
nC++.
 Wr
it
ebet
tercode:
TheJav
apr
ogr
ammi
ngl
anguageencour
agesgood
codi
ngpr
act
ices,
andi
tsgar
bagecol
l
ect
ionhel
psy
ouav
oidmemor
y
l
eaks.I
tsobj
ector
ient
ati
on,
itsJav
aBeanscomponentar
chi
tect
ure,
andi
tswi
de-
rangi
ng,
easi
l
yext
endi
bleAPIl
ety
our
euseot
herpeopl
e’
s
t
est
edcodeandi
ntr
oducef
ewerbugs.
 Dev
eloppr
ogr
amsmor
equi
ckl
y:Yourdev
elopmentt
imemaybeas
muchast
wiceasf
astv
ersuswr
it
ingt
hesamepr
ogr
am i
nC++.Why
?
Youwr
it
efewerl
i
nesofcodeandi
tisasi
mpl
erpr
ogr
ammi
ngl
anguage
t
hanC++.
 Av
oidpl
atf
orm dependenci
eswi
th100%Pur
eJav
a:Youcankeepy
our
pr
ogr
am por
tabl
ebyav
oidi
ngt
heuseofl
i
brar
ieswr
it
teni
not
her
l
anguages.The100%Pur aTM Pr
eJav oductCer
ti
fi
cat
ionPr
ogr
am hasa
r
eposi
tor
yofhi
stor
ical
processmanual
s,whi
tepaper
s,br
ochur
es,
and
si
mil
armat
eri
alsonl
i
ne.
 Wr
it
eonce,
runany
wher
e:Because100%Pur
eJav
apr
ogr
amsar
e
compi
l
edi
ntomachi
ne-
independentby
tecodes,
theyr
unconsi
stent
ly
onanyJav
apl
atf
orm.

46
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Di
str
ibut
esof
twar
emor
eeasi
l
y:Youcanupgr
adeappl
etseasi
l
yfr
om acent
ral
ser
ver
.Appl
etst
akeadv
ant
ageoft
hef
eat
ureofal
l
owi
ngnewcl
assest
obel
oaded

ont
hef
ly,
”wi
thoutr
ecompi
l
ingt
heent
ir
epr
ogr
am.
TCP/
IPst
ack

TheTCP/
IPst
acki
sshor
tert
hant
heOSIone:

TCPi
saconnect
ion-
ori
ent
edpr
otocol
;UDP(
UserDat
agr
am Pr
otocol
)is
aconnect
ionl
esspr
otocol
.

I
Pdat
agr
am’
s

TheI
Play
erpr
ovi
desaconnect
ionl
essandunr
eli
abl
edel
i
ver
ysy
stem.I
t
consi
der
seachdat
agr
am i
ndependent
lyoft
heot
her
s.Anyassoci
ati
onbet
ween
dat
agr
am mustbesuppl
i
edbyt
hehi
gherl
ayer
s.TheI
Play
ersuppl
i
esachecksum
t
hati
ncl
udesi
tsownheader
.Theheaderi
ncl
udest
hesour
ceanddest
inat
ion
addr
esses.TheI
Play
erhandl
esr
out
ingt
hroughanI
nter
net
.Iti
sal
sor
esponsi
blef
or
br
eaki
ngupl
argedat
agr
am i
ntosmal
l
eronesf
ort
ransmi
ssi
onandr
eassembl
i
ng
t
hem att
heot
herend.

UDP:

UDPi
sal
soconnect
ionl
essandunr
eli
abl
e.Whati
taddst
oIPi
sachecksum f
ort
he
cont
ent
soft
hedat
agr
am andpor
tnumber
s.Thesear
eusedt
ogi
veacl
i
ent
/ser
ver
model
-seel
ater
.

47
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

TCP

TCPsuppl
i
esl
ogi
ctogi
vear
eli
abl
econnect
ion-
ori
ent
edpr
otocol
abov
eIP.I
t
pr
ovi
desav
irt
ual
cir
cui
tthatt
wopr
ocessescanuset
ocommuni
cat
e.

I
nter
netaddr
esses

I
nor
dert
ouseaser
vice,
youmustbeabl
etof
indi
t.TheI
nter
netusesanaddr
ess
schemef
ormachi
nessot
hatt
heycanbel
ocat
ed.Theaddr
essi
sa32bi
tint
eger
whi
chgi
vest
heI
Paddr
ess.Thi
sencodesanet
wor
kIDandmor
eaddr
essi
ng.The
net
wor
kIDf
all
sint
ovar
iouscl
assesaccor
dingt
othesi
zeoft
henet
wor
kaddr
ess.

Net
wor
kaddr
ess

Cl
assAuses8bi
tsf
ort
henet
wor
kaddr
esswi
th24bi
tsl
eftov
erf
orot
her
addr
essi
ng.Cl
assBuses16bi
tnet
wor
kaddr
essi
ng.Cl
assCuses24bi
tnet
wor
k
addr
essi
ngandcl
assDusesal
l32.

Subnetaddr
ess

I
nter
nal
l
y,t
heUNI
Xnet
wor
kisdi
vi
dedi
ntosubnet
wor
ks.Bui
l
ding11i
scur
rent
lyon
onesubnet
wor
kanduses10-
bitaddr
essi
ng,
all
owi
ng1024di
ff
erenthost
s.

Hostaddr
ess

8bi
tsar
efi
nal
l
yusedf
orhostaddr
esseswi
thi
noursubnet
.Thi
spl
acesal
i
mitof256
machi
nest
hatcanbeont
hesubnet
.

Tot
aladdr
ess

The32bi
taddr
essi
susual
l
ywr
it
tenas4i
nteger
ssepar
atedbydot
s.

48
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Por
taddr
esses

Aser
viceexi
stsonahost
,andi
sident
if
iedbyi
tspor
t.Thi
sisa16bi
tnumber
.To
sendamessaget
oaser
ver
,yousendi
ttot
hepor
tfort
hatser
viceoft
hehostt
hati
t
i
srunni
ngon.Thi
sisnotl
ocat
iont
ranspar
ency
!Cer
tai
noft
hesepor
tsar
e"wel
l
known"
.

Socket
s

Asocketi
sadat
ast
ruct
uremai
ntai
nedbyt
hesy
stem t
ohandl
enet
wor
k
connect
ions.Asocketi
scr
eat
edusi
ngt
hecal
l .I
socket tr
etur
nsani
ntegert
hati
sli
ke
af
il
edescr
ipt
or.I
nfact
,underWi
ndows,
thi
shandl
ecanbeusedwi
thReadFi
ea
l nd
Wr
it ef
eFi
l unct
ions.

#i
ncl
ude<sy
s/t
ypes.
h>
#i
ncl
ude<sy
s/socket
.h>
i
ntsocket
(i
ntf
ami
l
y,i
ntt
ype,
intpr
otocol
);

Her
e"f
ami
l
y"wi
l
lbeAF_I
NETf
orI
Pcommuni
cat
ions,
pr ocolwi
ot l
lbezer
o,andt
ypewi
l
l
dependonwhet
herTCPorUDPi
sused.Twopr
ocesseswi
shi
ngt
ocommuni
cat
e
ov
eranet
wor
kcr
eat
easocketeach.Thesear
esi
mil
art
otwoendsofapi
pe-butt
he
act
ual
pipedoesnoty
etexi
st.

JFr
eeChar
t

JFr
eeChar
tisaf
ree100%Jav
achar
tli
brar
ythatmakesi
teasyf
ordev
eloper
sto
di
spl
aypr
ofessi
onal
qual
i
tychar
tsi
nthei
rappl
i
cat
ions.JFr
eeChar
t'
sext
ensi
ve
f
eat
ureseti
ncl
udes:

Aconsi
stentandwel
l
-document
edAPI
,suppor
ti
ngawi
der
angeofchar
tty
pes;

Af
lexi
bledesi
gnt
hati
seasyt
oext
end,
andt
arget
sbot
hser
ver
-si
deandcl
i
ent
-si
de
appl
i
cat
ions;

Suppor
tformanyout
putt
ypes,
incl
udi
ngSwi
ngcomponent
s,i
magef
il
es(
incl
udi
ng
PNGandJPEG)
,andv
ect
orgr
aphi
csf
il
efor
mat
s(i
ncl
udi
ngPDF,
EPSandSVG)
;

49
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

JFr
eeChar
tis"
opensour
ce"or
,mor
especi
fi
cal
l
y,f
reesof
twar
e.I
tisdi
str
ibut
ed
undert
het
ermsoft
heGNULesserGener
alPubl
i
cLi
cence(
LGPL)
,whi
chper
mit
s
usei
npr
opr
iet
aryappl
i
cat
ions.

1.MapVi
sual
i
zat
ions
Char
tsshowi
ngv
aluest
hatr
elat
etogeogr
aphi
cal
areas.Someexampl
esi
ncl
ude:
(a)
popul
ati
ondensi
tyi
neachst
ateoft
heUni
tedSt
ates,
(b)i
ncomepercapi
taf
oreach
count
ryi
nEur
ope,
(c)l
i
feexpect
ancyi
neachcount
ryoft
hewor
ld.Thet
asksi
nthi
s
pr
ojecti
ncl
ude:

Sour
cingf
reel
yredi
str
ibut
abl
evect
orout
li
nesf
ort
hecount
ri
esoft
hewor
ld,
st
ates/
prov
incesi
npar
ti
cul
arcount
ri
es(
USAi
npar
ti
cul
ar,
butal
soot
herar
eas)
;

Cr
eat
inganappr
opr
iat
edat
aseti
nter
face(
plusdef
aul
timpl
ement
ati
on)
,ar
ender
ed,
andi
ntegr
ati
ngt
hiswi
tht
heexi
sti
ngXYPl
otcl
assi
nJFr
eeChar
t;

Test
ing,
document
ing,
test
ingsomemor
e,document
ingsomemor
e.

2.Ti
meSer
iesChar
tInt
eract
ivi
ty
I
mpl
ementanew(
toJFr
eeChar
t)f
eat
uref
ori
nter
act
ivet
imeser
ieschar
ts-
--t
o
di
spl
ayasepar
atecont
rol
thatshowsasmal
lver
sionofALLt
het
imeser
iesdat
a,
wi
thasl
i
ding"
view"r
ect
angl
ethatal
l
owsy
out
osel
ectt
hesubsetoft
het
imeser
ies
dat
atodi
spl
ayi
nthemai
nchar
t.

3.Dashboar
ds
Ther
eiscur
rent
lyal
otofi
nter
esti
ndashboar
ddi
spl
ays.Cr
eat
eaf
lexi
bledashboar
d
mechani
sm t
hatsuppor
tsasubsetofJFr
eeChar
tchar
tty
pes(
dial
s,pi
es,
t
her
momet
ers,
bar
s,andl
i
nes/
ti
meser
ies)t
hatcanbedel
i
ver
edeasi
l
yvi
abot
hJav
a
WebSt
artandanappl
et.

4.Pr
oper
tyEdi
tor
s
Thepr
oper
tyedi
tormechani
sm i
nJFr
eeChar
tonl
yhandl
esasmal
lsubsetoft
he
pr
oper
ti
est
hatcanbesetf
orchar
ts.Ext
end(
orr
eimpl
ement
)thi
smechani
sm t
o
pr
ovi
degr
eat
erend-
usercont
rol
overt
heappear
anceoft
hechar
ts.

J2ME(
Jav
a2Mi
croedi
ti
on)
:-

50
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

SunMi
crosy
stemsdef
inesJ2MEas"
ahi
ghl
yopt
imi
zedJav
arun-
ti
meenv
ironment
t
arget
ingawi
der
angeofconsumerpr
oduct
s,i
ncl
udi
ngpager
s,cel
l
ularphones,
scr
een-
phones,
digi
tal
set
-t
opboxesandcarnav
igat
ionsy
stems.
"Announcedi
n
June1999att
heJav
aOneDev
eloperConf
erence,
J2MEbr
ingst
hecr
oss-
plat
for
m
f
unct
ional
i
tyoft
heJav
alanguaget
osmal
l
erdev
ices,
all
owi
ngmobi
l
ewi
rel
ess
dev
icest
oshar
eappl
i
cat
ions.Wi
thJ2ME,
Sunhasadapt
edt
heJav
apl
atf
ormf
or
consumerpr
oduct
sthati
ncor
por
ateorar
ebasedonsmal
lcomput
ingdev
ices.

1.Gener
alJ2MEar
chi
tect
ure

J2MEusesconf
igur
ati
onsandpr
ofi
l
est
ocust
omi
zet
heJav
aRunt
imeEnv
ironment
(
JRE)
.Asacompl
eteJRE,
J2MEi
scompr
isedofaconf
igur
ati
on,
whi
chdet
ermi
nes
t
heJVM used,
andapr
ofi
l
e,whi
chdef
inest
heappl
i
cat
ionbyaddi
ngdomai
n-speci
fi
c
cl
asses.Theconf
igur
ati
ondef
inest
hebasi
crun-
ti
meenv
ironmentasasetofcor
e
cl
assesandaspeci
fi
cJVM t
hatr
unonspeci
fi
cty
pesofdev
ices.We'
l
ldi
scuss
conf
igur
ati
onsi
ndet
ail
int
heThepr
ofi
l
edef
inest
heappl
i
cat
ion;
speci
fi
cal
l
y,i
tadds
domai
n-speci
fi
ccl
assest
otheJ2MEconf
igur
ati
ont
odef
inecer
tai
nusesf
ordev
ices.
We'
l
lcov
erpr
ofi
l
esi
ndept
hint
heThef
oll
owi
nggr
aphi
cdepi
ctst
her
elat
ionshi
p
bet
weent
hedi
ff
erentv
irt
ual
machi
nes,
conf
igur
ati
ons,
andpr
ofi
l
es.I
tal
sodr
awsa
par
all
elwi
tht
heJ2SEAPIandi
tsJav
avi
rt
ual
machi
ne.Whi
l
etheJ2SEv
irt
ual
machi
nei
sgener
all
yref
err
edt
oasaJVM,
theJ2MEv
irt
ual
machi
nes,
KVM andCVM,
ar
esubset
sofJVM.Bot
hKVM andCVM canbet
houghtofasaki
ndofJav
avi
rt
ual

51
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

machi
ne-
-it
'sj
ustt
hatt
heyar
eshr
unkenv
ersi
onsoft
heJ2SEJVM andar
especi
fi
c
t
oJ2ME.

2.
Dev
elopi
ngJ2MEappl
i
cat
ions

I
ntr
oduct
ionI
nthi
ssect
ion,
wewi
l
lgoov
ersomeconsi
der
ati
onsy
ouneedt
okeepi
n
mi
ndwhendev
elopi
ngappl
i
cat
ionsf
orsmal
l
erdev
ices.We'
l
ltakeal
ookatt
heway
t
hecompi
l
eri
sinv
okedwhenusi
ngJ2SEt
ocompi
l
eJ2MEappl
i
cat
ions.Fi
nal
l
y,we'
l
l
expl
orepackagi
nganddepl
oymentandt
her
olepr
ever
if
icat
ionpl
aysi
nthi
spr
ocess.

3.
Desi
gnconsi
der
ati
onsf
orsmal
ldev
ices

Dev
elopi
ngappl
i
cat
ionsf
orsmal
ldev
icesr
equi
resy
out
okeepcer
tai
nst
rat
egi
esi
n
mi
nddur
ingt
hedesi
gnphase.I
tisbestt
ost
rat
egi
cal
l
ydesi
gnanappl
i
cat
ionf
ora
smal
ldev
icebef
orey
oubegi
ncodi
ng.Cor
rect
ingt
hecodebecausey
ouf
ail
edt
o
consi
deral
loft
he"
got
chas"bef
oredev
elopi
ngt
heappl
i
cat
ioncanbeapai
nful
pr
ocess.Her
ear
esomedesi
gnst
rat
egi
est
oconsi
der
:

*Keepi
tsi
mpl
e.Remov
eunnecessar
yfeat
ures,
possi
blymaki
ngt
hosef
eat
uresa
separ
ate,
secondar
yappl
i
cat
ion.

*Smal
l
eri
sbet
ter
.Thi
sconsi
der
ati
onshoul
dbea"
nobr
ainer
"foral
ldev
eloper
s.
Smal
l
erappl
i
cat
ionsusel
essmemor
yont
hedev
iceandr
equi
reshor
teri
nst
all
ati
on
t
imes.Consi
derpackagi
ngy
ourJav
aappl
i
cat
ionsascompr
essedJav
aAr
chi
ve(
jar
)
f
il
es.

*Mi
nimi
zer
un-
ti
mememor
yuse.Tomi
nimi
zet
heamountofmemor
yusedatr
un
t
ime,
usescal
art
ypesi
npl
aceofobj
ectt
ypes.Al
so,
donotdependont
hegar
bage
col
l
ect
or.Youshoul
dmanaget
hememor
yef
fi
cient
lyy
our
sel
fbyset
ti
ngobj
ect
r
efer
encest
onul
lwheny
ouar
efi
nishedwi
tht
hem.Anot
herwayt
oreducer
un-
ti
me
memor
yist
ousel
azyi
nst
ant
iat
ion,
onl
yal
l
ocat
ingobj
ect
sonanas-
neededbasi
s.
Ot
herway
sofr
educi
ngov
eral
landpeakmemor
yuseonsmal
ldev
icesar
etor
elease
r
esour
cesqui
ckl
y,r
euseobj
ect
s,andav
oidexcept
ions.

4.
Conf
igur
ati
onsov
erv
iew

Theconf
igur
ati
ondef
inest
hebasi
crun-
ti
meenv
ironmentasasetofcor
ecl
asses

52
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

andaspeci
fi
cJVM t
hatr
unonspeci
fi
cty
pesofdev
ices.Cur
rent
ly,
two
conf
igur
ati
onsexi
stf
orJ2ME,
thoughot
her
smaybedef
inedi
nthef
utur
e:

*Connect
edLi
mit
edDev
iceConf
igur
ati
on(
CLDC)
isusedspeci
fi
cal
l
ywi
tht
heKVM
f
or16-
bitor32-
bitdev
iceswi
thl
i
mit
edamount
sofmemor
y.Thi
sist
heconf
igur
ati
on
(
andt
hev
irt
ual
machi
ne)usedf
ordev
elopi
ngsmal
lJ2MEappl
i
cat
ions.I
tssi
ze
l
i
mit
ati
onsmakeCLDCmor
eint
erest
ingandchal
l
engi
ng(
from adev
elopmentpoi
nt
ofv
iew)t
hanCDC.CLDCi
sal
sot
heconf
igur
ati
ont
hatwewi
l
lusef
ordev
elopi
ngour
dr
awi
ngt
ool
appl
i
cat
ion.Anexampl
eofasmal
lwi
rel
essdev
icer
unni
ngsmal
l
appl
i
cat
ionsi
saPal
m hand-
hel
dcomput
er.

*Connect
edDev
iceConf
igur
ati
on(
CDC)
isusedwi
tht
heCv
irt
ual
machi
ne(
CVM)
andi
susedf
or32-
bitar
chi
tect
uresr
equi
ri
ngmor
ethan2MBofmemor
y.An
exampl
eofsuchadev
icei
saNetTVbox.

5.
J2MEpr
ofi
l
es

Whati
saJ2MEpr
ofi
l
e?

Aswement
ionedear
li
eri
nthi
stut
ori
al,
apr
ofi
l
edef
inest
het
ypeofdev
icesuppor
ted.
TheMobi
l
eInf
ormat
ionDev
icePr
ofi
l
e(MI
DP)
,forexampl
e,def
inescl
assesf
or
cel
l
ularphones.I
taddsdomai
n-speci
fi
ccl
assest
otheJ2MEconf
igur
ati
ont
odef
ine
usesf
orsi
mil
ardev
ices.Twopr
ofi
l
eshav
ebeendef
inedf
orJ2MEandar
ebui
l
tupon
CLDC:
KJav
aandMI
DP.Bot
hKJav
aandMI
DPar
eassoci
atedwi
thCLDCandsmal
l
er
dev
ices.Pr
ofi
l
esar
ebui
l
tont
opofconf
igur
ati
ons.Becausepr
ofi
l
esar
especi
fi
cto
t
hesi
zeoft
hedev
ice(
amountofmemor
y)onwhi
chanappl
i
cat
ionr
uns,
cer
tai
n
pr
ofi
l
esar
eassoci
atedwi
thcer
tai
nconf
igur
ati
ons.
Askel
etonpr
ofi
l
euponwhi
chy
ou
cancr
eat
eyourownpr
ofi
l
e,t
heFoundat
ionPr
ofi
l
e,i
sav
ail
abl
eforCDC.

Pr
ofi
l
e1:
KJav
a

KJav
aisSun'
spr
opr
iet
arypr
ofi
l
eandcont
ainst
heKJav
aAPI
.TheKJav
apr
ofi
l
eis
bui
l
tont
opoft
heCLDCconf
igur
ati
on.TheKJav
avi
rt
ual
machi
ne,
KVM,
accept
sthe
sameby
tecodesandcl
assf
il
efor
matast
hecl
assi
cJ2SEv
irt
ual
machi
ne.KJav
a
cont
ainsaSun-
speci
fi
cAPIt
hatr
unsont
hePal
m OS.TheKJav
aAPIhasagr
eat
deal
incommonwi
tht
heJ2SEAbst
ractWi
ndowi
ngTool
ki
t(AWT)
.Howev
er,

53
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

becausei
tisnotast
andar
dJ2MEpackage,
itsmai
npackagei
scom.
sun.
kjav
a.We'
l
l
l
ear
nmor
eaboutt
heKJav
aAPIl
ateri
nthi
stut
ori
alwhenwedev
elopsomesampl
e
appl
i
cat
ions.

Pr
ofi
l
e2:
MIDP

MI
DPi
sgear
edt
owar
dmobi
l
edev
icessuchascel
l
ularphonesandpager
s.The
MI
DP,
li
keKJav
a,i
sbui
l
tuponCLDCandpr
ovi
desast
andar
drun-
ti
meenv
ironment
t
hatal
l
owsnewappl
i
cat
ionsandser
vicest
obedepl
oyeddy
nami
cal
l
yonenduser
dev
ices.MI
DPi
sacommon,
indust
ry-
standar
dpr
ofi
l
eformobi
l
edev
icest
hati
snot
dependentonaspeci
fi
cvendor
.Iti
sacompl
eteandsuppor
tedf
oundat
ionf
or
mobi
l
eappl
i
cat
ion

dev
elopment
.MI
DPcont
ainst
hef
oll
owi
ngpackages,
thef
ir
stt
hreeofwhi
char
ecor
e
CLDCpackages,
plust
hreeMI
DP-
speci
fi
cpackages.

*j
ava.
lang

*j
ava.
io

*j
ava.
uti
l

*j
avax.
micr
oedi
ti
on.
io

*j
avax.
micr
oedi
ti
on.
lcdui

*j
avax.
micr
oedi
ti
on.
midl
et

*j
avax.
micr
oedi
ti
on.
rms

7.
2SERVLETS/
JSP

I
ntr
oduct
ion

ASer
vletI
sagener
icser
verext
ensi
on.aJav
acl
asst
hatcanbel
oaded
Dy
nami
cal
l
ytoexpandt
hef
unct
ional
i
tyofaser
ver
.Ser
vlet
sar
ecommonl
y
usedwi
thwebser
ver
s.Wher
etheycant
aket
hepl
aceCGIscr
ipt
s.

Aser
vleti
ssi
mil
art
opr
opr
iet
aryser
verext
ensi
on,
exceptt
hati
trunsi
nsi
dea
Jav
aVi
rt
ual
Machi
ne(
JVM)ont
heser
ver
,soi
tissaf
eandpor
tabl
e

54
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Ser
vlet
soper
atesol
elywi
thi
nthedomai
noft
heser
ver
.

Unl
i
keCGIandFastCGI
,whi
chusemul
ti
plepr
ocessest
ohandl
esepar
ate
pr
ogr
am orsepar
ater
equest
s,separ
atet
hreadswi
thi
nwebser
verpr
ocesshandl
eal
l
ser
vlet
s.Thi
smeanst
hatser
vlet
sar
eal
lef
fi
cientandscal
abl
e.

Ser
vlet
sar
epor
tabl
e;bot
hacr
ossoper
ati
ngsy
stemsand al
soacr
ossweb
ser
ver
s.Jav
a Ser
vlet
s of
fert
he bestpossi
ble pl
atf
orm f
orweb appl
i
cat
ion
dev
elopment
.

Ser
vlet
sar
eusedasr
epl
acementf
orCGIscr
ipt
sonawebser
ver
,theycan
ext
endanysor
tofser
versuchasamai
lser
vert
hatal
l
owsser
vel
tstext
endi
ts
f
unct
ional
i
typer
hapsbyper
for
mingav
irusscanonal
lat
tacheddocument
sor
handl
i
ngmai
lfi
l
ter
ingt
asks.

Ser
vlet
s pr
ovi
de a Jav
a-based sol
uti
on used t
o addr
ess t
he pr
obl
ems
cur
rent
lyassoci
ated wi
th doi
ng ser
ver
-si
de pr
ogr
ammi
ng i
ncl
udi
ng i
next
ensi
ble
scr
ipt
ingsol
uti
onspl
atf
orm-
speci
fi
cAPI

sandi
ncompl
etei
nter
face.

Ser
vlet
sar
eobj
ect
sthatconf
ormt
oaspeci
fi
cint
erf
acet
hatcanbepl
ugged
i
ntoaJav
a-basedser
ver
.Ser
vlet
sar
etot
heser
ver
-si
dewhatappl
etsar
etot
he
ser
ver
-si
de whatappl
ets ar
etot
he cl
i
ent
-si
de-
obj
ectby
te codes t
hatcan be
dy
nami
cal
l
yloadedof
fthenet
.Theydi
ff
erf
orm appl
etsi
nthant
heyar
efacel
ess
obj
ect
s(wi
thoutgr
aphi
csoraGUIcomponent
).
Theyser
veaspl
atf
ormi
ndependent
,
dy
nami
cal
l
yloadabl
e,
plugabl
ehel
perby
tecodeobj
ect
sont
heser
versi
det
hatcan
beusedt
ody
nami
cal
l
yext
endser
ver
-si
def
unct
ional
i
ty.

Forexampl
eanHTTPser
vletcanbeusedt
ogener
atedy
nami
cHTMLcont
ent
wheny
ouuseser
vlet
stodody
nami
ccont
enty
ougett
hef
oll
owi
ngadv
ant
ages:

 They
’ref
ast
erandcl
eanert
henCGIscr
ipt
s
 Theyuseast
andar
dAPI
(theser
vletAPI
)
 Theypr
ovi
deal
ltheadv
ant
agesofJav
a(r
unonav
ari
ety ofser
ver
s
wi
thoutneedi
ngt
ober
ewr
it
ten)
At
tract
ivenessofSer
vlet
s:

Theyar
emanyf
eat
uresofser
vlet
sthatmaket
hem easyandat
tr
act
ivet
otuse

55
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

t
hesei
ncl
ude:

 Easi
l
yconf
igur
eusi
ngt
heGUI
-basedAdmi
ntool
]
 CanbeLoadedandI
nvokedf
rom al
ocaldi
skorr
emot
elyacr
osst
he
net
wor
k.
 Canbel
i
nkedt
oget
herorchai
ned,sot
hatonser
vletcancal
lanot
her
ser
vlet
,orsev
eral
ser
vlet
sinsequence.
 Canbecal
l
eddy
nami
cal
l
yfr
om wi
thi
nHTML,pagesusi
ngser
ver
-si
de
i
ncl
ude-
tags.
 Ar
esecur
e-ev
enwhendownl
oadi
ngacr
osst
henet
wor
k,t
heser
vlet
secur
it
ymodel
andser
vletandboxpr
otecty
oursy
stem f
rom unf
ri
endl
y
behav
ior
.,
Adv
ant
agesoft
heser
vletAPI

Oneoft
hegr
eatadv
ant
agesoft
heser
vletAPIi
spr
otocoli
ndependent
.It
assumesnot
hingabout
:

 Thepr
otocol
bei
ngusedt
otr
ansmi
tont
henet
 Howi
tisl
oaded
 Theser
verenv
ironmenti
twi
l
lber
unni
ngi
n
 Thesequant
it
iesar
eimpor
tant
,becausei
tal
l
owst
heSer
vletAPIt
obe
embedded i
n many di
ff
erent ki
nds of ser
ver
s.Ther
e ar
e ot
her
adv
ant
agest
otheser
vel
tAPIaswel
lThesei
ncl
ude:
 I
t’
s ext
ensi
ble-
you can i
nher
ital
lyourf
unct
ional
i
tyf
rom t
he base
cl
assesmadeav
ail
abl
etoy
ou
 I
t’
ssi
mpl
esmal
l
,andeasyt
ouse.
Feat
uresofSer
vlet
s:

Ser
vlet
sar
eper
sist
ent
.Ser
vletar
eloadedonl
ybyt
hewebser
verandcan
mai
ntai
nser
vicesbet
weenr
equest
s.
Ser
vlet
sar
efast
.Si
nceser
vlet
sonl
yneedt
obel
\l
oadedonce,t
heyof
fer
muchbet
terper
for
manceov
ert
hei
rCGIcount
erpar
ts.
Ser
vlet
sar
epl
atf
ormi
ndependent
.
Ser
vlet
s ar
e ext
ensi
ble Jav
aisar
obust
,obj
ect
-or
ient
ed pr
ogr
ammi
ng

56
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

l
anguage,
whi
cheasi
l
ycanbeext
endedt
osui
tyourneeds.
Ser
vlet
sar
esecur
e
Ser
vlet
sar
eusedwi
thav
ari
etyofcl
i
ent
.
Ser
vlet
s ar
e cl
asses and i
nter
faces f
rom t
ow packages,
j
avax .
ser
vlet and
j
avax.
ser
vlet
.ht
tp.
The j
ava.
ser
vletpackage cont
ains cl
asses tsuppor
tgener
ic,
pr
otocol
-i
ndependentser
vlet
s.Thecl
assesi
nthej
avax
.ser
vel
t.
htt
ppackageToand
HTTPspeci
fi
cfunct
ional
i
tyext
endt
hesecl
asses

Ev
ery ser
vletmusti
mpl
ementt
he j
avax
.ser
vel
tint
erf
ace.
Mostser
vlet
s
i
mpl
ementi
tby ext
endi
ng one oft
wo cl
asses.
jav
ax.
ser
vlet
.Gener
icSer
vletor
j
avax.
ser
vlet
.ht
tp.
Htt
pSer
vlet
.A pr
otocol
-i
ndependent ser
vlet shoul
d subcl
ass
Gener
ic-
Ser
vlet
.whi
l
eanHt
tpser
vletshoul
dsubcl
assHt
tpSer
vlet
,whi
chi
sit
sel
fa
subcl
assofGener
ic-
ser
vletwi
thaddedHTTP-
speci
fi
cfunct
ional
i
ty.

Unl
i
keaj
avapr
ogr
am,aser
vletdoesnothav
eamai
n()met
hod,
I
nst
eadt
he
ser
veri
nthepr
ocessofhandl
i
ngr
equest
sinv
okecer
tai
nmet
hodsofaser
vlet
.Each
t
imet
heser
verdi
spat
chesar
equestt
oaser
vlet
,iti
nvokest
heser
vel
tsSer
vice(
)
met
hod,

Agener
icser
vletshoul
dov
err
idei
tsser
vice(
)met
hodt
ohandl
erequest
sas
appr
opr
iat
efort
heser
vlet
.Theser
vice(
)accept
stwopar
amet
ersar
equestobj
ect
andar
esponseobj
ect.
Ther
equestobj
ectt
ell
stheser
vletaboutt
her
equest
,whi
l
e
t
her
esponseobj
ecti
susedt
oret
urnar
esponse

I
nCont
rast
.anHt
tp ser
vlet usual
l
y does not ov
err
ide t
he ser
vice(
)
met
hod.
Inst
eadi
tov
err
idesdoGet
()t
ohandl
eGETr
equest
sanddoPost
()t
ohandl
e
Postr
equest
s.AnHt
tpser
vletcanov
err
ideei
therorbot
hoft
hesemodul
est
he
ser
vice(
)met
hodofHt
tpSer
vlethandl
est
heset
upanddi
spat
chi
ngt
oal
lthedoXXX(
)
met
hods.
whi
chi
swhyi
tusual
l
yshoul
dnotbeov
err
idden

Ther
emai
nder
sint
hej
avax.
ser
vletandj
avax
.ser
vlet
.ht
tp.
packagear
elar
gel
y
suppor
tcl
asses.
TheSer
vlet
RequestandSer
vlet
Responsecl
assesi
njav
ax.
ser
vlet
pr
ovi
deaccesst
ogener
icser
verr
equest
sandr
esponseswhi
l
eHt
tpSer
vlet
Request
andHt
tpSer
vlet
Responsecl
assesi
njav
ax.
ser
vletpr
ovi
deaccesst
ogener
icser
ver
r
equest
s and r
esponses whi
l
e Ht
tpSer
vlet
Requestand Ht
tpSer
vlet
Response i
n

57
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

j
avax.
ser
vlet
.ht
tp pr
ovi
de access a HTTP r
equest
s and r
esponses . The
j
avax.
ser
vlet
.ht
tp pr
ovi
de cont
ains an Ht
tpSessi
on cl
ass t
hatpr
ovi
des bui
l
t-i
n
sessi
on t
racki
ng f
unct
ional
i
tyand Cooki
e cl
ass t
hatal
l
ows qui
ckl
yset
up and
pr
ocessi
ngHt
tpCooki
es.

Loadi
ngSer
vlet
s:

Ser
vlet
scanbel
oadedf
rom t
hei
rpl
aces.Fr
om adi
rect
oryt
hati
sont
he
CLASSPATH.TheCLASSPATHoft
heJav
aWebSer
veri
ncl
udesser
vicer
oot
/cl
asses/
,
whi
chi
swher
ethesy
stem cl
assesr
esi
de

Fr
om t
he <SERVI
CE_
ROOT/
ser
vlet
s/di
rect
ory
.Thi
sis noti
nthe ser
ver
’s
cl
asspat
h.Acl
assl
oaderi
susedt
ocr
eat
eser
vlet
sfor
mthi
sdi
rect
ory
.Newser
vlet
s
canbeadded-
exi
sti
ngser
vlet
scanber
ecompi
l
edandt
heser
verwi
l
lnot
icet
hese
changes. Fr
om a r
emot
e l
ocat
ion.
For t
his a code base l
i
ke
ht
tp:
//ni
ne.
eng/
classes/
foo/i
srequi
redi
naddt
iont
otheser
vlet
’scl
assname.
Ref
er
t
otheadmi
nGui
docsonser
vletsect
iont
oseehowt
osett
hisup.

Loadi
ngRemot
eSer
vlet
s

Remot
eser
vlet
scanbel
oadedby
:

 Conf
igur
ing t
headmi
n Toolt
o set
up aut
omat
icl
oadi
ng ofr
emot
e
ser
vlet
s.
 Sel
ect
iongupser
versi
dei
ncl
udet
agsi
n.ht
mlf
il
es
 Def
ini
ngaf
il
terchai
nConf
igur
ati
on

I
nvoki
ngSer
vlet
s

Aser
vleti
nvokeri
saser
vlett
hati
nvokest
he“
ser
ver
”met
hodonanamed
ser
vlet
.I
ftheser
vleti
snotl
oadedi
ntheser
ver
,t
hent
hei
nvokerf
ir
stl
oadest
he
ser
vlet
(ei
therf
orml
ocaldi
skorf
rom t
henet
wor
k)andt
het
heni
nvokest
he“
ser
vice”
met
hod.
Alsol
i
keappl
ets,
l
ocalser
vlet
sint
heser
vercanbei
dent
if
iedbyj
ustt
he
cl
assname.
Inot
herwor
ds,
ifaser
vletnamei
snotabsol
ute.
iti
str
eat
edasl
ocal
.

ACl
i
entcanI
nvokeSer
vlet
sint
heFol
l
owi
ngWay
s:

58
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

 Thecl
i
entcanaskf
oradocumentt
hati
sser
vedbyt
heser
vlet
.
 Thecl
i
ent
(br
owser
)cani
nvoket
heser
vletdi
rect
lyusi
ngaURL,oncei
t
hasbeenmappedusi
ngt
heSERVLETALI
ASESSect
ionoft
headmi
n
GUI
 Theser
vletcanbei
nvokedt
hroughser
versi
dei
ncl
udet
ags.
 Theser
vletcanbei
nvokedbypl
aci
ngi
tint
heser
vlet
s/di
rect
ory
 Theser
vletcanbei
nvokedbyusi
ngi
tinaf
il
terchai
n
TheSer
vletLi
feCy
cle

TheSer
vletl
i
fecy
clei
soneoft
hemostexci
ti
ngf
eat
uresofSer
vlet
s.Thi
sli
fe
cy
clei
sapower
fulhy
bri
doft
hel
i
fecy
clesusedi
nCGIpr
ogr
ammi
ngandl
ower
-l
evel
NSAPIandI
SAPIpr
ogr
ammi
ng.

Theser
vletl
i
fecy
cleal
l
owsser
vletengi
nest
oaddr
essbot
htheper
for
mance
andr
esour
cepr
obl
emsofCGIandt
hesecur
it
yconcent
sofl
ow l
evelser
verAPI
pr
ogr
ammi
ng.

Ser
vletl
i
fecy
clei
shi
ghl
yfl
exi
bleSer
ver
shav
asi
gni
fi
cantl
eewayi
nhowt
hey
chooset
osuppor
tser
vlet
s.Theonl
yhar
dandf
astr
ulei
sthataser
vletengi
nemust
conf
ort
othef
oll
owi
ngl
i
fecy
clecont
act
:

 Cr
eat
eandi
nit
ial
i
zet
heser
vlet
s
 Handl
ezer
oormor
eser
vicef
rom cl
i
ent
s
 Dest
royt
heser
vletandt
hengar
bageCol
l
ect
sit
.
I
t’
sper
fect
lyl
egalf
oraser
vlettbel
oaded,cr
eat
edani
nit
ial
zedi
nit
sown
JVM,
onl
ytobedest
roy
edandgar
bagecol
l
ect
edwi
thouthancdl
i
nganycl
i
ent
request
oraf
terhandl
i
ngj
ustoner
equest

Themostcommonandmostsensi
blel
i
fecy
clei
mpl
emnt
ati
onsf
orHTTP
ser
vel
tsar
e:

Si
ngl
ejav
avi
rt
ual
machi
neandast
ati
neper
sist
ence.

I
nitandDest
roy

Justl
i
keAppl
etsser
vlet
scandef
inei
nit
()anddest
roy
()met
hods,Aser
vlet
s
i
nit
(Ser
viceConf
ig)met
hod i
scal
l
ed byt
he ser
veri
mmedi
atel
yaf
tert
he ser
ver

59
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

const
ruct
stheser
vlet
’si
nst
ance.
Depandi
ngont
heser
verandi
tsconf
igur
ati
on,t
his
canbeatanyoft
heset
imes

 Whent
heser
verst
ates
 Whent
heser
vleti
sfi
rstr
equest
ed,j
ustbef
oret
heser
vice(
)met
hodi
s
i
nvoked
 Att
her
equestoft
heser
veradmi
nist
rat
or
I
nanycase,
nit
()i
sguar
ant
eedt
obecal
l
edbef
oret
heser
vlethandl
esi
tsf
ir
st
r
equest

Thei
nit
()met
hodi
sty
pical
l
yusedt
oper
for
m ser
vleti
nit
ial
i
zat
ioncr
eat
ingor
l
oadi
ngobj
ect
sthatar
eusedbyt
heser
vleti
nhandl
i
ngofi
tsr
equest
.Inor
dert
o
pr
ovi
dinganewser
vletanyi
nfor
mat
ionabouti
tsel
fandi
tsenv
ironment
,aser
verhas
t
ocal
laser
vel
tsi
nit
()met
hodandpassanobj
ectt
hati
mpl
ementt
heSer
vlet
Conf
ig
i
nter
face.Thi
sSer
vlet
Conf
igobj
ectsuppl
i
esaser
vletwi
thi
nfor
mat
ionabouti
ts
i
nit
ial
i
zat
ionpar
amet
ers.
Thesepar
amet
ersar
egi
vent
otheser
vlet
sandar
enot
associ
atedwi
thanysi
ngl
erequest
.Theycanspeci
fyi
nit
ialv
alues,suchaswher
ea
count
ershoul
dbegi
ncount
ing,ordef
aul
tval
ues,per
hapsat
empl
atet
ousewhen
notspeci
fi
edbyt
her
equest
,

Theser
vercal
l
saser
vlet
’sdest
roy
()met
hodwhent
heser
vleti
saboutt
obe
unl
oaded.I
nthedest
roy
()met
hod,aser
vletshoul
dfr
ee anyr
esour
cesi
thas
acqui
redt
hatwi
l
lnotbegar
bagecol
l
ect
ed.Thedest
roy
()met
hodal
sogi
vesa
ser
vletachancet
owr
it
eouti
tsunsav
ed.cachedi
nfor
mat
ionoranyper
sist
ent
i
nfor
mat
iont
hatshoul
dber
eaddur
ingt
henextcal
ltoi
nit
().

Sessi
onTr
acki
ng
HTTPi
sast
atel
esspr
otocol
,i
tpr
ovi
desnowayf
oraser
vert
orecogni
zet
hat
asequenceofr
equest
sisal
lfr
om t
hesamecl
i
ent
.Thi
scausesapr
obl
em f
or
appl
i
cat
ionsuchasshoppi
ngcar
tappl
i
cat
ions.Ev
eni
nchatappl
i
cat
ionser
vercan’
t
knowexact
lywho’
smaki
ngar
equestofsev
eral
cli
ent
s.

Thesol
uti
onf
ort
hisi
sforcl
i
entt
oint
roducei
tsel
fasi
tmakeseachr
equest
,
Eachcl
i
ent
sneedst
opr
ovi
deauni
quei
dent
if
iert
hatl
etst
heser
veri
dent
if
yit
,ori
t
needst
ogi
vesomei
nfor
mat
iont
hatt
heser
vercanuset
opr
oper
lyhandl
ethe

60
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

r
equest
,Ther
ear
esev
eralway
stosendt
hisi
ntr
oduct
oryi
nfor
mat
ionwi
theach
r
equestSuchas:

UserAut
hor
izat
ion

Onewayt
oper
for
m sessi
ont
racki
ngi
stol
ever
aget
hei
nfor
mat
iont
hatcomeswi
th
Useraut
hor
izat
ion.When a web ser
verr
est
ri
cts access t
o some ofi
ts
r
esour
ces t
o onl
ythose cl
i
ent
sthatl
og i
n usi
ng a r
ecogni
zed user
name and
passwor
d.Af
tert
hecl
i
entl
ogsi
n,t
heuser
namei
sav
ail
abl
etoaser
vlett
hrough
get
Remot
eUser
()

Weanuset
heuser
namet
otr
ackt
hesessi
on.Onceauserhasl
oggedi
n,t
he
br
owserr
emember
sheruser
nameandr
esendst
henameandpasswor
dast
heuser
v
iewsnew pagesont
hesi
te.Aser
vletcani
dent
if
ytheusert
hroughheruser
name
andt
hey
’rebyTr
ackhersessi
on.

The bi
ggestadv
ant
age ofusi
ng useraut
hor
izat
ion t
o per
for
m sessi
on
t
racki
ngi
sthati
t’
seasyt
oimpl
ement
.Si
mpl
ytel
lthepr
otectasetofpages,
anduse
get
Remot
eUser
()t
oident
if
yeachcl
i
ent
.Anot
heradv
ant
agei
sthatt
het
echni
que
wor
ksev
enwhent
heuseraccessesy
oursi
tef
orm orexi
stsherbr
owserbef
ore
comi
ngback.

Thebi
ggestdi
sadv
ant
ageofuseraut
hri
zat
ioni
sthati
trequi
reseachusert
o
r
egi
sterf
oranaccountandt
henl
ogi
nineacht
imet
hest
art
svi
sit
ingy
oursi
te.Most
user
swi
l
ltol
erat
eregi
ster
ingandl
aggi
ngi
nasanecessar
yev
ilwhent
heyar
e
accessi
ngsensi
ti
vei
nfor
mat
ion,buti
tsal
lov
erki
l
lforsi
mpl
esessi
ont
racki
ng.
Other
pr
obl
em wi
thuseraut
hor
izat
ioni
sthatausercannotsi
mul
taneousl
ymai
ntai
nmor
e
t
hanonesessi
onatt
hesamesi
te.

Hi
ddenFor
m Fi
elds

Onewayt
osuppor
tanony
moussessi
ont
racki
ngi
stousehi
ddenf
rom f
iel
ds.
Ast
henamei
mpl
i
es,
thesear
efi
eldsaddedt
oanHTML,
for
mthatar
enotdi
spl
ayed
i
nthecl
i
ent
’sbr
owser
,Theyar
esentbackt
otheser
verwhent
hef
ormt
hatcont
ains
t
hem i
ssubmi
tt
ed.

I
nasense,hi
ddenf
ormf
iel
dsdef
ineconst
antv
ari
abl
esf
oraf
orm.Toa

61
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

ser
vletr
ecei
vi
ngasubmi
tt
edf
orm,t
her
eisnodi
ff
erencebet
weenahi
ddenf
iel
ds
andav
isi
blef
il
ed.

Asmor
eandmor
einf
ormat
ioni
sassoci
atedwi
thacl
i
ent
ssessi
on.I
tcan
becomebur
densomet
opassi
tal
lusi
nghi
ddenf
ormf
iel
ds.I
nthesesi
tuat
ionsi
t’
s
possi
blet
opassonj
ustauni
quesessi
onI
Dthati
dent
if
iesaspar
ti
cul
arcl
i
ent
s
sessi
on.

Thatsessi
on I
D can be associ
ated wi
th compl
etei
nfor
mat
ion abouti
ts
sessi
ont
hati
sst
oredont
heser
ver
.

The adv
ant
age ofhi
dden f
orm f
iel
ds i
sthei
rubi
qui
ty and suppor
tfor
anony
mit
y.Hi
ddenf
iel
dsar
esuppor
tedi
nal
lthepopul
arbr
owser
s,t
heydemandon
speci
alser
verr
equi
rement
s,andt
heycanbeusedwi
thcl
i
ent
sthathav
en’
tregi
ster
ed
orl
oggedi
n.

Themaj
ordi
sadv
ant
agewi
tht
hist
echni
que,howev
eri
sthatwor
ksonl
yfora
sequenceofdy
nami
cal
l
ygener
atedf
orms,Thet
echni
quebr
eaksdowni
mmedi
atel
y
wi
thst
ati
cdocument
s,emai
l
eddocument
sbookmar
keddocument
sandbr
owser
shut
downs.

URLRewr
it
ing

URLr
ewr
it
ingi
sanot
herwayt
osuppor
tanony
moussessi
ont
racki
ng,Wi
th
URLr
ewr
it
ingev
eryl
ocalURLt
heusermi
ghtcl
i
ckoni
sdy
nami
cal
l
ymodi
fi
ed.or
r
ewr
it
ten,
toi
ncl
udeext
ra,
inf
ormat
ion.Theext
rai
nfor
mat
ioncanbei
nthedef
orm of
ext
rapat
hinf
ormat
ion,added par
amet
ers,orsomecust
om,ser
ver
-speci
fi
c.URL
change.Duet
othel
i
mit
edspaceav
ail
abl
einr
ewr
it
ingaURL,
theext
rai
nfor
mat
ioni
s
usual
l
yli
mit
edt
oauni
quesessi
on.

Eachr
ewr
it
ingt
echni
quehasi
tsownadv
ant
ageanddi
sadv
ant
age

Usi
ngext
rapat
hinf
ormat
ionwor
ksonal
lser
ver
s,andi
twor
ksasat
argetf
or
f
ormst
hatusebot
htheGetandPostmet
hods.I
tdoesnotwor
kwel
lift
heser
vlet
hast
ouset
heext
rapat
hinf
ormat
ionast
ruepat
hinf
ormat
ion

Theadv
ant
agesanddi
sadv
ant
agesofURL.
rewr
it
ingcl
osel
ymat
cht
hoseof
hi
dden f
orm f
il
eds,
The maj
ordi
ff
erence i
sthatURL r
ewr
it
ing wor
ks f
oral
l
dy
nami
cal
l
ycr
eat
eddocument
s,suchast
heHel
pser
vlet
,notj
ustf
orms.Wi
tht
he

62
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

r
ightser
versuppor
t,cust
om URLr
ewr
it
ingcanev
enwor
kforst
ati
cdocument
s.

Per
sist
entCooki
es

Af
our
tht
echni
quet
oper
for
m sessi
ont
racki
ngi
nvol
vesper
sist
entcooki
es.A
cooki
eisabi
tofi
nfor
mat
ion.sentbyawebser
vert
oabr
owsert
hatcanl
aterbe
r
eadbackf
ormt
hatbr
owser
.Whenabr
owserr
ecei
vesacooki
e,i
tsav
est
hecooki
e
andt
her
eaf
tersendst
hecooki
ebackt
otheser
vereacht
imei
taccessesapageon
t
hatser
ver
,subj
ectt
ocer
tai
nrul
es.Becauseacooki
e’
sval
uecanuni
quel
yident
if
ya
cl
i
ent
,cooki
esar
eof
tenusedf
orsessi
ont
racki
ng.

Per
sist
entcooki
esof
feranel
egant
,ef
fi
cienteasywayt
oimpl
ementsessi
on
t
racki
ng.Cooki
espr
ovi
deasaut
omat
icani
ntr
oduct
ionf
oreachr
equestaswecoul
d
hopef
or.Foreachr
equest
,acooki
ecanaut
omat
ical
l
ypr
ovi
deacl
i
ent
’ssessi
onI
D
orper
hapsal
i
stofcl
i
ent
sper
for
mance.Theabi
l
ityt
ocust
omi
zecooki
esgi
vest
hem
ext
rapowerandv
ersat
il
it
y.

The bi
ggestpr
obl
em wi
th cooki
esi
sthatbr
owser
sdon’
tal
way
saccept
cooki
essomet
imest
hisi
sbecauset
hebr
owserdoesn’
tsuppor
tcooki
es.Mor
eof
ten
i
tsbecause

Thebr
owserdoesn’
tsuppor
tcooki
es.Mor
eof
teni
tsbecauset
heuserhas
speci
fi
cal
l
yconf
igur
edt
hebr
owsert
oref
usecooki
es.

Thepowerofser
ves:

Thepowerofser
vlet
sisnot
hingbutt
headv
ant
agesofser
vlet
sov
erot
her
appr
oaches, whi
ch i
ncl
ude por
tabi
l
ity
, power
, ef
fi
ciency
, endur
ance, saf
ety
el
egance,
i
ntegr
ati
on,
ext
ensi
bil
i
tyandf
lexi
bil
i
ty.

Por
tabi
l
ity

Asser
vlet
sar
ewr
it
teni
njav
aandconf
ormt
oawel
ldef
inedandwi
del
y
accept
edAPI
.t
heyar
ehi
ghl
ypor
tabl
eacr
ossoper
ati
ngsy
stemsandacr
ossser
ver
i
mpl
ement
ati
on

Wecandev
elopaser
vletonaWi
ndowsNTmachi
ner
unni
ngt
hej
avawebser
verand
l
aterdepl
oyi
tef
for
tl
essl
yonahi
gh-
endUNI
Xser
verr
unni
ngapache.Wi
thser
vlet
s
wecanr
eal
l
y“wr
it
eonce,
ser
veev
erywher
e”

63
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Ser
vletpor
tabi
l
ityi
snott
hest
umbl
i
ngbl
ocki
tsoof
teni
swi
thappl
ets,f
ort
wo
r
easons

Fi
rst
,Ser
vletpor
tabi
l
ityi
snotmandat
oryi
.e.ser
vlet
shast
owor
konl
yonser
ver
machi
nest
hatwear
eusi
ngf
ordev
elopmentanddepl
oyment

Second,
ser
vlet
sav
oidt
hemoster
ror
-pr
oneandi
nconst
ancyi
mpl
ement
edpor
ti
onof
t
hej
aval
anguages.

Power

Ser
vlet
s can har
ness t
he f
ullpoweroft
he cor
ejav
a.API

s:such as
Net
wor
kingandUr
laccess,
mul
ti
thr
eadi
ng,
imagemani
pul
ati
on,
dat
a compr
essi
on,
dat
abaseconnect
ivi
ty,i
nter
nat
ional
i
zat
ion,r
emot
emet
hodi
nvocat
ion(
RMI
)CORBA
connect
ivi
ty,
andobj
ectser
ial
i
zat
ion,
amongot
her
s,

Ef
fi
ciencyandEndur
ance

Ser
vleti
nvocat
ioni
shi
ghl
yef
fi
cient
,Onceaser
vleti
sloadedi
tgener
all
y
r
emai
nsi
ntheser
ver
’smemor
yasasi
ngl
eobj
ecti
nst
ance,Ther
eaf
tert
heser
ver
i
nvokest
heser
vel
tto handl
ear
equestusi
ng asi
mpl
e,l
i
ghtwei
ght
ed met
hod
i
nvocat
ion.
Unl
i
ket
heCGI
,ther
e’snopr
ocesst
ospawnori
nter
pret
ert
oinv
oke,so
t
heser
vletcanbegi
nhandl
i
ngt
her
equestal
mosti
mmedi
atel
y,Mul
ti
ple,concur
rent
r
equest
sar
ehandl
edt
her
equestal
mosti
mmedi
atel
y.Mul
ti
ple,concur
rentr
equest
s
ar
ehandl
edbysepar
atet
hreads,
soser
vlet
sar
ehi
ghl
yscal
abl
e.

Ser
vlet
singener
alar
eendur
ingobj
ect
s.Becauseaser
vlet
sst
aysi
ntheser
ver
’s
memor
yasasi
ngl
eobj
ecti
nst
ance.i
taut
omat
ical
l
ymai
ntai
nsi
tsst
ateandcanhol
d
ont
oext
ernal
resour
ces,
suchasdat
abaseconnect
ions.

Saf
ety

Ser
vlet
ssuppor
tsaf
epr
ogr
ammi
ngpr
act
icesonanumberofl
evel
s.

Ast
heyar
ewr
it
teni
njav
a,ser
vlet
sinher
itt
hest
rongt
ypesaf
etyoft
hej
ava
l
anguage.I
n addi
ti
on t
he ser
vletAPIi
simpl
ement
ed t
o be t
ype saf
e.Jav
a’s
aut
omat
icgar
bagecol
l
ect
ionandl
ackofpoi
nter
smeant
hatser
vlet
sar
egener
all
y
saf
efr
om memor
ymanagementpr
obl
emsl
i
kedangl
i
ngpoi
nter
sinv
ali
dpoi
nter
r
efer
encesandmemor
yleaks.

64
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Ser
vlet
s can handl
e er
ror
s saf
ely
,due t
ojav
a’s except
ion – handl
i
ng
mechani
sm.I
faser
vletdi
vi
desbyzer
oorper
for
mssomei
l
legaloper
ati
ons,i
t
t
hrowsanexcept
iont
hatcanbesaf
elycaughtandhandl
edbyt
heser
ver
.

A ser
vercanf
urt
herpr
otect i
tsel
ffr
om ser
vlet
sthr
ought
heuseofj
ava
secur
it
ymanager
.A ser
vercanexecut
eit
sser
vlet
sundert
hewat
chofast
ri
ct
secur
it
ymanager
.

El
egance

Theel
eganceoft
heser
vletcodei
sst
ri
ki
ng.
Ser
vletcodei
scl
ean,obj
ect
or
ient
edmodul
arandamazi
ngl
ysi
mpl
eoner
easonf
ort
hissi
mpl
i
cit
yist
heser
ved
APIi
tsel
f.Whi
chi
ncl
udesmet
hodsandcl
assest
ohandl
emanyoft
her
out
inechor
es
ofser
vletdev
elopment
.Ev
en adv
anced t
o oper
ati
onsl
i
ke cooki
e handl
i
ng and
sessi
ont
racki
ngt
racki
ngar
eabst
ract
edi
ntconv
eni
entcl
asses.

I
ntegr
ati
on

Ser
vlet
sar
eti
ght
lyi
ntegr
atedwi
tht
heser
ver
.Thi
sint
egr
ati
onal
l
owsaser
vlet
t
ocooper
atewi
tht
heser
veri
ntwoway
s.f
ore.
g.:aser
vletcanuset
heser
vert
o
t
ransl
atef
il
e pat
hs,per
for
m l
oggi
ng,check aut
hor
izat
ion,per
for
m MI
ME t
ype
mappi
ngandi
nsomecasesev
enadduser
stot
heser
ver
’suserdat
abase.

Ext
ensi
bil
i
tyandFl
exi
bil
i
ty

Theser
vletAPIi
sdesi
gnedt
obeeasi
l
yext
ensi
ble.Asi
tst
andst
odayt
heAPI
i
ncl
udescl
assest
hatar
eopt
imi
zedf
orHTTPser
vlet
s.Butl
ateri
tcanbeext
ended
andopt
imi
zedf
oranot
hert
ypeofser
vlet
s.I
tisal
sopossi
blet
hati
tssuppor
tfor
HTTPser
vlet
scoul
dbef
urt
herenhanced.

Ser
vlet
sar
eal
soqui
tef
lexi
ble,Sunal
soi
ntr
oducedj
avaser
verpages.whi
ch
of
ferawayt
owr
it
esni
ppet
sofser
vletcodedi
rect
lywi
thi
nast
ati
cHTMLpage
usi
ngsy
ntaxsi
mil
art
oMi
crosof
t’
sAct
iveser
verpages(
ASP)
.

7.
3JDBC
I
nanef
for
ttosetani
ndependentdat
abasest
andar
dAPIf
orJav
a;Sun
Mi
crosy
stemsdev
elopedJav
aDat
abaseConnect
ivi
ty,
orJDBC.JDBCof
fer
sa
gener
icSQLdat
abaseaccessmechani
sm t
hatpr
ovi
desaconsi
stenti
nter
facet
oa
v
ari
etyofRDBMSs.Thi
sconsi
stenti
nter
facei
sachi
evedt
hrought
heuseof“
plug-
in”

65
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

dat
abaseconnect
ivi
tymodul ordr
es, iver
s.I
fadat
abasev
endorwi
shest
ohav
eJDBC
suppor
t,heorshemustpr
ovi
det
hedr
iverf
oreachpl
atf
ormt
hatt
hedat
abaseand
Jav
arunon.
Togai
nawi
deraccept
anceofJDBC,
SunbasedJDBC’
sfr
amewor
konODBC.
Asy
oudi
scov
eredear
li
eri
nthi
schapt
er,
ODBChaswi
despr
eadsuppor
tonav
ari
ety
ofpl
atf
orms.Basi
ngJDBConODBCwi
l
lal
l
owv
endor
stobr
ingJDBCdr
iver
sto
mar
ketmuchf
ast
ert
handev
elopi
ngacompl
etel
ynewconnect
ivi
tysol
uti
on.
JDBCwasannouncedi
nMar
chof1996.I
twasr
eleasedf
ora90daypubl
i
c
r
evi
ewt
hatendedJune8,
1996.Becauseofuseri
nput
,thef
inal
JDBCv
1.0
speci
fi
cat
ionwasr
eleasedsoonaf
ter
.
Ther
emai
nderoft
hissect
ionwi
l
lcov
erenoughi
nfor
mat
ionaboutJDBCf
ory
out
o
knowwhati
tisaboutandhowt
ousei
tef
fect
ivel
y.Thi
sisbynomeansacompl
ete
ov
erv
iewofJDBC.Thatwoul
dfi
l
lanent
ir
ebook.
JDBCGoal
s
Fewsof
twar
epackagesar
edesi
gnedwi
thoutgoal
sinmi
nd.JDBCi
sonet
hat
,
becauseofi
tsmanygoal
s,dr
ovet
hedev
elopmentoft
heAPI
.Thesegoal
s,i
n
conj
unct
ionwi
thear
lyr
evi
ewerf
eedback,
hav
efi
nal
i
zedt
heJDBCcl
assl
i
brar
yint
oa
sol
i
dfr
amewor
kforbui
l
dingdat
abaseappl
i
cat
ionsi
nJav
a.
Thegoal
sthatwer
esetf
orJDBCar
eimpor
tant
.Theywi
l
lgi
vey
ousomei
nsi
ght
ast
owhycer
tai
ncl
assesandf
unct
ional
i
tiesbehav
ethewayt
heydo.Theei
ght
desi
gngoal
sforJDBCar
easf
oll
ows:
SQLLev
elAPI
Thedesi
gner
sfel
tthatt
hei
rmai
ngoal
wast
odef
ineaSQLi
nter
facef
orJav
a.
Al
thoughnott
hel
owestdat
abasei
nter
facel
evel
possi
ble,
iti
satal
owenough
l
evel
forhi
gher
-l
evel
tool
sandAPI
stobecr
eat
ed.Conv
ersel
y,i
tisatahi
gh
enoughl
evel
forappl
i
cat
ionpr
ogr
ammer
stousei
tconf
ident
ly.At
tai
ningt
hisgoal
al
l
owsf
orf
utur
etool
vendor
sto“
gener
ate”JDBCcodeandt
ohi
demanyof
JDBC’
scompl
exi
ti
esf
rom t
heenduser
.

1.SQLConf
ormance
SQLsy
ntaxv
ari
esasy
oumov
efr
om dat
abasev
endort
odat
abasev
endor
.In
anef
for
ttosuppor
tawi
dev
ari
etyofv
endor
s,JDBCwi
l
lal
l
owanyquer
y
st
atementt
obepassedt
hroughi
ttot
heunder
lyi
ngdat
abasedr
iver
.Thi
sal
l
ows

66
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

t
heconnect
ivi
tymodul
etohandl
enon-
standar
dfunct
ional
i
tyi
namannert
hati
s
sui
tabl
efori
tsuser
s.

2.JDBCmustbei
mpl
ement
alont
opofcommondat
abasei
nter
faces
TheJDBCSQLAPImust“
sit
”ont
opofot
hercommonSQLl
evel
API
s.Thi
s
goal
all
owsJDBCt
ouseex
ist
ingODBCl
evel
dri
ver
sbyt
heuseofasof
twar
e
i
nter
face.Thi
sint
erf
acewoul
dtr
ansl
ateJDBCcal
l
stoODBCandv
icev
ersa.
3.Pr
ovi
deaJav
aint
erf
acet
hati
sconsi
stentwi
tht
her
estoft
heJav
asy
stem
BecauseofJav
a’saccept
ancei
ntheusercommuni
tyt
husf
ar,
thedesi
gner
s
f
eel
thatt
heyshoul
dnotst
rayf
rom t
hecur
rentdesi
gnoft
hecor
eJav
asy
stem.

4.Keepi
tsi
mpl
e
Thi
sgoal
probabl
yappear
sinal
lsof
twar
edesi
gngoal
li
sti
ngs.JDBCi
sno
except
ion.Sunf
eltt
hatt
hedesi
gnofJDBCshoul
dbev
erysi
mpl
e,al
l
owi
ngf
or
onl
yonemet
hodofcompl
eti
ngat
askpermechani
sm.Al
l
owi
ngdupl
i
cat
e
f
unct
ional
i
tyonl
yser
vest
oconf
uset
heuser
soft
heAPI
.

5.Usest
rong,
stat
ict
ypi
ngwher
everpossi
ble
St
rongt
ypi
ngal
l
owsf
ormor
eer
rorchecki
ngt
obedoneatcompi
l
eti
me;
also,
l
esser
rorappearatr
unt
ime.

6.Keept
hecommoncasessi
mpl
e
Becausemor
eof
tent
hannot
,theusual
SQLcal
l
susedbyt
hepr
ogr
ammerar
e
si
mpl
eSELECT’
s,I
NSERT’
s,DELETE’
sandUPDATE’
s,t
hesequer
iesshoul
dbe
si
mpl
etoper
for
m wi
thJDBC.Howev
er,
mor
ecompl
exSQLst
atement
sshoul
d
al
sobepossi
ble.

Fi
nal
l
ywedeci
dedt
opr
oceedt
hei
mpl
ement
ati
onusi
ngJav
aNet
wor
king.

Andf
ordy
nami
cal
l
yupdat
ingt
hecachet
abl
ewegof
orMSAccessdat
abase.

Jav
ahat
wot
hings:
apr
ogr
ammi
ngl
anguageandapl
atf
orm.

Jav
aisahi
gh-
lev
elpr
ogr
ammi
ngl
anguaget
hati
sal
loft
hef
oll
owi
ng

Si
mpl
e Ar
chi
tect
ure-
neut
ral

Obj
ect
-or
ient
ed Por
tabl
e

67
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Di
str
ibut
ed Hi
gh-
per
for
mance

I
nter
pret
ed mul
ti
thr
eaded

Robust Dy
nami
c

Secur
e

Jav
aisal
sounusual
int
hateachJav
apr
ogr
am i
sbot
hcompi
l
edand
i
nter
pret
ed.Wi
thacompi
l
eyout
ransl
ateaJav
apr
ogr
am i
ntoan
i
nter
medi
atel
anguagecal
l
edJav
aby
tecodest
hepl
atf
orm-
independent
codei
nst
ruct
ioni
spassedandr
unont
hecomput
er.Compi
l
ati
onhappens
j
ustonce;
int
erpr
etat
ionoccur
seacht
imet
hepr
ogr
am i
sexecut
ed.The
f
igur
eil
l
ust
rat
eshowt
hiswor
ks.

Jav
aPr
ogr
am I
nter
pret
er

Compi
l
ers MyPr
ogr
am

Youcant
hinkofJav
aby
tecodesast
hemachi
necodei
nst
ruct
ionsf
or
t
heJav
aVi
rt
ual
Machi
ne(
Jav
aVM)
.Ev
eryJav
aint
erpr
eter
,whet
heri
t’
sa
Jav
adev
elopmentt
ool
oraWebbr
owsert
hatcanr
unJav
aappl
ets,
isan
i
mpl
ement
ati
onoft
heJav
aVM.TheJav
aVM canal
sobei
mpl
ement
edi
n
har
dwar
e.Jav
aby
tecodeshel
pmake“
wri
teonce,
runany
wher
e”possi
ble.
Youcancompi
l
eyourJav
apr
ogr
am i
ntoby
tecodesonmypl
atf
ormt
hat
hasaJav
acompi
l
er.Theby
tecodescant
henber
unanyi
mpl
ement
ati
on
oft
heJav
aVM.Forexampl
e,t
hesameJav
apr
ogr
am canr
unWi
ndowsNT,
Sol
ari
s,andMaci
ntosh.
Mi
crosof
tOpenDat
abaseConnect
ivi
ty(
ODBC)i
sast
andar
dpr
ogr
ammi
ng
i
nter
facef
orappl
i
cat
iondev
eloper
sanddat
abasesy
stemspr
ovi
der
s.Bef
oreODBC
becameadef
act
ost
andar
dforWi
ndowspr
ogr
amst
oint
erf
acewi
thdat
abase
sy
stems,
progr
ammer
shadt
ousepr
opr
iet
aryl
anguagesf
oreachdat
abaset
hey

68
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

want
edt
oconnectt
o.Now,
ODBChasmadet
hechoi
ceoft
hedat
abasesy
stem
al
mosti
rr
elev
antf
rom acodi
ngper
spect
ive,
whi
chi
sasi
tshoul
dbe.Appl
i
cat
ion
dev
eloper
shav
emuchmor
eimpor
tantt
hingst
owor
ryaboutt
hant
hesy
ntaxt
hati
s
neededt
opor
tthei
rpr
ogr
am f
rom onedat
abaset
oanot
herwhenbusi
nessneeds
suddenl
ychange.
Thr
ought
heODBCAdmi
nist
rat
ori
nCont
rol
Panel
,youcanspeci
fyt
he
par
ti
cul
ardat
abaset
hati
sassoci
atedwi
thadat
asour
cet
hatanODBCappl
i
cat
ion
pr
ogr
am i
swr
it
tent
ouse.Thi
nkofanODBCdat
asour
ceasadoorwi
thanameoni
t.
Eachdoorwi
l
lleady
out
oapar
ti
cul
ardat
abase.Forexampl
e,t
hedat
asour
cenamed
Sal
esFi
gur
esmi
ghtbeaSQLSer
verdat
abase,
wher
east
heAccount
sPay
abl
edat
a
sour
cecoul
dref
ert
oanAccessdat
abase.Thephy
sical
dat
abaser
efer
redt
obya
dat
asour
cecanr
esi
deany
wher
eont
heLAN.
TheODBCsy
stem f
il
esar
enoti
nst
all
edony
oursy
stem byWi
ndows95.
Rat
her
,theyar
einst
all
edwheny
ouset
upasepar
atedat
abaseappl
i
cat
ion,
suchas
SQLSer
verCl
i
entorVi
sual
Basi
c4.
0.Whent
heODBCi
coni
sinst
all
edi
nCont
rol
Panel
,i
tusesaf
il
ecal
l
edODBCI
NST.
DLL.I
tisal
sopossi
blet
oadmi
nist
ery
our
ODBCdat
asour
cest
hroughast
and-
alonepr
ogr
am cal
l
edODBCADM.
EXE.Ther
eisa
16-
bitanda32-
bitv
ersi
onoft
hispr
ogr
am andeachmai
ntai
nsasepar
atel
i
stof
ODBCdat
asour
ces.
Fr
om apr
ogr
ammi
ngper
spect
ive,
thebeaut
yofODBCi
sthatt
heappl
i
cat
ioncanbe
wr
it
tent
ouset
hesamesetoff
unct
ioncal
l
stoi
nter
facewi
thanydat
asour
ce,
r
egar
dlessoft
hedat
abasev
endor
.Thesour
cecodeoft
heappl
i
cat
iondoesn’
t
changewhet
heri
ttal
kst
oOr
acl
eorSQLSer
ver
.Weonl
yment
iont
heset
woasan
exampl
e.Ther
ear
eODBCdr
iver
sav
ail
abl
eforsev
eral
dozenpopul
ardat
abase
sy
stems.Ev
enExcel
spr
eadsheet
sandpl
aint
extf
il
escanbet
urnedi
ntodat
a
sour
ces.Theoper
ati
ngsy
stem usest
heRegi
str
yinf
ormat
ionwr
it
tenbyODBC
Admi
nist
rat
ort
odet
ermi
newhi
chl
ow-
lev
elODBCdr
iver
sar
eneededt
otal
ktot
he
dat
asour
ce(
suchast
hei
nter
facet
oOr
acl
eorSQLSer
ver
).Thel
oadi
ngoft
heODBC
dr
iver
sist
ranspar
entt
otheODBCappl
i
cat
ionpr
ogr
am.I
nacl
i
ent
/ser
ver
env
ironment
,theODBCAPIev
enhandl
esmanyoft
henet
wor
kissuesf
ort
he
appl
i
cat
ionpr
ogr
ammer
.

Theadv
ant
agesoft
hisschemear
esonumer
oust
haty
ouar
epr
obabl
y

69
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

t
hinki
ngt
her
emustbesomecat
ch.Theonl
ydi
sadv
ant
ageofODBCi
sthati
tisn’
tas
ef
fi
cientast
alki
ngdi
rect
lyt
othenat
ivedat
abasei
nter
face.ODBChashadmany
det
ract
orsmaket
hechar
get
hati
tist
oosl
ow.Mi
crosof
thasal
way
scl
aimedt
hatt
he
cr
it
ical
fact
ori
nper
for
mancei
sthequal
i
tyoft
hedr
iversof
twar
ethati
sused.I
nour
humbl
eopi
nion,
thi
sist
rue.Theav
ail
abi
l
ityofgoodODBCdr
iver
shasi
mpr
oveda
gr
eatdeal
recent
ly.Andany
way
,thecr
it
ici
sm aboutper
for
mancei
ssomewhat
anal
ogoust
othosewhosai
dthatcompi
l
erswoul
dnev
ermat
cht
hespeedofpur
e
assembl
ylanguage.May
benot
,butt
hecompi
l
er(
orODBC)gi
vesy
out
heoppor
tuni
ty
t
owr
it
ecl
eanerpr
ogr
ams,
whi
chmeansy
ouf
ini
shsooner
.Meanwhi
l
e,comput
ers
getf
ast
erev
eryy
ear
.
7.
4ORACLE
Or
acl
eisar
elat
ionaldat
abasemanagementsy
stem,whi
chor
gani
zesdat
ain
t
hef
orm oft
abl
es.Or
acl
eisoneofmanydat
abaseser
ver
sbasedonRDBMSmodel
,
whi
chmanagesaseerofdat
athatat
tendst
hreespeci
fi
cthi
ngs-
dat
ast
ruct
ures,
dat
aint
egr
it
yanddat
amani
pul
ati
on.

Wi
thor
acl
ecooper
ati
veser
vert
echnol
ogywecanr
eal
i
zet
hebenef
it
sofopen,
r
elat
ionalsy
stemsf
oral
ltheappl
i
cat
ions.Or
acl
emakesef
fi
cientuseofal
lsy
stems
r
esour
ces,onal
lhar
dwar
ear
chi
tect
ure;t
odel
i
verunmat
chedper
for
mance,pr
ice
per
for
manceand scal
abi
l
ity
.AnyDBMS t
o becal
l
ed asRDBMS hast
o sat
isf
y
Dr
.E.
F.Codd’
srul
es.

Feat
uresofOr
acl
e:

Por
tabl
e

TheOr
acl
eRDBMSi
sav
ail
abl
eonwi
der
angeofpl
atf
ormsr
angi
ngf
rom PCs
t
osupercomput
ersandasamul
tiuserl
oadabl
emodul
eforNov
elNet
War
e,i
fyou
dev
elopappl
i
cat
iononsy
stem y
oucanr
unt
hesameappl
i
cat
iononot
hersy
stems
wi
thoutanymodi
fi
cat
ions.

Compat
ibl
e

Or
acl
ecommandscanbeusedf
orcommuni
cat
ingwi
thI
BM DB2mai
nfr
ame
RDBMSt
hati
sdi
ff
erentf
rom Or
acl
e,whi
chi
sOr
acl
ecompat
ibl
ewi
thDB2.Or
acl
e
RDBMSi
sahi
ghper
for
mancef
aul
ttol
erantDBMS,whi
chi
sspeci
all
ydesi
gnedf
or

70
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

onl
i
net
ransact
ionpr
ocessi
ngandf
orhandl
i
ngl
argedat
abaseappl
i
cat
ions.

Mul
ti
thr
eadedSer
verAr
chi
tect
ure

Or
acl
e adapt
abl
e mul
ti
thr
eaded ser
verar
chi
tect
ure del
i
ver
s scal
abl
e hi
gh
per
for
mancef
orv
eryl
argenumberofuser
sonal
lhar
dwar
ear
chi
tect
urei
ncl
udi
ng
sy
mmet
ri
c mul
ti
processor
s (
sumps) and l
oosel
y coupl
ed mul
ti
processor
s.
Per
for
mancei
sachi
evedbyel
i
minat
ingCPU,I
/O,memor
yandoper
ati
ngsy
stem
bot
tl
enecksandbyopt
imi
zi
ngt
heOr
acl
eDBMSser
vercodet
oel
i
minat
eal
lint
ernal
bot
tl
enecks.

Or
acl
ehasbecomet
hemostpopul
arRDBMSi
nthemar
ketbecauseofi
tseaseof
use

 Cl
i
ent
/ser
verar
chi
tect
ure.
 Dat
aindependence.
 Ensur
ingdat
aint
egr
it
yanddat
asecur
it
y.
 Managi
ngdat
aconcur
rency
.
 Par
all
elpr
ocessi
ngsuppor
tforspeedupdat
aent
ryandonl
i
net
ransact
ion
pr
ocessi
ngusedf
orappl
i
cat
ions.
 DBpr
ocedur
es,
funct
ionsandpackages.
Dr
.E.
F.Codd’
sRul
es

These r
ules ar
e used f
orv
aluat
ing a pr
oductt
o be cal
l
ed as r
elat
ional
dat
abasemanagementsy
stems.Outof12r
ules,
aRDBMSpr
oductshoul
dsat
isf
yat
l
east8r
ules+r
ulecal
l
edr
ule0t
hatmustbesat
isf
ied.

RULE0:
Foundat
ionRul
e

Foranysy
stem t
obeadv
ert
isedas,orcl
aimedt
ober
elat
ionalDBMSshoul
d
managedat
abasewi
thi
nitsel
f,wi
thoutusi
nganext
ernal
language.

RULE1:
Inf
ormat
ionRul
e

Al
li
nfor
mat
ioni
nrel
ati
onaldat
abasei
srepr
esent
edatl
ogi
call
eveli
nonl
yone

71
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

wayasv
aluesi
ntabl
es.

RULE2:
Guar
ant
eedAccess

Eachandev
erydat
ainar
elat
ionaldat
abasei
sguar
ant
eedt
obel
ogi
cal
l
y
accessi
bil
i
tybyusi
ngt
oacombi
nat
ionoft
abl
ename,
pri
mar
ykeyv
alueandcol
umn
name.

RULE3:
Syst
emat
icTr
eat
mentofNul
lVal
ues

Nul
lval
ues ar
e suppor
ted f
or r
epr
esent
ing mi
ssi
ng i
nfor
mat
ion and
i
nappl
i
cabl
einf
ormat
ion.Theymustbehandl
edi
nsy
stemat
icway
,independentof
dat
aty
pes.

RULE4:
Dynami
cOnl
i
neCat
alogbasedRel
ati
onModel

Thedat
abasedescr
ipt
ioni
srepr
esent
edatt
hel
ogi
call
eveli
nthesameway
asor
dinar
ydat
asot
hataut
hor
izeduser
scanappl
ythesamer
elat
ionall
anguaget
o
i
tsi
nter
rogat
ionast
heydot
other
egul
ardat
a.

RULE5:
Compr
ehensi
veDat
aSubLanguage

Ar
elat
ionalsy
stem maysuppor
tsev
erall
anguagesandv
ari
ousmodel
soft
ermi
nal
use.Howev
ert
her
emustbeonel
anguagewhosest
atementcanexpr
essal
loft
he
f
oll
owi
ng:

Dat
aDef
ini
ti
ons,Vi
ew Def
ini
ti
ons,Dat
aMani
pul
ati
ons,I
ntegr
it
y,Const
rai
nts,
Aut
hor
izat
ionandt
ransact
ionboundar
ies.

RULE6:
ViewUpdat
ing

Anyv
iewt
hati
stheor
eti
calcanbeupdat
abl
eifchangescanbemadet
othe
t
abl
est
hatef
fectt
hedesi
redchangesi
nthev
iew.

RULE7:
Highl
evel
Updat
e,I
nser
tandDel
ete

72
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Thecapabi
l
ityofhandl
i
ngabaser
elat
ionalorder
ivedr
elat
ionalasasi
ngl
e
oper
andappl
i
esnotonl
yret
ri
eval
ofdat
aal
sot
oit
sinser
ti
on,
updat
ing,
anddel
eti
on.

RULE8:
Phy
sical
Dat
aIndependence

Appl
i
cat
ion pr
ogr
am and t
ermi
nalact
ivi
ti
es r
emai
nlogi
cal
l
y uni
mpai
red
whenev
eranychangesar
emadei
nei
therst
orager
epr
esent
ati
onoraccessmet
hod.

RULE9:
Logi
cal
Dat
aIndependence

Appl
i
cat
ion pr
ogr
ams and t
ermi
nalact
ivi
ti
es r
emai
nlogi
cal
l
yuni
mpai
red
whenev
eranychangesar
emadei
nei
therst
orager
epr
esent
ati
onoraccessmet
hods.

RULE10:I
ntegr
it
yIndependence

I
ntegr
it
yconst
rai
ntsspeci
fi
ctopar
ti
cul
ardat
abasemustbedef
inabl
eint
he
r
elat
ional
dat
ast
oredi
nthecat
alog,
noti
nappl
i
cat
ionpr
ogr
am.

RULE11:
Dist
ri
but
edI
ndependence

Whet
herornotasy
stem suppor
tsdat
abasedi
str
ibut
ion,i
tmusthav
eadat
a
sub-
language t
hat can suppor
t di
str
ibut
ed dat
abases wi
thout changi
ng t
he
appl
i
cat
ionpr
ogr
am.

RULE12:
NonSub-
Ver
sion

I
far
elat
ionalsy
stem hasl
owl
evell
anguage,
thatl
owl
anguagecannotuset
o
subv
ersi
onorbypasst
hei
ntegr
it
yrul
esandconst
rai
ntsexpr
essedi
nthehi
gher
l
evel
rel
ati
onal
language.

Or
acl
esuppor
tst
hef
oll
owi
ngCodd’
sRul
es

Rul
e1:I
nfor
mat
ionRul
e(Repr
esent
ati
onofi
nfor
mat
ion)
-YES.

Rul
e2:Guar
ant
eedAccess-
YES.

Rul
e3:Sy
stemat
ict
reat
mentofNul
lval
ues-
YES.

Rul
e4:Dy
nami
con-
li
necat
alog-
basedRel
ati
onal
Model
-YES.

Rul
e5:Compr
ehensi
vedat
asubl
anguage-
YES.

73
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Rul
e6:Vi
ewUpdat
ing-
PARTI
AL.

Rul
e7:Hi
gh-
lev
elUpdat
e,I
nser
tandDel
ete-
YES.

Rul
e8:Phy
sical
dat
aIndependence-
PARTI
AL.

Rul
e9:Logi
cal
dat
aIndependence-
PARTI
AL.

Rul
e10:
Int
egr
it
yIndependence-
PARTI
AL.

Rul
e11:
Dist
ri
but
edI
ndependence-
YES.

Rul
e12:
Non-
subv
ersi
on-
YES.

7.
5HTML(
Hyper
textMar
kupLanguage)
Thel
anguagesoft
hewor
ldwi
deweb(
WWW)
,al
l
owsuser
stopr
oduceswebpages
t
hati
ncl
udedt
ext
,gr
aphi
csandpoi
ntert
oot
herwebpages(
Hyper
li
nks)
.
HTMLi
snotapr
ogr
ammi
ngl
anguagebuti
tisanappl
i
cat
ionofI
SOSt
andar
d
8879,
SGML(
Standar
dGener
ali
zedMar
kupLanguage)
,but

Speci
ali
zedt
ohy
per
textandadapt
edt
otheWeb.Thei
deabehi
ndHy
per
text
onepoi
ntt
oanot
herpoi
nt.Wecannav
igat
ethr
ought
hei
nfor
mat
ionbasedonout
i
nter
estandpr
efer
ence.Amar
kupl
anguagei
ssi
mpl
yaser
iesofi
temsencl
osed
wi
thi
ntheel
ement
sshoul
dbedi
spl
ayed.

Hy
per
li
nksar
eunder
li
nedoremphasi
zedwor
kst
hatl
oadt
oot
herdocument
s
orsomepor
ti
onsoft
hesamedocument
.

Ht
mlcanbeusedt
odi
spl
ayanyt
ypeofdocumentont
hehostcomput
er,
whi
chcanbegeogr
aphi
cal
l
yatadi
ff
erentl
ocat
ion.I
tisav
ersat
il
elanguageandcan
beusedonanypl
atf
orm ordeskt
op

HTMLpr
ovi
dest
ags(
speci
alcodes)t
omaket
hedocumentl
ookat
tr
act
ive.

HTMLpr
ovi
desar
enotcase-
sensi
ti
ve.Usi
nggr
aphi
cs,
font
s,di
ff
erentsi
zes,
col
or,
etc.
.canenhancet
hepr
esent
ati
onoft
hedocument
.Any
thi
ng

Thati
snotat
agi
spar
toft
hedocumenti
tsel
f.

74
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

Basi
cHt
mlTags:

<!
---
-> Speci
fi
cComment
s.

<A>………</
A> Cr
eat
esHy
per
textl
i
nks.

<B>………</
B> Cr
eat
eshy
per
textl
i
nks.

<Bi
g>…….
.</
Big> For
mat
stexti
nlar
ge-
font

<Body
>…….
</Body
> cont
ainsal
ltagsandt
exti
ntheHt
ml-
document

<Cent
er>……</
Cent
er> Cr
eat
esText

<DD>……….
.</
DD> Def
ini
ti
onofat
erm.

<TABLE>……</
TABLE> cr
eat
est
abl
e

<Td>……….
.</
Td> i
ndi
cat
est
abl
edat
ainat
abl
e.

<Tr
>……….
.</
Tr> desi
gnat
esat
abl
erow

<Th>……….
</Th> cr
eat
esaheadi
ngi
nat
abl
e.

Adv
ant
ages:

 AHTMLdocumenti
ssmal
landhenceeasyt
osendov
ert
henet
.I
tis
smal
l
 becausei
tdoesnoti
ncl
udef
ormat
tedi
nfor
mat
ion.
 HTMLi
spl
atf
ormi
ndependent
HTMLt
agsar
enotcase-
sensi
ti
ve.

75
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

7.
6JAVASCRI
PT
TheJav
aScr
iptLanguage
Jav
aScr
ipti
sacompact,obj
ect
-basedscr
ipt
ingl
anguagef
ordev
elopi
ng
cl
i
entandser
veri
nter
netappl
i
cat
ions.Net
scapeNav
igat
or2.
0int
erpr
etsJav
aScr
ipt
st
atement
sembeddeddi
rect
lyi
nanHTMLpage.andLi
vewi
reenabl
esy
out
ocr
eat
e
ser
ver
-basedappl
i
cat
ionssi
mil
art
ocommongat
ewayi
nter
face(
cgi
)pr
ogr
ams.

I
nacl
i
entappl
i
cat
ionf
orNav
igat
or,Jav
aScr
iptst
atement
sembeddedi
nan
HTMLPagecanr
ecogni
zeandr
espondt
ouserev
ent
ssuchasmousecl
i
cksf
orm

I
nput
,andpagenav
igat
ion.

Forexampl e,youcanwr iteaJav aScri


ptfunct
iontov eri
fythatuser senter
val
idinformationintoaf ormrequesti
ngat elephonenumberorzi pcode.Wi t
hout
anynet worktransmission,anHtmlpagewi t
hembeddedJav aScriptcani nterpr
et
theenteredtextandalerttheuserwit
hamessagedi al
ogiftheinputisinval
idory ou
canuseJav aScri
ptt oper f
orm anacti
on( suchaspl ayanaudi of i
le,executean
appl
et,orcommuni catewithaplug-i
n)inresponsetot heuseropeningorexi ti
nga
page.

76
Pr
oGuar
d:Det
ect
ingMal
i
ciousAccountsi
nSoci
al-
Net
wor
k-BasedOnl
i
ne
Promotions

BI
BLI
OGRAPHY
[
1]Y.WangandS.D.Mai
nwar
ing,“
Human-
cur
rencyi
nter
act
ion:l
ear
ningf
rom
v
irt
ualcur
rencyusei
nchi
na,
”inPr
oceedi
ngsoft
heSI
GCHIConf
erenceonHuman
Fact
orsi
nComput
ingSy
stems.ACM,
2008,
pp.25–28.
[
2]J.S.GansandH.Hal
abur
da,“
Someeconomi
csofpr
ivat
edi
git
alcur
rency
,”
Rot
manSchoolofManagementWor
kingPaper
,no.2297296,
2013.
[
3]X.Hu,J.Tang,andH.Li
u,“
Onl
i
nesoci
alspammerdet
ect
ion,
”inPr
oceedi
ngsof
t
heTwent
y-Ei
ght
hAAAIConf
erenceonAr
ti
fi
cialI
ntel
l
igence.AAAI
,2014,
pp.59–65.
[
4] ——, “
Lev
eragi
ng knowl
edge acr
oss medi
a f
or spammer det
ect
ion i
n
mi
crobl
oggi
ng,
”inPr
oceedi
ngsoft
he37t
hint
ernat
ionalACM SI
GIRconf
erenceon
Resear
ch&dev
elopmenti
ninf
ormat
ionr
etr
iev
al.ACM,
2014,
pp.547–556.
[
5]Z.Chu,S.Gi
anv
ecchi
o,H.Wang,andS.Jaj
odi
a,“
Det
ect
ingaut
omat
ionoft
wit
ter
account
s:Ar
eyouahuman,bot
,orcy
bor
g?”I
EEETr
ansact
ionsonDependabl
eand
Secur
eComput
ing,
vol
.9,
no.6,
pp.811–824,
2012.

77

You might also like