Thursday, July 19, 2007

Linksys WRT54GL: OpenWRT

Thanks to my friend who works in network hardware line so that I can obtain this device locally. I'm lucky enough to get this linksys wireless router model WRT54GL of which I can install linux(OpenWRT) on it flawlessly, all I need is just upload the firmware that provided by OpenWRT and update . I follow the instructions here to get it install. I'm planning to install other applications such as fprobe and kismet for the fun of it. I just learn that IPKG is nifty packaging system for embedded device.

By default it's LAN interface has IP address 192.168.1.1, I login to the web interface via firefox browser that you are seeing now, you can setup the password and the default user name is root. Since I'm the subscriber of the Best ISP here for their Screamyx package, I just need to setup PPPOE for the WAN connection, configuring the user and password for the pap authentication and I'm done.


If you find yourself *nix head, then you can ssh into the router box as well, of course the main user is root and you can change the password from here as well, everything can be configured via CLI console.


This is what I want, I have bought another box mainly for war driving purpose, the changeable antenna is definitely a plus point. If you want to know the prize, it is about RM220.

Enjoy (;])

VisualRegexp: Nice Regex Learning Tool

I always emphasize on how important and helpful regular expression is as you can construct powerful pattern matching using them. Anyway I have found this good learning tool for people who would like to learn about regex, it is called VisualRegexp where you can find here -

http://laurent.riesterer.free.fr/regexp/

I install it via gentoo portage, the GUI interface is pretty simple and straight forward, what you need to do is just type in the keyword you want to match in the lower input pane, then construct the regex pattern matching in the upper input pane, then click on go button and you will see the part that is matching will turn red color, this can help you to understand how regex works and also create more accurate regex pattern.


Once you have mastered regular expression, you will be more handy in using some of the shell tools such as egrep, sed, awk and more proficient when you need to write signatures for analysis tools such as ngrep, snort, bro-ids and so forth.

If you want to learn more about it, check out this very simple tutorial and I guess you will love it -

http://zez.org/article/articleprint/11/

Cheers ;]

Wednesday, July 18, 2007

Outlook Email Forensics

I have done this previously and can't recall everything, however I would like to share here about what I have done before I'm out of memory. I myself don't use outlook mail client therefore I need to convert it to unix mbox mail format so that I can examine them, I found libpst that can do the job for me and install it via FreeBSD port -

shell>pkg_add -vr libpst

To extract all the emails from outlook pst file, run -

shell>readpst Monitoring.pst -o Email-Forensic

shell>ls -la Email-Forensic
-rw-r--r-- 1 geek00l geek00l 5104848 Mar 21 17:52 Backup and remove
-rw-r--r-- 1 geek00l geek00l 5693288 Mar 21 17:52 Deleted Items
-rw-r--r-- 1 geek00l geek00l 691007 Mar 21 17:52 Noc
-rw-r--r-- 1 geek00l geek00l 201746 Mar 21 17:52 Root
-rw-r--r-- 1 geek00l geek00l 441450 Mar 21 17:52 Junk
-rw-r--r-- 1 geek00l geek00l 10521973 Mar 21 17:52 Alert

shell>file *
Backup and remove: ASCII mail text
Deleted Items: ASCII mail text, with very long lines
Noc: ASCII mail text
Root: ASCII mail text
Junk: ASCII mail text
Alert: ASCII mail text

That's possible to retrieve Outlook 2003 email but it requires more works and the pst file size must less than 2G or you will have to split it before converting it back to older pst format so that it can be parsed by readpst.

I should have read Real Digital Forensics so that I won't need to google around because it is introduced in Real Digital Forensics book as well, anyway have fun.

Cheers ;]

Argus: Anonymize the flows

After l have read the interesting example in secviz.org, I decide to try the argus graphing example using afterglow and graphviz tool, however I'm lazy to change the IPs in my pcap file that contains p2p traffic to protect the privacy, hence I decide to use one of the tool bundled in argus suite called ranonymize(the name tells the story), I converted my pcap file to argus file format so that it can be parsed by argus suite.

shell>argus -r p2p-suspect.pcap -w p2p-suspect.arg

Now I just need to use ranonymize to read the file and pipe it to other tools to generate the graph, I have afterglow source under ~/i-Apps and below is the full command line I use -

shell>ranonymize -r p2p-suspect.arg -w - | \
racluster -r - -m saddr daddr proto dport -c, -s saddr daddr | \ ~/i-Apps/afterglow/src/perl/graph/afterglow.pl -a -t -e 2 -c \ ~/i-Apps/afterglow/src/perl/parsers/color.properties | \
neato -Tgif -o p2p-anonymize.gif

Now you will have p2p-anonymize.gif file in the current directory and here's the simple graph. You can see all the IPs are already been anonymized but you get the idea of the flows.


Instead of reading pcap raw data, sometimes graph helps.

Enjoy ;]

HeX liveCD 1.0R: The Progress

What we have done so far for HeX liveCD to reach 1.0 Solid Release, here are the lists -

- bash odd screen buffer fixed

- metasploit 3 updated by chfl4gs_ since no respond from the porter

- normal user can mount vfs

- non-root user can sniff on bpf interface as long as they are in wheel user group

- bro-ids porting in progress

- bsd installer porting

- fluxbox menu redesign

If you have any thought about the liveCD, just let us know!

Cheers ;]

Ourmon 2.7 Web Interface Configuration

I have previously installed ourmon 2.7 on FreeBSD that you can find here, since ourmon is great with all its meaningful graphs(of which I think it makes sense to network security analyzt instead of those I have seen in commercial systems(don't ask me which one) where all the graphs are generated on behalf of your management that has little or no value to us.

To get what I mean, you can check out the demo here -

http://jerry.cat.pdx.edu/ourmon/

After the installation via unofficial FreeBSD port that offered by Jim Binkley, we can now moving to setup and configure our web server so that we can view our statistical data via web interface, here's the step by step -

Installing apache 1.3 using FreeBSD port -

shell>pkg_add -vr apache

Add these two lines to /etc/rc.conf -

apache_enable="YES"
apache_flags=""

Then edit apache configuration file which is /usr/local/etc/apache/httpd.conf, you have to change the values below to where ourmon data is stored -

DocumentRoot "/usr/local/www/data/ourmon"



AllowOverride All

Since those data are sensitive, therefore we need at least basic authentication to read the data, I use .htaccess for this matter, just create .htaccess file and put in /usr/local/www/data/ourmon, the file shoud look like this -

AuthName "Access Denied!"
AuthType Basic
AuthUserFile /usr/local/mrourmon/.htpasswd
Require valid-user

Last I generate .htpasswd with the command -

shell>htpasswd -c -b /usr/local/mrourmon/.htpasswd trinity matrix

The user I have just created is trinity and the password is matrix. By now we can start apache -

shell>apachectl start

Just launch the web browser and point it to the box that running ourmon will do. You will see the similar web interface like the demo above. Please keep in mind this is not the best deployment but quick example to get it work.

Enjoy ;]

Friday, July 13, 2007

The Better Way to Promote Ubuntu Linux

Sometimes you are bored of what you are doing and you start to find something amusing, here's the interesting one -

http://lynstatic.doubleukay.com/uploads//av-114386.jpg


I bet that will attract more users, what a niche way to increase Ubuntu Linux user base!!!!!

Enjoy ;]

Tuesday, July 10, 2007

HeXtra 1.0 Beta

