GithubHelp home page GithubHelp logo

icepa / icepa Goto Github PK

View Code? Open in Web Editor NEW
730.0 61.0 84.0 3.37 MB

iOS system-wide VPN based Tor client

License: MIT License

Objective-C 2.11% Shell 2.52% Swift 94.97% Ruby 0.40%
tor icepa vpn ios ios-app swift-3 ios-extension rust swift xcode apple rustup bridges-traffic

icepa's Introduction

iCepa Restart

This is a completely fresh implementation of the iCepa app.

It is a testbed for Network Extension experiments for advanced VPN-style apps.

It was originally developed for use with Tor by Conrad Kramer, hence the name ("Cepa" means onion in Latin), but can be used as a base for all other sorts of proxies now and also with Pluggable Transports.

Features

  • Container app for installing and controlling the Network Extension and displaying log output for easier debugging.
  • App Group storage to share files between the app and the extension.
  • iOS and MacOS implementation.
  • Basic messaging implementation to show how to communicate between app and extension.
  • Easy build configuration via xcconfig file.
  • Clean encapsulation of NE code in VpnManager and BasePTProvider classes.
  • Clean implementation of a TorManager to show usage of Tor.framework.
  • Tor.framework integrated as a git submodule for easy debugging.
  • Proxy can be run in extension and in app and easily switched.
  • Glue code for different tun2socks implementations to try out.

Different tun2socks implementations

Since a lot of existing proxy code can't handle IP packets directly (like Tor), a big part of the experiment is/was trying out different projects which go in between. Code for these is kept around for demonstration purposes, but is disabled, except the last (called leaf), which currently seems to be the best option.

The following libraries were tried and might be of interest to you:

  • OBTun2Socks A stab at packaging a C tun2socks implementation in a CocoaPod.

  • GoTun2Socks A Go implementation of tun2socks. Discontinued.

  • outline-go-tun2socks A Go tun2socks implementation by the Outline project.

  • tun2tor A Rust implementation of tun2socks specifically written for Tor with support for its DNS resolution. (slightly updated to fix compilation issues, but still outdated and discontinued)

  • leaf A flexible proxy framework written in Rust with support for SOCKS, HTTP CONNECT, ShadowSocks and many more with highly configurable routing options.

Getting started

git clone --recursive [email protected]:iCepa/iCepa.git
cd iCepa
pod install # or `update`
open iCepa.xcworkspace

Network Extensions can only be run on a real device. You will also need a paid Apple Developer subscription to be able to manually create the development certificates needed.

Don't edit project.pbxproj (the project configuration) directly, instead use Config.xcconfig, where all signing-related info is kept out of the way.

You will need to create 3 identifiers here: https://developer.apple.com/account/resources/identifiers/list

  • A group identifier.
  • An app bundle identifier for the app itself.
  • An app bundle identifier used for the Network Extension.

Both app IDs need the capabilities "App Groups" and "Network Extensions". Add the created group ID to the "App Groups" capability.

Put these IDs in the respective fields in Config.xcconfig.

The devloper team ID can be found on the aforementioned page in the top right.

Create 2 iOS development profiles here for the app and the extension: https://developer.apple.com/account/resources/profiles/list

Put their "names" as their specifiers in Config.xcconfig.

In Xcode, go to "Preferences" -> "Accounts" -> select your Apple ID -> "Download Manual Profiles"

Now, you should be able to compile and run on a real device.

Author, License

Benjamin Erhart, Die Netzarchitekten e.U.

Under the authority of Guardian Project.

Licensed under MIT

Icon

Icon taken from

https://thenounproject.com/term/onion/35969/

By Brennan Novak, Public Domain

icepa's People

Contributors

chrisballinger avatar conradev avatar fredericjacobs avatar johnantoni avatar mtigas avatar tladesignz 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

icepa's Issues

Build fails Tor framework from Carthage

In the cartfile, I wrote github "iCepa/Tor.framework" "master" and ran carthage update.
The build fails with the following error:
*** Building scheme "Tor-Mac" in Tor.xcodeproj
** BUILD FAILED **

The following build commands failed:
ExternalBuildToolExecution openssl-Mac
(1 failure)
A shell task failed with exit code 65:
** BUILD FAILED **

The following build commands failed:
ExternalBuildToolExecution openssl-Mac
(1 failure)

I don't know what I'm doing wrong.

Please help. Thanks

error: could not find `Cargo.toml` in `iCepa/Extension/tun2tor` or any parent directory

When trying to build the Mac version, I get:

error: could not find `Cargo.toml` in `iCepa/Extension/tun2tor` or any parent directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: target/x86_64-apple-darwin/debug/libtun2tor.a (No such file or directory)
$ rustup --version
rustup 0.6.3 (a0e2132 2016-08-28)

iCepaTunnel is killed on iPhone 5S for using too much memory

