Skip to content

update README.md & fix oneshot.py hidden essid error: KeyError: 'ESSID' #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
**Getting OneShot**
```
cd ~
wget https://raw.githubusercontent.com/drygdryg/OneShot/master/oneshot.py
wget https://raw.githubusercontent.com/kimocoder/OneShot/master/oneshot.py
```
Optional: getting a list of vulnerable to pixie dust devices for highlighting in scan results:
```
wget https://raw.githubusercontent.com/drygdryg/OneShot/master/vulnwsc.txt
wget https://raw.githubusercontent.com/kimocoder/OneShot/master/vulnwsc.txt
```
## Arch Linux
**Installing requirements**
Expand All @@ -48,11 +48,11 @@ Optional: getting a list of vulnerable to pixie dust devices for highlighting in
```
**Getting OneShot**
```
wget https://raw.githubusercontent.com/drygdryg/OneShot/master/oneshot.py
wget https://raw.githubusercontent.com/kimocoder/OneShot/master/oneshot.py
```
Optional: getting a list of vulnerable to pixie dust devices for highlighting in scan results:
```
wget https://raw.githubusercontent.com/drygdryg/OneShot/master/vulnwsc.txt
wget https://raw.githubusercontent.com/kimocoder/OneShot/master/vulnwsc.txt
```
## Alpine Linux
It can also be used to run on Android devices using [Linux Deploy](https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy)
Expand All @@ -67,18 +67,18 @@ Adding the testing repository:
```
**Getting OneShot**
```
sudo wget https://raw.githubusercontent.com/drygdryg/OneShot/master/oneshot.py
sudo wget https://raw.githubusercontent.com/kimocoder/OneShot/master/oneshot.py
```
Optional: getting a list of vulnerable to pixie dust devices for highlighting in scan results:
```
sudo wget https://raw.githubusercontent.com/drygdryg/OneShot/master/vulnwsc.txt
sudo wget https://raw.githubusercontent.com/kimocoder/OneShot/master/vulnwsc.txt
```
## [Termux](https://termux.com/)
Please note that root access is required.

#### Using installer
```
curl -sSf https://raw.githubusercontent.com/drygdryg/OneShot_Termux_installer/master/installer.sh | bash
curl -sSf https://raw.githubusercontent.com/kimocoder/OneShot_Termux_installer/master/installer.sh | bash
```
#### Manually
**Installing requirements**
Expand All @@ -88,7 +88,7 @@ Please note that root access is required.
```
**Getting OneShot**
```
git clone --depth 1 https://github.com/drygdryg/OneShot OneShot
git clone --depth 1 https://github.com/kimocoder/OneShot OneShot
```
#### Running
```
Expand Down
4 changes: 2 additions & 2 deletions oneshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,14 +1013,14 @@ def colored(text, color=None):
for n, network in network_list_items:
number = f'{n})'
model = '{} {}'.format(network['Model'], network['Model number'])
essid = truncateStr(network['ESSID'], 25)
essid = truncateStr(network.get('ESSID', 'Unknown'), 25)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Extract raw ESSID before truncation to reduce duplication

Assign the result of network.get('ESSID', 'Unknown') to a variable before using it, to avoid duplication and improve maintainability.

deviceName = truncateStr(network['Device name'], 27)
line = '{:<4} {:<18} {:<25} {:<8} {:<4} {:<27} {:<}'.format(
number, network['BSSID'], essid,
network['Security type'], network['Level'],
deviceName, model
)
if (network['BSSID'], network['ESSID']) in self.stored:
if (network['BSSID'], network.get('ESSID', 'Unknown')) in self.stored:
print(colored(line, color='yellow'))
elif network['WPS locked']:
print(colored(line, color='red'))
Expand Down