There are many NSM based tools that we don't install because it is not available via FreeBSD port system, don't blame us of not creating the package for it since we are all busy and some of them are not yet into production release but very useful in many conditions, here we have included extra NSM based tools that you can download, decompress and run it! We call it as HeXtra(HeX Extra) and its version is 1.0 Beta(similar to the HeX liveCD version) so it won't create confusion for future release. Here are the tools that we have included -

- Afterglow

- Argus3 RC

- Bro-Nids

- Chaosreader

- Sguil Client(CVS)

It is pretty easy to get them running, just do the following -

shell>mkdir ~/rp-Mnt

Mount your usb thumb drive to rp-Mnt -

shell>sudo sysctl vfs.usermount=1

shell>sudo chmod 777 /dev/da0s1 (it's da0s1 in my case but it may be differ)

shell>mount -t msdosfs /dev/da0s1 ~/rp-Mnt

shell>cd ~/rp-Mnt

shell>wget \
http://rawpacket.org/anonymous/projects/HeXtra-1.0B.tar.bz2

shell>tar xvjf HeXtra-1.0B.tar.bz2

All the tools reside in its specified directory and you can run them any time by now. On the other hand, we have also included clamav signature database to make it easy for user who want to use clamAV, snort signatures are not included but you can easily fetch it using oinkmaster, I will write up the howto later. I have also added the script call NSM-Offline.sh which you just need to run it against the network data(pcap) and it will generate NSM output for examination. Credit goes to Niklas who has initially written this script. I just modified it to run flawlessly using this liveCD. Make sure you have snort signatures in place in order to run this script as well.

Cheers ;]

Monday, July 09, 2007

HeX liveCD: Download Mirrors

Thanks to Dr. J who is kind enough to provide the bandwidth for our liveCD download mirrors, if you are in the other part of the world than Asia Pacific, you are encouraged to download from those mirrors instead.

- Mirror 1 (http)

- Mirror 2 (http)

- Mirror 3 (https)

For https mirror, if you want to download using wget, you can do so with -

shell>wget --no-check-certificate \
https://secure.redsphereglobal.com/data/tools/security/live/hex-i386-1.0beta.iso

Enjoy (;])

Sunday, July 08, 2007

Tech Training: Structured Network Threat Analysis and Forensics

Last year, me and mel have conducted the training at HITB conference. The training is about performing network traffic analysis using NSM concept but more on threat centric. We are also adding the part Network Based Forensics and discarding Host Based Forensics this year to make it more compatible to the topic.

Again this year, we will be conducting the training at HITB conference again, however all the students who attend to the training no longer need to load the VMware image in order to use all the analysis tools but utilizing the HeX liveCD if possible(in case if the laptop brought by the students not FreeBSD compatible, he or she can still use VMware/Qemu to load the liveCD but we are trying to avoid this condition so that you can make full use of your computer resources.

There will be updates for our training contents as well to cope with the whole network security scene. If you are interested in the training, feel free to check it out here.

Peace ;]

Friday, July 06, 2007

HeX liveCD: The Analogy

Most of the people have this problem with liveCD, after booting it up, play around and forget about it .....

I think problem with the liveCD is its customized environment, for example if I'm familiar with linux but not bsd, then I have to dig into google to get some setup done because of different approach in setting up stuffs(sys v and bsd style for example), only who develop the liveCD can make use of it efficiently because he or she knows the environment entirely and familiar with the operating system.

Different liveCD is developed for different purpose, many prefer end user based liveCD, security liveCD(penetration testing and hacking), forensic liveCD and thus far, I have never seen any liveCD that mainly develop to perform Network Security Monitoring operation. I do know Knoppix-NSM and NST, but their design is more for real time monitoring with NSM Based tools but HeX is more emphasizing on reactive NSM operation and Network Based Forensics. For me I prefer to call this as Network Data Analysis Centric liveCD and it can be learning tool as well if you are interested in NSM.

First of all, I must admit I love two specific liveCDs - Backtrack and Helix. Both present really good idea to serve their purpose. Guess I don't have to speak about Backtrack anymore as I guess most of the people in security industry find it useful, on the other hand Helix is liveCD mainly developed to perform computer forensics in Incident Response operation, you can easily create the case and duplicate the data with Helix and it offers wide range of Forensic tools as well to do the job. And they are not those throw in new logo and install all the tools without customization liveCD which I hate the most.

Yes, our liveCD development team never aim for wide range of audience when creating this liveCD, as stated officially this liveCD is designed for network security analyzt, and not only we offer wide range of NSM based tools but also concentrating on the work flows. We believe tools are as good as how Network Security Analyzt can utilize it. You may have already read this before using this liveCD. We are following this logic -

Obtain Network Based Data -> Utilizing NSM Based Tools -> Generate Output -> Output Interpretation -> Output Analysis -> Output Summarization -> Report

I would like to draw a beautiful diagram for this but I just want to show the simple quickies. As a analyzt(especially in reactive NSM operation), we need to obtain network based data first, then using all the necessary tools to generate the output(I prefer to call it output because it means nothing if you don't understand them), then interpret the output(this part is pretty dynamic based on the skills level, however the more you understand about each field that presented by the output and the more you practice, you are getting better and efficient). To analyze the output, it is very dependent based on your experience, knowledge(TCP/IP, Programming) and how efficient you can make use of internet resources, Once finished the analysis part, you will have to conclude everything you have studied, and summarize the output. At the end, write the report with hostility but keep in mind the report does present how well you understand the output and translate it to concrete form.

The liveCD can only make up to this part(see below) -

Obtain Network Based Data -> Utilizing NSM Based Tools -> Generate Output

The rest depends on how analyzt able to perform it -

Output Interpretation -> Output Analysis -> Output Summarization -> Report

To further improve the usage of the liveCD and share it with the community, great documentation is a must. Therefore I will start writing a series of how-to guideline so that people who are interested can make full use of this liveCD and learning tips and tricks on using NSM based tools. Hopefully it can fill the gaps and you all love it.

Have I mentioned my Network Security Analyzt Handbook? It's in the progress now and hopefully you can use it inline with this liveCD soon.

Enjoy (;])

Wednesday, July 04, 2007

HeX liveCD 1.0 Beta: ReadyBoost?

I haven't tried out Windows Vista but some of my friends are using them, and they are showing off this feature to me call ReadyBoost where you can just plug in your flash drive and it will be the add on "Memory" to boost the performance. Sorry to say that I'm not impressed.

I started to use the HeX liveCD in my production environment so that I can find more problems to fix, it seems I have to use snort today to analyze the network data. After I launched the liveCD, I decided to download snort rules which is not distributed together with the liveCD using oinkmaster, you need to register at snort main site in order to download VRT certified snort rules by acquiring the oink code or you can use bleedingsnort rules. I use the former one and what I need is just uncomment one liner and put in my oink code -

Copy the sample oinkmaster configuration file to user directory -

shell>cp /usr/local/etc/oinkmaster.conf.sample ~/oinkmaster.conf

Uncomment this line and replace oinkcode with the code you obtain from snort site -

url = http://www.snort.org/pub-bin/oinkmaster.cgi/oinkcode/snortrules-snapshot-CURRENT.tar.gz

I started to fetch the ruleset to the snort-rules directory -

shell>mkdir snort-rules

shell>oinkmaster -C ~/oinkmaster.conf -o snort-rules

Once I have all the rules downloaded, I copy snort configuration file to snort-rules directory as well -

shell>cp /usr/local/etc/snort/snort.conf-sample snort-rules/snort.conf

I commented this line -

# include $RULE_PATH/local.rules

Then I started to run snort with the pcap file given -

