Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
fuswim
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sysadmin
fuswim
Commits
3a987222
Commit
3a987222
authored
Jul 22, 2021
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fucking colors!
parent
97f46205
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
5 deletions
+49
-5
fuswim
fuswim
+49
-5
No files found.
fuswim
View file @
3a987222
...
@@ -15,6 +15,29 @@ except:
...
@@ -15,6 +15,29 @@ except:
boot
=
False
boot
=
False
auto
=
False
auto
=
False
class
colors
:
RED
=
'
\033
[31m'
ENDC
=
'
\033
[m'
GREEN
=
'
\033
[32m'
YELLOW
=
'
\033
[33m'
BLUE
=
'
\033
[34m'
CYAN
=
'
\033
[36m'
def
sigcol
(
qual
):
sigcol
=
{
45
:
colors
.
YELLOW
,
60
:
colors
.
ENDC
,
70
:
colors
.
GREEN
}
rcol
=
colors
.
RED
for
col
in
sigcol
.
keys
():
if
int
(
qual
)
>=
col
:
rcol
=
sigcol
[
col
]
return
rcol
def
kill_proc
(
name
,
ops
=
False
):
def
kill_proc
(
name
,
ops
=
False
):
for
process
in
psutil
.
process_iter
():
for
process
in
psutil
.
process_iter
():
...
@@ -64,11 +87,11 @@ def checkYN(res, default='N'):
...
@@ -64,11 +87,11 @@ def checkYN(res, default='N'):
return
True
return
True
elif
res
.
lower
()
==
'n'
or
res
.
lower
()
==
'fuck no!'
:
elif
res
.
lower
()
==
'n'
or
res
.
lower
()
==
'fuck no!'
:
return
False
return
False
print
(
'WHAT? "'
+
res
+
'"? WHAT THE FUCK? I take it as a fuck no!'
)
print
(
colors
.
RED
+
'WHAT? "'
+
res
+
'"? WHAT THE FUCK? I take it as a fuck no!'
+
colors
.
ENDC
)
return
False
return
False
if
not
interface
in
detect_ifaces
():
if
not
interface
in
detect_ifaces
():
print
(
"OH FUCK! Interface "
+
interface
+
" doesn't exists. Exiting..."
)
print
(
colors
.
RED
+
"OH FUCK! Interface "
+
interface
+
" doesn't exists. Exiting..."
+
colors
.
ENDC
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -102,8 +125,29 @@ else:
...
@@ -102,8 +125,29 @@ else:
print
(
"fucking wpa_supplicant for "
+
interface
+
" already fucked but still down, refucking it"
)
print
(
"fucking wpa_supplicant for "
+
interface
+
" already fucked but still down, refucking it"
)
start_wpa
(
interface
)
start_wpa
(
interface
)
# detect all networks...
# detect all networks...
#netw = iw_parse.get_interfaces(interface="wlan0")
netw
=
iw_parse
.
get_interfaces
(
interface
=
"wlan0"
)
#pprint(netw)
i
=
1
nets
=
{}
for
net
in
netw
:
if
'Mode'
in
net
.
keys
()
and
net
[
'Mode'
]
==
'Master'
:
if
'Name'
in
net
.
keys
()
and
net
[
'Name'
]:
nets
[
net
[
'Name'
]]
=
net
else
:
name
=
'NoEssid_'
+
str
(
i
)
i
=
i
+
1
nets
[
name
]
=
net
print
(
'Here it is your fucking networks...:'
)
i
=
0
for
net
in
nets
.
keys
():
sig
=
nets
[
net
][
'Signal Level'
]
qual
=
nets
[
net
][
'Quality'
]
enc
=
'Open'
if
'Encryption'
in
nets
[
net
]
.
keys
():
enc
=
nets
[
net
][
'Encryption'
]
freq
=
nets
[
net
][
'Frequency'
]
print
(
" "
+
str
(
i
)
+
": "
+
colors
.
BLUE
+
net
+
colors
.
ENDC
+
" ("
+
sigcol
(
qual
)
+
"sig: "
+
sig
+
", qual: "
+
nets
[
net
][
'Quality'
]
+
", freq: "
+
freq
+
", enc: "
+
enc
+
colors
.
ENDC
+
")"
)
i
=
i
+
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment