Skip to content

Commit 33a1d36

Browse files
author
wraith-wireless
committed
0.1.0 Initial Production Release
1 parent 4fef466 commit 33a1d36

38 files changed

+404
-216
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# modified from https://github.com/github/gitignore/blob/master/Python.gitignore
2+
#Copyright (c) 2016 GitHub, Inc.
3+
#
4+
#Permission is hereby granted, free of charge, to any person obtaining a
5+
#copy of this software and associated documentation files (the "Software"),
6+
#to deal in the Software without restriction, including without limitation
7+
#the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
#and/or sell copies of the Software, and to permit persons to whom the
9+
#Software is furnished to do so, subject to the following conditions:
10+
#
11+
#The above copyright notice and this permission notice shall be included in
12+
#all copies or substantial portions of the Software.
13+
#
14+
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
#FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
#
21+
#DEALINGS IN THE SOFTWARE.
22+
123
# Byte-compiled / optimized / DLL files
224
__pycache__/
325
*.py[cod]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ software in furtherance of or with intent to commit any fraudulent or other ille
3737
activities, or otherwise in violation of any applicable law, regulation or legal
3838
agreement.
3939

40-
See <http://www.gnu.org/licenses/> for a copy of the GNU General Public License.
40+
See <http://www.gnu.org/licenses/> for a copy of the GNU General Public License.

MANIFEST.in

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# Include license, README, channels, device, pyw and user guide
2-
include LICENSE README.md __init__.py channels.py device.py pyw.py PyRIC.pdf TODO RFI
1+
# Include license, README, channels, device, rfkill, pyw and user guide
2+
include LICENSE README.md __init__.py channels.py device.py rfkill.py pyw.py PyRIC.pdf TODO RFI
33

44
# Include subdirectories
5-
# NOTE: we do not include test folder in installation
6-
recursive-include lib net examples docs
7-
recursive-include docs *.help
5+
# device_details.py was not being included without the below recursive include
6+
recursive-include lib net examples docs tests guide
7+
recursive-include examples *.py
8+
recursive-include docs *.help
9+
recursive-include tests *.py
10+
recursive-include guide *.tex *.bib *.png

PyRIC.pdf

113 KB
Binary file not shown.

README.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ uses netlink (or ioctl) sockets to communicate directly with the kernel.
2222
about iw updates and rewriting your parsers.
2323
* Easy: If you can use iw, you can use PyRIC
2424

25-
Python is primarliy and originally a port of a subset of iw but has evolved in
25+
PyRIC is primarliy and originally a port of a subset of iw but has evolved in
2626
an attempt to meet the needs of wireless pentesting as it relates to wireless
2727
network cards. In addition to providing iw related functions, PyRIC implements:
2828
* ifconfig functionality such as mac address, ip address, netmask and broadcast
@@ -61,8 +61,7 @@ commands although an understanding of libnl(.py) is helpful especially, if for
6161
example, the code is to be extended to handle multicast or callbacks.
6262

