Giter Site home page Giter Site logo

onionshare / onionshare Goto Github PK

View Code? Open in Web Editor NEW
6.1K 187.0 626.0 32.97 MB

Securely and anonymously share files, host websites, and chat with friends using the Tor network

Home Page: https://onionshare.org/

License: Other

Python 95.18% Shell 0.59% HTML 1.55% Batchfile 0.02% CSS 0.86% JavaScript 1.67% PowerShell 0.13%
tor file-sharing onionshare onion-service tor-onion-service security python cross-platform open-source

onionshare's Introduction

OnionShare

Run Tests

OnionShare

OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor network.

Installing OnionShare

You can download OnionShare for Windows and macOS from the OnionShare website.

For macOS you can also use Homebrew:

brew install --cask onionshare

See these instructions to install OnionShare in Linux as a Flatpak or Snap package.

Documentation

To learn how OnionShare works, what its security properties are, how to use it, and how to contribute to the project, check out https://docs.onionshare.org.

onionshare's People

Contributors

ao-loclab avatar baccount avatar comradekingu avatar delirious-lettuce avatar egypcio avatar emmapeel2 avatar enotodden avatar gabboxl avatar garrettr avatar gjwentink avatar hiromipaw avatar irykoon avatar jxtsai avatar kapatych-be avatar kf3hhnaspm avatar lwesterhof avatar micahflee avatar mig5 avatar milotype avatar noisycoil avatar r4v5 avatar saptaks avatar scootergrisen avatar tachyglossues avatar thomaswaldmann avatar tictactoe101 avatar u451f avatar weblate avatar whew avatar xinxinxinxinxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onionshare's Issues

Occasionally webkit crashes when closing onionshare-gui

It only happens sometimes.

[user@dev onionshare]$ onionshare-gui                
java version "1.7.0_55"
OpenJDK Runtime Environment (fedora-2.4.7.4.fc20-x86_64 u55-b13)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
 * Running on http://127.0.0.1:36424/
filename: /home/user/code/onionshare/onionshare.egg-info/PKG-INFO
filehash: d23f58b9f60dd373be527e8554520398998ff30b
filesize: 1039
127.0.0.1 - - [31/May/2014 20:17:46] "GET /ec4d43d26feb5d356ae6c5731092ddc9 HTTP/1.1" 200 -
127.0.0.1 - - [31/May/2014 20:17:48] "GET /favicon.ico HTTP/1.1" 200 -
127.0.0.1 - - [31/May/2014 20:17:48] "GET /favicon.ico HTTP/1.1" 200 -
1   0x7f53800d8527 /lib64/libjavascriptcoregtk-1.0.so.0(WTFCrash+0x17) [0x7f53800d8527]
2   0x7f538010c095 /lib64/libjavascriptcoregtk-1.0.so.0(_ZN3WTF10StringImplD1Ev+0x1f5) [0x7f538010c095]
3   0x7f538010c139 /lib64/libjavascriptcoregtk-1.0.so.0(_ZN3WTF10StringImpl7destroyEPS0_+0x9) [0x7f538010c139]
4   0x7f5380ecaf4d /lib64/libwebkitgtk-1.0.so.0(+0x7ebf4d) [0x7f5380ecaf4d]
5   0x7f5380ecaf69 /lib64/libwebkitgtk-1.0.so.0(+0x7ebf69) [0x7f5380ecaf69]
6   0x7f5380e2d514 /lib64/libwebkitgtk-1.0.so.0(+0x74e514) [0x7f5380e2d514]
7   0x7f5380e41bff /lib64/libwebkitgtk-1.0.so.0(+0x762bff) [0x7f5380e41bff]
8   0x7f5380e9932b /lib64/libwebkitgtk-1.0.so.0(_ZN7WebCore4Node14removedLastRefEv+0x3b) [0x7f5380e9932b]
9   0x7f5381abb8c8 /lib64/libwebkitgtk-1.0.so.0(+0x13dc8c8) [0x7f5381abb8c8]
10  0x7f53937614c9 /lib64/libc.so.6(+0x394c9) [0x7f53937614c9]
11  0x7f5393761515 /lib64/libc.so.6(+0x39515) [0x7f5393761515]
12  0x7f5393749d6c /lib64/libc.so.6(__libc_start_main+0xfc) [0x7f5393749d6c]
13  0x400721 /usr/bin/python() [0x400721]
Segmentation fault (core dumped)
[user@dev onionshare]$ 

