How To Monitor Network Activity From Within App? - iphone

I'm trying to monitor network activity on my iPhone from within an app I'm developing. Does iOS support a netstat-like command or something similar that can tell me what what inbound and outbound connections are active ?

After some searching I found Apple's code used for netstat.
Everything you need in the void protopr(uint32_t proto, char *name, int af) function.
I tested on the device and sysctlbyname("net.inet.tcp.pcblist_n",...) works.
That should be all you need.

I can't test this but from what I gather you will have to use sysctl in combination with sysctlnametomib or alternatively sysctlbyname for this:
sysctlbyname("net.inet.tcp.pcblist", ...)
and/or
sysctlbyname("net.inet.udp.pcblist", ...)

You can use burp suite for this purpose , By this you can inspect all the http data going through your phone.
You have to install this in your mac/ubuntu/windows machine, and then create a proxy server with help of this tool and then modify your wifi setting in iphone/android phone to use your pc as proxy , and then it will capture all the input/output traffic.
Read full instruction here -
http://www.engadget.com/2011/02/21/how-to-inspect-ioss-http-traffic-without-spending-a-dime/

Related

Simple Localhost Server in Xcode/Swift?

I am making a macos app in XCode, and I was wondering if there was a way to make it host a local server that is visible across the network.
I am trying to find a way so that it would host something on the devices's network with it's hostname/ip address, so if someone goes to http://hostname:5000 they would be able to see the response, and the app would be able to see the request, just like how hosting a local python server works. Is there any way to do this in XCode with Swift?
For example: the user presses 'start server' on their screen. The server is hosted across the network. Anytime a request is made to it, they get a notification.
Just to make you concern you may find some sample codes, including local web server inside the app.Few of them I found are:
https://github.com/ooper-shlab/MyWebViewApp-Swift
https://github.com/depoon/SwiftLocalhost
The main thing is it's just a public
, experimental code, so it's not simple, not easy to adopt, not all coding best-recommended, far from readable and may have severe bugs.But you can use it as a working example and take any parts of it into your app.

Python- ARP Scan without scapy

I want to write ARP scanner in python without using scapy. I know it's easy to perform arp scan using scapy but I don't want to install winpcap/npcap.
Is there any other way to do it?
Short answer: No. see https://stackoverflow.com/a/395921/5459467
It is a Windows restriction not to allow access to the layer 2. All you'll have is a copy of the header if you set the options correctly, but it won't allow you to send ARPs.
Winpcap/Npcap works around this by adding a driver below the basic API, where access to level 2 is possible.

How can I test my code changing registers of MAX30003 in movesense?

I want to test if the code for changing register settings in MAX30003 on MAX-ECG-MONITOR works.
Checking it via PC Simulator: Is that even possible?
Checking it, when firmware is already on the sensor, with wbcmd or adbBridge. Unfortunately, I dont have programming jig so I would like to know how I can use Adb Bridge to read/write the register settings.
I already tried the following code:
adb shell am broadcast -a android.intent.action.MOVESENSE --es type get --es path Component/Max3000x --es value ''''''
There must be some --es settings to get the register value for the right adress, as described for wbcmd
PC Simulator is not possible since it doesn't simulate the MAX30003 chip.
The Component api of MAX30003 contains a resource /Component/MAX3000x/Register that can be used to read & write the registers of the MAX30003 chip while it's running (I'm not fluent with adb-bridge to know how the API is accessed using that).
Just some words of warning about going this route: The API in question is "non-public" API, i.e. it is possible that it will not work, it will change or it will disappear in future software versions or Movesense sensor hardware revisions. If there is something specific you need that is not part of the /Meas/HR or /Meas/ECG API's, it is a good idea to create a Request in the bitbucket issues.
Full Disclosure: I work for the Movesense team

PJSIP via CLI on Raspberry

I am new to Raspberry and VOIP. I am interested to make a door intercom system using raspberry, as I read most of the post here and those are really helpful,one of the raspberry is acting as server (Asterisk and PBX). I was able to call using sflphonebut that was only for desktop mode and I am interested to call using CLI and for that I installed "PJSIP" as reffered by most of users, but don't have any idea what to do next (I mean how should i start). As it is written after installation I am supposed to try for "pjsua" and "pjsystest" in pjsip-apps/bin, but it doesn't ring any bell for me.
Sorry for my level as beginner but if you don't begin how are you supposed to masters it.
I shall be very thankful.
so i can't explain all of the stuff you need to know, but with this Site you should be able to register to you PBX. It's an documentation to the high level API of PJSUA. If you go further on that site they will lead you through the things you have to do to establish a call.
Although this can be very frustrating because there are many error that can appear. There are some python test application under pjproject/pjsip-apps/src/python/samples, here you should firstly try to establish a call between two clients to be sure you server is well configured.
Just for info, the dest_uri you have to give in the call.py is like so sip:ip:port and you have to change the values in the register.py to your client infos. Then run the register.py in one shell and the call.py in an other shell.
Hopefully i could help you over some barriers, feel free to ask if something was unclear.

GWT - How to detect if we are on the same machine as the server

I`m currently developing a gwt application on a embedded device (linux with touchscreen) the server and client is started on the device.
I want my client to detect if it`s on the device or not. Because some screen are not available when connecting remotely
You can make a call to the server first and check there if it was made from remote or local address. A response from server should indicate if show screen "A" or not. Hope this helps.
Deferred binding might be the answer. GWT MobileWebApp sample app uses it to discern the form factor of the target in FormFactor.gwt.xml. In essence you define a property and write a provider which determines its value. You then read the property and deliver the appropriate View (in the MVP sense).
BTW I am developing an app for a similar scenario and I'm thinking of reimplementing my solution: reading a URL query parameter which is only present in the browser on the embedded device. Not too awesome. The aforementioned example should allow better hiding of the embedded platform identifier.