You are on page 1of 33

Issue 2 – Mar 2010 | Page - 1

Issue 12 – Jan 2011 | Page - 2


Issue 12 – Jan 2011 | Page - 3

JavaScript - JavaScript in web pages. Executing


JavaScript in someone's system does not
Botnets require any 0-days or exploits but simply
requires the person to visit a website.
Moreover the same piece of JavaScript
would work across all OSs‘ and
Heading 1 platform(desktops, tablets, mobiles etc).
Anybody who has had even a slight brush Every time a user clicks on a link he is giving
with the security industry would have heard a remote website an opportunity to execute
of Botnets atleast once. Botnets are a group code (JavaScript) on his machine. The
of computers compromised and controlled window of this opportunity is widened by
by an attacker, these computers or zombies the concept of tabbed browsing. Most users
would perform any actions that the attacker have multiple open tabs and most tabs
commands them to do. Botnets are usually remain open throughout the browsing
created by compromising the victims' session which could stretch for hours.
systems with some remote code execution This enables an external entity to utilize the
exploits and then installing backdoors on user‘s processing power and bandwidth for
them. The attackers must have been his malicious needs. Spammers, especially
working on exploits for 0-days or newly on sites like Twitter, have been able to get
discovered vulnerabilities to be able to thousands of users to click on their links in
infect more victims. Even then they are very short durations. But JavaScript is
usually restricted to only one platform believed to be handicapped due to
unless they have exploits and backdoors for performance constraints and the
the different platforms out there. restrictions enforced by the browser‘s
There is another type of remote code sandbox. This however is a misconception
execution that is far more easier to perform as JavaScript engines have become extremly
Issue 12 – Jan 2011 | Page - 4

fast over the recent years. Moreover HTML5 2) Extending execution lifetime:
introduces WebWorkers which is a Once a victim visits the attacker controlled
threading model for JavaScript. This lets page it is essential to keep this page open in
any website start a background JavaScript the victim‘s browser for as long as possible.
thread unknown to the user and execute This can be done by using a combination of
code without slowing down or making the Clickjacking and Tabnabbing.
browser unresponsive. When the page is loaded, it would contain
an invisible link with the target attribute set
to ‗_blank‘. This link is always placed under
Creating a JavaScript Botnet: the mouse pointer using the
A JavaScript botnet would include ‗document.onmousemove‘ event handler.
thousands of systems that have the attacker This way, when the victim clicks anywhere
controlled page open on their browsers for on the page a new tab opens and grabs the
an extended duration allowing continued victim‘s attention. With multiple tabs open
execution of the attacker‘s JavaScript. the likelihood of the victim coming back to
There are two phases in building such a the main tab and closing it is reduced.
botnet: To add to this effect Tabnabbing can be
1) Reaching out to victims used to refresh the page after the user leaves
2) Extending execution lifetime it, to update the favicon and appearance to
seem similar to popular websites like
1) Reaching out to victims : YouTube, Google or Facebook so that the
page blends in with the other tabs the victim
This involves getting the victim to visit an would usually have open. There is a working
attacker controlled website. This can be demo[http://www.andlabs.org/hacks/xtend
done in a number of different ways: _life.html] for this available on the Attack
1) Email spam and Defense Labs website.
2) Trending topics on Twitter
3) Persistent XSS on popular websites, JavaScript botnet activities:
forums etc JavaScript botnets can be used to perform
4) Search Engine Poisoning the same activities that are performed by
5) Compromised websites traditional botnets.
6) Abusing URL Shortners This article will discuss three such activities:
1) Application‐level DDoS attacks
These are methods used by current 2) Email Spam
JavaScript malware authors to attack 3) Distributed password cracking
victims to their website and can draw
thousands of victms. While traditional 1) Application‐level DDoS attacks
malware spreading website can be quickly DDoS attacks have been all over news in
identified due to automated crawlers recent time as activists belonging to either
looking for signatures of browser exploits, side of the Wikileaks debate took out each
JavaScript botnet payloads are less likely to others websites. Firms like Mastercard and
be identified since its regular JavaScript Visa have suffered significant losses due to
working within the constraints of the this.
sandbox and does not perform any
exploitation against the browsers.
Issue 12 – Jan 2011 | Page - 5

