14 Interpreting outputs
Some statistics of incoming IPs
Brief background
Focus today
Protecting:
You, your family and people who’re important around you
Threats
Protecting:
You, your family and people who’re important around you
Your belonging (money, for example)
Threats
Protecting:
You, your family and people who’re important around you
Your belonging (money, for example)
Your integrity (come to this later)
Threats
Protecting people
Protecting people
Protecting people
Protecting people
Protecting people
Protecting people
Example
Example Machine side
People side Vulnerable host
Vulnerable people
Attack vectors
Example
Example Machine side
People side Vulnerable host
Vulnerable people Needs frequent
Needs frequent knowl- updates/patches
edge/advice/tazkirah
Attack vectors
Example
Example Machine side
People side Vulnerable host
Vulnerable people Needs frequent
Needs frequent knowl- updates/patches
edge/advice/tazkirah Prey/victim in the same
Prey/victim in the same time(machine that was
time (people who attack compromised, and later
and the victim) become stepstone to
attack)
Type of attacks
Methods of attack
Methods of attack
Methods of attack
Methods of attack
Passive attack
Worms - although vague, depends on the several issues -
network connections etc.
Type of attacks
Methods of attack
Passive attack
Worms - although vague, depends on the several issues -
network connections etc.
Phishing
Type of attacks
Methods of attack
Passive attack
Worms - although vague, depends on the several issues -
network connections etc.
Phishing
PDF exploits
Type of attacks
Methods of attack
Passive attack
Worms - although vague, depends on the several issues -
network connections etc.
Phishing
PDF exploits
Anything drive-by-download type
Prevention
Threats
Fast-flux network
DNS Poisoning
Victim preyed to
Happens in “cache” server follow/click the bait URL
Domain Name System
Threats
Fast-flux network
DNS Poisoning
Victim preyed to
Happens in “cache” server follow/click the bait URL
Attacks certain population Able to decieve everyone on
(say if the cache name the Internet
server for Organization X
was attacked, it only
happens there)
Domain Name System
Threats
Fast-flux network
DNS Poisoning
Victim preyed to
Happens in “cache” server follow/click the bait URL
Attacks certain population Able to decieve everyone on
(say if the cache name the Internet
server for Organization X
was attacked, it only Serving malware, spam,
happens there) extreme p0rn, on
bulletproof webhosting
Deceiving users to say,
expose online banking pins
or passwords
Domain Name System
Threats
Fast-flux network
DNS Poisoning
Victim preyed to
Happens in “cache” server follow/click the bait URL
Attacks certain population Able to decieve everyone on
(say if the cache name the Internet
server for Organization X
was attacked, it only Serving malware, spam,
happens there) extreme p0rn, on
bulletproof webhosting
Deceiving users to say,
expose online banking pins Characteristics: one domain
or passwords map to a lot of IPs, with
short Time to Live (TTL)
Domain Name System
DNS Poisoning
Fast-flux network
Fast-flux animation
Source: http://www.f-secure.com/weblog/archives/fastflux.gif
Source:Fortinet
Domain Name System
Source:Fortinet
Malware
Intro
Malware
Malware
Malware
Malware
Malware
Kippo
Kojoney
Nepenthes/Dionaea
Mwcollect
Attack Containment/Prevention
Malware analysis
/opt/dionaea/var/dionaea/binaries/4a6e5980ad7d1a4bbe71ec46fa96755e
>> checking binary for known windows API calls
>> checking for plaintext commands or calls >> found plaintext: kernel32
>> found plaintext: CreateProcessA >> found plaintext: GetProcAddress
>> found plaintext: http address
>> checking for windows api calls >> done
/opt/dionaea/var/dionaea/binaries/d7904fa2b3bba7bde11c01073a4b1fdf
>> checking binary for known windows API calls
>> checking for plaintext commands or calls
>> found plaintext: possible windows cmd
>> found plaintext: kernel32
>> found plaintext: GetProcAddress
>> found plaintext: http address
>> checking for windows api calls >> done
/opt/dionaea/var/dionaea/binaries/dd128e54320ce15ab7e3c1f0648740be
>> checking binary for known windows API calls
>> checking for plaintext commands or calls
>> found plaintext: possible windows cmd
>> found plaintext: kernel32
>> found plaintext: GetProcAddress
>> found plaintext: http address
>> checking for windows api calls >> done
Attack Containment/Prevention
Encryption in Malware
dd128e54320ce15ab7e3c1f0648740be
Found XOR 00 position 9DC34: http://broker.adobe.com/Acrobat/index.cgi
Found XOR 00 position E7BE8: http://mail.ru/:StringDatat_play....vk.
Found XOR 00 position E7D7C: http....nk
Found XOR 00 position E7DD0: http://mail.ru/:StringIndex
Found XOR 00 position E7F8C: http. Found XOR 00 position E7F94: http....vk.
Found XOR 00 position E8070: http://win.mail.ru/cgi-bin/auth:StringData
Found XOR 00 position E81A8: http://win.mail.ru/cgi-bin/auth:StringIndex
Found XOR 00 position E8330: https://www.google.com/accounts/ServiceLogin:Strin
...
Found XOR 00 position E84E0: https://www.google.com/accounts/ServiceLogin:Strin
Found XOR 00 position F1B0B: http://www.usertrust.com1.0...U....UTN-USERFirst-H
Found XOR 00 position F1D7B: http://crl.comodoca.com/UTN-USERFirst-Hardware.crl
Found XOR 00 position F1DB5: http://crl.comodo.net/UTN-USERFirst-Hardware.crl0.
Found XOR 00 position F1E04: http://crt.comodoca.com/UTNAddTrustServerCA.crt09.
Found XOR 00 position F1E41: http://crt.comodo.net/UTNAddTrustServerCA.crt0...*
Found XOR 00 position F23BC: http://www.public-trust.com/CPS/OmniRoot.html0...U
Found XOR 00 position F2498: http://www.public-trust.com/cgi-bin/CRL/2018/cdp.c
...
....so on
Attack Containment/Prevention
Encryption in Malware
Libemu
From Libemu’s website :
Features
executing x86 instructions
reading x86 binary code
register emulation
shellcode execution
shellcode detection
static analysis
win32 api hooking
Benefits
detect shellcodes
execute the shellcodes
profile shellcode behaviour
Libemu
Example of libemu in action
Step 1
Let say we have such collections of PDF exploits . . .
Libemu
Example of libemu in action
Step 2
They are PDF, but the malicious ones . . .
Libemu
Example of libemu in action
Step 3
Checking the PDFs using AV . . .
Libemu
Example of libemu in action
Step 4
Now, using a PDF decoder, we strip the suspected shellcode . . .
Libemu
Example of libemu in action
Step 5
Put them into a blank textfile . . .
Libemu
Example of libemu in action
Step 6
By using libemu’s tool “sctest”
Libemu
Example of libemu in action
Step 7
We got a nicely drawn flow graph
Honeypots
SSH-based honeypot
Kippo Honeypot
Honeypots
SSH-based honeypot
Kippo Honeypot
Honeypots
Misc protocol based honeypot-Amun
Amun honeypot I
.::[Amun - Main] ready for evil orders: ::.
.::[Amun - vuln_check] CHECK Incoming: 213.XX.XX.7:31204
(Bytes: 18) ::.
.::[Amun - vuln_check] CHECK Incoming: cisco
(Bytes: 7) ::.
.::[Amun - vuln_check] CHECK Incoming: telnet 213.XX.XX.7 31204
(Bytes: 25) ::.
.::[Amun - vuln_check] CHECK Incoming: cisco
(Bytes: 7) ::.
.::[Amun - vuln_check] CHECK Incoming: 213.XX.XX.7:31204
(Bytes: 18) ::.
.::[Amun - vuln_check] CHECK Incoming: telnet 213.XX.XX.7 31204
(Bytes: 25) ::.
.::[Amun - vuln_check] CHECK Incoming: 213.XX.XX.7:31204
(Bytes: 18) ::.
.::[Amun - vuln_check] CHECK Incoming: cisco
(Bytes: 7) ::.
.::[Amun - vuln_check] CHECK Incoming: telnet 213.XX.XX.7 31204
(Bytes: 25) ::.
.::[Amun - vuln_check] CHECK Incoming: 213.XX.XX.7:31204
(Bytes: 18) ::.
.::[Amun - vuln_check] CHECK Incoming: cisco
(Bytes: 7) ::.
.::[Amun - vuln_check] CHECK Incoming: telnet 213.XX.XX.7 31204
(Bytes: 25) ::.
.::[Amun - shellcode_manager] found langenfeld xor decoder (key: 153) ::.
.::[Amun - shellcode_manager] found langenfeld shellcode (key: 153 port: 56, ip: 222.XX.XX.61) ::
Honeypots
Misc protocol based honeypot-Amun
Amun honeypot II
Honeypots
Misc protocol based honeypot-Amun
Got something?
Honeytrap honeypot
BPF s t r i n g i s ’ ( ( t c p [ 1 3 ] & 0 x04 != 0 and t c p [ 4 : 4 ] == 0 ) o r
( icmp [ 0 ] == 3 and icmp [ 1 ] == 3 ) ) and ( s r c h o s t ( 1 9 2 . 1 6 8 . 2 . 2 ) ) ’ .
Logging to / opt / honeytrap / honeytrap . l o g .
I n i t i a l i z a t i o n complete .
Mwcollect
root@auber:~# mwcollectd -l
_ __ _____ _____ ___ | | | ___ ___| |_ __| |
| ’_ ‘ _ \ \ /\ / / __/ _ \| | |/ _ \/ __| __/ _‘ |
| | | | | \ V V / (_| (_) | | | __/ (__| || (_| |
|_| |_| |_|\_/\_/ \___\___/|_|_|\___|\___|\__\__,_|
Copyright 2009 Georg Wicherski, Kaspersky Labs GmbH <gw@mwcollect.org>
This program is licensed under the GNU Lesser General Public License.
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/dynserv-nfqueue.so with configur
/opt/mwcollectd/etc/mwcollectd/dynserv-nfqueue.conf...
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/dynserv-mirror.so with configura
/opt/mwcollectd/etc/mwcollectd/dynserv-mirror.conf...
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/filestore-streams.so with config
/opt/mwcollectd/etc/mwcollectd/filestore-streams.conf...
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/filestore-binaries.so with confi
/opt/mwcollectd/etc/mwcollectd/filestore-binaries.conf...
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/shellcode-libemu.so with no conf
[2010-06-23 11:44:23 INFO] Creating 1 shellcode testing threads.
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/download-tftp.so with no configu
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/download-curl.so with no configu
[2010-06-23 11:44:23 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/submit-mwserv.so with configurat
/opt/mwcollectd/etc/mwcollectd/submit-mwserv.conf...
[2010-06-23 11:44:24 SPAM] Loading module /opt/mwcollectd/lib/mwcollectd/log-file.so with no configuratio
[2010-06-23 11:44:27 EVENT] ["download.result.success":xxx]
{ url = "https://xxx.mwcollect.org/xxx", response = "OK: 120", type = "submit-mwserv.xxx" }
Honeypots
Misc protocol based honeypot-Nepenthes
Nepenthes honeypot
# #
Nepenthes Ampullaria
# #
Dionaea honeypot
Dionaea-some features
Succesful downloads
Special section - Dionaea
SQLite
SQLite in Dionaea
Special section - Dionaea
SQLite
Special section - Dionaea
SQLite
Visualization
Plot to Gnuplot
Visualization
Gnuplot
Visualization
Gnuplot
Visualization
Afterglow+Graphviz
Afterglow+Graphviz
Visualization
Dionaea in action
Interpreting outputs
Some statistics of incoming IPs
n a j m i @ a u b e r : ˜ $ f o r i i n ‘ awk −F ” | ” { ’ p r i n t $1 ’ } r e m o t e h o s t . t x t ‘ ;
do e c h o $ i ‘ g e o i p l o o k u p $ i | awk −F ” GeoIP C o u n t r y E d i t i o n ” { ’ p r i n t $2 ’ } ‘ ; done
8 5 . 1 9 0 . 0 . 3 : DE , Germany
9 0 . 2 1 3 . 2 1 8 . 7 6 : GB, U n i t e d Kingdom
1 2 1 . 1 5 . 1 6 6 . 2 3 7 : CN, C h i n a
6 0 . 6 3 . 2 1 7 . 2 0 0 : CN, C h i n a
5 8 . 2 3 . 1 8 4 . 1 0 4 : CN, C h i n a
2 1 8 . 2 8 . 1 9 . 2 2 9 : CN, C h i n a
1 2 4 . 1 0 6 . 1 8 9 . 2 2 5 : PH, P h i l i p p i n e s
1 4 0 . 2 1 1 . 1 6 6 . 4 : US , U n i t e d S t a t e s
8 9 . 1 6 . 1 7 6 . 1 6 : GB , U n i t e d Kingdom
5 8 . 2 5 . 3 9 . 2 2 1 : CN, C h i n a
7 5 . 7 5 . 1 8 . 5 3 : US , U n i t e d S t a t e s
2 2 1 . 2 1 2 . 1 2 1 . 6 8 : CN, C h i n a
8 9 . 2 1 1 . 1 5 9 . 4 3 : QA, Q a t a r
2 1 2 . 1 1 7 . 1 6 3 . 1 9 0 : LU , Luxembourg
2 1 3 . 1 6 1 . 1 9 6 . 1 1 : FR , F r a n c e
1 2 5 . 6 0 . 2 4 1 . 1 7 4 : PH, P h i l i p p i n e s
2 1 8 . 5 9 . 2 3 5 . 1 4 6 : CN, C h i n a
Interpreting outputs
Some statistics of incoming IPs
Sorting datasets I
n a j m i @ a u b e r : ˜ $ c a t l i s t | s o r t −d | u n i q −c | s o r t −n
1 FI , F i n l a n d
1 GR , G r e e c e
1 HK, Hong Kong
1 LU , Luxembourg
1 MO, Macau
1 MX, Mexico
1 PK , P a k i s t a n
1 RS , S e r b i a
1 RU , R u s s i a n F e d e r a t i o n
1 SG , S i n g a p o r e
2 AU, A u s t r a l i a
2 CO, C o l o m b i a
2 CR , C o s t a R i c a
2 ES , S p a i n
2 IR , I r a n , I s l a m i c R e p u b l i c o f
2 NO, Norway
2 QA, Q a t a r
2 SE , Sweden
2 TH, T h a i l a n d
2 TW, Taiwan
3 BN, B r u n e i D a r u s s a l a m
3 BR , B r a z i l
3 DE , Germany
3 GB , U n i t e d Kingdom
3 KR, Korea , R e p u b l i c o f
4 CA , Canada
Interpreting outputs
Some statistics of incoming IPs
Sorting datasets II
4 IT , I t a l y
5 FR , F r a n c e
5 IP Address not found
5 PH, P h i l i p p i n e s
6 VN, Vietnam
8 IN , I n d i a
9 EG , E gypt
13 JP , Japan
15 TR , T u r k e y
17 MY, M a l a y s i a
21 PE , Peru
24 US , U n i t e d S t a t e s
115 CN, C h i n a
Interpreting outputs
Some statistics of incoming IPs
We can use any AV or in Linux simply the CLI based AV, or some other
options, such as the following Ruby-based script from
http://hammackj.com/2010/02/22/tool-virustotal-rb/;
$cat f i l e
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f
$ . / v i r u s t o t a l . r b −f f i l e
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : a−s q u a r e d R e s u l t :
T r o j a n−D r o p p e r . Win32 . P a r a d r o p ! IK
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : AhnLab−V3 R e s u l t :
Win32 / Korgo . worm . 1 0 8 7 9
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : A n t i V i r R e s u l t : Worm/ Korgo . I
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : A n t i y−AVL R e s u l t :
Worm/ Win32 . Padobot . gen
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : A u t h e n t i u m R e s u l t : W32/ Korgo . I
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : A v a s t R e s u l t : Win32 : Korgo−G
042774 a 2 b 7 7 8 4 e e 0 f 7 4 6 2 e 3 c e 7 2 1 e c 0 f : S c a n n e r : A v a s t 5 R e s u l t : Win32 : Korgo−G
-end-
&
ÕºË @Qº