manbytesgnu_site

Source files for manbytesgnu.org
git clone git://holbrook.no/manbytesgnu_site.git
Info | Log | Files | Refs

20240810_comms.rst (11603B)


      1 Comms summary
      2 ############
      3 
      4 :date: 2024-08-10 18:10:25
      5 :category: Hygiene
      6 :author: Louis Holbrook
      7 :tags: ssh,bash
      8 :slug: put-anon
      9 :summary: How to set up your own mini-service to share files safely and anonymously
     10 :lang: en
     11 :status: draft
     12 
     13 
     14 One should think that sharing a single file with someone else on the internet without anyone else knowing would be the simplest thing there is.
     15 
     16 Sadly, it's not. Really not.
     17 
     18 Let's see how to traverse the obstacles with a minimum of skill, and a minimum of tools.
     19 
     20 
     21 Anonymous VPN
     22 =============
     23 
     24 First step is to make sure that the connection you use to register the service has some degree of anonymity.
     25 
     26 There are and will always be services out there that will enable you to do this. They will never be the same as time passes. The important thing is to know what to look for.
     27 
     28 
     29 Connecting
     30 ----------
     31 
     32 No matter which of the two stategies you are using, you should use some unidentifiable, disposable connection to do the initial registration.
     33 
     34         * A truly anonymous VPN (it's harder than you think)
     35 
     36 
     37 The public wifi
     38 +++++++++++++++
     39 
     40 Unless you are *really really* in the sights of the surveillance state, a random internet cafe access point should do nicely.
     41 
     42 Just make sure that if you are using a public wifi, you randomize your MAC address before connecting. I myself use `wpa_supplicant` directly, and it offers the `mac_addr` and `preassoc_mac_addr` configuration directives for this purpose (for connection and access point search, respectively). Otherwise, your MAC address can be correlated across access points, that increasingly as "Local Magic Device" offers from big corporations.
     43 
     44 
     45 The Tor Browser
     46 +++++++++++++++
     47 
     48 It's really hard to say whether the Tor Browser is a honey-trap or not. But single-shot sessions used for one single purpose has a low risk of compromise.
     49 
     50 Still, the public wifi option is preferable.
     51 
     52 
     53 The anonymous VPN
     54 +++++++++++++++++
     55 
     56 Now, this is much harder than you may think.
     57 
     58 How do you sign up for the VPN? Some email? How did you get that email? Without the same VPN? How did you pay for it?
     59 
     60 VPN is an extra layer of protection that is as secure as the security you used to sign up for it.
     61 
     62 The only service I've come across so far that counts as an exception is the self-sources method for registration used by `Mullvad <https://mullvad.net/en>`_ It's nearly unfathomable that some 15 years after the Bitcoin revolution, client-side secrets aren't the canonical way of authentication. With Mullvad, you generate a secret on the fly, and if you lose the secret you lose the account. And the account may be paid for with cryptocurrency. (Remember, though, you are just as safe as the connection used to generate that account.)
     63 
     64 An example
     65 ++++++++++
     66 
     67 1. You go to a random wifi access point
     68 2. You randomize your MAC address
     69 3. You start a TOR session
     70 4. You make a VPN account with Mullvad
     71 
     72 Now, the payme
     73 
     74 
     75 The email anachronism
     76 =====================
     77 
     78 It is nearly unfathomable that still 15 years on from the Bitcoin revolution, we are still working with emails and, even worse, phone numbers, to register accounts.
     79 
     80 I haven't seen a single VPS provider that does not use one of these forms of registration.
     81 
     82 So, seriously! Anyone! Do something!
     83 
     84 Anyway, right now it is how it is, so the next step becomes making an email address with our anonymous connection.
     85 
     86 Unsurprisingly, getting an anonymous email is getting harder and harder.
     87 
     88 No sweat, you may thinkg. You could just roll your own.
     89 
     90 But then, how do you register the domain name for the email, and how do you pay for that? Not easy. The registrars will want an email.
     91 
     92 Confound it! You're back to square one.
     93 
     94 
     95 The honeytrap method
     96 --------------------
     97 
     98 Currently, `Protonmail <https://proton.me>` is one of the few options at the time of writing. However, it has been around for so long as a private email solutino that there is good reason to suspect that they are just one more of those honeypots that promise you safety and privacy for everything except what's inside their services, and ultimately they both mine your data for yourself and give you up to the empire if compelled to do so.
     99 
    100 
    101 The lone geek site method
    102 -------------------------
    103 
    104 Funnily, small individual-run private services like `<https://danwin1210.de/mail/>`_ still exist out there.
    105 
    106 To be honest, I would love to see more services like that. Services that are simply too small and obscure for the empire to care about. And when they start caring, it closes down and 10 more take its place.
    107 
    108 That would be how we win.
    109 
    110 
    111 The disposable method
    112 ---------------------
    113 
    114 I have used `receivemail.org <https://www.receivemail.org>`_ for several years now as a disposable email recipient for registrations and contacts of all sorts that I didn't want polluting my email.
    115 
    116 The main feature of services like this is that no registration is required. A related type of service is `guerrillamail.com <https://guerrillamail.com>`
    117 
    118 Of course, there is no access control for these mailboxes, so you cannot use it to protect anything of real value. For any service that requires one email service once and never again, it will probably do nicely.
    119 
    120 Keep in mind that a lot of Fascism-as-a-Service providers out there will block entities like this from receiving email from them. If they do, probably they are not for you.
    121 
    122 
    123 The anonymous server
    124 ====================
    125 
    126 There *are* options out there that will let you establish a VPS for a small amount of cryptocurrency per year. I have had luck with using `1984.is <https://1984.is>`_.
    127 
    128 Iceland is a good territory for digital anonymity and sovereginty ever since they gave the middle finger to the global banking establishment after the 2008 crash, when they wanted to loot the country under the legal cover of utter fraud of the population.
    129 
    130 You only need the email for registration. After that, your email will be your username, and you don't have to verify it exists. At least not for now. Who knows what the future will bring.
    131 
    132 So sign up for the VPS, in which you can set up a webserver.
    133 
    134 
    135 The web server
    136 ==============
    137 
    138 Settings up a webserver is out of the scope of this post.
    139 
    140 However, all you need is a vanilla server that serves any file in a given directory.
    141 
    142 
    143 The posts
    144 =========
    145 
    146 How do we get the content to the server?
    147 
    148 First of all, remember that the same anonymity precautions are valid for any connection you make to the VPS.
    149 
    150 Having established that, here's a small shell script [1]_ that will upload a file to a random identifier, while creating
    151 
    152 * A retrieval URI
    153 * A QR code for the retrieval URL
    154 
    155 .. code-block:: bash
    156 
    157         REMOTEPROTO=${REMOTEPROTO:-http}
    158         REMOTESSHHOST=${REMOTESSHHOST:-localhost}
    159         REMOTEHOST=${REMOTEHOST:-localhost}
    160         REMOTESSHPATH=${REMOTESSHPATH:-/var/www}
    161         # note this should handle missing start or end slash if exposed!
    162         REMOTEPATH=/
    163         TMPDIR=/tmp
    164 
    165         fi=$1
    166 
    167         if [ ! -f "$fi" ]; then
    168                 exit 1
    169         fi
    170 
    171         uu=$(uuidgen)
    172 
    173         d=$(mktemp -d)
    174 
    175         ext=${fi##*.}
    176 
    177         fn="$uu.$ext"
    178 
    179         fo=$d/$fn
    180 
    181         cp $fi $fo
    182 
    183         scp -q $fo ${REMOTESSHHOST}:${REMOTESSHPATH}
    184         ssh ${REMOTESSHHOST} chmod 644 ${REMOTESSHPATH}/$fn
    185 
    186         url="${REMOTEPROTO}://${REMOTEHOST}${REMOTEPATH}$fn"
    187 
    188         qrencodebin=$(which qrencode)
    189         if [ ! -z "$qrencodebin" ]; then
    190                 $qrencodebin "$url" -s 10 -m 6 -o $TMPDIR/${uu}_qr.png
    191         fi
    192 
    193         echo $url
    194 
    195 Simply:
    196 
    197 1. Generate a random identifier as a file basename
    198 2. Attach the file extension to the filename
    199 3. Make a file copy through SSH to the public web folder of the VPS
    200 4. Share the URI (or qr code stored to `$TMPDIR` with the same name) to retrieve.
    201 
    202 
    203 The get
    204 =======
    205 
    206 Safety always depends on the weakest link in the chain.
    207 
    208 In this example, your privacy is not necessarily compromised by stupidity on the other end, that does not mean that the other party is secure.
    209 
    210 But I would beg of you; show me one single example where this isn't the case. Where the sender and/or receiver:
    211 
    212 * is in full control of their client
    213 * is in full control of their node, receiving or sending
    214 * is in full control of their relay
    215 
    216 I have looked! Oh my, have I looked. Let's look at some of them?
    217 
    218 
    219 Signal
    220 ------
    221 
    222 `Signal <https://signal.org>`_
    223 
    224 Yes, the canonical safe space. Endorsed by Snowden himself. The forward- and backward secret axolotl crypto protocol.
    225 
    226 ... and it asks for your phone number.
    227 
    228 Ant how many places in the world do you get anonymous phone numbers anymore?
    229 
    230 Norway, where I'm from, will ask you for your digital ID.
    231 
    232 The belgians distribute fucking passport scanners to their SIM card vendors.
    233 
    234 Portugal, where I live, actually still offers them. For now.
    235 
    236 And many places there is still a second-hand market available.
    237 
    238 But in general, you have to bend or break the law to get them.
    239 
    240 So that's the premise for your super-secret app? Sorry, I don't buy it.
    241 
    242 ... and apart from that, good luck setting up your own infrastructure.
    243 
    244 
    245 Session Messenger
    246 -----------------
    247 
    248 `Session <https://getsession.org>`_
    249 
    250 The app is immature.
    251 
    252 The GUI is buggy.
    253 
    254 The anonymity is arguably less than with Signal.
    255 
    256 If only setting up your own node was easier.
    257 
    258 It's not.
    259 
    260 It's *SO* complicated.
    261 
    262 And it even requires buying into the `Oxen <https://oxen.io/>`_ cryptocurrency, which is its own snake pit of track coverings.
    263 
    264 
    265 
    266 Deltachat
    267 ---------
    268 
    269 `DeltaChat <https://delta.chat/en/>`_ 
    270 
    271 I absolutely adore Deltachat.
    272 
    273 If content secrecy was all I cared about, I would say that this service is the no-brainer default.
    274 
    275 It is email-as-a-chat, making the encryption part automagical and easy.
    276 
    277 No evil middle party involved. Largely like the original intention of email and Pretty-Good-Privacy.
    278 
    279 I may do a separate post on how this option could be implemented within the same security scope of the webserver VPS, but it will take quite a bit more effort for the provider.
    280 
    281 But as stated; *who* is talking to *who* is less of a  secret here.
    282 
    283 
    284 SimpleX
    285 -------
    286 
    287 `SimpleX <https://simplex.org>`_
    288 
    289 This is a newer arrival, and it stands out in two aspects in particular:
    290 
    291 * Running a node is *easy*, and requires *no resources*.
    292 * It has a bundled CLI client!!
    293 
    294 Like Signal, it offers double-ratchet encryption.
    295 
    296 However, unlike most all other applications, it tries to make its absence of a user id its selling point. The idea is you make a connection link on the fly, and that connection link is never translated to an ID.
    297 
    298 And yes, this theoretically helps avoid collateral damage when one conversation pair is disclosed. Let's say the authorities seize your friend, and forces him or her to decrypt his or her phone. They can see what he or she wrote, but not necessarily any identity of counterparties (except for whatever is disclosed in the messages themselves, of course). It is a neat, neat trick.
    299 
    300 
    301 whatever-paste-as-a-service
    302 ---------------------------
    303 
    304 Yes, for sure. Hiding among the masses works perfectly.
    305 
    306 **IF** you will encrypt the data you post yourself. Because whatever encryption offered by the server is not under your control.
    307 
    308 Will you?
    309 
    310 Really?
    311 
    312 Securely?
    313 
    314 Good for you!
    315 
    316 But if not: You're screwed!
    317 
    318 In this case - at a minimum, the other party should be retrieving the file using the same precautions as you took above. Tha is, through a VPN or Tor or public wifi, or all two or three.
    319 
    320 Remember, though, that not all cases are a question of both parties being secret. If the retriever does not have to hide (much), then they may act accordingly.
    321 
    322 
    323 ..
    324 
    325         .. [1] You will need the `qrencode` packagefor that