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
b1b4b486
Commit
b1b4b486
authored
Jul 22, 2021
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fucking state machine
parent
a0177509
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
41 deletions
+84
-41
fuswim
fuswim
+84
-41
No files found.
fuswim
View file @
b1b4b486
...
@@ -108,6 +108,40 @@ def start_wpa(interface):
...
@@ -108,6 +108,40 @@ def start_wpa(interface):
kill_proc
(
"wpa_supplicant"
,
interface
)
kill_proc
(
"wpa_supplicant"
,
interface
)
sh
(
"/sbin/wpa_supplicant -s -B -P /run/wpa_supplicant."
+
interface
+
".pid -i wlan0 -D nl80211,wext -C /run/wpa_supplicant"
)
sh
(
"/sbin/wpa_supplicant -s -B -P /run/wpa_supplicant."
+
interface
+
".pid -i wlan0 -D nl80211,wext -C /run/wpa_supplicant"
)
def
show_fuck_list
(
nets
):
print
(
'
\n
Here it is your fucking networks...:
\n
'
)
i
=
0
netind
=
{}
for
net
in
nets
.
keys
():
netconf
=
""
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'
]
nconf
=
read_netconf
(
net
)
if
nconf
[
'saved'
]:
nauto
=
'NO'
if
nconf
[
'auto'
]:
nauto
=
'YES'
netconf
=
"AUTO: "
+
nauto
+
", PRIO: "
+
str
(
nconf
[
'prio'
])
print
(
" "
+
str
(
i
)
+
": "
+
colors
.
BLUE
+
net
+
colors
.
ENDC
+
" ("
+
sigcol
(
qual
)
+
"sig: "
+
sig
+
", qual: "
+
qual
+
", freq: "
+
freq
+
", enc: "
+
enc
+
colors
.
ENDC
+
") "
+
netconf
)
netind
[
str
(
i
)]
=
nets
[
net
]
i
=
i
+
1
return
netind
def
nofuck
(
fuck
):
if
not
fuck
or
fuck
!=
'none'
:
print
(
"
\n
"
+
colors
.
RED
+
"FUCK YOU! MAKE A FUCKING CHOICE!"
+
colors
.
ENDC
)
def
fuckquit
(
fuck
):
if
fuck
.
lower
()
==
'q'
:
print
(
colors
.
RED
+
"
\n
I'M FUCKING KILLING MYSELF!
\n
"
+
colors
.
ENDC
)
sys
.
exit
(
0
)
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
'boot'
:
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
'boot'
:
print
(
' * start to fucking with your wireless... '
)
print
(
' * start to fucking with your wireless... '
)
boot
=
True
boot
=
True
...
@@ -156,11 +190,25 @@ else:
...
@@ -156,11 +190,25 @@ 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...
netw
=
iw_parse
.
get_interfaces
(
interface
=
"wlan0"
)
i
=
1
nets
=
{}
for
net
in
netw
:
SM
=
"init"
EXIT
=
False
while
not
EXIT
:
if
SM
==
"init"
:
SM
=
"detect"
nets
=
{}
elif
SM
==
"detect"
:
# detect all networks...
print
(
colors
.
GREEN
+
"
\n
LET'S FUCKING SCAN AND SEE WHO IS AROUND...
\n
"
+
colors
.
ENDC
)
netw
=
iw_parse
.
get_interfaces
(
interface
=
"wlan0"
)
i
=
1
nets
=
{}
for
net
in
netw
:
if
'Mode'
in
net
.
keys
()
and
net
[
'Mode'
]
==
'Master'
:
if
'Mode'
in
net
.
keys
()
and
net
[
'Mode'
]
==
'Master'
:
if
'Name'
in
net
.
keys
()
and
net
[
'Name'
]:
if
'Name'
in
net
.
keys
()
and
net
[
'Name'
]:
nets
[
net
[
'Name'
]]
=
net
nets
[
net
[
'Name'
]]
=
net
...
@@ -168,37 +216,32 @@ for net in netw:
...
@@ -168,37 +216,32 @@ for net in netw:
name
=
'NoEssid_'
+
str
(
i
)
name
=
'NoEssid_'
+
str
(
i
)
i
=
i
+
1
i
=
i
+
1
nets
[
name
]
=
net
nets
[
name
]
=
net
SM
=
"main"
elif
SM
==
"main"
:
netind
=
{}
def
show_fuck_list
(
nets
):
fuck
=
"none"
print
(
'
\n
Here it is your fucking networks...:
\n
'
)
while
fuck
not
in
netind
.
keys
()
and
fuck
.
lower
()
not
in
[
'e'
,
'r'
,
'q'
,
's'
]:
i
=
0
nofuck
(
fuck
)
netind
=
{}
netind
=
show_fuck_list
(
nets
)
for
net
in
nets
.
keys
():
fuck
=
input
(
"
\n
Choose a fucking one by index, or press E for edit, R to remove, S tore-scan, Q to shit the hell out: "
)
netconf
=
""
fuckquit
(
fuck
)
sig
=
nets
[
net
][
'Signal Level'
]
if
fuck
.
lower
()
==
'r'
:
qual
=
nets
[
net
][
'Quality'
]
SM
=
"remove"
enc
=
'Open'
elif
fuck
.
lower
()
==
's'
:
if
'Encryption'
in
nets
[
net
]
.
keys
():
SM
=
"detect"
enc
=
nets
[
net
][
'Encryption'
]
freq
=
nets
[
net
][
'Frequency'
]
nconf
=
read_netconf
(
net
)
elif
SM
==
"remove"
:
if
nconf
[
'saved'
]:
print
(
"
\n
FOR FUCK SAKE, are you too lazy to do a rm by hand in "
+
NETPATH
+
"?
\n
"
)
nauto
=
'NO'
netind
=
{}
if
nconf
[
'auto'
]:
fuck
=
"none"
nauto
=
'YES'
while
fuck
not
in
netind
.
keys
()
and
fuck
.
lower
()
not
in
[
'b'
,
'q'
]:
netconf
=
"AUTO: "
+
nauto
+
", PRIO: "
+
str
(
nconf
[
'prio'
])
nofuck
(
fuck
)
print
(
" "
+
str
(
i
)
+
": "
+
colors
.
BLUE
+
net
+
colors
.
ENDC
+
" ("
+
sigcol
(
qual
)
+
"sig: "
+
sig
+
", qual: "
+
qual
+
", freq: "
+
freq
+
", enc: "
+
enc
+
colors
.
ENDC
+
") "
+
netconf
)
netind
[
str
(
i
)]
=
nets
[
net
]
i
=
i
+
1
return
netind
netind
=
{}
fuck
=
"none"
while
fuck
not
in
netind
.
keys
()
and
fuck
.
lower
()
not
in
[
'e'
,
'R'
,
'q'
]:
netind
=
show_fuck_list
(
nets
)
netind
=
show_fuck_list
(
nets
)
fuck
=
input
(
"
\n
Choose a fucking one by index, or press E for edit, R to remove, Q to shit the hell out: "
)
fuck
=
input
(
"
\n
Choose a fucking one by index, or press B for back, Q do shit the hell out: "
)
fuckquit
(
fuck
)
if
fuck
.
lower
()
==
'b'
:
SM
=
"main"
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