Logan's Technology Tutorials

Tutorials for various things.

This is a short tutorial for setting up I2P on Linux with i2pd for web browsing.

What is I2P

I2P is an anonymous network layer somewhat similar to Tor. Rather than .onion sites it lets you browse .i2p sites. It can also be used to run other Internet services anonymously but I will only be talking about web browsing. The I2P project doesn't recommend using I2P to browse the surface web and redirects you to Tor instead.

Most of the websites I've seen are blogs from people in the tech field (here is an example).

I2P daemon

Installation

Installing the I2P daemon. This might work, if it doesn't then click This Link, and the instructions there.

  1. apt

    sudo apt install i2pd

  2. guix

    guix install i2pd

    Running i2p daemon

    I like to run i2pd with –unix.handlesigstp in case I want to send a stop signal to it.

    i2pd —unix.handle_sigtstp

If this works i2pd should be running and it should be writing messages to your terminal.

Your distro might have set up i2pd to run on your init system, if this is the case you might not need to run i2pd.

firefox setup

profile (optional)

You should probably create a firefox profile to browse i2p. Technically this step is optional but if you use your main profile for I2P then you won't be able to use firefox on normal internet.

Create a new firefox profile with

firefox -P

Click “Create Profile” and go through the wizard. Give it a name like i2p (the name can be anything but I'm going to use i2p in this article).

After you are done with the wizard I recommend turning “Use the selected profile without asking at startup” off so that you can avoid accidentally opening the wrong profile.

setting up the proxy

After you have the profile, you need configure it to use the I2P tunnel as a proxy.

Either open up firefox through the profile manager with your i2p profile selected or run

firefox -P i2p

After that set up the preferences

  • go to about:preferences#general (you can paste this in your url bar)
  • Click Network Settings
  • Click Manual proxy configuration
  • In Http proxy:
    • put 127.0.0.1 as your HTTP proxy
    • put 4444 as your port
  • Click OK to close the window and confirm your changes
  1. disable https

    Https wasn't working for me, there might be a way to fix this but I don't know about it. I turned off HTTPS instead.

    • Go to about:preferences#privacy
    • Scroll down to HTTPS-Only mode
    • Click “Don't enable HTTPS-Only Mode”

    Exit out, you might want to configure the web browser to be more private but I am not going to go into detail on how to do that.

    Test if you can browse i2p websites by going to http://reg.i2p/. If it doesn't work then make sure i2pd is running and try again.

browsing i2p with wget

With most command line tools, you can set the “httpproxy” environment variable to whatever your proxy address is.

For example

http_proxy=127.0.0.1:4444 wget http://reg.i2p/

Browsing i2p websites

reg.i2p

http://reg.i2p/ is a domain name registry for i2p websites, it has a huge list of i2p websites in it. If you want to use it to find I2P websites then try clicking the hamburger menu and then picking “latest” or “alive” to the websites it has registered.

Other lists

These are other lists of websites, It seems like they have less than reg.i2p.

other tools

i2pd webconsole

To open up the i2pd webconsole go to http://127.0.0.1:7070/. You can do this on a normal web browser, it dosen't have to be configured for I2P. The web console can let you look at the i2p tunnels you have configured and do other stuff.


By Logan Andersen. This work is licensed under CC BY-SA 4.0

You can see my other blogs here.

Imagine that you have written a very long post on a forum you like. Everything is edited and you press “send”, The screen begins to change, and after a little while loading, it tells you that your post failed. You try to hit the back arrow, but your post hasn't been saved in the text field. Your post has vanished into the either, is there a way to get it back? The answer is Yes!

One way to recover an old post on firefox is to dump the program's core, and then search the core of the post you wrote. For this to work, it needs to be the case that you didn't close the program, or any relevant tabs. I got this trick from https://superuser.com/questions/975744/how-do-i-recover-information-ive-typed-into-a-website-after-i-accidentally-lost

Basic instructions

The first thing to do is to dump the program's core this can be done by finding the firefox process's PID, and then using the “gcore” command to dump the core of it.

ps -e | grep -i firefox sudo gcore 31337

where 31337 is the PID you got from the ps -e command (It will be a different number in your case probably).

After that you should get a file called “core.31337” which contains the contents of the entire firefox program. Part of the core will have the contents of the post you lost.

Searching the core

Hex editor

If you have a good hex editor, you can usually search for a section of the post you lost in the core file and then copy and paste it a text file.

Unix command line

I didn't feel like going into a hex editor so I decided to use command line utilities instead. The first problem I had was that the core was bigger than the amount of ram I had available, so I needed to split it into lines each program could process at a time. I did this with the fold command, and then I piped it into a tr command which deleted all of the binary. I took the command from: https://stackoverflow.com/questions/9988379/how-to-grep-a-text-file-which-contains-some-binary-data

After that, I searched for a section of text within the file that had part of the post I wrote

fold -bw 1024 < core.31337 | tr '[\000-\011\013-\037\177-\377]' '.' > dump grep -ni 'monkeys are primates' dump

From those commands, grep gave me a line number on where my post was located around, so I needed to grab all the lines around that post, Which I did with sed (I simply took the number from grep -n and then I made a sed command to print the sections around that number by adding and subtracting it by about 20 lines.

sed -n '39999990,40000050p;40000051q' dump > oldpost cat oldpost

This was a small enough file that I could copy and paste the post, remove any extra periods, rejoin any lines I was missing, and then copy paste the post back into the form.


By Logan Andersen. This work is licensed under CC BY-SA 4.0

You can see my other blogs here.