I just published version 2014.01.a of ScrambleSuit. The API is now up-to-date (it uses self.circuit and circuitCreated() instead of handshake()) and it works for me in external and managed mode on Linux.
Another thing which just came to mind: Do we want to use inter-arrival time obfuscation or not? Right now, it is activated (see USE_IAT_OBFUSCATION in const.py). While throughput it still reasonable, we can maximise it by completely disabling inter-arrival time obfuscation. That might not be a bad choice as timing-based attacks seem to be an exotic threat at this point. Activating it at a later point in time is a matter of simply setting the above variable to True.
Another thing which just came to mind: Do we want to use inter-arrival time obfuscation or not? Right now, it is activated (see USE_IAT_OBFUSCATION in const.py). While throughput it still reasonable, we can maximise it by completely disabling inter-arrival time obfuscation. That might not be a bad choice as timing-based attacks seem to be an exotic threat at this point. Activating it at a later point in time is a matter of simply setting the above variable to True.
I guess keeping it disabled for now makes sense.
Maybe we should add an optional CLI/managed-mode switch to scramblesuit that enables it if it's needed? So that clients can enable it dynamically if it's needed by editing their torrc.
Another thing which just came to mind: Do we want to use inter-arrival time obfuscation or not? Right now, it is activated (see USE_IAT_OBFUSCATION in const.py). While throughput it still reasonable, we can maximise it by completely disabling inter-arrival time obfuscation. That might not be a bad choice as timing-based attacks seem to be an exotic threat at this point. Activating it at a later point in time is a matter of simply setting the above variable to True.
I guess keeping it disabled for now makes sense.
Agreed.
Maybe we should add an optional CLI/managed-mode switch to scramblesuit that enables it if it's needed? So that clients can enable it dynamically if it's needed by editing their torrc.
Hmm, I'm not quite convinced that we should expose these internals to the user. If it ever becomes necessary, we can just update our bundles with the option enabled.
Still looking forward to your Windows testing :3
I just got around to testing it on a 64-bit Windows 7. It seems to work. I tested it using Python 2.7 in external mode (is it reasonable to infer that it will also work in managed mode?). I also noticed that we now need the module pyyaml which I added to setup.py. I also updated ChangeLog.
Another thing which just came to mind: Do we want to use inter-arrival time obfuscation or not? Right now, it is activated (see USE_IAT_OBFUSCATION in const.py). While throughput it still reasonable, we can maximise it by completely disabling inter-arrival time obfuscation. That might not be a bad choice as timing-based attacks seem to be an exotic threat at this point. Activating it at a later point in time is a matter of simply setting the above variable to True.
I guess keeping it disabled for now makes sense.
Agreed.
Maybe we should add an optional CLI/managed-mode switch to scramblesuit that enables it if it's needed? So that clients can enable it dynamically if it's needed by editing their torrc.
Hmm, I'm not quite convinced that we should expose these internals to the user. If it ever becomes necessary, we can just update our bundles with the option enabled.
Still looking forward to your Windows testing :3
I just got around to testing it on a 64-bit Windows 7. It seems to work. I tested it using Python 2.7 in external mode (is it reasonable to infer that it will also work in managed mode?). I also noticed that we now need the module pyyaml which I added to setup.py. I also updated ChangeLog.
Yes, I guess your testing should be sufficient.
You might also want to test starting up the listeners in managed mode in Windows. You can do that by using the following environment variables:
The first are for the client, the second are for the server case. Put them in a file (say test_managed_client.sh) and do source test_managed_client.sh. Then run obfsproxy --log-min-severity=debug --log-file=fun managed and check whether the listener was started and if the logs have anything weird. Starting up both listeners in managed mode should give us some more confidence that it works well on Windows.
I think this last branch scramblesuit_integration-3 does not contain the scramblesuit docs in the /doc directory.
Ugh, good catch, sorry for that.
I will add them and merge the whole branch to obfsproxy Real Soon Now (today or tomorrow).
I already added it in a separate commit to the scramblesuit_integration-3 branch. But please give me one more day to test it on Windows in the simulated external mode.
Also, it would be nice if we could test scramblesuit automatically using the integration tester in obfsproxy/test/tester.py. It's pretty easy: we just need to add:
But maybe it would be nice to clean up the session ticket after such a test. How should we do this? We could add a hidden test-only CLI switch to scramblesuit that disables session resumption but it would be a bit ugly. Maybe we can do post-test cleanup in unittest?
Also, it would be nice if we could test scramblesuit automatically using the integration tester in obfsproxy/test/tester.py.
Good point, keep 'em coming. I added another commit to the scramblesuit_integration-3 branch.
But maybe it would be nice to clean up the session ticket after such a test. How should we do this? We could add a hidden test-only CLI switch to scramblesuit that disables session resumption but it would be a bit ugly. Maybe we can do post-test cleanup in unittest?
I think we should adapt our unit tests to our code and not the other way around. In my commit, I overwrote setUp() and tearDown() to create and delete the two temporary directories.
BTW, I noticed that you use "--shared-secret" for external mode but "password" everywhere else (in handle_socks_args() and in the server-side parameters). Maybe we should use the same switch in all cases? I'm using "--shared-secret" in obfs2, but feel free to choose whichever one you want.
BTW, I noticed that you use "--shared-secret" for external mode but "password" everywhere else (in handle_socks_args() and in the server-side parameters). Maybe we should use the same switch in all cases? I'm using "--shared-secret" in obfs2, but feel free to choose whichever one you want.
I gave this a shot and it seems to work. For the record, this is how you seem to set environment variables on Windows:
{{{
SET TOR_PT_MANAGED_TRANSPORT_VER=1
And that's **not** the same as the following which is incorrect:
Please see branch scramblesuit_init for some simplifications of the __init__() function.
Commit 4ecfb762:
Nitpick: assert is a statement and not a function, i.e., you don't need braces.
In fact, I wouldn't even use assert in that case. When Python is invoked with -O, asserts are ignored. I would turn the else branches into an elif and append an else branch which throws an exception. (I found this link to have a good explanation on when to use asserts).
The if-branch in server.py seems unnecessary as both, "server" and "ext_server" lead to weAreClient being set to False.
Commit ff86f6a2, f15be57b, d921f485, and ae86d3d4:
The changes look good to me. Could you please turn this into a separate branch forked from the ScrambleSuit repository? I would prefer to merge changes from the ScrambleSuit repository into the obfsproxy repository and not the other way around.
Please see branch scramblesuit_init for some simplifications of the __init__() function.
Commit 4ecfb762:
Nitpick: assert is a statement and not a function, i.e., you don't need braces.
In fact, I wouldn't even use assert in that case. When Python is invoked with -O, asserts are ignored. I would turn the else branches into an elif and append an else branch which throws an exception. (I found this link to have a good explanation on when to use asserts).
The if-branch in server.py seems unnecessary as both, "server" and "ext_server" lead to weAreClient being set to False.
Commit ff86f6a2, f15be57b, d921f485, and ae86d3d4:
The changes look good to me. Could you please turn this into a separate branch forked from the ScrambleSuit repository? I would prefer to merge changes from the ScrambleSuit repository into the obfsproxy repository and not the other way around.
Makes sense. You can find my scramblesuit-only branch at https://git.gitorious.org/scramblesuit/scramblesuit.git with branch name scramblesuit_init.
I also isolated the obfsproxy-only changes to branch init_transport_config in my personal obfsproxy repo.
BTW Philipp, you might be able to use the get_public_server_options() transport method that David Stainton recently added to obfsproxy, so that you generate a password if the admin hadn't specified one.
Then you can save it to a file in TOR_PT_STATE_LOCATION and use it the next time you boot up.
Does this make sense? You think it might be too messy?
BTW Philipp, you might be able to use the get_public_server_options() transport method that David Stainton recently added to obfsproxy, so that you generate a password if the admin hadn't specified one.
Then you can save it to a file in TOR_PT_STATE_LOCATION and use it the next time you boot up.
Does this make sense? You think it might be too messy?
BTW Philipp, you might be able to use the get_public_server_options() transport method that David Stainton recently added to obfsproxy, so that you generate a password if the admin hadn't specified one.
Then you can save it to a file in TOR_PT_STATE_LOCATION and use it the next time you boot up.
Does this make sense? You think it might be too messy?
I think it's a good idea and the benefit clearly outweighs the (small) messiness: We no longer need to force bridge operators to set ServerTransportOptions. I'll do some more testing and then create another obfsproxy branch.
BTW Philipp, you might be able to use the get_public_server_options() transport method that David Stainton recently added to obfsproxy, so that you generate a password if the admin hadn't specified one.
Then you can save it to a file in TOR_PT_STATE_LOCATION and use it the next time you boot up.
Does this make sense? You think it might be too messy?
I think it's a good idea and the benefit clearly outweighs the (small) messiness: We no longer need to force bridge operators to set ServerTransportOptions. I'll do some more testing and then create another obfsproxy branch.
Hm. I just skimmed over the patch. I will look more into it soon.
I wonder if we can move all this file-creation/reading logic to __init__() instead of get_public_server_options(). It would be more suiting I think.
Also where is SERVER_PASSWORD_FILE initialized in the pushed code?
We should also think what we want to happen if a person sets up a ServerTransportOptions line after a SERVER_PASSWORD_FILE has been created.
Maybe we could have a more descriptive log message than No password found in transport options.. Maybe it should be directed to the bridge operator and say No password was specified. Generating and caching a new one.. Maybe there should also be a log message for Found a cached password. Using this one.
We should also figure out what happens if writeToFile fails. This might be better handled by moving this logic to __init__() I think.
I like the changes. What do you think about renaming the new State.password element to State.fallback_password or something?
Done.
Updated master. Any plans regarding when you want to merge init_transport_config?
Soon. Maybe even tomorrow or the day after (Monday, Tuesday).
Do you think anything else remains to do before the merge?
I can't think of anything at this point. And I'm not familiar enough with the bundle building process to know if there's anything which could cause issues.