RE env for inspecting APKs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. # Quick Start
  2. ## Starting the server
  3. On the server, run the following
  4. ```bash
  5. $ python3 -m venv .example
  6. $ activate .example/bin/activate
  7. $ python3 NetGenieSrv.py
  8. ```
  9. This opens three sockets:
  10. 1. The bridge socket that listens for the phone to connect to.
  11. 2. An ``incoming'' socket to read packets sent from the device to the server
  12. 3. An ``outgoing'' socket to write packets from the server to the device.
  13. On the phone, connect to the server and port specified by the `-B` and `-b` arguments.
  14. This can be specified by changing the source code or using the following command-line
  15. arguments:
  16. ```bash
  17. $ python3 NetGenieSrv.py -h
  18. usage: NetGenieSrv.py [-h] [-B BRIDGE_IP] [-b BRIDGE_PORT] [-I IOIP] [-i INCOMING_PORT] [-o OUTGOING_PORT]
  19. options:
  20. -h, --help show this help message and exit
  21. -B BRIDGE_IP, --bridge_ip BRIDGE_IP
  22. The IP that listens for NetGenie mobile app client connections.
  23. -b BRIDGE_PORT, --bridge_port BRIDGE_PORT
  24. The port that listens for NetGenie mobile app client connections.
  25. -I IOIP, --ioip IOIP The IP that listens on the server for connections from whoever is debugging the phone.
  26. -i INCOMING_PORT, --incoming_port INCOMING_PORT
  27. The port that the person debugging will read packets from the device.
  28. -o OUTGOING_PORT, --outgoing_port OUTGOING_PORT
  29. The port that the person debugging will write packets to the device.
  30. ```
  31. ## Using the server
  32. ```bash
  33. $ ipython3
  34. import NetGenieSrv as ngs
  35. from scapy.all import *
  36. ip = IP(src='10.10.20.1', dst='255.255.4.20')
  37. tcp = TCP(sport=8080, dport=8443)
  38. pkt = ip/tcp
  39. a = pkt.build()
  40. insock, outsock = ngs.connectIO()
  41. pktIn = insock.read(40) # Read a packet send from the phone
  42. outsock.send(a) # Send a packet to the NetGenie client.
  43. ```