Skip to content

Commit 0486019

Browse files
committed
News 21/02/2022 15:57
1 parent ebb9924 commit 0486019

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ sudo python3 ghostui.py
1515
# Setup
1616
```bash
1717
sudo pip3 install -r requirements.txt
18+
```
19+
20+
## For Ubuntu based systems
21+
```bash
22+
sudo -H pip3 install -r requirements.txt
1823
```

ghostui.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,29 @@
44
import sys
55
import requests
66
import npyscreen
7+
import configparser
8+
from rich import print
79
from subprocess import Popen, PIPE
810

911
# Checking permissions
1012
if int(os.getuid()) != 0:
11-
print("[!] You need root permissions to use this tool.")
13+
print("[bold white on red]You need root permissions to use this tool!!")
14+
sys.exit(1)
15+
16+
# Checking CyberGhostVPN existence
17+
if os.path.exists("/usr/bin/cyberghostvpn") is False:
18+
print("[bold white on red]CyberGhostVPN seems not installed on this system!!")
1219
sys.exit(1)
1320

1421
# Available countries
1522
vpn_country = {
23+
"Australia": "AU", "Armenia": "AM", "Argentina": "AR",
1624
"Belgium": "BE", "Bulgaria": "BG", "Brazil": "BR",
1725
"Canada": "CA", "Switzerland": "CH", "Chile": "CL",
1826
"China": "CN", "Colombia": "CO", "Czechia": "CZ",
19-
"Germany": "DE", "Denmark": "DK", "Estonia": "EE"
27+
"Germany": "DE", "Denmark": "DK", "Estonia": "EE",
28+
"Kazakhstan": "KZ", "Pakistan": "PK", "Qatar": "QA",
29+
"Ukraine": "UA", "United States": "US"
2030
}
2131

2232
# Class for main form that handles connections and country selections
@@ -41,6 +51,10 @@ def create(self):
4151
npyscreen.ButtonPress, name="Stop Connection",
4252
when_pressed_function=self.StopConnect, relx=20
4353
)
54+
self.add(
55+
npyscreen.ButtonPress, name="Auth Information",
56+
when_pressed_function=self.AuthInfo, relx=20
57+
)
4458
self.add(
4559
npyscreen.ButtonPress, name="Get IP Info",
4660
when_pressed_function=self.GetIPInfo, relx=20
@@ -102,6 +116,15 @@ def StopConnect(self):
102116
pass
103117
except:
104118
pass
119+
def AuthInfo(self):
120+
auth_conf = configparser.ConfigParser()
121+
username = os.getenv("SUDO_USER")
122+
auth_conf.read(f"/home/{username}/.cyberghost/config.ini")
123+
npyscreen.notify_confirm(
124+
f"User: {auth_conf['account']['username']}",
125+
"INFO"
126+
)
127+
105128
def GetIPInfo(self):
106129
try:
107130
npyscreen.notify_wait(
@@ -124,7 +147,7 @@ def onStart(self):
124147

125148
# Our main application
126149
self.addForm(
127-
"MAIN", MainForm, name="CyberGhostVPN TUI v0.1", lines=30, columns=90
150+
"MAIN", MainForm, name="CyberGhostVPN TUI v0.2", lines=30, columns=90
128151
)
129152

130153
# Execution area

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
npyscreen
1+
npyscreen
2+
rich

0 commit comments

Comments
 (0)