OnionShare needs a logo

I'm building a GUI version which will need an icon. Does anyone have any ideas for what the OnionShare logo should look like? Please post ideas and versions of logos in this thread.

Use constant-time string comparison

In check_auth, you use Python's built-in equality operator to compare the usernames and passwords. This operator is not guaranteed to be constant time, which enables attackers to perform timing attacks to recover these secret values.

This is especially troublesome given the low entropy of both values (8 bytes each).

Localization

I'd like to get all the text in OnionShare translated into several languages.

Uses predictible directory name in world-writable directory

I had a quick look at the code, and it seems to me that on a given platform, get_hidden_service_dir always returns a directory name in /tmp, that's chosen in a pretty small space (basically a constant + a port). I admit I haven't verified this in pratice, so sorry if I'm wrong.

I haven't looked at how much little-t-tor trusts the content of a hidden service directory, checks for symlinks, ownership and permissions in case stuff already exists, so I've no idea what is the potential practical impact of this (might be overwriting arbitrary files with the permissions under which tor is running, or not).

I guess it would probably be quicker to switch to a random directory name, than to discuss whether, in this specific case, a non-random one might be safe :)

using a pre-configured hidden service by using --ip and --onion

It would be nice if there were --ip 192.168.0.10:9125 and --onion v645bzpxmdtclpv3.onion arguments, so already existing, self, pre, -configured hidden services could be used. That would allow running onionshare in systems such as Whonix, where Tor runs on a different machine.

Automatically close after download is complete

If we rewrite the download route to open the file and manually return chunks of it in the response, we can detect if the file finished downloading all the way or if it got cancelled.

I think the default behavior should be to automatically close onionshare after the download is complete.

There could be a --stay-open flag that you can use if you want to let multiple people download the file, like if you post an onionshare link to a chat room or on twitter or something.

The GUI can have a "Close when download completes" checkbox that's checked by default, that maps to the --stay-open flag.

Cannot connect to tor

I cannot connect to tor and I have no idea how I can do so.

I installed both onionshare and tor on both Mac OS X 10.9 and Debian 7.5.

In both cases I run tor from the command line and after a while get this response:
May 26 20:01:08.000 [notice] Bootstrapped 100%: Done.

To me it seems that tor is running.

However, when I fire up onionshare file.txt, I get the following error message:

Connecting to Tor control port to set up hidden service on port 50807.
Cannot connect to Tor control port on ports [9051, 9151]. Is Tor running?

What do I do wrong? And how can I fix this? Thanks!

404

Always get 404 skull and crossbones when attempting to download. No filename, no filesize and no sha1 calculated :-/

Build Windows installer package

I mentioned this in #17, but I think Windows packaging deserves it's own issue that's separate from the website. I'd like to try using something like http://www.py2exe.org/ to see if onionshare and onionshare-gui can just be exe files. I'd also like to create a setup.exe-style installer. Gotta figure out how to do that.

Clean up hidden service folders on close

Right now they stick around in /tmp until the OS deletes them. Assuming someone's computer was being forensically inspected:

  • Someone looking at the files on the filesystem could see the timestamps of the hidden service dir to prove that the user used OnionShare at that time
  • If someone found an OnionShare-looking link on the internet somewhere, they could prove that the user was the one who posted it (because the hostname is in the hidden service dir)
  • The hidden service secret key sticks around too. While it's extremely unlikely, it's possible that the people inspecting your files could have been running a rendezvous node and logging traffic, in which case they maybe could go back and decrypt their traffic log with this secret key, getting a copy of the file.

Use authenticated hidden services to prevent enumeration

Authenticated, or "stealth", Tor Hidden Services encrypt their descriptor with a randomly generated secret value (called a "cookie" in .torrc). The benefit of this is that an adversary cannot even learn if a THS is online without the cookie, because they can't decrypt the descriptor. I think this would also prevent an attacker with a lot of network perspective from narrowing down THS's by enumerating them, which has been used as part of attacks on THS in Trawling for Tor Hidden Services and others.

