{"id":96,"date":"2024-07-08T17:00:47","date_gmt":"2024-07-08T17:00:47","guid":{"rendered":"https:\/\/cybersecurityinfocus.com\/?p=96"},"modified":"2024-07-08T17:00:47","modified_gmt":"2024-07-08T17:00:47","slug":"creating-custom-onion-addresses-for-tor-hidden-services","status":"publish","type":"post","link":"https:\/\/cybersecurityinfocus.com\/?p=96","title":{"rendered":"Creating Custom .onion Addresses for Tor Hidden Services"},"content":{"rendered":"<p>This article can often contain rather random Tor .onion links. I\u2019ll show you how to create a custom .onion address for use with Tor hidden services.<\/p>\n<p>Custom .onion links often help other Tor users find and recognize your site.<\/p>\n<p>For example, close the Facebook .onion hidden service that allows users to access the Facebook website securely.\u00a0The Facebook .onion link is facebookcorewwwi.onion.<\/p>\n<p>For a public key hash that is randomly generated, it doesn\u2019t look very random, and many users wonder how they forward the full .onion link.<\/p>\n<p>The article below explains more about the processes Facebook took to create its custom .onion link.<\/p>\n<p>Quote from Tor \u201cThe short answer is that for the first half (\u201cFacebook\u201d), which is only 40 bits, they generated keys over and over until they got some keys whose first 40 bits of the hash matched the required string.\u00a0\u201c<\/p>\n<p><a href=\"https:\/\/blog.torproject.org\/blog\/facebook-hidden-services-and-https-certs\">https:\/\/blog.torproject.org\/blog\/facebook-hidden-services-and-https-certs<\/a><\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Birthday_attack\">https:\/\/en.wikipedia.org\/wiki\/Birthday_attack<\/a><\/p>\n<p>In this article, we will not be creating an .onion link like Facebook\u2019s fancy .onion link because we don\u2019t have that kind of computing power to process the entire address as it would take an immeasurable amount of time.<\/p>\n<p>To create custom .onion links, we can use the open-source tool Shallot.<\/p>\n<p>Shallot allows you to create custom .onion addresses for Tor hidden services.<\/p>\n<p>Individual approach means that part of the address can be selected.<\/p>\n<p>Selecting the entire address will take much longer, as stated above.<\/p>\n<h3 class=\"wp-block-heading\">Shallot Installation<\/h3>\n<p> # sudo apt-get install libcurl4-openssl-dev<\/p>\n<p># git clone https:\/\/github.com\/katmagic\/Shallot.git Shallot<\/p>\n<p># cd Shallot<br \/>\n# .\/configure &amp;&amp; make<br \/>\n# .\/shallot <\/p>\n<h3 class=\"wp-block-heading\">Usage<\/h3>\n<p> # .\/shallot ^test<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014-<br \/>\nFound matching pattern after 99133 tries: testvztz3tfoiofv.onion<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014-<br \/>\n\u2014\u2013BEGIN RSA PRIVATE KEY\u2014\u2013<br \/>\nMIICXgIBAAKBgQC3R85m6NQaA1ZjaYqvz1hvFIjbL4RtKdJbG8hlC9xEBkvfr\/BG<br \/>\n8Z5vDiUzdbDt8mEBuZUDanx80uGJvbXTgmczX0UlkEOgGiZ8RKpnsbKaf\/EJNrIw<br \/>\nT7MSXQmWNcm22nDeViV7fwy+Usyal2RE5cdVCFsPtEbVZqCumlKkEgCyFwIDBAZ7<br \/>\nAoGBAJSa2cGuru\/XhzJAEAIwHZbgPDnum9T\/srOYxUKW6afHZeOu5S4Cclwb+xb\/<br \/>\npGOtzn71XZfCKMfiVdxB\/f3XTcRrYB2VnBoNToTD7WfH6DksdDf4zunqiEjvxi9K<br \/>\nR+tKhxmF7OedrRt8wIhUmFd1E2Q9nbTHI6icdB4kR4QkYKZzAkEA5M6samK7+495<br \/>\n6SWpRXiePIs7sHKWuxdCrG7kW5RNJrv2CcGYwK46TPcaXBcRfM4eq9+9PGoKi0IO<br \/>\ngSpOZ5vRYQJBAM0QAZYTZ6ApD014x372MX1ZNofuYL\/+XF8ZPZV6Sh4+9MUBuNPb<br \/>\nyL7BENDr6pX4Zm6OepvAphhCa4vGno2pHncCQQCQnfhUCHANU4bjtX4EOoI63WDq<br \/>\nUwBOeIWxu0YvGt7Z25Dg9CNz\/aX8UZIoj6VyKxLRbR9+K3mNrNgaopW+ZDKzAkEA<br \/>\nttgTK1ALe+3v+5H+Ez1SvFPREDFcHihrfD1Ipc5zicY9ixTArgdyZvk+Pi+AMBVV<br \/>\nsL2HWvjRLEAgRclvKfkwWwJAFtM+BIGRM5me+fMALuBBEtKnbJ6maflsyucErEb0<br \/>\npIIBkovF5oyWO3lSBmtStJIANNkHOg8aXqjcgPKusDN7CQ==<br \/>\n\u2014\u2013END RSA PRIVATE KEY\u2014\u2013<\/p>\n<h3 class=\"wp-block-heading\">About the security of generated key pairs<\/h3>\n<p>\u201cIt is sometimes claimed that private keys generated by Shallot are less secure than those generated by Tor.<\/p>\n<p>This is incorrect.\u00a0Although Shallot generates a key pair with an unusually large common exponent e, it performs all the sanity checks specified in PKCS#1 v2.1 (directly in sane_key), and then performs all the sanity checks that Tor does when it generates RSA\u00a0(by calling the OpenSSL RSA_check_key function).<\/p>\n<h3 class=\"wp-block-heading\">Adding a new RSA private key to the Tor hidden service<\/h3>\n<p>Setting up a Tor hidden service is fairly simple, it requires running a web server on the machine and setting the HiddenServiceDir and HiddenServicePort in the tor configuration file.<\/p>\n<p>Location of torrc: \/etc\/tor\/torrc<\/p>\n<p> # nano \/etc\/tor\/torrc <\/p>\n<p>When Tor starts a hidden service, it generates a new public\/private key pair for the hidden service.<\/p>\n<p>The key pair is then written to the private_key file.<\/p>\n<p>Webmasters are advised to keep this key safe from others to prevent an attacker from gaining access to these keys so that they can impersonate a hidden service and perform various Man-in-the-Middle and Downgrade attacks on the targeted Tor hidden service.<\/p>\n<p>If you replace the RSA private key (including its header and footer) in the private_key file in the HiddenServiceDir specified in your torrc, then when you restart Tor, a hostname file will be created in HiddenServiceDir that contains your new .onion\u00a0address.<\/p>\n<p>The execution time required to create custom .onion links<\/p>\n<p>Tor .onion connection generation time with a given number of initial characters on a 1.5 GHz processor<\/p>\n<p>Generation time (approx.)<\/p>\n<p>1 less than a second<\/p>\n<p>2 less than a second<\/p>\n<p>3 less than a second<\/p>\n<p>4 \u2013 2 seconds<\/p>\n<p>5 \u2013 1 minute<\/p>\n<p>6 \u2013 30 minutes<\/p>\n<p>7 \u2013 1 day<\/p>\n<p>8 \u2013 25 days<\/p>\n<p>9 \u2013 2.5 years<\/p>\n<p>10 \u2013 40 years<\/p>\n<p>11 \u2013 640 years<\/p>\n<p>12 \u2013 10 thousand years<\/p>\n<p>13 \u2013 160 thousand<\/p>\n<p>14 \u2013 2.6 million years<\/p>\n<p><a href=\"https:\/\/github.com\/katmagic\/Shallot\"><strong>Shallot Git Repo<\/strong><\/a><\/p>\n<p><strong><a href=\"https:\/\/github.com\/lachesis\/scallion\">Scallion Oinionhash Generator<\/a><\/strong><\/p>\n<p>That\u2019s all. Have a nice day, everyone!<\/p>\n<p>\u2764\ufe0f If you liked the article,\u00a0<strong>like and subscribe<\/strong>\u00a0to my channel\u00a0<strong>\u201c<a href=\"http:\/\/t.me\/codelivly\">Codelivly<\/a>\u201d.<\/strong><\/p>\n<p>\ud83d\udc4d If you have any questions or if I would like to discuss the described hacking tools in more detail, then\u00a0<strong>write in the comments<\/strong>. Your opinion is very important to me!<\/p>","protected":false},"excerpt":{"rendered":"<p>This article can often contain rather random Tor .onion links. I\u2019ll show you how to create a custom .onion address for use with Tor hidden services. Custom .onion links often help other Tor users find and recognize your site. For example, close the Facebook .onion hidden service that allows users to access the Facebook website [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-96","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts\/96"}],"collection":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96"}],"version-history":[{"count":0,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions"}],"wp:attachment":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}