1045 points · by throwaway124592 · 4y ago · 183 comments
Following the protests, the government has cut off or severely limited residential and especially mobile broadband access to the internet and people can only access websites and services hosted inside Iran. This has made connecting to VPNs with servers outside Iran, and Tor close to impossible. That being said, the servers inside Iranian data centers still have access to the outside world.
The government has also blocked Instagram and WhatsApp (the main channels of communication used by people inside Iran), and alternatives such as Telegram, Signal, etc are also blocked, halting communications to a crawl. People have to either call each other via GSM or send SMSs (which by the way is being monitored and messages containing keywords related to the protests don't even get delivered). As you can imagine, it's preventing people from coordinating the protests and strikes, and with the sattelite TVs being also heavily jammed, the only source of information accessible to most people is the government-led local TV channels which are distributing regime propaganda 24/7 and trying to scare people into submission.
We (a group of tech people inside Iran) have started using the servers inside Iranian data centers gain access to the Internet, and are setting up VPN servers and Tor bridges and giving the information to people we know. It's not scalable, and it's risky for us (the servers inside Iran can be traced back to us), but that's the only way we could think of to help. The technical details are published here:
https://github.com/InternetForIran/InternetForIran
We need help on multiple fronts:
- Please review and contribute to our repository on GitHub linked above. We need to improve the security and make deployment easier.
- The methods for setting up Tor bridges described in the repository were working up until 2 days ago, but have mostly stopped working and we haven't figured out why yet, maybe you can help?
- We have reports that V2Ray VMess and ShadowSocks are working inside Iran even at times when most other tools and protocols don't. We haven't been able to reliably deploy and test this (there are many configuration options and it's not clear which methods are working). Please create an issue or send a PR if you know how it works and how to deploy it.
- If you are an Iranian expat: Get a server inside Iran and set this up for your family and friends and get them back online.
- If you are an entrepreneur or work at a tech startup inside Iran: Your company already has servers inside Iran. Talk with your team, set up VPN servers and Tor bridges and share them with other employees and ask them to help get their family and friends online.
Edit: Formatting.
Knowing that, the simplest and easiest solution that would avoid detection is to SSH tunnel into that datacenter and SSH-ProxyForward out of that datacenter into Amazon AWS via SSH and use that SSH proxy chain as a SOCKS proxy for browsers. Make sure the browser is using the SOCKS proxy (SSH) for its DNS. Many sites will make your friends solve captchas if they show up from Amazon so if you have a friend outside of Iran in the same AWS region that is willing to open SSH on their home router then one could add that private home router as their last hop in the SSH proxy forward. Do not go directly from the datacenter to the home. It is normal and expected for Datacenters to SSH to Amazon.
SSH Client -> Iranian Datacenter / Server -> AWS VM -> Home router in same region as AWS -> Internet.
If many people are using the same server and VM then make sure that MaxStartups and MaxSessions have been increased in sshd_config as well as any PAM limits on the servers for open files on every node in the path. Clients should enable ControlPath / ControlMaster in their ssh_config or ~/.ssh/config. To harden each hop configure PermitOpen to only allow the SSH hops and the final hop should also permit *:443
Examples of all these steps can be found on SuperUser / StackExchange / ServerFault and are all public knowledge. All above-board, no hacking involved.
[Edit] Removing the Squid MITM SSL-Bump proxy idea. That would make follow on questions harder to explain.
[Edit from Fatnino's input] If your Amazon VPC's are too outbound-restricted then pick another VPS provider that is commonly used for hosting 3rd party tools for datacenters, preferably one already used by that datacenter.
[Edit] In theory hypothetically speaking every hop possible could have misconfigured but realistic looking syslog so that SSH connections are not logged on the server and in theory a log-less silent rule in the edge firewall to not log SSH connections. Sometimes syslog disks also fill up by mistake. SSH can also be performed in ephemeral diskless containers such as Docker, Podman and LXC.
To make this happen, you should have a minimum number of connections from inside Iran into the datacenter.
For a small group of trusted people with always on connections, you could just create a linear chain of SSH forwards connecting everyone. For widespread connectivity, a TOR bridge through the path you describe would be workable.
The ISP would still be able to see any traffic to the gateway, but if you had enough links outside of government monitored net infrastructure to the gateway (hard lines you take down or obfuscate when the patrol does their rounds, wireless point to point connections), the risk would be on the gateway operator.
(Please do not take my advice without evaluation. This is speculation from a SWE, not advice for life or death situations.)
Edit: I suppose if your ingress traffic is over links not monitored by government anyway, it doesn't matter if you use SSH or a web application forwarding traffic to a SOCKS proxy behind the scenes. Not sure if the idea presented above would be useful in other scenarios.
Edit2: I guess usability is a benefit, even without security benefits. "Plug in this cable and type this URL into your browser" is easier than "open a terminal and establish an SSH connection."
Something that looks similar to mosh being UDP and encrypted but that allows proxied traffic would be Tinc Open Source VPN [1] The nicest thing about Tinc is that it does user-space dynamic mesh routing without requiring packet forwarding being enabled. I would call it a middle ground to onion routing if set up right. It has configurable compression. The reason I did not suggest this is that it is not simple to set up and get OpSec right the first time out of the gate unless the people involved are already very experienced with it. That's why I suggested SSH. SSH is relatively simple, well known and will blend in with all the legit SSH traffic and more people have experience with SSH. SSH egress from a datacenter is normal, expected and likely already permitted to AWS without making logged firewall changes.
A gateway is a single, big ass signal that says "come murder me".
Using Tor sounds good in theory, but it's too far easy to identify all of the Tor connections and identify the residences connected to them.
I would suggest using SSH tunnels on whatever port a given server normally communicates on. If this is 443, connections should just look like normal web browsing on an ISP level. If the server is used to transmit other data over TLS using that port should be fine too.
All of that said, the challenging thing is not to secure the traffic, but to make it look normal. A persistent connection is not normal from a residential IP in most cases. This means you should take your session down once you've sent your messages for the day.
Except that it doesn't look like TLS - depending on what the traffic inspection capabilities look like I imagine someone speaking SSH on port 443 is pretty incriminating :/
The connection to the residence would be the last hop in the SSH proxy foward chain meaning that all Iran will see is Datacenter -> AWS. Then it is AWS -> residence. Iran would not have visibility into AWS egress traffic, rather Five-Eyes [1] would see everything in and out of AWS.
Datacenter -> Non-Iranian-AWS Region -> Non-Iranian Residence -> Internet.
The flow from the DC to AWS is all they would see.
So my connections looked like this:my laptop at work in California, tunnel to aws in Virginia, tunnel back to a server at my house in California, connect to actual desired site likely hosted on aws in Virginia yet again.
SSH can be used for file transfers via sftp so it is not uncommon to have long transfers of data. In this edge case however one could set up a simple rate limited rsync over ssh and then rate limit ssh slightly higher so that the browsing shares the bandwidth creating a relatively smooth data stream. Data streams are not expected to be perfectly constant across the internet so a little fluctuation would be fine.
If Multiplexing is being used via ControlMaster ControlPath in the client then the people browsing will be riding the extra SSH channels without having to re-authenticate after their first authentication. The first SSH channel would be used for the SFTP transfer.
rsync -aq --bwlimit=600 /some/dir/big-file ssh-first-hop:/dev/null
Then rate limit SSH just above 600KB/s using `tc`. On a modern kernel this is one line. tc qdisc add dev eth0 handle 101: root cake diffserv3 bandwidth 6mbit internet nat egress ack-filter triple-isolate ethernet memlimit 32M
One could use HTB bucket rules with tc on older kernels.All of this said, I do not believe this step is required unless a datacenter's SSH traffic patterns were already being traffic profiled and I would theorize that for this to be the case Iran's intelligence agency would have been watching them for other reasons.
When similar events unfolded in Syria, people created redundant social networks of fake Facebook accounts. This seemed to work well. When captured and tortured, people would hand over credentials for one account. People would detect that network was "burned" and move to the next one.
This gave the officials very little information, since the accounts did not reference real names, and locations were obfuscated. High risk private messages were deleted, etc.
The key to this working was that Facebook was not sympathetic to or cooperating with the Syrian government, and accessing Facebook was a common (not worth prosecuting) infraction.
I'd be worried that they will fingerprint / honeypot tor infrastructure, then round people up. The existence of the tor client or connection logs basically proves guilt.
Friending facebook accounts with cutsey names is much less incriminating. Edit: Also, any honeypot proxy connection logs just show that you used https to access facebook.
She has been successful using VPN and WhatsApp until today. I don't know if I'll ever hear from her again.
Right now, it seems like those who use the internet and phones are at a disadvantage. Phones are always tracked, and the internet is a giant surveillance tool. If the government controls the network, then it is always at a great advantage, no matter if VPN or Tor is used.
Back then, the governments didn't have that either. Pigs on the streets with barely working (or understandable) radios, outdated huge paper maps, and if they were lucky a barely working chopper for a bit of aerial surveillance. The only tools were water cannons, batons, tear gas that didn't work against drunk people, shields and live ammo.
These days, the abilities of governments in counter-protesting are absurd:
- each pig has not just a radio with high quality audio transmission, but also a digital data channel for streaming video and other intel in both directions
- tons of surveillance cameras with high definition imaging sensors
- cheap-ass drones
- there are multiple vendors offering "data fusion" for command centers. Think of platforms that fuse everything into one cohesive environment: a Google Maps map and satellite view, with individual position markers for each unit, live feeds from thousands of surveillance cameras, live feeds from officer body cameras, live feeds from drones and choppers, AI analyzing all of that to predict movements of the masses, incoming firehose feeds from Twitter and Facebook...
- highly effective tear gases, mobile walls on tanks to lock down streets [first photo of 1], tasers, rubber bullets, LRAD acoustic weapons and other non-deadly tools for crowd control
It's hard to mount successful protest against nations that have half the stuff I just described, and as HK shows all but impossible against a nation that does have this kind of abilities.
[1] https://www.hrw.org/news/2018/12/14/france-police-crowd-cont...
Protesters can just have their accounts frozen, and/or deposits confiscated, as we seen in recent examples.
(Those young kids who use their latest Apple watch to pay for coffee in the morning just because it's "convenient" really do not understand what they are sleepwalking into...)
Adding to this, their security forces learned a great deal as well. Here is a brief talk on this covering a little bit of the protest history and what is likely to occur. [1]
[1] - https://www.youtube.com/watch?v=ooROZDeds8o [video 4 mins]
We have not been blocked yet, session is an e2ee decentralised messenger.
I don't want to seem insensitive to the Iran situation, but how does Session compare to other popular encrypted messaging services?
It is based on the signal messenger, the apps look nearly identical.
And you don't have a phone number or an account login, you just have a long UID that you use like your phone number and a random recovery phrase. It is all about not sending much metadata about you, your phone, etc.
Seems to be a fork from Signal by oxenio. It's selling point seems to be the crypto currency relation?
Signal also has a private cryptocurrency attached to it, most definitely used by criminals, scammers and even pump and dumped by the founders which one of them are the founders of Signal. (Yes. Moxie is part of it.)
Did session and lokinet already have a code security audit or pentest?
freemesh for wifi AP based mesh networks. not as convenient as briar, but considering the situation having multiple modes of communication seems like a good hedge.
https://freemeshwireless.com/
also, if you can get a hold of lora wan based devices, e.g. esp32 w/ lorawan, you can set up a lorawan based mesh network with wifi entry points. https://meshtastic.org/Worst case a mule gets captured or turns to the government in which case those messages are lost. That's all.
I am furthermore searching for a method to check whether it works from inside Iran or not. Was trying a VPN from Cyberghost, but with that it is possible to visit blocked sites, I did not previously know that data centers in Iran have unblocked access. With that I could check myself whether it works and could detect after which contact we were blocked.
However, I think we shouldn't forget that we have no real way of knowing if any of this works in all regions, what sort of access/blocks people there need to go through to connect to even basic services. So maybe instead of being worried ONLY about these issues (which are more in line with our skill set), we should try and pressure our own elected officials to take some measures, any measures to help people there.
You can setup an Ansible playbook and automate the whole deployment without any issues. Most VPSes cost a few cents a day to run and could serve a lot of people. The technology aspect on our end has never been the bottleneck or the problem, but rather how to disseminate these bits of information to those who need them the most and how to actually stop this from happening yearly/monthly across the world.
So I guess what I'm trying to say is thank you for your efforts, keep it up and if you know people there who can spread information about these solutions, even better! We don't know for sure the restrictions we need to fight through, so it would be great to know more about that... And in the meantime, drop an email if nothing else, to your local representatives/elected officials and ask them to do something, anything at this point, to support people exercising their right to protest. Because it's quickly becoming an optional extra even in the West.
Is this a concern? The Signal Proxy is designed so that the person running it cannot see any content. I guess the concern is them seeing your IP, and a VPN is not usable?
An easy way to help someone in a censored country to access Tor.
If you have an idea based on your own knowledge of what they asked for,I'd put it there, that will keep them from duplicating effort.
I have thought about trying to run a VPN server on my EC2 web server for my friends in Iran but not sure if regular VPN protocols are even allowed through. I don't think they know what Tor is much less how to set it up with a custom bridge. They seem to be using some kind of proxy/bridge for Telegram, but didn't know the technical English vocab to tell me exactly what it was.
Ironically, I once talked to someone very pro-regime on HelloTalk and asked them why they were using Telegram if it was blocked/illegal there, since they would defend the regime on anything else you asked them about. They claimed to believe that it was blocked because of US sanctions and denied that the government blocked any websites. Is this a narrative they are pushing on state media there?
Nowadays, the limit is gone and there is faster internet access but the issue of filtering still exists. When a service doesn't work in Iran it's either due to sanctions, the government blocking access to some domain/ip, or a combination of both. The user is left wondering which one it is and how they can get around it
Mostly not. Censorship works by elimination, not by requiring initial permission. The main exception is internet access to blocked services. Government supporters get access to services that are otherwise blocked to the public.
> They claimed to believe that it was blocked because of US sanctions and denied that the government blocked any websites
The government and their supporters are bad liers. By bad, I mean they don't even try to make it convincing. The president told a foreign journalist that covering is optional in Iran. That is while their "morality police" has killed a woman and the whole country is burning in riots. This is while that same journalist is wearing scarf to be allowed to talk to the president, in US!
This narrative is probably helped by the fact that half the internet is being blocked on the US side because of sanctions - i.e. the entirety of Google Cloud.
I don't believe so. In general, assholes who get their money from the government, create their own fake news which is even faker than what is published in the state media. Which makes sense, as the state media optimizes for everyone watching it, not just the bootlickers.
> regular VPN protocols
Naive, Hysteria, Trojan, VLESS, etc. seem to work. Of course, foreign servers are, at times like this, only accessible in datacenters, which means the protocol would be irrelevant.
1. Take a picture.
2. Use app to insert message into picture, encrypt with passphrase.
3. SMS picture to friend or upload to Iranian equivalent of imgur (if any is up).
4. Friend loads picture into app and types passphrase to get message.
I'm not sure what a good choice of app would be, but something good must exist?
Just being able to organize internally is super useful. The protestors don't need to use Facebook to organize effectively.
Also have a look at their blog post about NAT traversal for some potential inspiration: https://tailscale.com/blog/how-nat-traversal-works/
Good luck out there! I'll have a look at your github repo now.
And it requires a control server with auth. Simply cutting off access to the control server would disable clients from connecting.
While there is headscale, configuring the tailscale clients is tricky and would not scale to hundreds or thousands of non technical people.
/!/ Also tailscale is a mesh network. It would only take one rouge client to revel all other clients. This is very very dangerous given the use case.
Tornode running on a censors machine is ideal.
When you focus on setting up servers, you can argue it is mainly about communication.
They cannot go after anyone who wants to be online again - but of course they will go after anyone, who set up infrastructure especially for activists.
I would frame it internally strictly as "going online".
Since its a decentralized protocol, not one single domain like signal and WhatsApp, it should just still work.
It can be installed on an iranian server and then federate with all other world wide servers.
Deploy a proxy server is the first step. Take the experiences from China:
1. Always try to pretend to be a normal traffic. Your ISP, DC, all the entities alongside your network, they will all try to detect you and ban/jail you. In China, they detect the symbol of unnormal traffic, record everyone using the default proxy port, training ML model to find proxy users. If your gov does not have the tech, I believe China Gov will surely exports them.
2. Always beaware about the help. Gov may publish some honeypot VPN to monitor the opponent. The public server or deployment script may have backdoor or virus.
That's a war never end.
Also, the copyright notice at the bottom of their help center is Google: https://support.getoutline.org/s/article/Data-collection?lan...
A tiny bit more digging and it is actually Google in sheep's clothing: https://jigsaw.google.com/
That's gonna be a no for me, dawg.
https://github.com/arlolra/meek
[edit] checked back in on it since i hadn't used it for a bit. Looks like the clients probably still work but the development seems to have been abandoned for a couple years now. So sad. It had an amazing community. Maybe still does...
https://www.understandingwar.org/backgrounder/iran-crisis-up...
https://www.understandingwar.org/backgrounder/iran-crisis-up...
The why in video form: https://www.youtube.com/watch?v=pZ1O_gmPneI
The why in blog form: https://qbix.com/blog/2019/03/08/how-qbix-platform-can-chang...
any gotchas I should worry about? (the aws calculator gives me 76.65$ USD / month)
I want to help but I am by no mean rich... don't want a crazy AWS bill...
thanks!
> the government has cut off or severely limited residential and especially mobile broadband access to the internet
How limited is the Internet access? As long as the network didn't go straight to "whitelist" mode, there may be ways to gain access to the blocked sites. Since you mentioned machines in data centers can still access the outside world, I guess it's still working in "blacklist" mode - only the sites they blocked are inaccessible.
As the rumor goes, Iran imported the censoring tech and equipment from PRC, so anything that works in China will most probably work in Iran.
V2ray and Vmess work in China because they disguise their protocols AND servers as normal web stuff. I wouldn't recommend Shadowsocks because the Chinese Great Firewall can now partially recognize it. If all things failed, HTTP proxies over TLS with legit Let's Encrypt certificates and client certificate authentication may be much more viable.
The Chinese guys also have tons of free proxies & VPN providers that are updated regularly stockpiled on GitHub, but most are documented in ambiguous language, such as these (I have no affiliation with any of them):
https://github.com/bannedbook/fanqiang https://github.com/Alvin9999/new-pac https://github.com/freefq/free https://github.com/anaer/Sub
My suggestion would be,
1. Search for such repositories on GitHub. The keyword you want to use is "翻墙", or go straight to the links listed above. You'll need to research their documents, or
2. Create an Issue stating your situation and that you need help.
I believe the owners of those repos may have the ability AND willingness to help you out.
And the communication part.... I used Matrix in China with the server placed abroad, and it worked very well, because it's working on top of HTTPS. Again, anything that seems normal web stuff have a higher chance of getting pass the censorship.
Be safe out there.
Are the popular Matrix homeservers banned?
It seems not much has been said about the gay men regularly executed in Iran, by government or vigilante/honour killings. I'm just hoping the protests achieve something and that the protestors, after fighting for women's rights there, don't go on to continue executing gay people after all is said & done.
https://signal.org/blog/run-a-proxy/
https://github.com/signalapp/Signal-TLS-ProxyThose in Brazil or other unstable countries should use this as a model and have something prepared before the worst happens.
StarLink has been given special dispensation to operate in Iran. This is not the same as air dropping a warehouse worth of terminals and setting up usable ground stations.
You do need to get the user terminals into the country, though. But once you do, they're easier to hide than a geostationary satellite dish.
IMHO, this is the biggest threat to police states like Iran, North Korea, etc. in years. They are very dependent on controlling access to information and breaking through that threatens their power and they have treated the internet as an existential threat by raising firewalls and imposing very strict controls and limitations. However, phones are a weakness. At least so far.
Information is basically a weapon that can be used to influence large amounts of people. The Russians just used propaganda to sell their own population on a war that they wanted to start. That didn't just happen overnight; the propaganda started years ago. That would have been impossible without strict controls on media and freedom of press. Iran, Russia, North Korea, China, and a few other countries are at this point very dependent on controlling access to information. It's a strategic weakness that is exploitable. Break through the information blocks and things start changing.
https://www.businessinsider.com/spacex-starlink-internet-ukr...
No internet required.
Would it be possible to setup a VPN inside Iran and for me to connect to this VPN, using my connection as a gateway?
> Iranians can't possibly have any agency. Is that what you're saying?
As someone who grew up in a country that had experienced FOUR US backed coups, multiple 'spontaneous people's movements' of the same nature, yes. That's precisely what Im saying.
The agency that the locals have in such situations is co-opted and subverted by the source that organizes the protests, leaving only a husk of their original intention represented by various symbolism and paraphernalia. The resulting government NEVER does anything in line with the original protests. The policies are always privatizing the nation's resources, setting up US bases, borrowing more from US-controlled financial institutions, reduction of labor protections, deregulation. The same ills that plague the US.
Even if one is not a student of geopolitics or has no knowledge of recent political history, he or she can easily tell who backed such a regime change operation by the resulting policies.
(Though I'm fairly sure the protests are unrelated)
What do you intend to achieve with the chaos? Syria? Iraq? Afghanistan? Division of Iran into ethnic and religious enclaves? Because that is what the CIA/NSA/Mossad is working for.
I'm all for protests by and for Iranians but this is no longer something related to Iran.
And, you my dear sir, are of course a person working for foreign interests trying to get input from all of the tech people here who think they are doing good. You are not.
This is an attempt at a color revolution!
Both parts benefit. Educating people how to avoid the government in a open and public forum has the collateral of educating the Iranian government (the only part holding real, unlimited access outside the country) into where to look for and what signals to catch. They will learn the tricks fast, so is unclear if this will be good or bad for the Iranian people in the end.
I wonder, just wondering... if hair is forbidden and so disturbing for the male in that country, women with a full shaved head could just appear in public in mass without neither hiding their head, nor breaking the law, and [in theory] avoiding the entire legal trap without frontally opposing the power. Right?.
"You don't stand women hair, is dirty and lascivious for you?, okay, hair is gone, will not hidden anymore the purple spots in my head where you hit me. Are you happy now, manchild?"
I know that things are not so simple, but... oblique seems the way to go.
also see the movies : "my teheran for sale" and "Persepolis"
as much as I hate USA foreign policy, it is also possible that Iranians want peace and freedom outside of foreign interests.
not everything is black and white.
It gets me so angry when people criticise the very freedom that allows them to do that criticising. It's like tautological self-harm.
I think non-interventionism is a bad choice for individuals with the power to help people under repressive regimes communicate with the outside world.
Jean-Luc Picard
That it is. When their society has reached a tipping point where women are burning their hijabs in the street in front of massive groups and cameras I think they have decided to not hide in the shadows and are willing to sacrifice themselves for what they believe in. Many of them are likely to have unspeakable things done to them. I suspect they know the sacrifices they are making and willing to take risks. Godspeed to them.
LISTER: Do you mean they had a war over whether the doughnut diner hats were red or blue?
HOLLY: Yeah. Most of them were killed fighting about that. It's daft really, innit?
LISTER: You're not kidding. They were supposed to be green.
I also support the rights of private citizens living in a free society to act on their own behalf, however they see fit.
That's not a dangerous game, that's an excercise of the rights protected by the society they are part of.
I will say even more. Other governments are watching and likely debating what could be used on their respective turfs. Something to think about.
In my opinion, any methods to help Iranian people to help them shake this control that aren't covert Western attacks on Iran or Islam are a good thing. Helping the protestors to communicate with each other is one of the most neutral, anodyne things you can do. For me, legitimate government is created through discussions, plans, and agreements among the governed. Any disruption of that is despotism. Maybe, one day, Iranians will be helping us protest.
If you're going to insinuate something else, I'd suggest you get some actual evidence first. Just saying "colour revolution" or whatever is intellectually lazy, as well as being dishonest and dismissive about people who are risking their lives and liberty.
I just don’t know why this childlike notion that well-coordinated protests are organic persists. It may have been true in medieval times but not today. I can draw you a clear pattern of foreign interference in similar protests with hundreds of data points. Even if this one was completely organic, it would be a staggeringly outlying data point.