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

v1.3.0: write after end in reverse conn. mode #5

Closed
3 of 4 tasks
roccomuso opened this issue Jul 27, 2017 · 0 comments
Closed
3 of 4 tasks

v1.3.0: write after end in reverse conn. mode #5

roccomuso opened this issue Jul 27, 2017 · 0 comments
Assignees
Labels

Comments

@roccomuso
Copy link
Owner

roccomuso commented Jul 27, 2017

In a reverse shell scenario:

Error: write after end
    at writeAfterEnd (/home/rocco/Desktop/REPOS/netrat/lib/seed/node_modules/readable-stream/lib/_stream_writable.js:276:12)
    at DestroyableTransform.Writable.write (/home/rocco/Desktop/REPOS/netrat/lib/seed/node_modules/readable-stream/lib/_stream_writable.js:320:20)
    at Socket.ondata 

On both client and server. Bug introduced in v1.3.0 pheraps.

Client:

new NetcatClient()
 .addr(RHOST)
 .port(RPORT)
 .retry(RETRY)
 .filter(filterShxCmd)
 .connect()
 .exec(cmd)

function filterShxCmd(chunk, enc, cb) {
  if (chunk.toString().indexOf('shx') === 0){
    // TODO ..
    cb(null)
  } else cb(null, chunk)
}

Server:

var NetcatServer = netcat.server
var nc = new NetcatServer()

nc.k().port(6666).listen().serve(process.stdin).pipe(process.stdout)
  • almost fixed with v1.3.1. See issue below

Duplicate stream on client reconnection (probably a self._filter issue).

  1. server up.
  2. client connect ... client disconnect.
  3. another client connect ... client disconnect.
  4. server: ls --> results is piped twice!
  • Fix issue.
  • Add TCP tests for this!

Another issue related pheraps:

  • Transfer file test failing on macOS (see travis builds).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant