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.

Connection resets after uploading a file linux

See original GitHub issue

Bug Description

After uploading a file with pwncat on some machines, trying to access the same shell will result in the connection being reset. Interesting this doesn’t happen when I try to establish a reverse shell in my local machine but fails on remote machines.

pwncat version

Using pwncat in docker.
$ pwncat --version
0.4.2

Target System (aka β€œvictim”)

https://tryhackme.com/room/toc2

Steps to Reproduce

Steps to reproduce the behavior:

  1. Obtain a shell, then CTRL+D
  2. Upload linpeas.sh
  3. CTRL+D again to enter the remote session.

Expected Behavior

Able to access session after successfully uploading a file

(remote) frank@toc:/home/frank$ 
(local) pwncat$ upload /tools/peas/linPEAS/linpeas.sh
./linpeas.sh ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% β€’ 342.9/342.9 KB β€’ ? β€’ 0:00:00
[08:46:04] uploaded 334.83KiB in 3.25 seconds                                                                                                                                                                                     upload.py:85
(local) pwncat$                                                                                                                                                                                                                               

[08:46:25] warning: 10.10.224.225:56778: connection reset                                                                                                                                                                       manager.py:496
(local) pwncat$

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Mitul16commented, Jun 17, 2021

Yes, this is why the loop for sending C-d wasn’t a good method Thank you for your time explaining all of this πŸ˜€

1reaction
calebstewartcommented, Jun 17, 2021

The internals of termios settings and TTY/PTYs gets very confusing and a lot of it is so closely coupled with kernel implementations and archaic standards that understanding it’s interaction is difficult. That added to the fact that most people don’t use these settings makes finding information on what the β€œcorrect” or β€œstandard compliant” API is difficult. I’ve read the termios man page more times than I’d like to admit trying to figure out how all this works. Lol

Read more comments on GitHub >

github_iconTop Results From Across the Web

File upload results with connection reset - linux - Super User
When trying to upload a file I get different behaviours : file size about 1.5mb : file is correctly sent to the server...
Read more >
Connection Reset during large file uploads to AWS s3 using ...
The system works for smaller files but fails when uploading larger files. The files my users will need to upload could be anywhere...
Read more >
'Connection reset by peer' on lftp while uploading files
I wanted to write a small script to upload all those files to an FTP server at the end of the day with...
Read more >
Uploading files larger than ~4MB results in "The connection ...
They get a "The connection was reset" this error in FireFox and in chrome they get "Error 101 (net::ERR_CONNECTION_RESET): Unknown error." InΒ ...
Read more >
Rsync connection reset by peer - Unix & Linux Stack Exchange
Rsync connections are mostly easy to resume when the underlying TCP connection drops: just run it again. As long as each run has...
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