shell>mkdir snort-output

shell>snort -c ~/snort-rules/snort.conf -ybr malicious.pcap -l ~/snort-output
output truncated .....
Killed ...

I check my /var/log/messages and I got this -
output truncated ....
Jul 4 14:33:33 raWPacket kernel: pid 2079 (snort), uid 1000, was killed: out of swap space
Jul 4 14:34:50 raWPacket kernel: pid 2080 (snort), uid 1000, was killed: out of swap space

It is out of swap space, but I'm running this liveCD and requires no disk. What can I do to fix this? Can I do ReadyBoost? Of course I can't as that's Vista technology!!!!! But wait, I can use something call Memory Disk for swap, I plugged in my 2G USB thumb drive which formatted as msdos file system so that I can use it flawlessly with other OS, and tried to mount it -

shell>dmesg
Output truncated .....
umass0: vendor 0x13fe USB DISK Pro, rev 2.00/1.10, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <> Removable Direct Access SCSI-0 device
da0: 1.000MB/s transfers
da0: 1959MB (4012032 512 byte sectors: 255H 63S/T 249C)
da1 at umass-sim0 bus 0 target 0 lun 1
da1: <> Removable Direct Access SCSI-0 device
da1: 1.000MB/s transfers
da1: 1MB (2880 512 byte sectors: 64H 32S/T 1C)

shell>sudo sysctl vfs.usermount=1

shell>sudo chmod 777 /dev/da0s1

shell>mkdir ~/rp-mnt

shell>mount -t msdosfs /dev/da0s1 ~/rp-mnt

shell>mount
/dev/iso9660/raWPacket on / (cd9660, local, read-only)
devfs on /dev (devfs, local, multilabel)
/dev/md0.uzip on /usr (ufs, local, read-only)
/dev/md1 on /etc (ufs, local)
/dev/md2 on /usr/home (ufs, local)
/dev/md3 on /var (ufs, local)
/dev/md4 on /tmp (ufs, local)
/dev/da0s1 on /usr/home/analyzt/rp-mnt (msdosfs, local)

Then I created 1G disk image in the USB drive -

shell>dd if=/dev/zero of=~/rp-mnt/SwapBoost bs=1M count=1024

As you know we are using memory disk for our liveCD, therefore they are already existed in the device list -

shell>ls -la /dev/md*
crw-r----- 1 root operator 0, 92 Jul 4 17:31 /dev/md0
crw-r----- 1 root operator 0, 93 Jul 4 17:31 /dev/md0.uzip
crw-r----- 1 root operator 0, 94 Jul 4 17:31 /dev/md1
crw-r----- 1 root operator 0, 95 Jul 4 17:31 /dev/md2
crw-r----- 1 root operator 0, 96 Jul 4 17:31 /dev/md3
crw-r----- 1 root operator 0, 98 Jul 4 17:31 /dev/md4
crw------- 1 root wheel 0, 81 Jul 4 17:31 /dev/mdctl

You can see memory disk 0-4 are occupied, thus we can create md5

shell>sudo mdconfig -a -t vnode -f ./swap0 -u 5

Then enable the swap -

shell>sudo swapon /dev/md5

To check how much swap space is used -

shell>pstat -s -h
Device 1K-blocks Used Avail Capacity
/dev/md5 1048576 23M 1001M 5%

I run snort again now and it has no crash at all but takes long time to finish processing the pcap as swap space are used heavily. To get snort running smoother, you can uncomment this line in snort.conf -

config detection: search-method lowmem

ReadyBoost????? We have SwapBoost since long time ago!!!!!

Enjoy (;])

Tuesday, July 03, 2007

HeX liveCD 1.0 Beta

Today is great day for us, finally we reach 1.0 beta milestone!!!!! Thanks to all members that have put a lot of hard works to get it done, and I also feel thankful to my friends who have contributed some of their configuration files.

We are out of schedule but consider ourself meeting the timeline(though we plan to release the first beta by end of June but now is just early July!).

You can find all the information regarding the liveCD here -

http://www.rawpacket.org/projects/hex-livecd

Of course we do plan for future release and here's our current 1.0 idea -

Todo list:
1. Import BSD Installer
2. Shiny Fluxbox Menu(New idea already in my mind)
3. Add on analysis scripts that either written by raWPacket team members or any contributors
4. Extra fl0p, tcpXtract and pads signatures addon
5. Fix unknown bugs that reported by users

As usual, any valuable feedbacks(suggestions or critics) are welcomed, however keep in mind that make love no war.

Enjoy (;])

Saturday, June 30, 2007

Gentoo: Installing perl modules using CPAN

After seeing this interesting example - http://secviz.org/?q=node/74, I feel like trying out afterglow with argus on my gentoo laptop. I install graphviz with emerge and download afterglow instantly.

shell>wget \ http://optusnet.dl.sourceforge.net/sourceforge/afterglow/afterglow-1.5.7.tar.gz

shell>tar xvzf afterglow-1.5.7.tar.gz

I try to run afterglow and I get an error -

Can't locate Text/CSV.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/vendor_perl/5.8.8/i686-linux /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/local/lib/site_perl .) at /home/geek00l/i-Apps/afterglow/src/perl/graph/afterglow.pl line 111.
BEGIN failed--compilation aborted at /home/geek00l/i-Apps/afterglow/src/perl/graph/afterglow.pl line 111.

Since CSV.pm is not ported to gentoo portage, I have to use cpan instead -

shell>export LANG=en_US shell>perl -MCPAN -e shell

Your configuration suggests that CPAN.pm should use a working
directory of
/home/geek00l/.cpan
Unfortunately we could not create the lock file
/home/geek00l/.cpan/.lock
due to permission problems.

Please make sure that the configuration variable
$CPAN::Config->{cpan_home}
points to a directory where you can write a .lock file. You can set
this variable in either
/usr/lib/perl5/5.8.8/CPAN/Config.pm
or
/home/geek00l/.cpan/CPAN/MyConfig.pm

Could not open >/home/geek00l/.cpan/.lock: Permission denied

Permission problem, easily solved with sudo -

shell>sudo perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support enabled

cpan> test Text::CSV
CPAN: Storable loaded ok
Going to read /home/geek00l/.cpan/Metadata
Database was generated on Wed, 28 Feb 2007 06:09:10 GMT
LWP not available
CPAN: Net::FTP loaded ok
Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
Going to read /home/geek00l/.cpan/sources/authors/01mailrc.txt.gz
LWP not available
Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
Going to read /home/geek00l/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Thu, 07 Jun 2007 03:09:14 GMT
HTTP::Date not available

There's a new CPAN.pm version (v1.9102) available!
[Current version is v1.7602]
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless upgrade
while we are running...

LWP not available
Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
Going to read /home/geek00l/.cpan/sources/modules/03modlist.data.gz
Going to write /home/geek00l/.cpan/Metadata
Running test for module Text::CSV
Running make for A/AL/ALANCITT/Text-CSV-0.01.tar.gz
LWP not available
Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/authors/id/A/AL/ALANCITT/Text-CSV-0.01.tar.gz
CPAN: Digest::MD5 loaded ok
LWP not available
Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/authors/id/A/AL/ALANCITT/CHECKSUMS
Checksum for /home/geek00l/.cpan/sources/authors/id/A/AL/ALANCITT/Text-CSV-0.01.tar.gz ok
Scanning cache /home/geek00l/.cpan/build for sizes
Text-CSV-0.01/
Text-CSV-0.01/Makefile.PL
Text-CSV-0.01/test.pl
Text-CSV-0.01/README
Text-CSV-0.01/CSV.pm
Text-CSV-0.01/MANIFEST

