-
Notifications
You must be signed in to change notification settings - Fork 9
/
install.sh
executable file
·1370 lines (1341 loc) · 51.4 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
##############################################################################
##############################################################################
## Passive Network Audit Framework installer ##
## By Javier Santillan [jusafing@gmail.com] (2014) ##
## -------------------------------------------------------------------------##
## Requirements: ##
## - Debian GNU/Linux 7.0.x ##
## - Gentoo GNU/Linux stage3-x ##
## Summary : ##
## Installation script of Passive Network Audit Framework v0.1 ##
## It compiles and installs a set of traffic analysis tools. ##
## See README file for more info. ##
##############################################################################
##############################################################################
######################## VARIABLES CONFIGURATION #########################
##############################################################################
INSTALLER_DIR=`pwd`
INSTALLER_LOGFILE="$INSTALLER_DIR/install.log"
INSTALLER_USER=`whoami`
BUILD_DIR="$INSTALLER_DIR/build"
OPT_OS="debian" #default Debian
#------------------------------------------------------------------------#
PNAF_DIR="/pnaf"
PNAF_SENSORNAME="Test"
PNAF_USER="pnaf"
DIALOG=${DIALOG=dialog}
PNAF_INSTALLER="PNAF Installer v0.1.2"
PNAF_EMERGE="/usr/bin/emerge"
PNAF_APT="/usr/bin/aptitude"
#------------------------------------------------------------------------#
TCPXTRACT_WEB="https://github.com/gamelinux/tcpxtract.git"
YAFWEB="http://tools.netsa.cert.org/yaf/download.html#"
SSLDUMP_WEB="http://www.rtfm.com/ssldump/ssldump-0.9b3.tar.gz"
BRO_WEB="http://www.bro.org/downloads/release/bro-2.2.tar.gz"
PASSIVEDNS_WEB="https://github.com/gamelinux/passivedns.git"
SNORT_WEB="https://www.snort.org/downloads/snort/snort-2.9.7.0.tar.gz"
HTTPD_WEB="http://apache.mirror.1000mbps.com//httpd/httpd-2.2.27.tar.gz"
HTTPRY_SRCFILE="$INSTALLER_WORKDIR/build/httpry.tar.gz"
CXTRACKER_WEB="https://github.com/gamelinux/cxtracker.git"
CHAOSREADER_WEB="https://github.com/firnsy/chaosreader2/archive/master.zip"
SURICATA_WEB="http://www.openinfosecfoundation.org/download/suricata-2.0.tar.gz"
IPFORENSICS_WEB="https://github.com/verisign/ipforensics"
TCPDUMP_WEB="http://www.rtfm.com/tcpdump/tcpdump-0.9b3.tar.gz"
NETSNIFF_WEB="https://github.com/netsniff-ng/netsniff-ng.git"
ARGUS_WEB="http://qosient.com/argus/src/argus-3.0.6.tar.gz"
DNSCAP_WEB="https://github.com/verisign/dnscap.git"
PRADS_WEB="https://github.com/gamelinux/prads.git"
NFTRACKER_WEB="https://github.com/gamelinux/nftracker.git"
P0F_WEB="http://lcamtuf.coredump.cx/p0f3/releases/p0f-3.06b.tgz"
# Github https://github.com/p0f/p0f.git
BARNYARD_WEB="https://github.com/firnsy/barnyard2.git"
SILK_WEB="http://tools.netsa.cert.org/silk/download.html#"
TCPDSTAT_WEB="https://github.com/netik/tcpdstat.git"
TCPFLOW_WEB="http://www.digitalcorpora.org/downloads/tcpflow/"
#------------------------------------------------------------------------#
TCPXTRACT="tcpxtract-1.0.1"
YAF="yaf-2.5.0"
LIBPCAP="libpcap-1.6.2"
SSLDUMP="ssldump-0.9b3"
DNSDUMP="dnsdump-1.11"
BRO="bro-2.3.1"
PASSIVEDNS="passivedns"
SNORT="snort-2.9.7.0"
HTTPD="httpd-2.2.27"
HTTPRY="httpry"
NDPI="nDPI"
XPLICO="xplico-1.1.0"
CXTRACKER="cxtracker"
CHAOSREADER="chaosreader"
SURICATA="suricata-2.0.4"
IPFORENSICS="ipforensics"
TCPDUMP="tcpdump-4.5.1"
NETSNIFF="netsniff-ng"
ARGUS_SERVER="argus-3.0.6"
ARGUS_CLIENT="argus-clients-3.0.6"
DNSCAP="dnscap"
PRADS="prads"
NFTRACKER="nftracker"
P0F="p0f-3.06b"
BARNYARD="barnyard2"
SILK="silk-3.8.1"
TCPDSTAT="tcpdstat"
TCPFLOW="tcpflow-1.3.0"
#------------------------------------------------------------------------#
SURICATA_LIBJANSSON_LIB="/usr/lib/i386-linux-gnu/"
SURICATA_LIBJANSSON_INC="/usr/include/"
##############################################################################
##############################################################################
##############################################################################
start()
{
userInstall
startConfirm
selectTools
installTools "$TOOLS"
bannerLog
installPnaf
finalBanner
}
##############################################################################
logMsg()
{
dialog --infobox "[$1] - $2" 5 65
msg="[`date \"+%Y%m%d-%H:%M:%S\"`] [$1] - $2"
echo $msg >> $INSTALLER_LOGFILE
}
##############################################################################
execCmd()
{
local fname="execCmd"
cmd="$2"
logMsg "$1 -> $FUNCNAME" " Executing: $2 ... "
if [[ $cmd == *"aptitude"* ]]; then
eval $cmd 2>&1
else
eval $cmd &>> $INSTALLER_LOGFILE.exec
fi
if [ $? -ne 0 ]; then
logMsg "$FUNCNAME" "ERROR: Execution of $1 [$2]"
exitInstall
else
logMsg "$FUNCNAME" " $1 [$2] ... OK"
fi
}
##############################################################################
exitInstall()
{
local fname="exitInstall"
echo "The installation script has been terminated with errors"
logMsg "$FUNCNAME" "The installation script has been terminated with \
errors. See install.log files for details."
exit 1
}
##############################################################################
userInstall()
{
if [ "$INSTALLER_USER" != "root" ]; then
echo ""
echo ""
echo "#####################################################"
echo "# You must be root to run the installer #"
echo "#####################################################"
echo ""
echo ""
exit 1
fi
}
##############################################################################
exitInstaller()
{
echo
echo "#################################"
echo "## PNAF Installer has finished ##"
echo "#################################"
echo
exit 0
}
##############################################################################
startConfirm()
{
local fname="startConfirm"
logMsg "$FUNCNAME" "Preparing installer environment. See install.log \
files for detailed log ... (working)"
if [ -x "$PNAF_APT" ]; then
OPT_OS="debian"
execCmd "$FUNCNAME" "aptitude update"
execCmd "$FUNCNAME" "aptitude install -y dialog"
elif [ -x "$PNAF_EMERGE" ]; then
OPT_OS="gentoo"
execCmd "$FUNCNAME" "emerge-webrsync"
cmd="emerge --noreplace dialog"
eval "$cmd" &>> $INSTALLER_LOGFILE.exec
if [ $? -ne 0 ]; then
logMsg "$FUNCNAME" "ERROR: Execution of ($cmd)"
exitInstall
else
logMsg "$FUNCNAME" " $cmd ... OK"
fi
else
echo
echo "ERROR. Unable to find emerge nor aptitude"
exitInstall
fi
$DIALOG --title "$PNAF_INSTALLER" --clear \
--yesno "Welcome. Do you want to install PNAF\
on this system?" 7 70
case $? in
0)
echo "Starting PNAF installer.";;
1)
exitInstaller;;
255)
exitInstaller;;
esac
}
##############################################################################
selectTools()
{
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
$DIALOG --backtitle "$PNAF_INSTALLER" \
--title "OS selection" --clear \
--checklist "Please select the operating system of this sensor"\
20 61 15 \
"Prads" "1- Profiling and enumeration tool" on \
"P0f" "2- Profiling and enumeration tool" on \
"Tcpdstat" "3- Protocol Distribution" on \
"Suricata" "4- Intrusion Detection system" on \
"Snort" "5- Intrusion Detection system" on \
"Bro" "6- Intrusion Detection Framework" on \
"Barnyard" "7- Unified2 data logger" off \
"Cxtracker" "8- Session Tracker" on \
"Argus" "9- Network flow analyzer" on \
"Yaf" "10- Network Flow analyzer" off \
"Silk" "11- Network Flow Analyzer" off \
"Tcpflow" "12- Network Flow Analyzer" on \
"Chaosreader" "13- Application data analyzer" on \
"Xplico" "14- Application data analyzer" off \
"Httpry" "15- HTTP data extractor" on \
"Ssldump" "16- SSLv3/TLS data tracker" on \
"Dnsdump" "17- DNS data extractor" off \
"Dnscap" "18- DNS data extractor" off \
"PassiveDNS" "19- Passive DNS data collector" on \
"Nftracker" "20- File extractor" on \
"Tcpxtract" "21- File extractor" on \
"IPforensics" "22- Network traffic analyzer" on \
"Tcpdump" "23- Network traffic analyzer" on \
"Httpd" "24- HTTP server (frontend visualization)" on\
"ConfTemplates" "25- Template configuration files" off\
2> $tempfile
retval=$?
TOOLS=`cat $tempfile`
case $retval in
0)
echo "PNAF installer will prepare installation environment \
for '$TOOLS' based system"
;;
1)
echo "Cancel pressed."
exitInstaller
;;
255)
echo "ESC pressed."
exitInstaller
;;
esac
}
##############################################################################
installTools()
{
fname="installTools"
makeDirs
installPkg "$OPT_OS"
logMsg "$FUNCNAME" "Installing selected tools ($TOOLS)"
sleep 2
for i in `echo $TOOLS| sed 's/"//g'`;
do
runInstaller $i
done
}
##############################################################################
bannerLog()
{
local fname="bannerLog"
echo "##############################################"
echo "PASSIVE AUDIT FRAMEWORK INSTALLATION"
echo "##############################################"
echo "______________________________________________"
echo "Started @ [`date`]"
}
##############################################################################
cleanDir()
{
local fname="cleanDir"
if [ -d $1 ]; then
logMsg "$FUNCNAME" "Cleaning existing $1 directory"
execCmd "$FUNCNAME" "rm -rf $1"
# execCmd "$FUNCNAME" "mkdir -p $1"
fi
}
##############################################################################
makeDirs()
{
local fname="makeDirs"
$DIALOG --title "$PNAF_INSTALLER" --clear \
--yesno "Do you want to perform a clean installation? \
This will delete any existing PNAF installation" 7 70
case $? in
0)
cleanDir "$PNAF_DIR"
logMsg "$FUNCNAME" "#####################################"
logMsg "$FUNCNAME" "Creating PNAF directories"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/build"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/etc"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/bin"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/log"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/reports"
;;
1)
dialog --infobox "The installer will keep existing tools" 5 30;
sleep 1;
;;
255)
dialog --infobox "The installer will keep existing tools" 5 30;
sleep 1;
;;
esac
}
##############################################################################
installPnaf()
{
local outdir="$PNAF_DIR/build/pnaf"
logMsg "$FUNCNAME" "#####################################"
logMsg "$FUNCNAME" "Installing PNAF modules"
logMsg "$FUNCNAME" "Installing required CPAN modules"
execCmd "$FUNCNAME" "cpan -i Config::Auto"
execCmd "$FUNCNAME" "cpan -i Pod::Usage"
execCmd "$FUNCNAME" "cpan -i Proc::Daemon"
execCmd "$FUNCNAME" "cpan -i IO::CaptureOutput"
execCmd "$FUNCNAME" "cpan -i JSON:XS"
execCmd "$FUNCNAME" "cpan -i Cwd"
execCmd "$FUNCNAME" "cpan -i JSON::Parse"
execCmd "$FUNCNAME" "cpan -i Time::Piece"
execCmd "$FUNCNAME" "cpan -i Exception::Class"
execCmd "$FUNCNAME" "cpan -i Test::Warn"
execCmd "$FUNCNAME" "cpan -i Test::Differences"
execCmd "$FUNCNAME" "cpan -i Test::Deep"
execCmd "$FUNCNAME" "cpan -i Test::Most"
execCmd "$FUNCNAME" "cpan -i HTTP::BrowserDetect"
execCmd "$FUNCNAME" "cpan -i Getopt::Long"
execCmd "$FUNCNAME" "cpan -i String::Tokenizer"
execCmd "$FUNCNAME" "cpan -i URI::Encode"
execCmd "$FUNCNAME" "cpan -i Devel::Hexdump"
execCmd "$FUNCNAME" "cpan -i Digest::MD5"
execCmd "$FUNCNAME" "cpan -i Data::Dumper"
execCmd "$FUNCNAME" "cpan -i YAML"
execCmd "$FUNCNAME" "cpan -i NetPacket::Ethernet"
execCmd "$FUNCNAME" "cpan -i Net::Subnet"
logMsg "$FUNCNAME" "Installing PNAF prerequisite utilities"
execCmd "$FUNCNAME" "cd $INSTALLER_DIR/build/SnortUnified"
execCmd "$FUNCNAME" "perl Makefile.PL"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
cleanDir "$PNAF_DIR/www/json"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/www"
execCmd "$FUNCNAME" "cp -r $INSTALLER_DIR/build/json $PNAF_DIR/www/json"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/tmp/nvd.json \
$PNAF_DIR/etc/pnaf_dict.json"
execCmd "$FUNCNAME" "mkdir -p $outdir"
execCmd "$FUNCNAME" "cp -r $INSTALLER_DIR/build/pnaf/etc $outdir"
execCmd "$FUNCNAME" "cp -r $INSTALLER_DIR/build/pnaf/bin $outdir"
execCmd "$FUNCNAME" "touch $PNAF_DIR/log/pool.capture"
execCmd "$FUNCNAME" "touch $PNAF_DIR/log/pool.audit"
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/log/capture.fifo"
execCmd "$FUNCNAME" "mkfifo $PNAF_DIR/log/capture.fifo"
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/log/audit.fifo"
execCmd "$FUNCNAME" "mkfifo $PNAF_DIR/log/audit.fifo"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/log/capture"
logMsg "$FUNCNAME" "Installing PNAF Perl API "
execCmd "$FUNCNAME" "cd $INSTALLER_DIR/build/pnaf/Pnaf"
execCmd "$FUNCNAME" "perl Makefile.PL"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
makeLinks
}
##############################################################################
installConfTemplates()
{
local outdir="$PNAF_DIR/build/pnaf"
logMsg "$FUNCNAME" "Installing configuration files templates"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/tmp/iprep/pnaf_blcat.dat\
$PNAF_DIR/etc/pnaf_blcat.dat"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/tmp/iprep/pnaf_blip.dat\
$PNAF_DIR/etc/pnaf_blip.dat"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/tmp/iprep/pnaf_bldn.dat\
$PNAF_DIR/etc/pnaf_bldn.dat"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_snort.conf\
$PNAF_DIR/etc/snort.conf"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_suricata.yaml\
$PNAF_DIR/etc/suricata.yaml"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_emerging-dns.rules \
$PNAF_DIR/build/snort/rules/emerging-dns.rules "
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_emerging-attack_response.rules \
$PNAF_DIR/build/snort/rules/emerging-attack_response.rules "
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_emerging-current_events.rules \
$PNAF_DIR/build/snort/rules/emerging-current_events.rules"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_emerging-policy.rules \
$PNAF_DIR/build/snort/rules/emerging-policy.rules"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_emerging-worm.rules \
$PNAF_DIR/build/snort/rules/emerging-worm.rules"
execCmd "$FUNCNAME" "cp $INSTALLER_DIR/build/pnaf/etc/template_httpd.conf \
$PNAF_DIR/build/httpd/conf/httpd.conf"
}
##############################################################################
installPkg()
{
local fname="Pkg"
perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, \
autoconfig => 1); $c->edit(prerequisites_policy => "follow"); \
$c->edit(build_requires_install_policy => "yes"); $c->commit'
logMsg "$FUNCNAME" "Installing dependencies using (emerge/apt)"
if [ "$1" == "debian" ]; then
execCmd "$FUNCNAME" "aptitude install -y autoconf automake \
binutils-dev bison \
build-essential byacc ccache cmake dsniff flex g++ gawk gcc \
libcap-ng-dev libcli-dev libdatetime-perl libdumbnet-dev \
libfixposix0 libfixposix-dev libgeoip-dev zlib1g zlib1g-dev \
libgetopt-long-descriptive-perl libglib2.0-cil-dev \
libjansson4 libjansson-dev libldns-dev liblzo2-2 libnet1-dev \
libmagic-dev libmysql++3 libmysqlclient-dev libmysql++-dev \
libnacl-dev libncurses5-dev libldns1 libnetfilter-conntrack-dev \
libnetfilter-queue1 libnetfilter-queue-dev libnet-pcap-perl \
libnfnetlink0 libnfnetlink-dev libnl-3-dev libnl-genl-3-dev \
libpcap-dev libpcre3 libpcre3-dbg libpcre3-dev libsqlite3-dev \
libssl-dev liburcu-dev libyaml-0-2 libyaml-dev liblzo2-dev \
openssl pkg-config python-dev python-docutils sqlite3 swig \
git-core libglib2.0-dev libtool tcpslice tcpick tshark \
tcpflow ethtool"
elif [ "$1" == "gentoo" ]; then
execCmd "$FUNCNAME" "emerge-webrsync"
# Base packages
cmd="emerge --noreplace autoconf automake binutils bison libtool byacc\
ccache cmake flex gawk gcc dev-util/cmake sys-libs/libcap-ng\
dev-perl/glib-perl dev-libs/jansson dev-libs/lzo net-libs/libnet\
dev-libs/libnl virtual/perl-libnet dev-libs/geoip\
net-libs/libnetfilter_queue net-libs/libnetfilter_conntrack\
perl-core/libnet dev-perl/Net-PcapUtils dev-perl/Net-Pcap\
net-libs/libnfnetlink dev-db/sqlite dev-libs/libyaml\
dev-lang/swig net-analyzer/tcpflow dev-libs/libcli\
net-analyzer/dsniff dev-perl/DateTime ethtool"
logMsg "$FUNCNAME" "Executing: $cmd"
logMsg "$FUNCNAME" "See install.log.exec for detailed log ... (working)"
eval "$cmd" &>> $INSTALLER_LOGFILE.exec
if [ $? -ne 0 ]; then
logMsg "$FUNCNAME" "ERROR: Execution of ($cmd)"
exitInstall
else
logMsg "$FUNCNAME" " $cmd ... OK"
fi
fi
}
##############################################################################
runInstaller()
{
local fname="runInstaller-$1"
tool=$1
logMsg "$FUNCNAME" "Installing tool ($tool)"
sleep 1
case "$tool" in
Tcpxtract)
installTcpxtract
;;
Yaf)
installYaf
;;
Ssldump)
installSsldump
;;
Dnsdump)
installDnsdump
;;
PassiveDNS)
installPassiveDNS
;;
Snort)
installSnort
;;
Httpd)
installHttpd
;;
Httpry)
installHttpry
;;
Xplico)
installXplico
;;
Cxtracker)
installCxtracker
;;
Chaosreader)
installChaosreader
;;
Suricata)
installSuricata
;;
IPforensics)
installIpforensics
;;
Tcpdump)
installTcpdump
;;
Netsniff)
installNetsniff
;;
Argus)
installArgus
;;
Dnscap)
installDnscap
;;
Prads)
installPrads
;;
Nftracker)
installNftracker
;;
P0f)
installP0f
;;
Barnyard)
installBarnyard
;;
Silk)
installSilk
;;
Tcpdstat)
installTcpdstat
;;
Tcpflow)
installTcpflow
;;
Bro)
installBro
;;
ConfTemplates)
installConfTemplates
;;
*)
logMsg "$FUNCNAME" "ERROR: Unknown tool $tool"
sleep 1
;;
esac
}
##############################################################################
makeLinks()
{
local fname='makeLinks'
logMsg "$FUNCNAME" "Installing binaries"
cleanDir "$PNAF_DIR/bin"
execCmd "$FUNCNAME" "mkdir -p $PNAF_DIR/bin"
for i in `find $PNAF_DIR/build -name "*bin"`
do
local bins="`ls $i`"
# logMsg "$FUNCNAME" "Binaries from $i: $bins"
for j in `ls $i`
do
if [ -e $PNAF_DIR/bin/$j ]; then
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/bin/$j"
elif [ -L $PNAF_DIR/bin/$j ]; then
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/bin/$j"
fi
execCmd "$FUNCNAME" "ln -s $i/$j $PNAF_DIR/bin/$j"
done
done
logMsg "$FUNCNAME" "Installing configuration files"
for j in `find $PNAF_DIR/build -name "*.conf"`
do
local name=`echo $j | awk -F "/" '{print $NF}'`
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/etc/$name"
execCmd "$FUNCNAME" "ln -s $j $PNAF_DIR/etc/$name"
done
logMsg "$FUNCNAME" "Updating environment vars"
export PATH=$PNAF_DIR:$PATH
installDir=`echo $PNAF_DIR/bin | sed 's/\//\\\\\//g'`
execCmd "$FUNCNAME" "sed -i -r 's/:$installDir//g' /etc/profile"
execCmd "$FUNCNAME" "sed -i -r 's/PATH=\"(.*)\"/PATH=\"\1:$installDir\"/' /etc/profile"
execCmd "$FUNCNAME" "export PATH=$PNAF_DIR/bin:\$PATH"
execCmd "$FUNCNAME" "source /etc/profile"
execCmd "$FUNCNAME" "echo \"source /etc/profile\" >> ~/.bashrc"
}
##############################################################################
finalBanner()
{
local fname="Message"
banner="Passive Network Audit Framework v0.1 \
has been installed successfully"
logMsg "$FUNCNAME" "$banner"
}
##############################################################################
installTcpxtract()
{
local tool="tcpxtract"
local package=$TCPXTRACT
local outdir="$PNAF_DIR/build/$tool"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --prefix=$outdir"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
}
##############################################################################
installYaf()
{
local tool="yaf"
local package="libfixbuf-1.4.0"
local outdir="$PNAF_DIR/build/$tool"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
package=$YAF
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/"
cfgopt="--with-libpcap --enable-applabel --enable-plugins"
execCmd "$FUNCNAME" "./configure --prefix=$outdir $cfgopt"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
package="mysql-connector-c-6.1.3-linux-glibc2.5-x86_64"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "/usr/local/mysql"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -xxvf $package.tar.gz"
execCmd "$FUNCNAME" "mv $package /usr/local/mysql"
package="yaf_silk_mysql_mediator-1.4.1"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/"
execCmd "$FUNCNAME" "./configure --prefix=$outdir\
--with-mysql=/usr/local/mysql/bin/mysql_config"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
}
##############################################################################
installLibpcap()
{
if [ -d "/usr/local/pcap" ] && [ -L "/usr/lib/libpcap.a" ]; then
logMsg "$FUNCNAME" "LIBPCAP is already installed on the system"
sleep 2
else
local tool="libpcap"
local outdir="$PNAF_DIR/build/$tool"
local package="$LIBPCAP"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --prefix=/usr/local/pcap"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
if [ -L /usr/local/include/net ]; then
logMsg "$FUNCNAME" "Deleting existing link /usr/local/include/net"
execCmd "$FUNCNAME" "rm /usr/local/include/net"
fi
execCmd "$FUNCNAME" "ln -s /usr/local/pcap/include/pcap /usr/local/include/net"
if [ -L /usr/lib/libpcap.a ]; then
logMsg "$FUNCNAME" "Deleting existing link /usr/lib/libpcap.a"
execCmd "$FUNCNAME" "rm /usr/lib/libpcap.a"
fi
execCmd "$FUNCNAME" "ln -s /usr/local/pcap/lib/libpcap.a /usr/lib/libpcap.a"
execCmd "$FUNCNAME" "ldconfig"
fi
}
##############################################################################
installSsldump()
{
installLibpcap
local tool="ssldump"
local outdir="$PNAF_DIR/build/$tool"
local package="$SSLDUMP"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
if [ "$OPT_OS" == "debian" ]; then
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --prefix=$outdir"
elif [ "$OPT_OS" == "gentoo" ]; then
# Info on ebuild file from emerge
# * Applying ssldump-0.9-libpcap-header.patch ...
# * Applying ssldump-0.9-configure-dylib.patch ...
# * Applying ssldump-0.9-openssl-0.9.8.compile-fix.patch ...
# * Applying ssldump-0.9-DLT_LINUX_SLL.patch ...
# * Applying ssldump-0.9-prefix-fix.patch ...
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package-gentoo_patched.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --prefix=$outdir\
--with-pcap=/usr/local/pcap/ --build=x86_64-pc-linux-gnu\
--host=x86_64-pc-linux-gnu"
fi
local ins=`whereis install| grep -o ' install '`
execCmd "$FUNCNAME" "sed -i -r 's/INSTALL=.*-c/INSTALL=$ins -c/' Makefile"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
}
##############################################################################
installDnsdump()
{
installLibpcap
local tool="dnsdump"
local outdir="$PNAF_DIR/build/$tool"
local package="$DNSDUMP"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "mkdir -p $outdir/bin"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cp $package $outdir/bin/"
logMsg "$FUNCNAME" "Installing CPAN modules dependencies..."
execCmd "$FUNCNAME" "perl -MCPAN -e 'install Net::Packet'"
execCmd "$FUNCNAME" "perl -MCPAN -e 'install Net::DNS'"
}
##############################################################################
installBro()
{
installLibpcap
local tool="bro"
local outdir="$PNAF_DIR/build/$tool"
local package="$BRO"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --prefix=$outdir"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
}
##############################################################################
installPassiveDNS()
{
installLibpcap
local tool="passivedns"
local outdir="$PNAF_DIR/build/$tool"
local package="ldns-1.6.17"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --with-drill --disable-gost --disable-ecdsa"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
package="$PASSIVEDNS"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package/src"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
execCmd "$FUNCNAME" "cp -r $package/ $outdir"
execCmd "$FUNCNAME" "mkdir -p $outdir/bin"
execCmd "$FUNCNAME" "cp $outdir/src/passivedns $outdir/bin"
}
##############################################################################
installSnort()
{
local tool="snort"
local outdir="$PNAF_DIR/build/$tool"
installLibpcap
local package="libdnet-1.11"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $package source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
if [ "$OPT_OS" == "debian" ]; then
#execCmd "$FUNCNAME" "./configure"
execCmd "$FUNCNAME" "./configure \"CFLAGS=-fPIC -g -O2\" "
elif [ "$OPT_OS" == "gentoo" ]; then
execCmd "$FUNCNAME" "./configure \"CFLAGS=-fPIC -g -O2\" "
fi
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
local package="LuaJIT-2.0.2"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $package source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
local package="daq-2.0.4"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $package source file $package.tar.gz"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "ldconfig"
local package="snort-2.9.7.0"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $package source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
cmd="./configure --prefix=$outdir --enable-sourcefire\
--enable-large-pcap --enable-file-inspect --enable-open-appid"
execCmd "$FUNCNAME" "$cmd"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "mkdir $outdir/lib/snort_dynamicrules"
execCmd "$FUNCNAME" "mkdir $outdir/etc"
execCmd "$FUNCNAME" "cd etc"
execCmd "$FUNCNAME" "cp attribute_table.dtd file_magic.conf snort.conf \
unicode.map classification.config gen-msg.map reference.config \
threshold.conf $outdir/etc"
logMsg "$FUNCNAME" "Creating links on /usr/bin"
execCmd "$FUNCNAME" "rm -rf /lib/libdnet.1"
execCmd "$FUNCNAME" "ln -s /usr/local/lib/libdnet.1 /lib/"
execCmd "$FUNCNAME" "rm -rf /usr/bin/u2openappid"
execCmd "$FUNCNAME" "ln -s $outdir/bin/u2openappid /usr/bin"
package="snort-openappid"
logMsg "$FUNCNAME" "Configuring Snort OpenAppID"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "odp"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "mkdir $outdir/openappid/"
execCmd "$FUNCNAME" "mv odp $outdir/openappid/"
package="snortrules-snapshot-2970"
logMsg "$FUNCNAME" "Installing VRT rules"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool/snort-rules/vrt/"
cleanDir "$BUILD_DIR/$tool/snort-rules/vrt/rules"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "mv rules/ $outdir"
execCmd "$FUNCNAME" "mv so_rules/ $outdir"
execCmd "$FUNCNAME" "mv preproc_rules/ $outdir"
execCmd "$FUNCNAME" "cp -r etc/* $outdir/etc"
package="emerging.rules"
logMsg "$FUNCNAME" "Installing ET rules"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool/snort-rules/et"
cleanDir "$BUILD_DIR/$tool/snort-rules/et/rules"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "mv rules/* $outdir/rules"
execCmd "$FUNCNAME" "cat $outdir/rules/sid-msg.map >> $outdir/etc/sid-msg.map"
execCmd "$FUNCNAME" "cat $outdir/rules/gen-msg.map >> $outdir/etc/gen-msg.map"
execCmd "$FUNCNAME" "cat $outdir/rules/classification.config >> \
$outdir/etc/classification.config"
execCmd "$FUNCNAME" "touch $outdir/rules/white_list.rules"
execCmd "$FUNCNAME" "touch $outdir/rules/black_list.rules"
logMsg "$FUNCNAME" "Enabling ALL ruleset"
for i in `ls $outdir/rules/*.rules`
do
execCmd "$FUNCNAME" "sed -i 's/^#alert/alert/g' $i"
execCmd "$FUNCNAME" "sed -i 's/^##alert/alert/g' $i"
done
logMsg "$FUNCNAME" "Configuring $snortconf"
snortconf="$outdir/etc/snort.conf"
# Old variables
orpath="var RULE_PATH"
osrpath="var SO_RULE_PATH"
oprpath="var PREPROC_RULE_PATH"
owlpath="var WHITE_LIST_PATH"
oblpath="var BLACK_LIST_PATH"
olog="merged.log"
class="classification.config"
refer="reference.config"
thres="threshold.conf"
unico="unicode.map"
outu2="output unified2: "
rpath=`echo $outdir/rules | sed 's/\//\\\\\//g'`
srpath=`echo $outdir/so_rules | sed 's/\//\\\\\//g'`
prpath=`echo $outdir/preproc_rules | sed 's/\//\\\\\//g'`
epath=`echo $outdir/etc/ | sed 's/\//\\\\\//g'`
sdir=`echo $outdir/lib/ | sed 's/\//\\\\\//g'`
logMsg "$FUNCNAME" "Setting up snort.conf variables"
execCmd "$FUNCNAME" "sed -i -r 's/($orpath) .*/\1 $rpath/' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($osrpath) .*/\1 $srpath/' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($oprpath) .*/\1 $prpath/' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($owlpath) .*/\1 $rpath/' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($oblpath) .*/\1 $rpath/' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($class)/ $epath\1/g' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($refer)/ $epath\1/g' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/($thres)/ $epath\1/g' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/ ($unico)/ $epath\1/g' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/#.*($outu2.*)/\1/g' $snortconf"
execCmd "$FUNCNAME" "sed -i -r 's/\/usr\/local\/lib/$sdir/g' $snortconf"
lnumber=`grep -n "Step #6: Configure output" $snortconf\
| awk -F ":" '{print $1 }'`
inumber=`expr $lnumber - 2`
logMsg "$FUNCNAME" "Adding openappid preprocessor conf on line $inumber"
pline=" preprocessor appid : app_stats_filename appstats-unified.log,\
app_stats_period 60, app_detector_dir $outdir/openappid"
execCmd "$FUNCNAME" "sed -i '$inumber i $pline' $snortconf"
nlogu2="snortIds.log"
logcsv="output alert_csv: snort_csv.log"
logMsg "$FUNCNAME" "Configuring output pluggin configuration"
execCmd "$FUNCNAME" "sed -i -r 's/$olog/$nlogu2/g' $snortconf"
lnumber=`grep -n "$outu2" $snortconf | awk -F ":" '{print $1 }'`
inumber=`expr $lnumber + 2`
execCmd "$FUNCNAME" "sed -i '$inumber i $logcsv' $snortconf"
logMsg "$FUNCNAME" "Creating configuration files links for Snort"
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/etc/classification.config"
execCmd "$FUNCNAME" "ln -s $outdir/snort/etc/classification.config \
$PNAF_DIR/etc/"
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/etc/gen-msg.map"
execCmd "$FUNCNAME" "ln -s $outdir/snort/etc/gen-msg.map $PNAF_DIR/etc/"
execCmd "$FUNCNAME" "rm -f $PNAF_DIR/etc/sid-msg.map"
execCmd "$FUNCNAME" "ln -s $outdir/snort/etc/sid-msg.map $PNAF_DIR/etc/"
}
##############################################################################
installHttpd()
{
local tool="httpd"
local outdir="$PNAF_DIR/build/$tool"
local package="$HTTPD"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "./configure --prefix=$outdir"
execCmd "$FUNCNAME" "make"
execCmd "$FUNCNAME" "make install"
execCmd "$FUNCNAME" "rm -rf /etc/init.d/apache2"
execCmd "$FUNCNAME" "ln -s $HTTPD_DIR/bin/apachectl /etc/init.d/apache2"
}
##############################################################################
installHttpry()
{
local tool="httpry"
local outdir="$PNAF_DIR/build/$tool"
local package="$HTTPRY"
logMsg "$FUNCNAME" "Installing $package"
logMsg "$FUNCNAME" "Using $tool source file $package.tar.gz"
cleanDir "$outdir"
execCmd "$FUNCNAME" "cd $BUILD_DIR/$tool"
cleanDir "$package"
execCmd "$FUNCNAME" "tar -zxvf $package.tar.gz"
execCmd "$FUNCNAME" "cd $package"
execCmd "$FUNCNAME" "mkdir -p $outdir/bin"
execCmd "$FUNCNAME" "mkdir -p /usr/man/man1/"
installDir=`echo $outdir/bin | sed 's/\//\\\\\//g'`
logMsg "$FUNCNAME" "Installation dir $installDir on Makefile"
execCmd "$FUNCNAME" "sed -i -r 's/\/usr\/sbin/$installDir/' Makefile"
execCmd "$FUNCNAME" "make"