From a51e9e2eb96a34fc6813a2af0d09b363f689c424 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 18 Sep 2020 21:10:04 -0400 Subject: [PATCH 01/29] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1371b1f..06e971f 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,11 @@ apt install tor ### [Installation Methods](https://github.com/ruped24/toriptables2/wiki/Optional-Installation-methods-for-toriptables2.py) ### [Troubleshooting and FAQ](https://github.com/ruped24/toriptables2/wiki/Troubleshooting) + +--- + +### ToDo: +- [ ] Python3.x version, **[toriptables3](https://github.com/ruped24/toriptables2/wiki/Troubleshooting#faq)** +- [x] Compiled [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64 + +--- From 316f4dd5323f327e016a266a1fead3b96eeb69ed Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 18 Sep 2020 21:15:35 -0400 Subject: [PATCH 02/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06e971f..ce86a0f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ apt install tor --- ### ToDo: -- [ ] Python3.x version, **[toriptables3](https://github.com/ruped24/toriptables2/wiki/Troubleshooting#faq)** +- [ ] Python3.x version, **toriptables3** - [x] Compiled [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64 --- From 27b2ed39b79579d37c267eb3fb3a96d4973f650e Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 18 Sep 2020 21:21:02 -0400 Subject: [PATCH 03/29] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce86a0f..2dfb659 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ apt install tor --- ### ToDo: -- [ ] Python3.x version, **toriptables3** -- [x] Compiled [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64 +- [ ] Python3.x version, **toriptables3**. See FAQ. +- [x] Compiled [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64. --- From 1b775204251e27e862316b033254054fda0b2fdd Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 19 Sep 2020 08:16:26 -0400 Subject: [PATCH 04/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dfb659..dbed93d 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,6 @@ apt install tor ### ToDo: - [ ] Python3.x version, **toriptables3**. See FAQ. -- [x] Compiled [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64. +- [x] Compiled[toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64. --- From d909f07c88aa7639755d979c428c5cc740415e68 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 19 Sep 2020 08:17:10 -0400 Subject: [PATCH 05/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbed93d..3bcd597 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,6 @@ apt install tor ### ToDo: - [ ] Python3.x version, **toriptables3**. See FAQ. -- [x] Compiled[toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64. +- [x] Compile [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64. --- From c793fa7e55927483e141921f349c9a81a4d3ae32 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 19 Sep 2020 09:49:33 -0400 Subject: [PATCH 06/29] Update toriptables2.py --- toriptables2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toriptables2.py b/toriptables2.py index 0eec958..1602fdc 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -12,7 +12,7 @@ from commands import getoutput from subprocess import call, check_call, CalledProcessError from os.path import isfile, basename from os import devnull -from sys import stdout, stderr +from sys import exit, stdout, stderr from atexit import register from argparse import ArgumentParser from json import load From c8301bd77f4c3e4e26312f89d182573419584fb9 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 19 Sep 2020 18:03:40 -0400 Subject: [PATCH 07/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3bcd597..a2a63fe 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,6 @@ apt install tor ### ToDo: - [ ] Python3.x version, **toriptables3**. See FAQ. -- [x] Compile [toriptables2.py](https://github.com/ruped24/toriptables2/releases/tag/2-2.1) as an ELF 64-bit LSB executable, x86-64. +- [x] Compile toriptables2.py as an [ELF 64-bit LSB x86-64 executable](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). --- From e062bf6f618c6f6ad54e1af4cf3f1dc5b3a7b5e1 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 19 Sep 2020 18:10:33 -0400 Subject: [PATCH 08/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2a63fe..d4c8f4c 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,6 @@ apt install tor ### ToDo: - [ ] Python3.x version, **toriptables3**. See FAQ. -- [x] Compile toriptables2.py as an [ELF 64-bit LSB x86-64 executable](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). +- [x] Compile toriptables2.py as an **[ELF 64-bit LSB x86-64 executable](https://github.com/ruped24/toriptables2/releases/tag/2-2.1)**. --- From 874c19c498566186fd1ffc161ae060dbc482bbba Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 20 Sep 2020 00:12:24 -0400 Subject: [PATCH 09/29] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d4c8f4c..fc5bb44 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,7 @@ apt install tor --- -### ToDo: -- [ ] Python3.x version, **toriptables3**. See FAQ. -- [x] Compile toriptables2.py as an **[ELF 64-bit LSB x86-64 executable](https://github.com/ruped24/toriptables2/releases/tag/2-2.1)**. + +# [toriptables3](https://github.com/ruped24/toriptables3) --- From c23c58c50b6d9aaef30565b86ca9b451a86e5201 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 20 Sep 2020 03:34:34 -0400 Subject: [PATCH 10/29] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index fc5bb44..5a4ea15 100644 --- a/README.md +++ b/README.md @@ -88,5 +88,15 @@ apt install tor # [toriptables3](https://github.com/ruped24/toriptables3) +
Expand for toriptables3 +
+ +The successor to the Python2.7 version. + + +Upgrade to the [Python3.8 version](https://github.com/ruped24/toriptables3#toriptables3). + + +
--- From 9e66e5bd3312bf138a0a4559ad871214c2387e7f Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 20 Sep 2020 03:42:17 -0400 Subject: [PATCH 11/29] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a4ea15..f360058 100644 --- a/README.md +++ b/README.md @@ -91,10 +91,10 @@ apt install tor
Expand for toriptables3
-The successor to the Python2.7 version. +The successor to the Python 2.7 version. -Upgrade to the [Python3.8 version](https://github.com/ruped24/toriptables3#toriptables3). +Upgrade to the [Python 3.8 version](https://github.com/ruped24/toriptables3#toriptables3).
From 79d55809bde1626fbb0054a315a2f90f504fb7e3 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 20 Sep 2020 03:43:16 -0400 Subject: [PATCH 12/29] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index f360058..443ac99 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,9 @@ apt install tor
Expand for toriptables3
-The successor to the Python 2.7 version. - - Upgrade to the [Python 3.8 version](https://github.com/ruped24/toriptables3#toriptables3). +The successor to the Python 2.7 version.
From 54e944db597eab625f80cfeee39c9ffc60e5f1ee Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 20 Sep 2020 03:57:58 -0400 Subject: [PATCH 13/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 443ac99..43dc351 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ apt install tor Upgrade to the [Python 3.8 version](https://github.com/ruped24/toriptables3#toriptables3). -The successor to the Python 2.7 version. +The successor to the [Python 2.7 version](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). From 0a11c50333ae3e089c86bd7bc983c55ef6a1172e Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 20 Sep 2020 13:12:51 -0400 Subject: [PATCH 14/29] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 43dc351..e0ce989 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,14 @@ toriptables2.py -l --- #### To change Tor IP address: +
Expand for change Tor IP +
+ ```bash toriptables2.py -r ``` +
+ --- #### To automate changing Tor IP: From 68d6ab63b04586e82433ac9225e49a17ba06660c Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Mon, 21 Sep 2020 22:03:30 -0400 Subject: [PATCH 15/29] Update README.md --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e0ce989..b530dc0 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,6 @@ apt install tor --- -### [Installation Methods](https://github.com/ruped24/toriptables2/wiki/Optional-Installation-methods-for-toriptables2.py) - -### [Troubleshooting and FAQ](https://github.com/ruped24/toriptables2/wiki/Troubleshooting) - ---- - # [toriptables3](https://github.com/ruped24/toriptables3)
Expand for toriptables3 @@ -103,3 +97,7 @@ The successor to the [Python 2.7 version](https://github.com/ruped24/toriptables
--- + +### [Installation Methods](https://github.com/ruped24/toriptables2/wiki/Optional-Installation-methods-for-toriptables2.py) + +### [Troubleshooting and FAQ](https://github.com/ruped24/toriptables2/wiki/Troubleshooting) From 9695a9b2b10788ac524bc1c54457fb96747c51a3 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Mon, 21 Sep 2020 23:36:20 -0400 Subject: [PATCH 16/29] [Fixed] GUI notification --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index b530dc0..0ec810e 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,6 @@ toriptables2.py -r #### Dependencies: -Install [python-notify](http://ftp.br.debian.org/debian/pool/main/n/notify-python/python-notify_0.1.1-4_amd64.deb) - ```bash apt install tor ``` From 2f3527d9b48cc44f020f6af869b9c32b2cecb14e Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 18 Dec 2020 02:50:22 -0500 Subject: [PATCH 17/29] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0ec810e..341f4d0 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,15 @@ apt install tor * [Kali Linux, Rolling Edition [ON]](https://drive.google.com/open?id=0B79r4wTVj-CZSEdkaTBNOVc5aUU) * [Kali Linux, Rolling Edition [OFF]](https://drive.google.com/file/d/1NPZ1SKI9rh9XkaplF2_DzHSoPL77aiy-/view?usp=sharing) + +#### Usage Demo: +
Exapand for notification demo +
+ +* [Kali Linux, Rolling Edition Demo](https://drive.google.com/file/d/1kWdp8ciWTX5onuinR-3DjYKgcTFh9QJM/view?usp=sharing) + +
+ --- From 42a1e1574477c39d985ecf18ce4dadbd5af1f19c Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 18 Dec 2020 03:50:21 -0500 Subject: [PATCH 18/29] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 341f4d0..d76c673 100644 --- a/README.md +++ b/README.md @@ -76,11 +76,17 @@ toriptables2.py -r ```bash apt install tor ``` +*** #### Screenshots: +
Expand for screenshots +
+ * [Kali Linux, Rolling Edition [ON]](https://drive.google.com/open?id=0B79r4wTVj-CZSEdkaTBNOVc5aUU) * [Kali Linux, Rolling Edition [OFF]](https://drive.google.com/file/d/1NPZ1SKI9rh9XkaplF2_DzHSoPL77aiy-/view?usp=sharing) +
+*** #### Usage Demo:
Exapand for notification demo
From f7e9d9f77e89bc12b67ea16b44f8b391a072db24 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 18 Dec 2020 03:52:42 -0500 Subject: [PATCH 19/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d76c673..2396ab1 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ apt install tor
Exapand for notification demo
-* [Kali Linux, Rolling Edition Demo](https://drive.google.com/file/d/1kWdp8ciWTX5onuinR-3DjYKgcTFh9QJM/view?usp=sharing) +* [Kali Linux, Rolling Edition [Demo]](https://drive.google.com/file/d/1kWdp8ciWTX5onuinR-3DjYKgcTFh9QJM/view?usp=sharing)
From bc02f2debf773e30b10c67d1fdc4ef9cb9327562 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Mon, 15 Feb 2021 22:32:08 -0500 Subject: [PATCH 20/29] [Added] Link to toriptables3 AppImage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2396ab1..d34cd66 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ apt install tor
Expand for toriptables3
-Upgrade to the [Python 3.8 version](https://github.com/ruped24/toriptables3#toriptables3). +Upgrade to the [Python 3.8 version](https://github.com/ruped24/toriptables3/releases/tag/v3.0). The successor to the [Python 2.7 version](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). From d48aefaa2c86789faa583b60271961f9608279fb Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Tue, 16 Feb 2021 20:36:19 -0500 Subject: [PATCH 21/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d34cd66..1a608a5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ toriptables2.py -l * [Check My IPx](https://ipx.ac/) * [Check Tor Project](https://check.torproject.org) -* [Do I leak](http://www.doileak.com/) +* [Do I leak](https://www.doileak.com/classic.html) * [DNS leak test](http://dnsleaktest.com) * [Test IPv6](http://ipv6-test.com/) * [What is my proxy](http://whatismyproxy.com) From ec6b2def78b9607141abc5d09890beaa36903feb Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Fri, 19 Feb 2021 05:00:20 -0500 Subject: [PATCH 22/29] [Fixed] Changed IP Endpoint --- toriptables2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toriptables2.py b/toriptables2.py index 1602fdc..312e398 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -103,7 +103,7 @@ DNSPort %s while retries < 12 and not my_public_ip: retries += 1 try: - my_public_ip = load(urlopen('https://check.torproject.org/api/ip'))['IP'] + my_public_ip = load(urlopen('https://api.ipify.org?format=json'))['ip'] except URLError: sleep(5) print(" [\033[93m?\033[0m] Still waiting for IP address...") From dfa46f39508b09d91d08c813bf2613cbace6b8c0 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Thu, 25 Feb 2021 11:59:07 -0500 Subject: [PATCH 23/29] [Changed] IP Endpoint --- toriptables2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toriptables2.py b/toriptables2.py index 312e398..5d24c74 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -103,7 +103,7 @@ DNSPort %s while retries < 12 and not my_public_ip: retries += 1 try: - my_public_ip = load(urlopen('https://api.ipify.org?format=json'))['ip'] + my_public_ip = load(urlopen('https://ipinfo.io/json'))['ip'] except URLError: sleep(5) print(" [\033[93m?\033[0m] Still waiting for IP address...") From 719808e7a7c7b406ab06f64e60f4247553454170 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Thu, 25 Feb 2021 12:02:06 -0500 Subject: [PATCH 24/29] Update toriptables2.py --- toriptables2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toriptables2.py b/toriptables2.py index 5d24c74..312e398 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -103,7 +103,7 @@ DNSPort %s while retries < 12 and not my_public_ip: retries += 1 try: - my_public_ip = load(urlopen('https://ipinfo.io/json'))['ip'] + my_public_ip = load(urlopen('https://api.ipify.org?format=json'))['ip'] except URLError: sleep(5) print(" [\033[93m?\033[0m] Still waiting for IP address...") From 0fe91114485495fa65dee6dbdf72a4d35af36c13 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Thu, 25 Feb 2021 20:49:05 -0500 Subject: [PATCH 25/29] Update toriptables2.py --- toriptables2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toriptables2.py b/toriptables2.py index 312e398..1602fdc 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -103,7 +103,7 @@ DNSPort %s while retries < 12 and not my_public_ip: retries += 1 try: - my_public_ip = load(urlopen('https://api.ipify.org?format=json'))['ip'] + my_public_ip = load(urlopen('https://check.torproject.org/api/ip'))['IP'] except URLError: sleep(5) print(" [\033[93m?\033[0m] Still waiting for IP address...") From d1bb5dda42dfd5bcf8d5e357da839a8fcdc9f402 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 10 Apr 2021 23:11:45 -0400 Subject: [PATCH 26/29] [Added] toriptables2 AppImage --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1a608a5..5c9b329 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ apt install tor
Expand for toriptables3
-Upgrade to the [Python 3.8 version](https://github.com/ruped24/toriptables3/releases/tag/v3.0). +Upgrade to [toriptables3](https://github.com/ruped24/toriptables3/releases/tag/v3.0). -The successor to the [Python 2.7 version](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). +The successor to [toriptables2](https://github.com/ruped24/toriptables2/releases/tag/2-2.1).
From 331ae845e81bc956adfa088f8d09b9e873e69d7f Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 25 Apr 2021 02:57:19 -0400 Subject: [PATCH 27/29] [Updated] Troubleshooting w/ Set Tor ExitNodes --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c9b329..a36d684 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,7 @@ apt install tor
Expand for toriptables3
-Upgrade to [toriptables3](https://github.com/ruped24/toriptables3/releases/tag/v3.0). - -The successor to [toriptables2](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). +Upgrade to [toriptables3](https://github.com/ruped24/toriptables3/releases/tag/v3.0). The successor to [toriptables2](https://github.com/ruped24/toriptables2/releases/tag/2-2.1).
From e852a927c732fca39b0be055dae4756e8eada929 Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sun, 30 May 2021 02:27:06 -0400 Subject: [PATCH 28/29] [Releases] toriptables2-x86_64.AppImage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a36d684..f7a9293 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ apt install tor
Expand for toriptables3
-Upgrade to [toriptables3](https://github.com/ruped24/toriptables3/releases/tag/v3.0). The successor to [toriptables2](https://github.com/ruped24/toriptables2/releases/tag/2-2.1). +Upgrade to [toriptables3](https://github.com/ruped24/toriptables3/releases/tag/v3.0) the successor to [toriptables2](https://github.com/ruped24/toriptables2/releases/tag/2-2.1).
From 248d1d983d8da4fdd4394db5e8589f31539ead89 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 9 May 2022 07:18:09 -0400 Subject: [PATCH 29/29] toriptables2: convert to python3 Signed-off-by: Vincent Batts --- toriptables2.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/toriptables2.py b/toriptables2.py index 1602fdc..a8bb11e 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python2 +#! /usr/bin/env python3 # Written by Rupe version 2.1 # """ @@ -7,16 +7,15 @@ that sets up iptables and tor to route all services and traffic including DNS through the tor network. """ -from __future__ import print_function -from commands import getoutput -from subprocess import call, check_call, CalledProcessError +from subprocess import call, check_call, getoutput, CalledProcessError from os.path import isfile, basename from os import devnull from sys import exit, stdout, stderr from atexit import register from argparse import ArgumentParser from json import load -from urllib2 import urlopen, URLError +from urllib.request import urlopen +from urllib.error import URLError from time import sleep @@ -54,15 +53,15 @@ DNSPort %s fnull = open(devnull, 'w') try: tor_restart = check_call( - ["service", "tor", "restart"], + ["systemctl", "restart", "tor"], stdout=fnull, stderr=fnull) - if tor_restart is 0: - print(" {0}".format( - "[\033[92m+\033[0m] Anonymizer status \033[92m[ON]\033[0m")) + if tor_restart == 0: + print((" {0}".format( + "[\033[92m+\033[0m] Anonymizer status \033[92m[ON]\033[0m"))) self.get_ip() except CalledProcessError as err: - print("\033[91m[!] Command failed: %s\033[0m" % ' '.join(err.cmd)) + print(("\033[91m[!] Command failed: %s\033[0m" % ' '.join(err.cmd))) # See https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy#WARNING # See https://lists.torproject.org/pipermail/tor-talk/2014-March/032503.html @@ -96,8 +95,8 @@ DNSPort %s call(["iptables", "-A", "OUTPUT", "-j", "REJECT"]) def get_ip(self): - print(" {0}".format( - "[\033[92m*\033[0m] Getting public IP, please wait...")) + print((" {0}".format( + "[\033[92m*\033[0m] Getting public IP, please wait..."))) retries = 0 my_public_ip = None while retries < 12 and not my_public_ip: @@ -109,12 +108,12 @@ DNSPort %s print(" [\033[93m?\033[0m] Still waiting for IP address...") except ValueError: break - print + print() if not my_public_ip: my_public_ip = getoutput('wget -qO - ifconfig.me') if not my_public_ip: exit(" \033[91m[!]\033[0m Can't get public ip address!") - print(" {0}".format("[\033[92m+\033[0m] Your IP is \033[92m%s\033[0m" % my_public_ip)) + print((" {0}".format("[\033[92m+\033[0m] Your IP is \033[92m%s\033[0m" % my_public_ip))) if __name__ == '__main__': @@ -150,8 +149,8 @@ if __name__ == '__main__': load_tables.load_iptables_rules() elif args.flush: load_tables.flush_iptables_rules() - print(" {0}".format( - "[\033[93m!\033[0m] Anonymizer status \033[91m[OFF]\033[0m")) + print((" {0}".format( + "[\033[93m!\033[0m] Anonymizer status \033[91m[OFF]\033[0m"))) elif args.ip: load_tables.get_ip() elif args.refresh: @@ -160,4 +159,4 @@ if __name__ == '__main__': else: parser.print_help() except Exception as err: - print("[!] Run as super user: %s" % err[1]) + print(("[!] Run as super user: %s" % err))