BB
2 years ago
3 changed files with 167 additions and 38 deletions
@ -1 +1 @@ |
|||||
Subproject commit e3bbfed2c3548f815d740c9ae261329d708f6d9c |
|
||||
|
Subproject commit 990786c49eb008aaf82c0179a1944c8e2e0fd43c |
@ -0,0 +1,58 @@ |
|||||
|
# Quick Start |
||||
|
|
||||
|
## Starting the server |
||||
|
|
||||
|
On the server, run the following |
||||
|
|
||||
|
```bash |
||||
|
$ python3 -m venv .example |
||||
|
$ activate .example/bin/activate |
||||
|
|
||||
|
$ python3 NetGenieSrv.py |
||||
|
``` |
||||
|
|
||||
|
This opens three sockets: |
||||
|
|
||||
|
1. The bridge socket that listens for the phone to connect to. |
||||
|
2. An ``incoming'' socket to read packets sent from the device to the server |
||||
|
3. An ``outgoing'' socket to write packets from the server to the device. |
||||
|
|
||||
|
On the phone, connect to the server and port specified by the `-B` and `-b` arguments. |
||||
|
|
||||
|
This can be specified by changing the source code or using the following command-line |
||||
|
arguments: |
||||
|
|
||||
|
```bash |
||||
|
$ python3 NetGenieSrv.py -h |
||||
|
usage: NetGenieSrv.py [-h] [-B BRIDGE_IP] [-b BRIDGE_PORT] [-I IOIP] [-i INCOMING_PORT] [-o OUTGOING_PORT] |
||||
|
|
||||
|
options: |
||||
|
-h, --help show this help message and exit |
||||
|
-B BRIDGE_IP, --bridge_ip BRIDGE_IP |
||||
|
The IP that listens for NetGenie mobile app client connections. |
||||
|
-b BRIDGE_PORT, --bridge_port BRIDGE_PORT |
||||
|
The port that listens for NetGenie mobile app client connections. |
||||
|
-I IOIP, --ioip IOIP The IP that listens on the server for connections from whoever is debugging the phone. |
||||
|
-i INCOMING_PORT, --incoming_port INCOMING_PORT |
||||
|
The port that the person debugging will read packets from the device. |
||||
|
-o OUTGOING_PORT, --outgoing_port OUTGOING_PORT |
||||
|
The port that the person debugging will write packets to the device. |
||||
|
``` |
||||
|
|
||||
|
## Using the server |
||||
|
|
||||
|
```bash |
||||
|
$ ipython3 |
||||
|
|
||||
|
import NetGenieSrv as ngs |
||||
|
from scapy.all import * |
||||
|
ip = IP(src='10.10.20.1', dst='255.255.4.20') |
||||
|
tcp = TCP(sport=8080, dport=8443) |
||||
|
pkt = ip/tcp |
||||
|
a = pkt.build() |
||||
|
|
||||
|
insock, outsock = ngs.connectIO() |
||||
|
pktIn = insock.read(40) # Read a packet send from the phone |
||||
|
outsock.send(a) # Send a packet to the NetGenie client. |
||||
|
|
||||
|
``` |
Write
Preview
Loading…
Cancel
Save
Reference in new issue