Quick investigation (running the app and attaching debugger to iCepaTunnel process) has shown to network extension is killed by iOS for allocating too much memory (17 MB). This happens as soon as I try to open check.torproject.org in Safari.

Installation issues

Hey Conrad,

Was checking out the project, was having issues setting up the project.

  1. You've included the Tor.framework as a submodule and through Carthage. Was that Intentional?
  2. Build script for lipo is failing. It's assuming that libtun2tor.a has been built, but it appears that it is not the case? (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: target/x86_64-apple-ios/release/libtun2tor.a (No such file or directory)

Not Building

error: could not find Cargo.toml in /Users/"myuser"/Downloads/iCepa-master/Extension/tun2tor or any parent directory

I have completed all build steps

tor: line 57: ./Configure: No such file or directory

line 57: iCepa-master/Carthage/Checkouts/Tor.framework/Tor/openssl.sh: ./Configure: No such file or directory
make: *** No rule to make target depend'. Stop. make: *** No rule to make target build_libs'. Stop.
make: *** No rule to make target install_dev'. Stop. make: *** No rule to make target distclean'. Stop.

What is serverAddress in NETunnelProviderProtocol confuguration?

Hello,
I found config.serverAddress = "somebridge" in the permissionViewController.swift file.
I added the server address "127.0.0.1" there. But it disconnected. Can you please guide me what server address I need to put there to connect TOR-VPN.
Thank you!

AppStore

Can I download it from App Store ??

Special Network Extension request no longer needed?

Hey! I've been getting a dev environment set up — excited to potentially contribute to this project.

I shot off an email to Apple to get access to the proper Network Extension entitlement, and got this lovely autoreply email:

Thank you for requesting information about the Network Extension framework. Please note that as of November 10, 2016 this process is not required for developers who wish to use App Proxy, Content Filter, or Packet Tunnel APIs. To use these services please navigate to your Developer Account at https://developer.apple.com/account/ and select the Network Extension capability for the App ID you will be using for your app.

If you are requesting an entitlement for Hotspot Helper APIs and have already filled out the request questionnaire then your request will be addressed at our earliest convenience. Otherwise please visit https://developer.apple.com/contact/network-extension/ and enter the required information.

I assume this project is likely not using Network Extension framework APIs other than the Packet Tunnel APIs, and that thus manually emailing Apple might not be necessary any more to run on-device?

I still don't have a working dev environment (banging my head against Rust tun2tor issues — may open an issue here once it becomes obvious it isn't trivially user error), so I can't confirm yet, but this does seem promising. Figured I'd bring this to your attention, since it seems like such a recent policy change.

Release build broken

Release build fails with

Ld /Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Products/Release-iphoneos/Tor.framework/Tor normal (in target 'Tor-iOS' from project 'Tor')
    cd /Users/dodo/Work/CloneOuts/iCepa/Tor.framework
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios11.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk -L/Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Products/Release-iphoneos -F/Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Products/Release-iphoneos -filelist /Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Intermediates.noindex/Tor.build/Release-iphoneos/Tor-iOS.build/Objects-normal/arm64/Tor.LinkFileList -install_name @rpath/Tor.framework/Tor -Xlinker -rpath -Xlinker @loader_path/.. -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -object_path_lto -Xlinker /Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Intermediates.noindex/Tor.build/Release-iphoneos/Tor-iOS.build/Objects-normal/arm64/Tor_lto.o -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -fapplication-extension -ltor -lssl -lcrypto -levent -levent_core -levent_extra -levent_pthreads -llzma -lz -Xlinker -dependency_info -Xlinker /Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Intermediates.noindex/Tor.build/Release-iphoneos/Tor-iOS.build/Objects-normal/arm64/Tor_dependency_info.dat -o /Users/dodo/Library/Developer/Xcode/DerivedData/iCepa-cjffkldphkgpqraghzyrjxmzcvrs/Build/Products/Release-iphoneos/Tor.framework/Tor

ld: library not found for -ltor
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Debug build works OK.

Also, the build instructions in the README don't mention that you also need to install Rust, cbindgen and ffi. Also, if using M1 Macs, tor.sh, xz.sh and libevent.sh needs to be modified and /usr/local/... changed to /opt/homebrew/....

VPN no longer connects after iOS 17.2 update

At first it takes several minutes to reach 100% and then immediately VPN connection drops.

After that the app remains in invalid state where no new connections are possible without deleting the app and compiling it and installing it anew. The Tor log error is something like Could not open "/private/var/mobile/Containres/Shared/AppGroup/UUID/tor/cached-micodescs" for mmap(): No such file or directory. This error can only be then removed by reinstalling the app.

I've also tried updating to latest version of Tor.framework but to no avail.

It used to work perfectly before iOS update.

How is the project coming along?

Been waiting along time to see this app come into the mainstream.... whats the current situation? Any chance we can expect to see it soon for general use?

Build falied

I am trying to build the project for iOS but it is saying that you done have archtecture for arm64. Error is as follows:

