question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discovered a “new” way in which an attacker can transfer files to the honeypot without HonSSH being able to detect or intercept the file. This issue was only detected when the IDS started sending alerts about outbound SSH attacks.

The instance was not configured to send any email alerts, so i figured that someone had compromised the honeypot and downloaded some malware but, there was no entries in the downloads.log or any downloads directory in the sessions file structure. The only obvious thing was a EXEC session log, these are the entries that show the activity of the attacker

20160214_122650_425601 - [EXEC0] Opened Channel
20160214_122650_426107 - [EXEC0] Command Executed: mkdir /tmp/.xs/
20160214_122651_364395 - [EXEC0] Closed Channel
20160214_122651_647226 - [EXEC1] Opened Channel
20160214_122651_647703 - [EXEC1] Command Executed: cat >/tmp/.xs/daemon.i686.mod
20160214_122714_097971 - [EXEC1] Closed Channel
20160214_122714_641976 - [EXEC2] Opened Channel
20160214_122714_642469 - [EXEC2] Command Executed: chmod 777 /tmp/.xs/daemon.i686.mod
20160214_122715_559964 - [EXEC2] Closed Channel
20160214_122715_836329 - [EXEC3] Opened Channel
20160214_122715_836800 - [EXEC3] Command Executed: /tmp/.xs/daemon.i686.mod
20160214_122716_420530 - [EXEC3] Closed Channel
20160214_122716_421130 - [SSH  ] Lost Connection with 1.2.3.4

The only thing that raised a red flag was the size of the adv-log’s, some of them were larger than 3 MB, after digging trough them i discovered the following strings

  • \xeaUPX!\xd8
    UPX
  • \x7fELF\x01
    ELF

Given the size of the adv-log’s and the presence of these strings we can assume that the attacker used SSH to move binary files to the honeypot.

After a couple of tests i think i figured out how the attacker did this. It’s possible to pipe things from the local host into a SSH EXEC session.

echo "Test Test Test" | ssh -l derp 10.13.111.57 'cat - > /tmp/pipe_in_exec.txt'

This will pipe the output from the echo over SSH to /tmp/pipe_in_exec.txt on 10.13.111.57. Given that this is possible, might it be that the attacker used a similar technique to transfer the file?

Is this something that should be within the scope of HonSSH to catch/intercept/detect?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
bang-uincommented, Nov 8, 2016

@tnich would you mind having a look at https://github.com/bang-uin/honssh/commits/feature/fs_watch and telling me what you think about the inotify approach?

0reactions
bang-uincommented, Nov 11, 2016

These are just hints and infos for everyone who likes to test that branch. I’ll create a wiki page if this branch gets at some point merged into the master.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Piping codes and standards - The Engineering ToolBox
A survey of one of the most important pressure pipe codes - ASME B31, earlier known as ANSI B31. ASME B31.9 Building Services...
Read more >
Codes, Standards and Recommended Practices
Codes are intended to set forth engineering requirements deemed necessary for safe design and construction of piping installations.
Read more >
Some Important Piping Codes and Standards
The piping codes provide specific design criteria for the activities such as material (MOC) selection, checking of allowable working stresses, and load criteria ......
Read more >
Use of Codes and Standards in Piping System Design
Piping codes provide design rules for nonstandard components and for the reinforcement of openings in the pipe wall. They do not provide design ......
Read more >
PIPING CODES & STANDARDS - PIPING GUIDE
PIPING CODES & STANDARDS · The following codes are used for the design, construction and inspection of piping systems in North America ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found