CPAN.pm: Going to build A/AL/ALANCITT/Text-CSV-0.01.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Text::CSV
cp CSV.pm blib/lib/Text/CSV.pm
AutoSplitting blib/lib/Text/CSV.pm (blib/lib/auto/Text/CSV)
Manifying blib/man3/Text::CSV.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-Iblib/lib" "-Iblib/arch" test.pl
1..20
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
ok 17
ok 18
ok 19
ok 20
/usr/bin/make test -- OK

cpan> install Text::CSV
CPAN: Storable loaded ok
Going to read /home/geek00l/.cpan/Metadata
Database was generated on Thu, 07 Jun 2007 03:09:14 GMT
Running install for module Text::CSV
Running make for A/AL/ALANCITT/Text-CSV-0.01.tar.gz
CPAN: Digest::MD5 loaded ok
Checksum for /home/geek00l/.cpan/sources/authors/id/A/AL/ALANCITT/Text-CSV-0.01.tar.gz ok
Scanning cache /home/geek00l/.cpan/build for sizes
Text-CSV-0.01/
Text-CSV-0.01/Makefile.PL
Text-CSV-0.01/test.pl
Text-CSV-0.01/README
Text-CSV-0.01/CSV.pm
Text-CSV-0.01/MANIFEST
Removing previously used /home/geek00l/.cpan/build/Text-CSV-0.01

CPAN.pm: Going to build A/AL/ALANCITT/Text-CSV-0.01.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Text::CSV
cp CSV.pm blib/lib/Text/CSV.pm
AutoSplitting blib/lib/Text/CSV.pm (blib/lib/auto/Text/CSV)
Manifying blib/man3/Text::CSV.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-Iblib/lib" "-Iblib/arch" test.pl
1..20
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
ok 17
ok 18
ok 19
ok 20
/usr/bin/make test -- OK
Running make install
Installing /usr/lib/perl5/site_perl/5.8.8/Text/CSV.pm
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/version.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/new.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/status.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/error_input.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/string.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/fields.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/combine.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/parse.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/_bite.al
Installing /usr/lib/perl5/site_perl/5.8.8/auto/Text/CSV/autosplit.ix
Installing /usr/share/man/man3/Text::CSV.3pm
Writing /usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/Text/CSV/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i686-linux/perllocal.pod
/usr/bin/make install -- OK

cpan>quit
Lockfile removed.

Now I can use afterglow without much problems. It is decent tool to create network graph if you ask me, my friend mel has done it here with interesting example.

Peace ;]

liveCD changes

The liveCD website will be done pretty soon, so does the liveCD, we are currently doing all possible to reach first beta version and we have hard time through out last week but it is pretty much sorted out. By the way the liveCD has new name - Hex. You can find the reason why we name it as hex here.

This liveCD is NSM oriented and network security analyzt usually need to deal with hexadecimal(base16) when examining network data, and it is built using FreeBSD(red devil) Freesbie2 toolkits, therefore Hex is definitely the best artistic name ever.

By the way, I have configured bash shell to be more devilish with its two horns and tail -

Hex Bash Shell Prompt

You may notice that I haven't do much blogging lately, thanks to the liveCD development so that I can take a breath from the world of blogging(sarcasm).

Cheers (;])

Friday, June 22, 2007

FreeBSD: rsync over ssh

I usually use scp to transfer files since ssh is installed on most of Unix based OS, however I found it troublesome when the network connection is bad as I can't resume the transfer when connection is aborted and I have to waste my time and bandwidth to do it all over again. It is fine with small file transfer but it can be pain when dealing with large size file.

After talking to mel yesterday, I decided to try out rsync over ssh, and it appears that the setup is pretty simple and straight forward too. However I'm here to show FreeBSD setup -

To get rsync server runs on FreeBSD -

shell>pkg_add -vr rsync

shell>echo 'rsyncd_enable="YES"' >> /etc/rc.conf

shell>/usr/local/etc/rc.d/rsyncd start

Then start to run rsync client over ssh on client machine. Presume you have rsync installed and you want to transfer the file "testing" to your client machine from the server -

shell>rsync --append --progress -avz -e ssh root@remotehost:/tmp/testing /tmp
receiving file list ...
1 file to consider
2949067413 33% 127.45kB/s 7:08:26

You can resume the transfer if there's connection issue and this is very helpful in many cases.

Enjoy (;])

Tuesday, June 19, 2007

raWPacket LiveCD - Wallpapers

Our liveCD main designer - Vickson has sent me two wallpapers, one is the wallpaper for raWPacket team and another mainly for raWPacket liveCD, it will be shipped with the liveCD and we have scheduled to release the first beta version by end of June. Here's the preview of the wallpapers -

raWPacket team

raWPacket liveCD

The team is currently working hard on it, aside from creating smooth workflow for analyzt when using this liveCD, other highlight features will be -

- 10 extra tcpXtract signatures will be distributed

- 8 extra pads signatures will be distributed

- Well design menu and applications launching placement

We are still testing all the applications we have added, flowgrep 0.9 and metasploit 3 failed to build due to the bugs in port and we have contacted the porter.

Work in progress and stay tuned .....

Peace ;]

Wednesday, June 13, 2007

raWPacket LiveCD - progress 2

More progress about the liveCD development, most of the analysis tools are already added and the fluxbox menu is more shiny now. I have added sguil client as well because this liveCD is NSM oriented. Here's the quick screenshots -

Sguil Client Login Screen

Sguil Client Analyst Console

We are planning to add conky as system monitoring tool so if you have shiny conky configuration file - conkyrc that runs FreeBSD on laptop, feel free to share with us. Btw, here's the current raWPacket liveCD team members -

raWPacket liveCD Project
Original Idea & Leader: myself
Main Developer: chflags
Web Master: guti
Designer: vickson
Contributor: tenner(Fluxbox Style, irssi config)
Contributor: paulh(FreeBSD port)
Contributor: takizo

I will put more info once the main site of raWPacket liveCD is done, currently my blog will serve as liveCD project page until beta version is released.

Enjoy ;]

Monday, June 11, 2007

raWPacket LiveCD - progress

I don't blog much lately due to sickness, while I don't do much on testing and analysis, me and chflags have made some progress on our raWPacket LiveCD which based on FreesBIE 2. Here's the screenshot -

It is no way near production yet but it is very close to beta release. Once we have finished the alpha stage, we will deliver the first beta version and welcome anyone to try out. chflags has put up the near beta version of iso, I have found some bugs and will try to fix it in the source tree so don't yawn at us if it doesn't work for you.

By the way, the liveCD will has its own home soon once we have finished building the website for it.

Cheers ;]

It's all about Network Flow

Argus is my favorite tactical tool when performing flow based analysis and I have mentioned about it quiet a few times in my blog. While it works pretty well and flexible with its powerful client tools to do flow processing, it also offers complex usages. I have found two new weapons lately which can enhance my flow based analysis and complementing.

Undoubtedly argus can eat cisco netflow data, but that's not what argus do best. Argus is more pcap friendly instead of netflow data. Then which tools are great in Open Source arsenal to process netflow? I vote silktools where you can find at -

http://silktools.sourceforge.net/

Silktools is developed as part of NetSA security where you can find at -

http://tools.netsa.cert.org/

