{"id":2042,"date":"2018-09-08T14:31:03","date_gmt":"2018-09-08T20:31:03","guid":{"rendered":"https:\/\/www.lastdragon.net\/?p=2042"},"modified":"2018-09-08T19:06:28","modified_gmt":"2018-09-09T01:06:28","slug":"torghost","status":"publish","type":"post","link":"https:\/\/www.lastdragon.net\/?p=2042","title":{"rendered":"Torghost no es necesario."},"content":{"rendered":"<p>Antes de leer este articulo te invito a mirar el siguiente video.<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/c-9AtFXkkuM?rel=0\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n<p>Como dice el video, torghost es totalmente innecesario, cualquier distribuci\u00f3n de GNU\/Linux puede sin problemas poner las reglas necesarias.<\/p>\n<p><strong>\u00bf Que se requiere ?<\/strong><\/p>\n<p>1 Compilar o instalar Tor, el c\u00f3digo fuente actual ( Septiembre 2018 ) lo puedes descargar de aqu\u00ed:<\/p>\n<p><a href=\"https:\/\/www.torproject.org\/dist\/tor-0.3.3.9.tar.gz\">https:\/\/www.torproject.org\/dist\/tor-0.3.3.9.tar.gz<\/a><\/p>\n<p>2 Tener instalado cualquier distribuci\u00f3n de GNU\/Linux<\/p>\n<p><strong>Preparar TOR<\/strong><\/p>\n<p>1 Agregar 3 l\u00edneas al archivo torrc<\/p>\n<p>El archivo torrc el cual puede estar en \/etc\/tor o en la carpeta donde hayas instalado tor despu\u00e9s de compilarlo, al final de este archivo debe agregarse las siguientes l\u00edneas.<\/p>\n<p><code>AutomapHostsOnResolve 1<br \/>\nTransPort 9040<br \/>\nDNSPort 4053<\/code><\/p>\n<p>2 Ejecuta estos 2 comandos iptables<\/p>\n<p>Hare bloques de estos 2 comandos de acuerdo a las necesidades que puedas tener.<\/p>\n<p><em>Basicos, Mueve todo el trafico a tor<\/em><\/p>\n<p><code>iptables -t nat -A OUTPUT -p tcp -m tcp -j REDIRECT --to-ports 9040<br \/>\niptables -t nat -A OUTPUT -p udp -m udp --dport 53 -j REDIRECT --to-ports 4053<\/code><\/p>\n<p>Si solo quieres mandar a TOR el trafico de uno de los usuarios en GNU\/Linux, solo sustituye <strong>UsuarioLinux<\/strong> por el usuario que deseas que todo su trafico sea enviado a TOR<\/p>\n<p><code>iptables -t nat -A OUTPUT -p tcp -m owner --uid-owner UsuarioLinux -m tcp -j REDIRECT --to-ports 9040<br \/>\niptables -t nat -A OUTPUT -p udp -m owner --uid-owner UusarioLinux -m udp --dport 53 -j REDIRECT --to-ports 4053<\/code><\/p>\n<p><strong>Eso es todo<\/strong><\/p>\n<p>Hasta aqu\u00ed, agregando 3 l\u00edneas en torrc y 2 comandos iptables ya puedes hacer lo que torghost hace, de aqu\u00ed en adelante solo analizaremos el instalador y el script en si mismo<\/p>\n<p><code>clear<br \/>\necho \"******* Torghost installer ********\"<br \/>\necho \"\"<br \/>\necho \"=====> Installing tor bundle \"<br \/>\nsudo apt-get install tor -y -qq<br \/>\necho \"=====> Installing dependencies \"<br \/>\nsudo pip install stem<br \/>\necho \"=====> Installing TorGhost \"<br \/>\nsudo cp torghost \/usr\/bin\/torghost<br \/>\nsudo chmod +x \/usr\/bin\/torghost<br \/>\necho \"=====> Done \"<br \/>\necho \"=====> Open terminal and type 'torghost' for usage \"<br \/>\necho \"Any questions on cyber security? Join Hacker's QandA forum: https:\/\/www.askthehackers.com \"<\/code><\/p>\n<p>Como se puede ver este Script solo funciona en distros que soporten apt-get , traduzcamos ese instalador a RedHat o CentOS<\/p>\n<p><code>yum install epel* -y<br \/>\nyum install tor -y<br \/>\nyum install python-stem -y<br \/>\ncp torghost \/usr\/bin\/torghost<br \/>\nchmod +x \/usr\/bin\/torghost<\/code><\/p>\n<p>Con esas lineas ejecutadas desde la carpeta\/directorio del instalador de torghost  ya tendr\u00e1s instalado el torghost  en CentOS 7<\/p>\n<p>El c\u00f3digo de torghost  se puede descargar de aqu\u00ed <a href=\"https:\/\/github.com\/susmithHCK\/torghost\">https:\/\/github.com\/susmithHCK\/torghost<\/a> , pero su contenido es el siguiente, mira todo el c\u00f3digo en Python que es sustituido con 2 l\u00edneas de iptables, que dicho sea de paso, dentro del  c\u00f3digo solo meten unas l\u00edneas iptables <\/p>\n<p><code>#!\/usr\/bin\/python<\/p>\n<p>import os<br \/>\nimport sys<br \/>\nimport commands<br \/>\nfrom commands import getoutput<br \/>\nimport time<br \/>\nimport signal<br \/>\nfrom stem import Signal<br \/>\nfrom stem.control import Controller<\/p>\n<p>class bcolors:<br \/>\n    BLUE = '\\033[94m'<br \/>\n    GREEN = '\\033[92m'<br \/>\n    RED = '\\033[31m'<br \/>\n    YELLOW = '\\033[93m'<br \/>\n    FAIL = '\\033[91m'<br \/>\n    ENDC = '\\033[0m'<br \/>\n    BOLD = '\\033[1m'<br \/>\n    BGRED = '\\033[41m'<br \/>\n    WHITE = '\\033[37m'<\/p>\n<p>def t():<br \/>\n    current_time = time.localtime()<br \/>\n    ctime = time.strftime('%H:%M:%S', current_time)<br \/>\n    return \"[\"+ ctime + \"]\"<br \/>\ndef shutdown():<br \/>\n\tprint \"\"<br \/>\n\tprint bcolors.BGRED + bcolors.WHITE + t() + \"[info] shutting down torghost\" + bcolors.ENDC +\"\\n\\n\"<br \/>\n\tsys.exit()<\/p>\n<p>def sigint_handler(signum, frame):<br \/>\n    print '\\n user interrupt ! shutting down'<br \/>\n    shutdown()<\/p>\n<p>def logo():<br \/>\n\tos.system(\"clear\")<br \/>\n\tprint bcolors.RED + bcolors.BOLD<br \/>\n\tprint \"\"\"<br \/>\n      _____           ____ _               _<br \/>\n     |_   _|__  _ __ \/ ___| |__   ___  ___| |_<br \/>\n       | |\/ _ \\| '__| |  _| '_ \\ \/ _ \\\/ __| __|<br \/>\n       | | (_) | |  | |_| | | | | (_) \\__ \\ |_<br \/>\n       |_|\\___\/|_|   \\____|_| |_|\\___\/|___\/\\__|<br \/>\n\tv2.0 - SusmithHCK | www.askthehackers.com<\/p>\n<p>    \"\"\"<br \/>\n\tprint bcolors.ENDC<br \/>\ndef usage():<br \/>\n\tlogo()<br \/>\n\tprint \"\"\"<\/p>\n<p>\tUSAGE:<br \/>\n        torghost start -----(start torghost)<br \/>\n        torghost stop  -----(stop torghost)<br \/>\n\ttorghost switch ----(switch IP)<\/p>\n<p>    \"\"\"<br \/>\n\tsys.exit()<\/p>\n<p>def ip():<br \/>\n\twhile True:<br \/>\n\t\ttry:<br \/>\n\t\t\tipadd = commands.getstatusoutput('wget -qO- https:\/\/check.torproject.org | grep -Po \"(?< =strong>)[\\d\\.]+(?=<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Antes de leer este articulo te invito a mirar el siguiente video. Como dice el video, torghost es totalmente innecesario, cualquier distribuci\u00f3n de GNU\/Linux puede sin problemas poner las reglas necesarias. \u00bf Que se requiere ? 1 Compilar o instalar Tor, el c\u00f3digo fuente actual ( Septiembre 2018 ) lo puedes descargar de aqu\u00ed: https:\/\/www.torproject.org\/dist\/tor-0.3.3.9.tar.gz&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2045,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[],"class_list":["post-2042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-consultoria-y-manuales","category-hackers-and-tools"],"_links":{"self":[{"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/posts\/2042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2042"}],"version-history":[{"count":4,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/posts\/2042\/revisions"}],"predecessor-version":[{"id":2047,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/posts\/2042\/revisions\/2047"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=\/wp\/v2\/media\/2045"}],"wp:attachment":[{"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lastdragon.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}