6363
### b. Additions to iw
64-
In addition to providing some ifconfig functionality, I have also added several
65-
"extensions" to iw:
64+
Several "extensions" have been added to iw:
6665
* Persistent sockets: pyw provides the caller with functions & ability to pass
6766
their own netlink (or ioctl socket) to pyw functions;
6867
* One-time request for the nl80211 family id: pyw stores the family id in a
@@ -71,7 +70,7 @@ global variable
7170
(Cards are tuples t=(dev,phy #,ifindex)
7271

7372
These are minimal changes but they can improve the performance of any progams
74-
that need to access the wireless nic repeatedly as shown in the table below.
73+
that needs to access the wireless nic repeatedly as shown in the table below.
7574

7675
| chset | Total | Avg | Longest | Shortest |
7776
|------------|----------|--------|-----------|----------|
@@ -88,8 +87,8 @@ persistent netlink sockets are used with the total time and average hop time nea
8887
halved.
8988

9089
### c. Current State
91-
ATT, PyRIC accomplish my core needs but it is still a work in progress. It provides
92-
the following:
90+
ATT, PyRIC accomplishes my core needs but it is still a work in progress. It
91+
currently provides the following:
9392
* enumerate interfaces and wireless interfaces
9493
* identify a cards chipset and driver
9594
* get/set hardware address
@@ -104,7 +103,7 @@ the following:
104103
* get/set mode
105104
* add/delete interfaces
106105
* enumerate ISM and UNII channels
107-
* block/unblock rfkill devices (still working on it)
106+
* block/unblock rfkill devices
108107

109108
It also provides limited help functionality concerning nl80211 commands/attributes
110109
(for those who wish to add additional commands). However, it pulls directly from
@@ -116,10 +115,10 @@ To avoid confusion, PyRIC is the system as a whole, including all header files
116115
and "libraries" that are required to communicate with the kernel. pyw is a
117116
interface to these libraries providing specific funtions.
118117

119-
What it does - defines programmatic access to a small subset of iw and ifconfig.
120-
121-
What it does not do - handle multicast messages, callbacks or dumps or non nl80211
122-
funtionality.
118+
What it does - defines programmatic access to a subset of iw, ifconfig and iwconfig.
119+
In short, PyRIC provides Python wireless pentesters the ability to work with
120+
wireless cards directly from Python without having to use command line tools
121+
through Popen.
123122

124123
## 2. INSTALLING/USING:
125124

@@ -130,16 +129,13 @@ installation.
130129

131130
### a. Requirements
132131
PyRIC has only two requirements: Linux and Python. There has been very little
133-
testing (on my side) on kernel 4.x and Python 3 but working out the small bugs
134-
continues on Python 2.7 and kernel 3.13.x.
132+
testing (on my side) on kernel 4.x and Python 3 but unit testing confirms
133+
functionality on Python 2.7 and kernel 3.13.x.
135134

136135
### b. Install from Package Manager
137136
Obviously, the easiest way to install PyRIC is through PyPI:
138137

139-
sudo pip install --pre PyRIC
140-
141-
Note the use of the '--pre' flag. Without it, pip will not install PyRIC since
142-
it is still in the developmental stage.
138+
sudo pip install PyRIC
143139

144140
### c. Install from Source
145141
The PyRIC source (tarball) can be downloaded from https://pypi.python.org/pypi/PyRIC
@@ -366,6 +362,9 @@ Extending PyRIC is fun and easy too, see the user guide PyRIC.pdf.
366362
+ device_details.py display device information
367363
- tests test folder
368364
+ pyw.unittest.py unit test for pyw functions
365+
- guide User Guide resources
366+
+ PyRIC.tex User Guide LaTex
367+
+ PyRIC.bib User Guide bibliography
369368
- setup.py install file
370369
- setup.cfg used by setup.py
371370
- MANIFEST.in used by setup.py
@@ -400,7 +399,4 @@ Extending PyRIC is fun and easy too, see the user guide PyRIC.pdf.
400399
+ docs netlinke documentation/help
401400
* nlhelp.py nl80211 search
402401
* commands.help nl80211 commands help data
403-
* attributes.help nl80211 attributes help data
404-
* res User Guide resources
405-
- PyRIC.tex User Guide LaTex
406-
- PyRIC.bib User Guide bibliography
402+
* attributes.help nl80211 attributes help data

RFI

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,4 @@ dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
114114

115115
phy <phyname> set txpower <auto|fixed|limit> [<tx power in mBm>]
116116
Specify transmit power level and setting type.
117+

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
1) overall
22
o make a cli as well
3+
o determine if rfkill issue is related only to ubuntu
34
2) libnl.py
45
o see (1) in RFI
56
4) pyw

__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# root Distribution directory
1+
# PyRIC root Distribution directory
2+
# Do not import from this directory i.e from PyRIC import foobar
3+
# use pip to install or import from pyric

examples/device_details.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python
2-
""" device_details.py
2+
""" details.py
33
44
Example for displaying device details
5+
56
"""
67

78
import argparse as ap
@@ -67,7 +68,7 @@ def execute(dev):
6768
try:
6869
dev = args.dev
6970
if dev is None:
70-
print "usage: python device_details.py -d <dev>"
71+
print "usage: python details.py -d <dev>"
7172
else:
7273
execute(dev)
7374
except pyric.error as e:

examples/pentest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
""" pentest.py
33
44
Example for setting up a wireless environment - must be done as root
5+
56
"""
67

78
import argparse as ap

0 commit comments

Comments
 (0)