It is undeniable that all other projects are interesting too, but that doesn't make my point here and I have no time to check them out yet. The main reason why I'm looking into silktools is because it also offers wide range of analysis tools like argus do. Instead of just doing flow data collection, one can perform in depth analysis on the netflow data using the analysis tools that packed with silktools. But again I found out all these great tools come with complexity and that blow away a lot of new comers.

No fear, silktools comes with great documentation, I greatly appreciate all the hard works that have been put into it not only on the coding section but documentation. You can just learn them from the ground up at -

http://silktools.sourceforge.net/silk_docs.html

Check out the silktools analyst handbook and you may find it interesting, I have read through it and about time to bring them into practice.

The second weapon that worth mentioning is ourmon. You can find that I have installed it on FreeBSD. Ourmon is incredible in doing flow anomaly and heuristic detection that brought to you by Jim Binkley. While it doesn't emphasize on post or offline processing, it is the weapon that concentrating on real time analysis combining it's meaningful network graphs. I'm still learning to utilize ourmon in wide area network environment.

Combining argus, silktools and ourmon, I'm sured you will have a lot of fun to research on the network flow. Except argus 3, silktools and ourmon are available via FreeBSD port. Feel free to try them out. Other network flow processing tools that are great should be flow-tools and nfdump.

Peace ;]

Saturday, June 09, 2007

Nice Comment

I usually don't check out the comments in old blog post but today seems to be good day to check them out as I'm advised by Doctor to do something lighter. I never delete any comments whether it is positive or negative to me. As for now, I find a very nice comment which you can either read up in this link or read it below, the comment is the respond to this story -

Anonymous said...
The person who posted this has no idea about Ethical Hacking. I pity him. It looks like he likes to talk but no action.

Blogs are losing respect nowadays because of silly negative posts. May be one day Blogs will earn their respect like New York Times.

Why don't you take your post to Microsoft's Blue Hat conference as well. You might even call them a hoax. You are pathetic.

Stop posting negative comments and start contributing back to the security community.

I respect security organizations efforts to educate the mass about the issues involving security weakness. EC-Council, Cisco, McAfee are such organizations.

Hacking competition is just an example of attack methodology and don't take it literally.

Hacker Halted conferences provides generic view of security by experts around the world.

So stop complaining and act like a professional.

I will be attending Hacker Halted and Black Hat this year. Keep up the good work guys.

Stephen Jacobson
Sydney, Australia
Should I fight back, what do you think? I'm wondering who is pathetic, anyway I won't delete this silly negative comment.

Enjoy ;]

Friday, May 25, 2007

rsync copy

It is pretty interesting when I want to know the progress of my file copy process and I can't really see it with cp command. Hence I prefer to use rsync for this purpose while most people usually use rsync for file backup.

shell>rsync --progress -v ./dirty.pcap i-Pcaps/

dirty.pcap
520535973 100% 7.79MB/s 0:01:03 (xfer#1, to-check=0/1)

sent 520599601 bytes received 42 bytes 8071312.29 bytes/sec
total size is 520535973 speedup is 1.00

Not only you can see the progress but also the average time and its rate. Don't you think it is lovely?

Enjoy ;]

Wednesday, May 23, 2007

Nepenthes: Disable Modules

I have been mentioning about nepenthes(low level honeypot to attract malwares) and apparently it is pretty easy to turn on or off nepenthes modules(emulated vulnerable services). I don't want my nepenthes to listen on port 80 as I need to use port 80 for other application. To disable it doesn't seem to be trivial though -