Application‐level DDoS attack is an effective unlikely that the user will even sense that he
type of DDoS attack that has affected even is part of a DDoS attack.
sites like Twitter. Usually these attacks 2) Email Spam
involve large number for HTTP requests to Spam mails are largely sent using
specific sections of the website that could open‐relay mail servers and botnet zombies.
potentially be resource intensive for the Though it would not be possible to a regular
server to process. open‐relay mail server from JavaScript still
Background JavaScript threads that were it would be possible to send such spam
started using WebWorkers can send cross mails through the web equivalent of
domain XMLHttpRequests even though the open‐relay mails servers.
remote website does not support it. The Many websites have feedback sections
Cross Origin Request security restriction is which ask the user to enter their name,
only on reading the response. email ID, subject and feedback. Once these
A website that does not support Cross are entered and the form is submitted, the
Origin requests will also process these server would craft this in the form of an
request thereby creating load on the server. email, with hard‐coded from and to mail
A simple request like addresses and send it to the internal mail
http://www.target.site/search_product.php server.
?product_id=% when sent in large numbers Poorly designed websites would contain the
can create serve performance issues on the from and to mail addresses in hidden form
server. fields on the browser and by overwriting
A browser can send surprisingly large of them to external addresses it should be
GET requests to a remote website using possible to send mails with spoofed
COR from WebWorkers. During tests it was addresses if the company‘s mail server is
found that around 10,000 requests/minute also configured to operate in an open‐relay
can be sent from a single browser. With mode.
even a very small botnet of just 600 zombies Since only GET requests can be sent
we would be sending around 100,000 through COR, the feedback form should
requests/sec, depending on the nature of either be sending all data in QueryString or
the page being requested this could be it should be differentiating between
enough to bring a website down. QueryString and POST parameters.
After I wrote about DDoS attacks with COR Alternatively if it is JSP page then HTTP
a very smart person[http://shellex.info] Parameter Pollution can be used to submit
showed me that similar numbers could also forms over GET.
be achieved by using the img tag to request
remote resources. Ben Schmidt has gone 3) Distributed password cracking
one step further by creating a malcious URL Password cracking has always been a task
shortening service called assigned for programs written in native
d0z.me[http://d0z.me/]. d0z.me seems to code with performance enhancement by
work like any other URL shortening service writing some sections in Assembly. With its
but it actually shows the destination page in relatively slower execution rate JavaScript
an iframe while perform DoS attacks on a has never been considered for performing
target website from the victim's browser. It such resource‐intensive tasks.
executes this so well that it is extremly Things however have changed, JavaScript
engines in modern browser are becoming
Issue 12 – Jan 2011 | Page - 6

increasingly fast and the concept of


WebWorkers allows creation of dedicated
background threads for the purpose of
password cracking. During our tests it has
been possible to observe password guessing
rates of 100,000 MD5 hashes/second in
JavaScript.
This figure is still slow compared to native
code which can easily loop through a few
million MD5 hashes/second on a machine
with similar configuration. The JavaScript
approach has been found to be on an Lavakumar Kuppan
average about 100‐115 times slower than lava@andlabs.org
that of native code but more than that it
makes up in scalability. ~110 machines Lava is a Penetration tester and
running the JavaScript password cracking Security Researcher.
program can match the cracking rate of one
machine running a similar program written
in native code.
As shown in the previous sections it would
be very easy to build a botnet of a few
thousand zombies executing our JavaScript
password cracker in the background. Even
with 1100 zombies our cracking rate would
be equivalent to that of having 10 machines
of similar configurations running a
password cracked written in native code. An
effective botnet creation effort could
potentially get hundreds of thousands of
such zombies to crack password hashes
providing unimaginable computing
capability.
I have built
Ravan[http://www.andlabs.org/tools/ravan
.html], a JavaScript distributed hash
cracking system which is an implementation
of this concept designed to be used for
legitimate needs.
Issue 12 – Jan 2011 | Page - 7

Botnet detection the popular network sniffing tool known as

tool: Ourmon Ourmon.

How Ourmon Works


Introduction Ourmon is a *NIX based open source tool
originally designed for network packet
A botnet is a fusion of many exploits into a
sniffing. It works on the concept of
single client-server application. The server
promiscuous mode of Ethernet packet
is called as bot server (generally an IRC
detection. It also uses port mirroring
server) where as clients are called as
technique through a Layer 2 (Ethernet)
Botclients or Zombies or Drones. The most
switch. It works best in FreeBSD Operating
interesting thing about botclients is that
System.
they create more botclients in a coordinated
manner for accomplishing a common goal Ourmon has two software parts, which are
with little or no intervention from the called,
attacker. Botnets are used frequently
because the attacker's machines (botserver) 1. The probe or front-end which sniffs
are not used and all the work is done by the packets and summarizes them into
drones which are generally machines other various bits of
than that of the attacker. There are many statistical information.
common botnet families like Spybot, 2. The back-end graphics engine, which
Agobot, RBot, Mytob, SDBot etc. processes the probe result and
makes Web graphics, ASCII reports,
A botnet can be used for sniffing packets, log entries, and reports. The
starting DDoS attack, spamming, phishing, graphics engine needs web server
and stealing data. In this Tool Gyan column, like Apache to be installed.
we will learn about botnet detection though
Issue 12 – Jan 2011 | Page - 8

Installation of Ourmon Would you like to


compile/install ourmon? [y] y
ourmon build: using make -f
Ourmon can be downloaded from
Makefile.linux
http://sourceforge.net/projects/ourmon/. cc -I. -I/usr/local/include -O4
-DLINUX -DDAEMON -c ourmon.c
The latest version is cc -I. -I/usr/local/include -O4
ourmon29.tar.gz.Installation of Ourmon is -DLINUX -c ipanalyze.c
bit tricky because it depends on many things cc -I. -I/usr/local/include -O4
like the OS you are using and the web server -DLINUX -c machdep.c
that is running and some specific libraries. cc -I. -I/usr/local/include -O4
-DLINUX -c util.c
We need following libraries to be installed cc -I. -I/usr/local/include -O4
before installing Ourmon. -DLINUX -c interfaces.c
cc -I. -I/usr/local/include -O4
 libpcap-devel -DLINUX -c filter.c
filter.c: In function
 pcre
‘write_report’:
 pcre-devel
filter.c:1324: warning: passing
 rrdtool argument 7 of ‘print_icmplist’
 rrdtool-perl makes integer from pointer
without a cast
You can use "yum install" or ―zypper install‖ hashicmp.h:62: note: expected
whichever suits you best. Also make sure ‘int’ but argument is of type
that all these libraries and devel-tools are ‘int *’
compatible with the version of your OS. You filter.c:1324: warning: passing
also need to install a web server for the GUI argument 8 of ‘print_icmplist’
display of results. For this article, we have from incompatible pointer type
used Fedora as OS. hashicmp.h:62: note: expected
‘char *’ but argument is of type
Here are the screen prints of installation. ‘char (*)[1024]’
cc -I. -I/usr/local/include -O4
---------------------------------------------------- -DLINUX -c monconfig.c
cc -I. -I/usr/local/include -O4
[root@localhost mrourmon]# -DLINUX -c hashsort.c
./makeclean.sh cc -I. -I/usr/local/include -O4
[root@localhost mrourmon]# -DLINUX -c hashport.c
./configure.pl cc -O4 -DLINUX -c signal.c
configuration script to install cc -I. -I/usr/local/include -O4
ourmon. -DLINUX -c hashsyn.c
note: default is suggested like cc -I. -I/usr/local/include -O4
so: [default] -DLINUX -c hashicmp.c
note: just hit carriage-return cc -I. -I/usr/local/include -O4
for default actions -DLINUX -c hashscan.c
cc -I. -I/usr/local/include -O4
-------------------------------- -DLINUX -c ircscan.c
cc -I. -I/usr/local/include -O4
Would you like to install the -DLINUX -c trigger.c
ourmon probe? [y] y cc -I. -I/usr/local/include -O4
Front-end configuration phase -DLINUX -c cprogram.c
started #################### cc -I. -I/usr/local/include -O4
-DLINUX -c nonipanalyze.c
Issue 12 – Jan 2011 | Page - 9

cc -I. -I/usr/local/include -O4 and set it to your home network


-DLINUX -c patmatch.c and mask (A.B.C.D/maskbits
cc -O4 -DLINUX -c spinlock.c style)
cc -O4 -DLINUX -c sync.c Do you want to change the
cc -I. -I/usr/local/include -O4 topn_syn home network address?
-DLINUX -c ourpcap.c [y] y
cc -I. -I/usr/local/include -O4 note: the home net address may
-DLINUX -c hashblist.c be a subnet or host address
cc -O4 -DLINUX -c thread.c (/32).
cc -I. -I/usr/local/include -O4 enter a home net address and
-DLINUX -c stringstore.c mask. [127.0.0.1/32]
cc -I. -I/usr/local/include -O4 192.168.0.17/24
-DLINUX -c hashdns.c netmask: 192.168.0.17/24
cc -O4 -DLINUX -c pktlinux.c
cc -O4 -o ourmon ourmon.o Do you want to install the
ipanalyze.o machdep.o util.o ourmon startup script in the
interfaces.o filter.o ourmon bin? [y] y
monconfig.o hashsort.o
hashport.o signal.o hashsyn.o WARNING: the default for the
hashicmp.o hashscan.o ircscan.o interface may not be what you
trigger.o cprogram.o want.
nonipanalyze.o patmatch.o WARNING: use #ifconfig -a to
spinlock.o sync.o ourpcap.o determine interfaces.
hashblist.o thread.o Please enter the input interface
stringstore.o hashdns.o name to sniff from: [eth0] eth0
pktlinux.o -lpcre -lpcap input interface is eth0
/usr/lib/libJudy.a Please enter directory for probe
Next we determine the ourmon output files (mon.lite, etc.):
config/filter file to use. [/opt/ourmon/mrourmon/tmp]
By default, we use the local /opt/ourmon/mrourmon/tmp
/opt/ourmon/mrourmon/etc/ourmon. probe output directory name is:
conf to provide input filters to /opt/ourmon/mrourmon/tmp
ourmon. Creating bin/ourmon.sh driver
WARNING: you should for startup of ourmon.
read/edit/understand ourmon.sh placed in ourmon bin
ourmon.conf! for ourmon front-end/probe
Do you want to use another startup
ourmon.conf file in some other ./ourmon.sh start
directory than WARNING: this is a gross guess
/opt/ourmon/mrourmon/etc? [n] n and it may be best handled by
you yourself!
Next we suggest one modification to the WARNING: linux has at least two
ourmon.conf file. major variations in
distributions in this area!
If this is a default install, you should change install the startup script
the following config directive: (bin/ourmon.sh) in /etc
somewhere for boot startup? [y]
topn_syn_homeip y
network/netmask ourmon front-end install
complete
ourmon front-end build worked
Issue 12 – Jan 2011 | Page - 10

You should now run


/opt/ourmon/mrourmon/bin/ourmon. INFO only: also setting up
sh to start ourmon logging directory (if needed)
creating log rrddata tmp dirs,
e.g., # if necessary, in
/opt/ourmon/mrourmon/bin/ourmon. /opt/ourmon/mrourmon
sh start hit CR to continue:
If different, enter front-end
You can use ourmon.sh stop to output file directory absolute
stop ourmon path: [/opt/ourmon/mrourmon/tmp]
probe output file path (back-end
part 2: install the back-end, input/s) is
omupdate.pl, etc. (web part)? /opt/ourmon/mrourmon/tmp
[y] y Now we copy supplied .html files
Back-end configuration phase to the web directory for later
started editing
do you want to copy base web
################################ files to the web directory? [y]
y
We need a local web directory
for generated web output. INFO only: setting up local
hint: the webpath given here is rrdbase directory at
a guess: give the CORRECT base /opt/ourmon/mrourmon/rrddata
web directory with /ourmon at your runtime rrds get stored in
the end enter absolute web this directory, along with the
server web path directory: rrd error log file
if you create new BPF filters,
[/var/www/apache2- check rrdbase/ourmon.log for
default/ourmon] errors.
/var/www/html/ourmon hit CR to continue:
your output web path is:
/var/www/html/ourmon We need a UDP weight threshold
for UDP scan alerts
Do you want to create the web what should be the weight
directory for ourmon? (default is given): [10000000]
HINT: good idea if it doesn't
exist. [y] y
mkdir: cannot create directory Install backend crontab commands
`/var/www/html/ourmon': File in /etc/crontab (default answer
exists y)?: [y] y
cp bard/* ourmon system config complete
/var/www/html/ourmon/bard see INSTALL for post-config
cp batchip.sh batchipall.sh sanity checking
omupdate.sh
/opt/ourmon/mrourmon/bin [root@localhost mrourmon]# ls
cp *.pl /opt/ourmon/mrourmon/bin
cp mklogdir.sh ACKS CHANGES dumps
/opt/ourmon/mrourmon/bin INSTALL makeclean.sh
chmod +x README.bsd README.openbsd
/opt/ourmon/mrourmon/bin/*.sh scripts tmp ubuntudep.sh
chmod +x VERSION bin configure.pl etc
/opt/ourmon/mrourmon/bin/*.pl logs README
Issue 12 – Jan 2011 | Page - 11

README.linux rrddata The Ourmon Web Interface


src TODO uninstall.txt
web.pages

[root@localhost mrourmon]# cd
bin/

[root@localhost bin]# ls

batchipall.sh daily.pl
logbackup.pl mklogdir.sh
ombatchip.pl ombatchsyn.pl
omupdate.sh ourmon.sh ssh.pl
udpreport.pl batchip.sh
irc.pl makebar.pl
monbackup.pl ombatchipsrc.pl
omupdate.pl ourmon
sshdb.pl tcpworm.pl
wormtolog.pl

[root@localhost bin]#
----------------------------------------------------

When in doubt, read the supplied INSTALL


file at mrourmon/ as shown above. We can
detect the botnets from the GUI screen of
the Ourmon which runs continuously.
Reports are generated in daily, weekly,
monthly and yearly basis. Here are some
screen shots of the results. Note that here
we are showing you the screenshots of a
private network. In real time scenario the
screen shots will be different. But the
procedure of installation and results viewing
process remains the same.
Issue 12 – Jan 2011 | Page - 12

Ourmon Main Web Page:


Summarizations

TCP Anomaly Detection


Issue 12 – Jan 2011 | Page - 13

DNS RRDs:
Issue 12 – Jan 2011 | Page - 14

Major L2 protocol Graphs:

ICMP and UDP Error Generation


Page:
Issue 12 – Jan 2011 | Page - 15

Top N TCP and UDP flows:

UDP Summarizations:
Issue 12 – Jan 2011 | Page - 16

Base OS and Ourmon Directory


Screenshots:
Issue 12 – Jan 2011 | Page - 17

It is a huge tool and it can be used for


multiple purposes. Users are encouraged to
go through this tool carefully and find out
many interesting features. We also can see
evil channel sorts which show us all the
four types (PINGs, PONGs, JOINs and
PRIVMSG) of IRC messages. An IRC
channel having more than few clients with
high maxworm values can be a potential
botnet channel. Also, non-scanning host in
an evil-channel could be botnet servers.
Ashis Dash
ashisdash1@gmail.com
Further Reading Ashis is a network programmer,
blogger and open source software
1. ―Ourmon and Network Monitoring
advocate. He works extensively on
Performance", James Binkley, Bart
Massey, April 2005 Layer2/Layer 3 switches and
Freenix/USENIX paper routers. His areas of interests
2. "Anomaly-based Botnet Server include Network Security, Shell
Detection," James R. Binkley, Code and Buffer Overflow
Computer Science, PSU, FLOCON Techniques.
CERT/SEI, Vancouver WA, October
2006.
3. "Traffic Analysis of UDP-based flows
in Ourmon," Jim Binkley and Divya
Parkeh, FLOCON CERT/SEI 2009,
Phoenix, Arizona.

Documentation

1. http://sourceforge.net/projects/our
mon/
2. http://ourmon.sourceforge.net/
Issue 12 – Jan 2011 | Page - 18

What are Botnets? Malwares are any malicious computer


programs, which intentionally or
unintentionally cause harmful, irritating,
unrecoverable damages to one‘s computer
Introduction systems. There are varied types into which
Recently, Indian Cinema experienced an a malware can be categoriesed, viz-
unusual phenomenon of technology and Viruses–file infectors,
imagination - ―Ro ‗bot‘s‖. The superstar of inserting/appending code in the original
the south was again at his best and we could code and executes when the file is accessed.
see excellent combination of talent and Worms – Self-replicating programs which
technology. propagate through networks.
But ever wondered, if this was to happen for Trojans – Programs which disguise as
real, what were the things which we saw had normal programs but, steal/sniff data of
unusual strength? How could just they victim and send it to the attackers/infectors.
become ―1-2-ka-4‖ in number (or even Rootkits – Sophisticated malware
more)? Execute orders given to them with category, which is stealth to be detected and
most accuracy? Re-evolve even after the perform maximum damage.
destruction? Spyware – Fake / Copy of original
Well this was an absolute scenario which we programs, which are not harmful but
might face in near future. And this could be disguise to open backdoors into the system
possible by the evolution of current for further attacks.
technology called ―Bots‖ or ―Botnets‖. So Ransomware – Normally termed as
what exactly are bots/botnets? spywares, but are specifically used for
Before we actually see about Botnets, one money laundering and economical frauds.
needs to have an insight about the category And of course, the newly evolving technique
to which they belong – Malwares. of Bots/Botnets.
Issue 12 – Jan 2011 | Page - 19

So what exactly are Botnets? The Botmaster tries to install the malicious
A bot can be a single system infected with code in the users system by wooing them to
malicious software/code and a collection of access/download a fake file. Once the
bots form a botnet which is controlled by system is infected with the code, it tries to
the commands of the botnet controller. infect other systems connected to it. The
The above description contains some infected systems are known as ―Zombies‖.
specific terminologies which need to be Thus the infection is spread exponentially
understood in order to understand the into the computer systems and an army of
working of botnets.
A botnet starts with malicious code written
by the attacker. The attacker infects a single
system/server with the code. This in turn is
used by the attacker as Command and
Control (C&C) center for further infection.
The attacker here is often termed as
―Botmaster‖.

zombies is created
All the Zombies are connected to the
attacker by a Command and Control Center
(C&C). Attacker can send any commands to
all systems to which the connection has
been established using this.All this happens
with absolute no knowledge to the user.
Issue 12 – Jan 2011 | Page - 20

infected his/her system and deploy their


stub for the botnet. Thus the infected
system is now turned into a Zombie. Most of
the analyzed botnets till date used IRC
based C&C mechanism. For E.g., SDBot,
Agobot, etc.

But to create more sophisticated botnets


attackers have already slowly moved on to
P2P services, Dynamic DNS services, HTTP
C&C, etc. One of the major advantages of
these is that many organizations may not
When a botnet is being considered, some of allow IRC connections into their network,
the important aspects which are involved but almost all, allow services like HTTP.
are,
 Zombie Control Mechanism :
 Botnet Control Methodology,
To control the zombies, attacker decides his
 Zombie Control Techniques, own commands and protocols. Using these,
attackers control the infected systems
 Propagation Techniques,
(zombies). Many known bots have their own
 Target Exploits and Attack set of commands to change the passwords,
Techniques, download a file to the victims computer,
upload the logs of victim and to gather
 File Delivery and victims sensitive information. Attackers
change the passwords/ deploy a backdoor so
 Deception Strategies used. that the access can be maintained for the
next time. Attackers disable the antivirus
software in order to avoid
All the above points define the architecture detection/removal from the system.
of a Botnet.
 Propagation Techniques :
 Botnet Control Methodology :
As mentioned earlier, once a system gets
When an Attacker writes a code to deploy infected with the botnet, it itself can infect
botnet, attacker first needs a control other machines connected to it.
mechanism to find his victim, deploy the
botnet and to have control on the infected For e.g., if one system gets infected, it tries
systems. When botnets were first deployed, to infect other systems connected to it. Thus
the only mechanism which was used was there are now total two systems spreading
(Internet Relay Chat) IRC Servers. IRC the botnet.
servers were one of the most vulnerable and
easy to use Control mechanisms used by
attackers to start a botnet. Attackers used to
setup an IRC server and woo users to join
into it. Once a user joins in, attackers
Issue 12 – Jan 2011 | Page - 21

Thus the botnet spreads exponentially.  Deception Strategies :


(Remember the movie scene where snake
kind of thing spirals out from nowhere.) Since long IRC base bots could be used
Attackers use different mechanism for the without any stopping into a botnet. But with
propagation. Attackers send emails to users the increase in awareness among the people
and ask them to click on a malicious URL or about the botnets, it has been easy to detect
to download a greeting/joke file. compromised machines. Hence attackers
have started to come up with more and
An automated code tries to perform a more sophisticated techniques to avoid
vertical or horizontal scan to find out open detection. Common methods used were,
ports across a single address or a range of
addresses. - disabling any AV programs found onto the
systems,

- disguise as a legitimate program,


 Target Exploits and Attack
Techniques : - delete system logs, etc.

Most of the systems which fall prey to Now attackers are even trying to hide into a
botnets are often unpatched systems. system using rootkit technology. Rootkits
Attackers try to exploit known are the most stealth and undetectable
vulnerabilities of a system. A specific botnet malwares. Attackers have been trying to
can be designed to exploit a specific incorporate this kind of technology to avoid
vulnerability. In such cases, attacker only detection.
makes changes to the malwares it drops into
victims system. These kind of botnets have
All work and no play makes
the same basic architecture and hence are jack a dull boy –
variants of their previous.
With all its strategies,
techniques and its spread,
what does a botnet do?
 File Delivery :
Typically botnets evolved with
By now it is quite clear, that every botnet a view to demonstrate
involves some kind of malware which is programming skills of its
creator.
deployed onto victim machine. When a But with its technological
system has been compromised, attacker advances, botnets are now a
acquires sufficient rights and lethal weapon for cyber
sends/downloads malwares into the victim criminals and hackers. Botnets
machine. Attacker may use utilities are now used for,
provided by IRC server for
- DDoS
download/upload purpose.
- Spamming
Attacker may also use HTTP/FTP protocols - Phishing
- Financial Frauds
to send/receive files depending upon the
- Identity Theft
system vulnerabilities. - Cheating in online games /polls
- Click Frauds
Issue 12 – Jan 2011 | Page - 22

- Espionage

Botnets cause a significant amount of loss to


an organization which has been plagued by
a botnet.Once a system/network gets
infected by the botnet it no longer belongs
to the user/owner. The attacker can have
full control of the system and can perform
all kinds of malicious activities using the
system. If current scenario of terrorism is
taken under consideration, botnets can be
an important weapon to affect a country‘s
stability and infrastructure. Pushkar Pashupat
According to recent observations, around push.pashupat@gmail.com
10000bot nodes are created per hour. Also
Pushkar aka- push is a Security
as stated in the Wikipedia page for Botnet,
evangelist, Working with Content
up to one quarter of all personal computers
Security and Anti-Virus Product
connected to the internet may be a part of
Company.
some or other botnet. There have been
many attempts to bring down as many
botnets as possible.

But as the old saying goes ―Prevention is


better than cure‖, its always better to
avoid getting infected than to detect and
remove it after infection. You never know
how much amount of damage has been done
till its detection.

- Standard methods of computer


security should strictly be followed
in an organization.

- Keep users well acquainted with the


best security practices to follow at
the workplace.

- Even though Content Security


products like AVs, IDS, IPS may not
be able to detect the new emerging
threats, its still a best practice to
keep them updated.

And of course,

“Patch!” “Patch!” “Patch!”


Issue 12 – Jan 2011 | Page - 23

About Information world‘s top experts on RBN, the infamous


Russian Business Network we‘re used to
Warfare: hear about. Besides being a wonderful
person and an highly-skilled professional,
new rules for a Jart belongs to an international network of
experts, closing working with Law
new world Enforcement and the IT Industry while
fighting cybercrime every day.

Summing up our backgrounds, we have


Introduction been able to develop this very first
presentation on such topics, bridging both
During my presentation at Club Hack
experiences and contacts, in order to build
Conference on day 2, the one named
something new, aiming to bring a totally
―Cybercrime, CyberWar, Information
new approach to the subject. Giving the
Warfare: what‘s this all about, from a
amount and nature of feedbacks, both on-
Hacker‘s perspective? New rules for a new
side (after my talk) and those emails I‘ve
world‖, I‘ve noticed a deep interest by the
received, I may definitely say that we‘ve
audience.
been able to reach the goals :)
All of the delegates, no matter if operating
in the InfoSec industry or in Military
Reasons to speak about
environments, attended this presentation
with an high and true interest, possibly due
Information Warfare from a
to the topic and keywords of the talk itself. hacker’s perspective
After 9/11, the IA (Intelligence Agency)
I have designed the slides along with Mr. world started to ―hunt‖ for hackers,
Jart Armin, RBN exploit and meaning that they made up their very first
Hostexploit.com founder and among the move into the digital underground, looking
Issue 12 – Jan 2011 | Page - 24

for hacking resources to be hired, with very deep link with SCADA and Industrial
specific goals. Automation (IA) security.

At the beginning, US Government was Analyzing the nutshell


informally seeking for hackers, in order to If we take a look at the wonderful graph
attack and/or infiltrate into Al Qaeda made by the folks at Hostexploit.com, we‘ll
communication network. I do remember notice how all of the above I‘ve written in
requests related to hacking into Thuraya this article, perfectly fits the reality of facts
(http://www.thuraya.com/), a Middle-East and what effectively happened.
based satellite operator.
While the 2000-2003 period has been for
Intelligence gossip at that time was claiming testing purposes, then during 2003 and
that Al-Qaeda‘s members were seen while 2004 we can see rising the extortion
using Thuraya phones, and obviously this approach, that would explain and justify
may have lead IAs to imagine a scenario in USA and Israel IAs (namely, just the ―top of
which, if somebody would have been able to the iceberg‖) to possibly seek for e-weapons.
obtain both CDRs and satellite information
of specific Thuraya‘s users, then analyzing Then, all of this leads us to 2005 and 2007,
and correlating those data, the war against where I can see a deep, highly-shaked mix
one of the main actors in worldwide between the China attacks and the ―botnets
terrorism could have been won. for hiring‖ boom, while not forgetting about
what happened in Estonia (2007) and
Then, the time passed by, and no more Georgia (2008).
requests of ―on-demand‖ hacking to
Thuraya‘s network have been made to The last three years made all of us seeing
world‘s most notorious, old-school hackers, the botnet concept nicely applied both to
at least as far as I know. During 2002 and Cybercrime and Information Warfare
2003 tough, those guys assisted to a huge environments, while affairs such as the
escalation of different requests, this time Vodafone Greece (2004/2005), Telecom
coming from US and Israel based IAs. These Italia ―Tiger team‖ scandal (2003/2005),
agencies were asking for 0-days, probably to Stuxnet (June 2010) and Israel VS Lebanon
be used in specific scenarios. Also, a few & Egypt (December 2010), not speaking
people got ―softly detailed‖ requests to run about the Wikileaks (and CableWeaks) one,
black operations (hacking attacks for definitely helped us at drawing the big
Intelligence purposes) picture and realize what this is all about.

2005 observed the official claim of attacks Today‘s trends see IAs and MoDs deeply
pointing to China as the source of them, and scouting hacker‘s environments and
popped up the very big issue of the Source underground, hiring specialized know-how
of the Attack or Attack Source Attribution, for mission-oriented capabilities, such as 0-
that‘s still pending today. Days e-arsenary, launching cyber attacks,
protecting National Security, rather than
Finally, since 2008 up to now we started relying on the Industry and the
being aware of National Critical Underground and Public communities in
Infrastructures (NCIs) and those issue while order to analyze malware and obtain early
trying to secure them, summed up to the
Issue 12 – Jan 2011 | Page - 25

around it: server farm rather than home


warning, alerts, malware trends and
users, so to speak.
statistics.
This is one of the main reasons why
So, during the very next years will hear
Industrial Espionage incidents raised up
about a few new terms, such as Next
drastically in the last 20 years, thanks to the
Generation Cybercrime (NGC) and Next
Digital Revolution, and IT and TLC
Generation Walfare (NGW), along with the
resources and chances.
evergreen Cyberwar and Information
Warfare. In both cases we found ―instruments‖ like
botnets, DDoS tools, 0-days and so on that,
From Cybercrime to Information
depending on the scenario itself, can be
Warfare, through Industrial
labeled as ―cybercrime tools‖ or ―e-
Espionage
weapons‖.
They do exist deep links between
While the Underground Economy business
Cybercrime and the concept itself of
model is indeed a wonderful and exciting
Information Warfare. This happens because
study, it‘s my opinion that what we should
today‘s information is digitally stored,
learn – and apply to our needs and
parked on hard drives rather then on-line,
scenarios – from the cybercrime
from virtual hard drives to social networks,
environment is mostly the technical-related
passing-by the Cloud. So, we just said that
part. Analysing the ―life‖ of botnets, rather
this information is digital. This means,
than reverse engineering latest malware and
beside the media where it is stored, that it
0-day exploited vulnerabilities may lead us
stays into a file: it could be an email file, an
to a total new world and perspectives, where
Excel or Word document, a PDF or a Power
the concept of electronic weapons to be
Point presentation, an Open Office
applied and used in Information Warfare
document, a simple text (txt) note. But it‘s
scenarios become totally true.
still a file, whose security relays on the
operating system of the computer storing it, We will assist to an escalation of digital
rather than the whole context and scenario attacks, where some of them will became
Issue 12 – Jan 2011 | Page - 26

public while others will not. The recent


NATO interest shown in Lisbona a few
weeks ago is an important sign: in case of
cyberattacks to a NATO Member, the other
Members should support and help the State
under attack‖. This means really a lot, and
automatically includes perspectives such as
Information Sharing, CERT (Gov and Mil
ones, mainly) involvement, Incident
Management, a Coordination Center, and
establishing defined Point of Contacts
among all the Members, as well as defining
the Chain of Cyber Command and how it
will interlink and interact with the external.

Because the threat is global, just as well as


the cybercrime is borderless.

What’s already happening?

Former speaker at Duma, Nikolai


Kuryanovich, back in 2007 made a very
strong but visionary statement:

―In the very near future, many conflicts will It‘s not a futuristic scenario, here we are
not take place on the open field of battle, talking about something that already
but rather in spaces on the Internet, fought happened a long time ago. It was in the
with the aid on information soldiers… middle of the 80‘s when CCC members
Hagbard and Pengo used to hack into
This means that a small force of hackers is
Government and Military contracts, as well
stronger than the multi-thousand force of
as centers and research labs, in the USA,
the current armed forces.‖
giving back the results of their hacks to the
Nowadays many States already began, KGB and receiving money and facilities
trough their Minister of Defence, to work on from them. Hagbard was found dead,
topics such as an Official Cyber Doctrine, hanged to a tree out of the town he was
Cyberwarfare Training, Cyberwarfare living it, and burned.
exercise and simulations, building an IT
Vodafone Head of Network Design, possibly
roadmap (from a military and National
involved in the 2005 Vodafone Greece
Security point of view), working as well with
affair, was found suicide. The same for
the IT industry and technical universities
Adamo Bove, working at Telecom Italia
(see Malaysia, China and many others),
Lawful Interception System. And, the same
establishing Information Warfare units and,
recently happened to Majid Shahriari in
obviously, starting keeping record of
Iran, and everything seems to be related to
hacking activities on other Nations.
the Stuxnet worm
(http://www.debka.com/article/20406/).
Issue 12 – Jan 2011 | Page - 27

It’s out there, right now.


No, we are not talking about an Hollywood About the Author
movie, tough it would be a great screenplay. Raoul ―Nobody‖ Chiesa is 36 years old and
This is reality. It‘s a paradigm shift, where lives in Turin, Italy. At UNICRI (United
the classical war between armies has Nations Interregional Crime & Justice
reached his long-term apogee, and a new Research Institute) he‘s a Senior Advisor on
paradigm recently started. So, the ―good & Cybercrime and manager for Strategic
old‖ Menani‘s scale on cyberconflicts, Alliances. Raoul is also a member of ENISA
raising from Cybervandalism to Internet (European Network Information & Security
crime, Cyberespionage, Cyberterrorism and Agency) Permanent Stakeholders Group
Cyberwar, will sadly need to be ―enhanced‖: (PSG) and a recognized international
new rules for a new world. security expert, running its own
independent security consulting companies,
Note from the Author @ Mediaservice.net (a Security Advisory
In this article I have reported information company) and @ PSS (Digital Forensics
that have been gathered from personal consulting). He can be contacted at chiesa
experience and network of contacts: [at] UNICRI [dot] IT
nevertheless, everything I am stating here is
―suspected to be so‖, meaning, speculations
and possible scenarios.

Also, I have to underline that the views


expressed are those of the author(s) and
speaker(s) and do not necessary reflect
the views of UNICRI or others United
Nations agencies and institutes, nor the
view of ENISA and its PSG (Permanent
Stakeholders Group).
Issue 12 – Jan 2011 | Page - 28

Botnet attacks Applicable Sections

and the Law Sections 43, 66 and 66 (A) of the


Information Technology Act and Section
426 of Indian Penal Code

Introduction  Sec. 43
A botnet (a contraction of the term If any person without permission of the
―RoBOT NETwork‖) is a computer owner or any other person who is incharge
network made up of a vast number of of a computer, computer system or
compromised computers that have computer network,—
been infected with malicious code, and can
be remotely-controlled through (c) Introduces or causes to be introduced
commands sent via the Internet. any computer contaminant or computer
Typically, users whose computers have been virus into any computer, computer system
conscripted into a botnet are unaware that or computer network;
their computers have been compromised.
The computer so affected is called as He shall be liable to pay damages by the way
“Zombie”. of compensation to the person so affected;

Explanation — for the purposes of this


section,—
The Law
Case Study
(i) "Computer Contaminant"
Siddarth, a skilled programmer creates a means any set of computer
malicious code and releases it on the instructions that are
internet. It has compromised vast number designed—
of computers and caused a loss of worth
millions of dollars.
Issue 12 – Jan 2011 | Page - 29

(a) to modify, destroy, record, transmit data  Sec. 66A


or program residing within a computer,
computer system or computer network; or Any person who sends, by means of a
computer resource or a communication
(b) by any means to usurp the normal device—
operation of the computer, computer
system, or computer network; (a) any information that is grossly
offensive or has menacing
character; or

 Sec. 66

Any person ―dishonestly‖ or ―fraudulently‖ (b) any information which he knows


– to be false, but for the purpose of
causing annoyance,
(c) Introduces or causes to be introduced inconvenience, danger,
any computer contaminant or computer obstruction, insult, injury,
virus into any computer, computer system criminal intimidation, enmity,
or computer network; hatred or ill will, persistently by
making use of such computer
He shall be liable for an imprisonment
resource or a communication
which may extend upto 3 years and fine
device,
upto Rs. 5 lakh.

For the purpose of this Section,


(c) any electronic mail or electronic
The word “dishonestly” shall have the
mail message for the purpose of
meaning assigned to it in Section 24 of the
causing annoyance or
Indian Penal Code. , i.e.:-
inconvenience or to deceive or to
―Whoever does anything with the intention mislead the addressee or
of causing wrongful gain to one person or recipient about the origin of such
wrongful loss to another person is said to do messages,
that thing "dishonestly".‖
He shall be punishable with imprisonment
The word “fraudulently” shall have the for a term which may extend to three years
meaning assigned to it in Section 25 of the and with fine.
Indian Penal Code, i.e.:-

―A person is said to do a thing fraudulently


if he does that thing with intent to defraud
but not otherwise.‖
Issue 12 – Jan 2011 | Page - 30

 Sec. 426 of Indian Penal Code

Punishment for mischief

Whoever commits mischief shall be


punished with imprisonment of either
description for a term which may extend to
three months, or with fine, or with both.

Additionally provisions are also made in Sagar Rahukar


Sec. 66F Cyber terrorism and Sec. 69B sr@asianlaws.org
Power to authorise to monitor and collect
traffic data or information through any Sagar Rahukar, a Law graduate, is
computer resource for cyber security Head(Maharashtra) at Asian
regarding introduction, intrusion and School of Cyber Laws. Sagar
spread of Computer Contaminant. specializes in Cyber Law,
Intellectual Property Law and
Corporate Law. Sagar also teaches
law at numerous educational
institutes and has also trained
officials from various law
enforcement agencies.
Issue 12 – Jan 2011 | Page - 31

Who is leaving my Windows


Although again we are dividing this article
home? in windows vs linux subsections, remember
most of the commands will work on both
the OS. All you have to be careful is with
additional tools you are using to filter
Introduction results.
The whole team came to me and said this
issue will have to be on BOTNET only. They To start with we‘ll see on how many ports is
gathered article in all sections related to the my machine listening to a connection
same topic & now it was my responsibility to
C:\> netstat -na | find /i
make ―Command Line Gyan‖ on the related "Listening"
topic. So finally I decided to give you a
closer look at my good old. cross platform
friend ‗netstat‘. There is a reason why I This will give you a list of ports on your
chose ‗netstat‘, this would give you an idea machine which are in listening mode. Make
and help you keep an eye on outgoing sure you check reason behind each. to be
connection & monitor if your machine is a sure which application has opened that port
part of botnet or not.
You may want to use switch –o to see the
You can say that my antivirus is up-to-date PID of the process which has opened the
and it will take care of the same, but having port
said that are we sure all the malware are
C:\> netstat -noa | find /i
caught by ‗my‘ antivirus? Am I sure my "Listening"
Linux box doesn‘t have a malware which is
leaving me vulnerable to this?
Now how can you check which application
And that‘s where our friend ‗netstat‘ comes does that PID belong to?
handy but we‘ll take a different approach to
use it this time. For that use WMIC
Issue 12 – Jan 2011 | Page - 32

C:\> wmic process where Aah! I hate & love the case sensitivity of
processid="pid" list full Linux environment. And that‘s why we use
–i to ignore case while searching and use
This will tell you the process with your only ―listen‖ in filter as it may differ among
chosen PID. various Linux flavors.

You may also try other switches of netstat I know Linux users are geek themselves, so
like this article was just a reminder that don‘t
forget your friend netstat, keep using it 
-b = display executable name responsible
for the connection

-p = specific protocol

-o = display process ID

-a = display all

-n = display IP only and no the fqdn

Rohit Srivastwa
But the most interesting you‘ll find is using
rohit@clubhack.com
a continous netstat to keep looking at the
results

C:\> netstat –na 5

This will keep checking the result of ―netstat


–na‖ every 5 seconds. You may choose your
own time interval and make a script out of it

For more work on netstat there is an


interesting but more difficult way in
Microsoft Powershell but we‘ll keep that out
from this article

Linux
For linux more or less all the parameters are
same. You may want to try the same
command on linux too. Remember
parameter for netstat are same, not the
other executables
Like the first example in linux will become

# netstat -na | grep –i "listen"


Issue 2 – Mar 2010 | Page - 1

You might also like