Since OnionShare's are intended to be short-lived, there may not be a practical attack based on enumerating hidden services (this would be worthwhile to investigate). However, if we can prevent such attacks easily, we should, as a defense in depth.

Supporting this would make the flow less elegant. At the moment, you need to modify your system, or TBB's, .torrc in order to access authenticated THS. Perhaps this should block on https://trac.torproject.org/projects/tor/ticket/8000.

onionshare python dependency too strict

I am trying to install with sudo dpkg -i onionshare_0.3dev-1_all.deb on debian wheezy. I got a few dependencies that I have mostly knocked over, but then there is this one:

dpkg: dependency problems prevent configuration of onionshare:
onionshare depends on python:any (>= 2.7.1-0ubuntu2).

My installed python is 2.7.3-4+deb7u1.

It appears that it is the ubuntu2 qualifier that is too strict.

I would really rather not change my python installation. Any chance of weakening the python dependency?

(The other dependencies were python-flask, python-qt4 (in the debian repos) and python-stem (in the wheezy backport repo)).

Fails if filenames have spaces in them

I just tried sharing a file called Screenshot from 2014-05-30 19:20:29.png. When I tried sharing it, onionshare would just display the usage line.

I have to rename it to screenshot.png, and it worked.

Fedora crash

Following the fedora build instructions from BUILD.md on a freshly booted Fedora 20 live dvd, it crashes.

Port to Windows

I briefly tested onionshare.py in Windows and it actually crashed the Tor running in Tor Browser. I just noticed that it's probably because Windows doesn't have files like /tmp/onionshare_hidden_service_*.

# set up hidden service
controller.set_options([
    ('HiddenServiceDir', '/tmp/onionshare_hidden_service_{0}/'.format(port)),
    ('HiddenServicePort', '80 127.0.0.1:{0}'.format(port))
])
onion_host = open('/tmp/onionshare_hidden_service_{0}/hostname'.format(port), 'r').read().strip()

I think making this work in Windows will involve making a Windows version of https://github.com/micahflee/onionshare/blob/master/onionshare-tails but called onionshare-windows.bat that sets the environment variables ONIONSHARE_PLATFORM to "Windows", and then modifying the hidden service part of onionshare.py to set HiddenServiceDir to somewhere in %Temp%.

Here's some info about the Windows local temp directory: http://environmentvariables.org/Temp
Here's some info on the Windows set command, which is used to manage environment variables: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/set.mspx?mfr=true

Oh, and also packaging for Windows so the whole thing is a .exe would be good too, but that should be a different bug I think.

OnionPort should support password-protected tor control port

Right now it assumes that control port doesn't have a password. It should provide a prompt for the control port password when it connects to a tor that has a password. And this password probably shouldn't be saved on disk, because then other programs could read it to take over tor.

Onionshare 0.3 from Onionshare.org not working on Windows

I installed Onionshare 0.3 for Windows and when I try to launch Onionshare nothing happens.

The installer did not appear to have any problems. I looked in a few places for logs but couldn't find anything, is there somewhere I can look for a log with detailed error?

This system already has Python 3.3.3 installed, which is needed for another application.

Onionshare_gui.py does not work but complied onionshare-launcher.exe does

Tested on Python 2.7 and Python 3.4. When attempting to run onionshare_gui.py or onionshare-launcher.py, both fail. onionshare_gui.py returns an exit code of 1 without any traceback information. onionshare-launcher.py returns the traceback of ImportError: No module named onionshare_gui I get these when running outside of my IDE and inside. Want to know if anyone can shed some light on this while I keep trying a few things with the code.

Traceback (most recent call last) [Error]

onionshare /var/www/index.html

