Skip to content

Instantly share code, notes, and snippets.

@tehmoon
Last active December 12, 2018 16:31
Show Gist options
  • Save tehmoon/765f165a4c5432a95800748ed8de0b8a to your computer and use it in GitHub Desktop.
Save tehmoon/765f165a4c5432a95800748ed8de0b8a to your computer and use it in GitHub Desktop.
Tor
# Example for tor client to connect to onion service
HidServAuth <onion service> <auth from hostname>
DataDir ~/.tor
SocksPort 9050 # set the port of the proxy
# Example and configuration for onion services:
HiddenServiceDir /home/moon/.tor2/sshd # Hidden service directory
HiddenServicePort 22 127.0.0.1:22 # Port redirection <RPORT> <LPORT>
HiddenServiceAuthorizeClient stealth kali # Stealth mode requires authentification
SocksPort 0 # Disable proxy
HiddenServiceSingleHopMode 1 # Make the onion circuit a single
HiddenServiceNonAnonymousMode 1 # Goes with option above
DataDirectory /home/moon/.tor # Global directory
## Check the hostname /home/moon/.tor/sshd/hostname

Use ssh:

ssh -o ProxyCommand 'nc -X 5 -x 127.0.0.1:<SocksPort> %h %p' <onion service>

SSH proxy through tor

ssh -o ProxyCommand="ssh -W %h:%p -o ProxyCommand=\"nc -X 5 -x localhost:9050 <onion address> 22\" <onion address>" -vvv <host>

Proxychains

  • install proxychains
  • change sock4 to sock5 in the configuration

Create certificate

  • openssl req -newkey rsa:2048 -days 730 -x509 -keyout irssi.key -out irssi.cert -nodes
  • cat mynick.cert irssi.key > irssi.pem
  • openssl x509 -sha1 -noout -fingerprint -in irssi.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'

Start irssi

  • /server add -auto -tls -tls_verify -network freenode -port 6697 chat.freenode.net
  • /msg NickServ IDENTIFY
  • /msg NICKSERV CERT ADD
  • /network add -sasl_username -sasl_password -sasl_mechanism EXTERNAL freenodetor
  • /server add -auto -net freenodetor -ssl -ssl_cert freenodeok2gncmy.onion 6697
  • /quit

Connect through tor

  • proxychains irssi -n

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment