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

Safely ignore exception when sock.shutdown() is called on a disconnected socket. #10

Closed
wants to merge 1 commit into from

Conversation

nk9
Copy link

@nk9 nk9 commented Apr 14, 2020

When using the smuggler tool on some sites, I was getting an error that stopped the run. Perhaps there's a way to make sure that shutdown() isn't called when the socket has already been closed. But catching and ignoring this exception seems to be effective.

 $ python3 smuggler.py -v 2 -u http://example.com                                                                                                         13:41:42

                                         _                             
         ___ _ __ ___  _   _  __ _  __ _| | ___ _ __       _ __  _   _ 
        / __| '_ ` _ \| | | |/ _` |/ _` | |/ _ \ '__|     | '_ \| | | |
        \__ \ | | | | | |_| | (_| | (_| | |  __/ |     _  | |_) | |_| |
        |___/_| |_| |_|\__,_|\__, |\__, |_|\___|_|    (_) | .__/ \__, |
                             |___/ |___/                  |_|    |___/ 

                        by @gwendallecoguic


[+] 0 hosts found: None
[+] 1 urls found: http://example.com
[+] 1 path found: None
[+] options are -> threads:10, verbose:2
[+] 1 urls to test.
[+] testing...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "smuggler.py", line 802, in doWork
    testURL( url )
  File "smuggler.py", line 614, in testURL
    r = doRequest( url, msg )
  File "smuggler.py", line 629, in doRequest
    r.send()
  File "smuggler.py", line 520, in send
    sock.shutdown( socket.SHUT_RDWR )
OSError: [Errno 57] Socket is not connected

@gwen001
Copy link
Owner

gwen001 commented Jun 24, 2020

Fixed, thank you.

@storenth
Copy link

Did this PR was merged? Can't find it under

git pull

@gwen001
Copy link
Owner

gwen001 commented Aug 10, 2020

It has been fixed a long time ago, thanks.

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

Successfully merging this pull request may close these issues.

None yet

3 participants