shell>grep '"80"' /etc/nepenthes/*.conf
/etc/nepenthes/log-surfnet.conf: "80",
/etc/nepenthes/vuln-asn1.conf: iisport "80";

Thus I just comment it out at nepenthes core configuration file - /etc/nepenthes/nepenthes.conf

// "vulnasn1.so", "vuln-asn1.conf", ""

Pretty quick isn't it. I have noted it down here for my poor memory sometimes.

Peace ;]

Monday, May 21, 2007

At last .....

I can't resist to post this while it is nothing related to computer security, but hey it is one of the best strategy game ever and I love it while I was young. I'm wondering whether the release of this game will suck my time away.



I bet most of you won't forget this tactical game that requires a lot of offensive and defensive approach to turnaround in the game. Hopefully Blizzard will make it successful again. It's about 10 years now ..... since 1997.

Rock & Roll ....

Enjoy (;])

Saturday, May 19, 2007

Argus 3.0: Cisco Netflow

Cisco netflow is invented initially to speed up the route with its flow cache, but it appears to be very useful this day where Cisco Netflow is used in different area. One of my interest field is examining the network flow data to track the malicious events but you are free to do any kind of interesting research with the netflow data in hand.

Cisco has improved and add new features to its IOS, I have found few new features for Netflow that looks pretty interesting to me where you can capture more useful information. The most commonly used Netflow version is 5, I would like to try out version 9(shiny?If any of you use version 9, I would like to hear from you) however argus doesn't identify Netflow version 9 yet thus I remain to use the solid Netflow version 5. So here I start to export Cisco Netflow data to argus collector(probe). Login to the Cisco Router, I run the following commands -

ios#config t
ios(config)#ip flow-capture packet-length
ios(config)#ip flow-capture ttl
ios(config)#ip flow-capture icmp
ios(config)#ip flow-capture ip-id

I choose to export the Netflow version 5 data from network interface GigabitEthernet 0/0 to my argus collector(192.168.0.55) port 9996.

ios(config)#ip flow-export source GigabitEthernet0/0
ios(config)#ip flow-export version 5
ios(config)#ip flow-export destination 192.168.0.55 9996
ios(config)#ip flow-top-talkers
ios(config)#interface GigabitEthernet 0/0

Enable it at the interface GigabitEthernet 0/0 for both ingress and egress flows -

ios(config-if)#ip route-cache flow
ios(config-if)#ip flow ingress
ios(config-if)#ip flow egress
Ctrl+z

Save it to survive reboot -

ios#copy run start

Once I have done the Cisco router configuration part, I login to my argus collector and do the following -

shell>rasplit -CS 9996 -M time 60m -n \
-w /nsm/argus/log/Net-DMZ/%Y/%m/%d/argus_%H:%M:%S

rasplit is one of argus client tools that can split resulting output into consecutive sections of records based on different criteria. The options -CS 9996 is to connect to port 9996 and identify the input as Cisco Netflow format. The interesting thing here is it will split the data hourly(-M time 60m) and log it to its respected directory.

To read the Netflow data, what you need to do is just change to directory /nsm/argus/log/Net-DMZ/2007/05/19(as for today) and read them with ra or racluster.

All for now, have fun with the flow!

Cheers (;])

Tuesday, May 15, 2007

Graphing with rrdtool

RRDtool is widely used today for network based graphing. If you want to learn how to use rrdtool to create graph, here are very good tutorial that I have found -

http://www.cuddletech.com/articles/rrd/rrdintro.pdf


http://merlin.com.ua/doc/rrd/tutorial/


http://www.study-area.org/tips/rrdtool/rrdtool.html

Or you can actually find out all the tutorials that available at the RRDtool website -

http://oss.oetiker.ch/rrdtool/tut/index.en.html


Cheers ;]

Saturday, May 12, 2007

SpyBye

Thanks to Adli who has told me about SpyBye(malwares hunter proxy) which is developed by Niels Provos(Honeyd Guy) where you can find here -

http://www.spybye.org/


Getting it installed is pretty straightforward, I just run it for the first time(I always run the command line with -h, habit sometimes kills :P) -

shell>./spybye -h
./spybye: invalid option -- h
./spybye: [-P] [-p port] [-g good] [-b bad]
-P disable private IP check; allows the proxy to fetch 127/8
-g good_patterns a file or url containing the good patterns
-b bad_patterns a file or url containing the danger patterns
for documentation of all options consult the man page

Starting it up -

shell>/usr/local/stow/spybye-0.2/bin $ ./spybye

SpyBye 0.2 starting up ...
LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days. ***
LibClamAV Warning: *** Please update it IMMEDIATELY! ***
LibClamAV Warning: **************************************************
Loaded 108322 signatures
Virus scanning enabled
Report sharing enabled.
Making connection to www.monkey.org:80 for /~provos/good_patterns
Received 529 bytes from http://www.monkey.org/~provos/good_patterns
Added 30 good patterns
Making connection to www.monkey.org:80 for /~provos/bad_patterns
Received 3332 bytes from http://www.monkey.org/~provos/bad_patterns
Added 205 bad patterns
Starting web server on port 8080
Configure your browser to use this server as proxy.

I configure my browser manually to point to the local proxy, you can do it easily with switchproxy on Firefox and start browsing milw0rm site -

Making connection to 213.150.45.196:80
Received request for http://spybye.org/results/?url=http://www.milw0rm.com
Received request for http://spybye.org/styles/css
Caching 37418 bytes for http://www.milw0rm.com (unknown)
Virus scanned 37418 bytes; result: clean
Received request for http://spybye.org/results/?url=http://www.milw0rm.com
Received request for http://www.milw0rm.com/milw0rm.css (http://www.milw0rm.com/) from 127.0.0.1
Making connection to 213.150.45.196:80
Received request for http://spybye.org/styles/css
Caching 2348 bytes for http://www.milw0rm.com/milw0rm.css (harmless)
Virus scanned 2348 bytes; result: clean
Received request for http://www.milw0rm.com/images/dot.gif (http://www.milw0rm.com/) from 127.0.0.1
Making connection to 213.150.45.196:80
Received request for http://www.milw0rm.com/images/milw0rm-wi.jpg (http://www.milw0rm.com/) from 127.0.0.1
Making connection to 213.150.45.196:80
Received request for http://ypn-js.overture.com/partner/js/ypn.js (http://www.milw0rm.com/) from 127.0.0.1
Making connection to 72.30.33.29:80
Caching 804 bytes for http://www.milw0rm.com/images/dot.gif (harmless)
Virus scanned 804 bytes; result: clean
Caching 7038 bytes for http://ypn-js.overture.com/partner/js/ypn.js (unknown)
Received request for http://spybye.org/results/?url=http://www.milw0rm.com
Received request for http://spybye.org/styles/css
Virus scanned 7038 bytes; result: clean
Received request for http://ypn-js.overture.com/d/search/p/ypn/jsads/?Partner=9308575640&adwd=468&adht=60&ctxtUrl=http%3A//spybye.org/%3Furl%3Dwww.milw0rm.com&amp;amp;bg=000000&bc=000000&cc=141414&lc=00c000&tc=FFFFFF&uc=00c000&du=1&cb=1177662499468 (http://www.milw0rm.com/) from 127.0.0.1
Making connection to 72.30.33.29:80
Caching 2713 bytes for http://ypn-js.overture.com/d/search/p/ypn/jsads/?Partner=9308575640&amp;amp;adwd=468&adht=60&ctxtUrl=http%3A//spybye.org/%3Furl%3Dwww.milw0rm.com&bg=000000&amp;amp;bc=000000&cc=141414&lc=00c000&tc=FFFFFF&uc=00c000&du=1&cb=1177662499468 (unknown)
Virus scanned 2713 bytes; result: clean
Expiring dns entry for ypn-js.overture.com
Received request for http://spybye.org/results/?url=http://www.milw0rm.com
Received request for http://spybye.org/styles/css
Caching 44225 bytes for http://www.milw0rm.com/images/milw0rm-wi.jpg (harmless)
Virus scanned 44225 bytes; result: clean

Interesting as it is reported as clean but relying on clamAV is actually not a perfect solution but it is the only Open Source Antivirus Software available, I have many malwares that collected from my nepenthes honeypot and seems not be able to recognized as malwares though. Anyway spybye is pretty interesting piece and you should use it if you suspect that your site contains malwares. It can be used as quick examination tools.

If you are interested to know what Niels has done including his contributions, check out -

http://www.citi.umich.edu/u/provos/

Enjoy ;]

raWPacket Sig and .....


The site is not online yet but hopefully soon, I'm currently working with few guys to get this site up and running, the purpose of it is to create the signatures repository for "not so popular or well known" network security tools such as tcpxtract, pads and fl0p(this is the current three in my mind), and providing signatures update for them. Hopefully with this kind of effort we can increase the momentum of the tools usages.

When the site goes live, anyone are free to contribute the signatures and we won't overtake the signature ownership from you, credit is for sure.

If you have some inhouse signatures that you have written previously and they are not bounced to any legal restriction, I do wish you share it out with the community. All the signatures will be included into the raWPacket LiveCD so that any analyst can easily access to them and performing the analysis process directly.

It seems I'm trying to deliver full suite of utilities(LiveCD, Books) for network security analyst and yes I'm. I promise I will built the CD/DVD that contains pcap data from OpenPacket once it goes live too so that anyone is free to learn all the network data with the tools in the LiveCD and Network Security Analyzt Handbook as reference that comes along.

More to come but I'm tire now .....

Enjoy ;]

Friday, May 11, 2007

Network Forensic Chart

I have came across the chart below when reading the article -

http://www.sandstorm.net/support/netintercept/downloads/ni-ieee.pdf


The chart illustrates what kind of information and data that you can obtained via network centric log(pcap). The breakdown shows clearly all forms of data that can be extracted when performing network forensics, this can give very clear view for people who want to learn more about the network forensics. It doesn't actually reflect the real world foo(data can be transfered via icmp and etc) however it does deliver the idea.

The chart says it all .....

What are the open source tools that can be used to performed network forensics?
- tcpXtract
- tcpflow
- chaosreader
- dataecho

Others that I can't think of now .....

Cheers ;]

Hacker Halted?

Again my friend sent me another interesting link regarding the event for cyber security industry in Malaysia. I think I should keep track of news in the star tech starting from now.

http://star-techcentral.com/tech/story.asp?file=/2007/5/1/technology/20070501101945&sec=technology

Malaysia needs more ethical hackers?
Unless you are talking about selling CEH training .....

But a capable IT security professional should also know how a hacker thinks
This is totally insane!!!!! Hacking is not something that can be learned through the training course unless it is delivered to someone who already has prior experience. Another questionable reason is that lots of CEH trainers are not from the hacker community and background, lots of them are just started learning about hacking from the course and passing the exam and get the license to be the CEH instructor, thus they themselves are not hackers and don't even know how hacker thinks, all they know are from the CEH training materials.

"When a professional is certified as an ethical hacker, it shows he knows what he's doing and that would definitely give an employer more assurance (of the professional's skills,"
Is this for real, I still recalled myself what was happening at the previous Hacker Halted Conference in Malaysia. He or she may give employer trouble too .....

According to EC-Council, IT security professionals should have practical experience with hacking but this should not involve illegal acts, of course.
Practical experience doesn't mean playing with all the windows hacking tools either. It's better to play with your toys or dolls then and you won't end up getting caught into jail.

People often misunderstand the meaning of the phrase "ethical hacking," said Sanjay Bavasi, president of the EC-Council. "In this context, it does not refer to the ethics of a person but to the processes and methods used in a hack," he said.
The context is cool enough as it creates pretty high confuse level, the processes and methods used in the hacks determine the person instead of the contrary and this can be taught!

"Since the concept is new, ECCouncil is often criticised for promoting 'legalised' hacking, but ethical hacking is necessary in security,"
This is nothing new.

For more information, you can check out the KL event at -

http://www.hackerhalted.com/

And if you are interested in their CTF event -
The hacking competition is open to all Malaysians and students of any nationality studying in Malaysia during the course of the competition. All entrants must register, receive acceptance of their registration from the organising committee and pay the registration fee of US$5000.

WOW 5000 US Dollar and you must sign the agreement to participate to the game, I thought this is a joke(affordable for students?????). I rather use that money to pay for my down payment when I buy a house.

Coincidentally their logo looks similar to HITB logo which is using a box as the symbol.

Seriously I don't see any interesting hackers in the speakers list. I don't think the intention behind this conference is to create awareness or motivate IT security processional to overcome potential threats or invasions into their systems but more on .....

Hacker Halted, sorry and there's no way to stop the hackers .....

Peace ;]

Saturday, May 05, 2007

Spammer: Love

It seems spammer would like to show some loves to me!!!!!

Beloved .....

Cheers ;]

Friday, May 04, 2007

linguistics

It is pretty enjoyable when reading the articles that written by Don Parker. I just came across this article that written by him lately and I think people who want to be network security analyst should read it.

http://www.securityfocus.com/columnists/443/

Don has pointed that passing the exam and writing practical paper by doing the real work are two things, that's definitely true as exam itself won't actually test the full set of skills that required to be efficient network security analyst. I have met a lot of people who getting a lot of certifications for the sake of employment and better pay. They forget the real meat to live in security industry should be the passionate, curiosity and continuously pursue the necessary knowledge. Remember security evolves over time.

I myself don't hold any GIAC certification thus I really have not much comments on that, what I would like to emphasize here should be the knowledge that must be acquired by network security analyst instead. To be a decent network security analyst(I still learn to be one), you must understand network protocols very well especially those widely used such as tcp, udp, icmp and such. Other than that, you must arm with at least one or two scripting languages to simplify your tasks as well as dealing with tricky incidents. Understanding the technologies such as firewall, intrusion detection/prevention system are important too but you may notice that if you don't have strong networking knowledge, you will have hard time understanding those technologies.

I won't be discussing further about all the necessary knowledges that are needed to be network security analyst, those will be written in my book in network security analyst: roadmap section so hopefully my knowledge sharing would help those wannabe.

So what you speak? I guess I speak hex most of the time.

Enjoy ;]

Wednesday, May 02, 2007

OpenBSD 4.1 Released

It's OpenBSD joy again, version 4.1 is just released and you can check out all the details here -

http://www.openbsd.org/41.html

I plan to upgrade my box to 4.1 by following the guide -

http://www.openbsd.org/41.html#upgrade

Various new packages such as OpenOffice are available. It's time to test out all the new features when possible!

Cheers :]

Saturday, April 28, 2007

Deleting zer0 size files & Renaming files with '-' prefix

I didn't notice that my research honeypot has its partition full when collecting malwares, hence it generates a lot of malware files with 0 size as there's no room for it. Since I have all of them collected under /var/nepenthes/binaries, I just execute the command below to delete all of the files with 0 size -

shell>cd /var/nepenthes/binaries

shell>find ./ -type f -size 0 -exec rm -rf '{}' \; -print

Then I list the all the files again -

shell>ls -la
total 808
drwxr-xr-x 2 root wheel 3584 May 4 19:49 .
drwxr-xr-x 7 root wheel 512 Jan 28 22:46 ..
-rw-r--r-- 1 root wheel 48808 Jan 29 20:31 06b6cd8fc0333df6a96a66910f0a285d
-rw-r--r-- 1 root wheel 8192 Jan 29 23:43 314b889b16b11886656c901656ffa847
-rw-r--r-- 1 root wheel 8192 Feb 1 20:05 579ab2f7e55c8ddc074603b82bb73ee4
-rw-r--r-- 1 root wheel 64464 May 4 19:49 6df903d10f7ad3ad688d90dba9380d3c
-rw-r--r-- 1 root wheel 58325 Jan 29 17:28 703a8118b285f85622db82e7350c16da
-rw-r--r-- 1 root wheel 40884 May 4 19:46 706e697ed520cc32027a525a645be1dd
-rw-r--r-- 1 root wheel 8192 Feb 1 05:54 a2628d55e482fac6448801187c0ce836
-rw-r--r-- 1 root wheel 158720 Jan 29 19:42 a4ed429c882f382b994b0860c5a9ced2
-rw-r--r-- 1 root wheel 8192 Feb 2 11:52 bc6595eff1398227ab0d4aa13acc20f4

I think I will need to write a script to automate the process, by moving all the files under this directory to another partition when /var partition is full or else I will need to do it manually which wasting my time.

Sometimes it is fun to poke with shell commands especially dealing a tricky one, to rename all the files in the directory with the prefix of '-' so that '-' get discarded, you can try the command below.

shell>for i in `ls -la | awk '{ print $9 }' | grep '^-.*'`; \
do mv -- $i `echo $i | cut -f 2 -d '-'`; done


I was asked about how to do this and think the commands crafted above should do the job. Have fun.

Peace ;]

Friday, April 27, 2007

TCPdump: Privilege Dropping & Passive OS Fingerprinting

I never really notice about this until today, I think OpenBSD has done a lot of modifications on tcpdump, privilege dropping is just one of the feature, you can check out all the change logs of OpenBSD to date here -

http://www.openbsd.org/plus41.html

In fact you navigate on the changes from Release to Release, searching for tcpdump keyword and you may find what were improved and fixed.

Another interesting feature is passive operating system fingerprinting is built into pf and tcpdump(both ipv4 and ipv6 wise), you can now turn it on by using -o option in tcpdump -

shell>tcpdump -o -nni em0
01:57:33.265112 211.75.232.180.54452 > 1.2.3.4.25: S (src OS: unknown) 1591369098:1591369098(0) win 5840 (DF)
01:57:38.819585 89.1.209.9.4723 > 1.2.3.4.25: S (src OS: Windows XP SP1, Windows 2000 SP4) 2701955957:2701955957(0) win 65535 (DF)
01:57:41.343984 89.1.209.9.2506 > 1.2.3.4.25: S (src OS: Windows XP SP1, Windows 2000 SP4) 360732020:360732020(0) win 65535 (DF)
01:57:44.057512 201.244.249.179.3015 > 1.2.3.4.25: S (src OS: Windows XP SP1, Windows 2000 SP4) 645056554:645056554(0) win 65535 (DF)
01:57:44.342456 89.1.209.9.2506 > 1.2.3.4.25: S (src OS: Windows XP SP1, Windows 2000 SP4) 360732020:360732020(0) win 65535 (DF)
01:57:44.438020 89.1.209.9.1479 > 1.2.3.4.25: S (src OS: Windows XP SP1, Windows 2000 SP4) 416546610:416546610(0) win 65535 (DF)
01:58:03.762505 202.74.217.6.1713 > 1.2.3.4.25: S (src OS: Windows 2000 RFC1323, Windows XP RFC1323) 478012651:478012651(0) win 65535 (DF)

It is making use of p0f database but only perform the fingerprinting on tcp packet with syn flag set(In fact p0f is more powerful as it works with packets with other flags as well). Anyway tcpdump should be able to give you a quick glance of the remote operating sytem that trying to probe to you.

Kudos to OpenBSD team about it. By the way, I bet you all can't wait for this -

http://www.openbsd.org/41.html

Peace ;]

Thursday, April 26, 2007

Open Source Compatible Handheld Device

I haven't bought any handheld device(handphone not counted), interestingly my friend sent me this link, and I start to think maybe I need one of these toy -

http://www.handhelds.org/moin/moin.cgi/SupportedHandheldSummary

If you know any reference regarding handheld devices that are OSS compatible, please do let me know. Thanks.

Cheers ;]

Saturday, April 21, 2007

NetSecAnalyst: The Handbook

Yeah, there are people asking me about the progress of my book - Network Security Analyst: The Handbook.

My initial idea is to have all my blog posts regarding usages of network security tools to be included and packaged into the book, but I realize that this won't make it a good book for Network Security Analyst. I have more thoughts about the book lately hence I can't have it shipped sooner. There are four primary sections for the book which I think very important for network security analyst wannabe -

Network Security Analyst: The RoadMap
What are good foundations and technical knowledge that should be acquired to become good network security analyst? I hope The RoadMap can answer question like that, until now I haven 't seen any books discussing about this topic yet.

Network Security Analyst: The WorkFlows
What are the methodologies and mechanisms that are used by network security analyst to handle their tasks? The routine daily tasks, the automated and manual process of performing analysis, situation handling and so forth.

This is more of how to think or work like a network security analyst. I will try to standardize the common work flows but you are free to extend it to your own way.

Network Security Analyst: The Tools
What are the tools that are commonly used by Network Security Analyst and how they use them? I believe this part should be demonstrating the NSM based tools usage, one should understand this is not the real meat of network security analyst, this is more of helper section to show various examples in using the network security tools. This section will usually be updated as I will import it from my blog and modify it to be more organized and readable. I suggest you read this book to get yourself ready when comes to using most of network security tools -

http://www.awprofessional.com/bookstore/product.asp?isbn=0321246772&rl=1

I truly believe that learning to use tools itself won't make you a good analyst, the right thing to do should be study on how to interpret the results that generated by the tools, this is always not been emphasized but I would see most of analysts will agree with me.

Network Security Analyst: The Case Study
How Network Security Analyst handles the (Intrusion/Extrusion)incidents in real world?

This will load up few incident scenarios and how Network Security Analyst starts his analysis process, examination, escalation and confirmation to decision making. This will make a good round up of what have been studied from previous three sections, and applying it to the real world scenario. One of the site that I suggest you look at should be -

http://www.honeynet.org/misc/chall.html

There are many challenges offered by honeynet community, knowledge sharing is always interesting.

I think this is the final layout for my handbook, hopefully I won't dream of any new ideas for the book again -

Sec 1 - Net Sec Analyst: The RoadMap
Sec 2 - Net Sec Analyst: The Workflows
Sec 3 - Net Sec Analyst: The Tools
Sec 4 - Net Sec Analyst: The Case Study

All the sections are actually correlated, everyone are welcomed to give me suggestions and inputs, what do you think? I don't have skill to write, but no one can stop me from writing anyway.

P/S: For the book, ayoi will be one of the contributor. I would love to spare my time to develop Network Security Analyst LiveCD(we called it raWPacket LiveCD) using freesbie and ship it together with the release of the book, time is always constraint. However I'm glad that I have chfl4gs with me now in developing the liveCD. Stay tuned!!!!!

Btw, I'm looking for non-paid editor(this is free ebook) as I don't know good english. If you would like to help, please let me know.

Peace (;])

Argus: Passive FTP Data Channel Extraction

When dealing with passive ftp instead of active ftp, I used to examine the network traffics manually especially to reconstruct all the data channels as it initials ephemeral ports(usually ports > 1024) for both client and server end dynamically and not like active ftp where fix port(20) is used at server side. After looking into how passive ftp actually works(for both over ipv4 and ipv6 and ftp server implementations), I decided to write a bash shell script to extract all the passive ftp data channel for the ftp flow from argus data. Again if you read my paper that I have used argus for botnet detection, this shell script will make use of argus client tools - ragrep again to extract all the necessary flow and its associated data channel. Here's the interesting result when I execute my script - argus-PASVFTP.sh.

IPv4 Illustration
shell>./argus-PASVFTP.sh
Input your argus data file, specify absolute path!
/home/geek00l/i-Pcaps/ipv4-ftp.arg
SrcAddr|Sport|DstAddr|Dport
192.168.0.24|49971|210.171.226.46|21
192.168.0.24|35839|210.171.226.46|21
Please specify source and destination IP and source PORT to locate associated passive ftp data channel .....
1. Source IP
192.168.0.24
2. Destination IP
210.171.226.46
3. Source Port
49971

Passive FTP Data Channel
61703
64897

Gotcha, here's the ftp data channel that being announced by ftp server for client to connect to - 61703 and 64897.

IPv6 Illustration
shell>./argus-PASVFTP.sh
Input your argus data file, specify absolute path!
/home/geek00l/i-Pcaps/ipv6.test.1.arg
SrcAddr|Sport|DstAddr|Dport
2001:5c0:925d:0:204:5aff:fe79:43a7|57339|2001:6c8:6:4::7|21
Please specify source and destination IP and source PORT to locate associated passive ftp data channel .....
1. Source IP
2001:5c0:925d:0:204:5aff:fe79:43a7
2. Destination IP
2001:6c8:6:4::7
3. Source Port
57339

Passive FTP Data Channel
64534
60801
60199

Works on ftp over IPv6 too, the ftp data channels are 64534, 60801 and 60199.

You can now running argus client tool(ra) to locate all the passive ftp flows by filtering those ports. Though I have only tested this script on FreeBSD and Gentoo Linux, it should work on other *nixes platform flawlessly as long as you have bash shell and argus clients installed. Again here I demonstrate the interesting example of using argus client tools.

Thanks to Richard for his ipv6 pcap file that he has sent me or else I won't be able to examine ftp over IPv6 lately.

I plan to include this script in the liveCD that we(me and chfl4gs) are developing actively, if any of you are interested to have fun with the script, feel free to let me know.

Enjoy (;])

linux.byexamples.com

Yes, I advocate open source. I support anyone who really want to push on open source stuffs. But I'm not doing enough as I don't involve in open source development or coding part. But do you really need to be almighty programmer in order to involve in open source movement? I bet not, there are many ways to promote open source. I believe every little piece of support and effort is important, whether you are testing the software, submit bug, writing documentation or etc.

My friend surface took different approach, he decided to promote open source usage by examples, and now it seems the site growing and there are many tips and tricks that are very useful. You can check it out at -

http://linux.byexamples.com/

I'm surprised when I see this site too -

http://www.byexamples.com/

Well done, surface! May the force be with you!!!!!

Cheers ;]

Thursday, April 19, 2007

Argus: Practical BotNet Detection

I use argus for my daily task, like I mentioned argus client tools are easy to use but hard to master, it is trivial to work with it sometimes. However I believe experience may make you wiser when dealing with complex tools, I really appreciate Hanashi's work on BIRT for sguil report generation. As Hanashi is working on sancp session data, I'm more of looking into argus flow data. Here's very short paper that I have written in using argus client tools(ragrep and radump) to perform botnet detection.

http://www.rawpacket.org/anonymous/argusR/Argus-PracticalBotNetDetection.pdf


The reason why I don't want to post this in blog because it may look cluttered, I welcome any feedbacks and idea about this short paper.

Enjoy ;]