Screen Shot 2019-08-06 at 3 38 37 PM

Memory Issue

You mentioned in the README file that

Tor currently exceeds the 5 MB memory limit set on packet provider extensions by Apple (TODO: File radar). Until this is fixed, iCepa's extension will crash. If you have a jailbroken device, you can circumvent this with jetsamctl. Possible solutions include increasing the use of memory mapping in tor.

In what way did you see this?
I'm developing a Packet Provider extension of my own and seeing my extension crash with "Message from debugger: Terminated due to memory issue". Is this what you see in your extension?
Also, how do you know the memory limit is 5MB?

Thanks!

Name it just 'Cepa'

It's a subjective, fickle thing—but I personally find just 'Cepa' to be a better name for this project than prefixing it with 'i-' like iOS apps did a decade ago. Seems dated.

I'm really happy you folks made headway with getting this working on iOS! Can't wait to try it out when it makes it onto the App Store.

Build issue. 2 errors.

error: could not find Cargo.toml in /Users/username/Desktop/dev/iCepa/Extension/tun2tor or any parent directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: target/aarch64-apple-ios/debug/libtun2tor.a (No such file or directory)

Add a license

Firstly, I really appreciate the efforts of iCepa - I'm learning a lot from this code being here and the setup so well-documented. Thank you thank you thank you!

Unfortunately, none of this code can really be used for other projects in iCepa's current state since it's missing a license that would permit any kind of reuse or distribution.

I'm guessing something similar to https://git.zx2c4.com/wireguard-go/tree/README.md#n11 would work, but IANAL nor am I the author.

Error when pressing "Start Tor" button

2017-02-02 13:11:05.195483 iCepa[391:42712] <iCepa.ControlViewController: 0x13fd06d10>: Error: Cannot connect to tor: The operation couldn’t be completed. No such file or directory

Project Updates w/ iOS10

With the recent beta of iOS 10 v2 increasing the memory limit to 15 MB... does that mean the bottleneck has been removed and development is going forward?

Build Failed (Carthage)

Cathage fails to build so i assumed is was to do with the simulator, so i ignored it and tried to run in xcode and i get a 'Tor/Tor.h' file not found

Cathage:

Bens-MacBook-Pro:iCepa mrbenftw$ carthage build --platform iOS
*** xcodebuild output can be found in /var/folders/mz/1cg7sr7s7b515769b36sv9w40000gn/T/carthage-xcodebuild.nbZ1Yl.log
*** Building scheme "Tor-iOS" in Tor.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/mrbenftw/Desktop/VPN/iCepa/Carthage/Checkouts/Tor.framework/Tor.xcodeproj -scheme Tor-iOS -configuration Release -derivedDataPath /Users/mrbenftw/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Tor.framework/f55ed743cad916d0746ffb53eb3d174500d5477d -sdk iphonesimulator -destination platform=iOS\ Simulator,id=C9D7D128-DD91-42A9-A913-CCBBEB2D088A -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/mrbenftw/Desktop/VPN/iCepa/Carthage/Checkouts/Tor.framework)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/mz/1cg7sr7s7b515769b36sv9w40000gn/T/carthage-xcodebuild.nbZ1Yl.log
Bens-MacBook-Pro:iCepa mrbenftw$

build failed with Xcode9

*** Fetching Tor.framework
*** Checking out Tor.framework at "50f357066cedb4c4f4980bae3b027006f2e9973c"
A shell task (/usr/bin/env git clone --quiet https://git.torproject.org/tor.git /Users/zhanmagicpocket/我的软件/Coscos2D/cocosDemo/我的项目/VPN/Demo/iCepa-master/Carthage/Checkouts/Tor.framework/Tor/tor) failed with exit code 128:
fatal: unable to access 'https://git.torproject.org/tor.git/': Failed to connect to git.torproject.org port 443: Connection refused

Build falied

I am trying to build the project for iOS but it is saying that you done have archtecture for arm64. Error is as follows:
62571858-67d69c80-b860-11e9-9f5a-b36936493c1e

Somebody suggested that I didn't install all Rust targets. But I have as you can see from the screenshot:
62575682-4a5a0080-b869-11e9-8c87-9073b640c0b9

Build is broken

Something about the Xcode's script environment being different enough to mess up cargo.

Temporary workaround is to build the library separately from Xcode, and then Build and Run from Xcode:

$ cd Extension/tun2tor
$ cargo build --lib --target aarch64-apple-ios

Building the project fails

I tried building the project but it fails with these errors:

  • iCepa-master/iOS/ViewController.swift:21:9: Type 'NETunnelProviderManager' has no member 'loadOrCreateDefaultWithCompletionHandler'
  • could not find Cargo.toml in iCepa-master/Extension/tun2tor or any parent directory
    fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: target/x86_64-apple-ios/debug/libtun2tor.a (No such file or directory)

I have followed the exact steps mentioned in README.

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.