Calculating SHA1 checksum.
Connecting to Tor control port to set up hidden service on port 52321.
Traceback (most recent call last):
File "/usr/local/bin/onionshare", line 10, in
onionshare.main()
File "/usr/local/lib/python2.7/dist-packages/onionshare/onionshare.py", line 122, in main
controller.authenticate()
File "/usr/local/lib/python2.7/dist-packages/stem/control.py", line 839, in authenticate
stem.connection.authenticate(self, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/stem/connection.py", line 518, in authenticate
raise IncorrectSocketType('unable to use the control socket')
stem.connection.IncorrectSocketType: unable to use the control socket

No Filename, no Hash, no Download

I have installed onionshare on arch linux with pip2.7 install onionshare.
When I try to share a file with onionshare filename I get the onion link, but opening it, there is no filename and no Hash displayed:
`


File size: bytes


SHA1 checksum:

` So trying to download it I get just the nice pink 404 Error Page.

Package this more properly?

Looking at the packaging, having all the dependencies in one directory is kinda redundant considering the extra effort it takes to maintain this project.
As far as i can tell the reason is because of Tails, while i don't know why so it would be awesome get an explanation there.

However, I'd purpose two solutions.

  • Git submodules.
    Most of not all except itsdangerous.py is available on github. So having them all as submodules pointing at the master branch or at a set commit seems more reasonable then having it all inside the repo.
  • Packaging it normally.
    While we are talking about security, pypi isnt the most secure thing we got in this world. But declaring the requirements and either fetch them from a repo/pypi seems better then the current approach.

Both would keep the packages updated with less effort. But again, this might be a question about security, so more input will probably be needed.

Figure out how to package with pywebkitgtk

The GUI relies on pywebkitgtk, which appears to be broken in pypi: https://pypi.python.org/pypi/pywebkitgtk/1.8

[user@dev tmp]$ virtualenv env
New python executable in env/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
[user@dev tmp]$ . env/bin/activate
(env)[user@dev tmp]$ pip install pywebkitgtk
Downloading/unpacking pywebkitgtk
  You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files.
  Downloading pywebkitgtk-1.1.8.tar.bz2 (277kB): 277kB downloaded
  Running setup.py egg_info for package pywebkitgtk
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
    IOError: [Errno 2] No such file or directory: '/home/user/tmp/env/build/pywebkitgtk/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

IOError: [Errno 2] No such file or directory: '/home/user/tmp/env/build/pywebkitgtk/setup.py'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/user/tmp/env/build/pywebkitgtk
Storing complete log in /home/user/.pip/pip.log

However it seems to work fine when installing with yum or apt-get.

"No Tor" error message should help user install/launch Tor Browser

If onionshare can't connect to the tor control port, probably one of these things is happening:

  • You're using a system tor but your control port isn't set up, or requires authentication
  • If you're not using a system tor, you don't have Tor Browser open

Right now the error message just says "Cannot connect to Tor control port on ports {0}. Is Tor running?".

I think it should tell you to open Tor Browser first and then try again, and if you don't have it to download it from https://www.torproject.org/.

If you're using Linux it should see if torbrowser-launcher is already installed. If it is, it should launch Tor Browser for you and then try again.

If not it should suggest that they install torbrowser-launcher to always have an up-to-date Tor Browser. And if they're using Ubuntu or an Ubuntu-derivative, it should offer to add this PPA and install torbrowser-launcher for them.

And of course it should still link to https://www.torproject.org/ for linux users who don't want to use torbrowser-launcher.

Build website, distribute packages on it

I registered onionshare.org, but haven't set up hosting yet. I need to get an SSL cert for it, build a simple website, and distribute gpg signed source packages, as well as binary packages for various operating systems.

I also want to see how simple it is to make a Windows exe using py2exe.

Write tests

Tests that come to mind are:

  • It should start a hidden service
  • Loading / on the hidden service should 404
  • Loading /[slug] on the hidden service should load the download page
  • Loading /[slug] should contain the word "checksum" or sometihng
  • Changing the language to others that are supported (like espanol), then loading /[slug] should contain that string in that language
  • Loading /[slug]/download on the hidden service should download the shared file, and it should be the same file

Onionshare doesn't play well with systemwide tor

On Ubuntu, there are several issues preventing the use of onionshare with the tor package installed from a package manager:

  1. By default, the tor control port is disabled
  2. Tor's AppArmor profile does not allow files to be created in /tmp
    • the solution for this is to include the rule /tmp/onionshare_** rw, in the tor apparmor config
  3. Since the hidden service directory is created by the user debian-tor, it is unreadably by the user launching onionshare-gui

I'm not sure how feasible it will be to fix these issues, since they appear to require modifying files owned by the tor package, and also have potential security ramifications. These issues (at least 1 and 3) will also affect Debian.

Package for Mac OS X

I've already made a lot of progress here: aaf8ae3

But now I'm having trouble getting pygtk to install at all in OSX.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.