Compare commits

...

29 Commits

Author SHA1 Message Date
Vincent Batts 248d1d983d
toriptables2: convert to python3
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2022-05-09 07:18:09 -04:00
Rupert Edwards e852a927c7
[Releases] toriptables2-x86_64.AppImage 2021-05-30 02:27:06 -04:00
Rupert Edwards 331ae845e8
[Updated] Troubleshooting w/ Set Tor ExitNodes 2021-04-25 02:57:19 -04:00
Rupert Edwards d1bb5dda42
[Added] toriptables2 AppImage 2021-04-10 23:11:45 -04:00
Rupert Edwards 0fe9111448
Update toriptables2.py 2021-02-25 20:49:05 -05:00
Rupert Edwards 719808e7a7
Update toriptables2.py 2021-02-25 12:02:06 -05:00
Rupert Edwards dfa46f3950
[Changed] IP Endpoint 2021-02-25 11:59:07 -05:00
Rupert Edwards ec6b2def78
[Fixed] Changed IP Endpoint 2021-02-19 05:00:20 -05:00
Rupert Edwards d48aefaa2c
Update README.md 2021-02-16 20:36:19 -05:00
Rupert Edwards bc02f2debf
[Added] Link to toriptables3 AppImage 2021-02-15 22:32:08 -05:00
Rupert Edwards f7e9d9f77e
Update README.md 2020-12-18 03:52:42 -05:00
Rupert Edwards 42a1e15744
Update README.md 2020-12-18 03:50:21 -05:00
Rupert Edwards 2f3527d9b4
Update README.md 2020-12-18 02:50:22 -05:00
Rupert Edwards 9695a9b2b1
[Fixed] GUI notification 2020-09-21 23:36:20 -04:00
Rupert Edwards 68d6ab63b0
Update README.md 2020-09-21 22:03:30 -04:00
Rupert Edwards 0a11c50333
Update README.md 2020-09-20 13:12:51 -04:00
Rupert Edwards 54e944db59
Update README.md 2020-09-20 03:57:58 -04:00
Rupert Edwards 79d55809bd
Update README.md 2020-09-20 03:43:16 -04:00
Rupert Edwards 9e66e5bd33
Update README.md 2020-09-20 03:42:17 -04:00
Rupert Edwards c23c58c50b
Update README.md 2020-09-20 03:34:34 -04:00
Rupert Edwards 874c19c498
Update README.md 2020-09-20 00:12:24 -04:00
Rupert Edwards e062bf6f61
Update README.md 2020-09-19 18:10:33 -04:00
Rupert Edwards c8301bd77f
Update README.md 2020-09-19 18:03:40 -04:00
Rupert Edwards c793fa7e55
Update toriptables2.py 2020-09-19 09:49:33 -04:00
Rupert Edwards d909f07c88
Update README.md 2020-09-19 08:17:10 -04:00
Rupert Edwards 1b77520425
Update README.md 2020-09-19 08:16:26 -04:00
Rupert Edwards 27b2ed39b7
Update README.md 2020-09-18 21:21:02 -04:00
Rupert Edwards 316f4dd532
Update README.md 2020-09-18 21:15:35 -04:00
Rupert Edwards a51e9e2eb9
Update README.md 2020-09-18 21:10:04 -04:00
2 changed files with 49 additions and 21 deletions

View File

@ -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)
@ -34,9 +34,14 @@ toriptables2.py -l
---
#### To change Tor IP address:
<details><summary>Expand for change Tor IP</summary>
<br>
```bash
toriptables2.py -r
```
</details>
---
#### To automate changing Tor IP:
@ -68,18 +73,42 @@ 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
```
***
#### Screenshots:
<details><summary>Expand for screenshots</summary>
<br>
* [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)
</details>
***
#### Usage Demo:
<details><summary>Exapand for notification demo</summary>
<br>
* [Kali Linux, Rolling Edition [Demo]](https://drive.google.com/file/d/1kWdp8ciWTX5onuinR-3DjYKgcTFh9QJM/view?usp=sharing)
</details>
</details>
---
# [toriptables3](https://github.com/ruped24/toriptables3)
<details><summary>Expand for toriptables3</summary>
<br>
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).
</details>
---
### [Installation Methods](https://github.com/ruped24/toriptables2/wiki/Optional-Installation-methods-for-toriptables2.py)
### [Troubleshooting and FAQ](https://github.com/ruped24/toriptables2/wiki/Troubleshooting)

View File

@ -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 stdout, stderr
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))