Find wifi enabled devices [stations] around [closed] - wifi

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 days ago.
Improve this question
Imagine this situation that there are some smartphones and computer around with their WiFi adapter (wireless adapters) on, but not necessary connected to a network.
Is there a way to look the MAC addresses via a Linux machine?
Any insights are appreciated.

Disconnected clients aren't always silent. In fact, more often than not, clients send out directed and broadcast probe requests searching for access points they have connected to previously, thus revealing their MAC addresses which can be displayed through airodump-ng or by filtering capture packets in Wireshark to display probe requests.
This is the suitable Wireshark filter:
wlan.fc.type_subtype eq 4

Old question, but i'll have a go anyway.
Wifi enabled devices usually send probe requests to try to find Access points they previously have been connected to, even when they are nowhere near them.
If you're using backtrack/kali linux, try this:
Create a wireless adapter alias running in monitor mode (assuming your adapter name is wlan0):
airmon-ng start wlan0
Start scanning for devices and access points:
airodump-ng mon0
The access points will be listed first with their Mac addresses under "BSSID", followed by the devices which will have their MAC addresses listed under "STATION" and a "not associated" flag under "BSSID" if they aren't connected to an access point.

Related

Nat Punchthrough understanding P2P concept [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 4 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
So, i have been reading up on NAT-Punchthrough. I seem to be getting the idea, but i have a hard time implementing it, and i feel that i am missing a step here.
Testing this functionality is kind of hard because i have little control over the environment when it comes to a internet based connection.
I have a SQL server to run as my "facilitator" it keeps the external address of both server and client, and their port as seen by the outside.
Here are steps so far:
- I connect to my SQL server through a web request (PHP script) that stores server/client IP/PORT
- When both are known, both client and server attempt connecting (server hosts on a set port, client connects over a set port)
- Nothing significant happens
There are 2 unknowns here, and i would like to check one with you.
Is it true that NAT-Punchthrough requires that i do the first step with the exact (internal/LAN) port i plan to connect with in the step after that?
If so, i don't know how exactly my server works underwater, so it might need more ports then my initial given static port to connect over, but that at least gives me a hint.
If anyone has more documentation on this then me, please let me know.
Sources:
Programming P2P application
http://www.mindcontrol.org/~hplus/nat-punch.html
NAT punch through works on the principle of educated guesswork. It is usually used to create connections with devices that do IP Masquerading. This is the technology used in most home internet modems to the point that NAT has become interchangeably used to refer to IP Masquerading.
When you connect out from a device which is behind a NAT system like a home modem. You have no control of the port that will be used for the outbound connection to the Internet. However many of these devices allocate ports using specific patterns. For example, incremental numbers.
NAT punch through involves trying to directly connect two source systems that are both behind independent NAT devices. A third system, your "facilitator" acts as a detector for the origin port numbers currently being assigned by both NAT devices on outbound connections. The origin port number, along with the IP address is then sent to the other parties.
So now the clever bit to answer your question. Both systems that want to directly connect, start trying to communicate to the other. They try connecting to a range of ports, around the known port number detected by the facilitator. This is the guesswork.
It is important that both source systems start trying to connect as this will establish NAT sessions in the local devices that allow traffic from the Internet in. If either source device correctly guesses one of those NAT session port numbers, then a connection is established.
In reality, engineers from organisations that have use for NAT punch through have probably spent some time examining the more popular NAT port allocation algorithms and tuning their software. If you have control of connections through your NAT devices, then it would be fairly easy to set up some tests and see how the port numbers change between connections to different servers.

How to set wifi to Android Things without an ethernet cable or adb [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I'm interested in knowing how to set the first wifi on android things (not android phone) without access to a network cable, for a fresh install.
There certainly must be a way to put the information in the SD card right after copying the OS image. If that can't be done directly, worst case scenario I would expect it should be possible to write a script and copy it somewhere into some of the partitions and have it automatically run at boot (which can be handy for other things). Unless the image is signed?
I would also be ok by writing an app that could be copied to SD card before first boot that would be auto-installed and do that thing for me. I would know how to write the app, but so far I don't know how to do the copy/autoinstall/autorun thing.
I would also be ok having one device connect to network and configure wifi, then clone its SD card into another one.
What really gets in my way is having to get a network cable every time I prepare a new SD card.
You should be able to add your wifi configuration at the end of /data/misc/wifi/wpa_supplicant.conf.
network={
ssid="SSID"
key_mgmt=WPA-PSK
psk="PASSPHRASE"
}
This should be located on the data (ext4) partition of the sdcard (for me /dev/sdb15)
You can use:
adb connect Android.local
to connect to Android Things PC (Raspberry PI3) and then just set up your WiFi like described in Android Things tutorial:
$ adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect \
-e ssid <Network_SSID> \
-e passphrase <Network_Passcode>
https://developer.android.com/things/hardware/raspberrypi.html

Intercept serial port data in Delphi [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I know how to comunicate over serial port using TComPort, but I'd like to view the data going in and out a virtual (USB<=>RSR232) COM port without interupting the transmition and (obviously) opening the port. To be precise I want to see the GPS data from the USB GPS receiver.
The thing is that I need to apps using the same data at the same time. My Delphi app and the navigation software. The alternative would be to have the decent PC navigation software with Europe maps (open street map would also be fine, but can't find any decent car navigation software) that has good API whci can return the GPS position.
Any ideas are welcome! :)
Thanks!
G.
Use the com0com device driver in conjunction with hub4com.
From documentation:
In conjunction with the com0com driver the hub4com allows to
handle data and signals from a single real serial device by a number of
different applications. For example, several applications can share data
from one GPS device;
Example:
GPS hub
You have a GPS device that connected to your computer via a physical COM1
port and you'd like to handle its data by two GPS applications. You can
do it this way:
With the com0com's Setup Command Prompt create COM5<->CNCB0 and
COM6<->CNCB1 virtual COM port pairs (see com0com's ReadMe.txt for
more info). For example:
command> install 0 PortName=COM5 -
command> install 1 PortName=COM6 -
Start the hub4com.exe on COM1, CNCB0 and CNCB1 ports:
hub4com \\.\COM1 \\.\CNCB0 \\.\CNCB1
It will send data received from COM1 port to CNCB0 and CNCB1 ports
and it will send data received from CNCB0 port to COM1 port.
Start the GPS applications on COM5 and COM6 ports.
You can use PortMon utility by Mark Russinovich
Advanced Serial Port Monitor can monitor USB COM port too and works on Windows 7,8 64 bit.
http://www.aggsoft.com/serial-port-monitor.htm
Note: you should use the SPY mode in ASPM.

How to make my laptop an App server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I developed an internet-based IOS app,and my app communicates with the server through html requests.
It works perfect when I test it locally. But when I test it through the internet,it seems the html requests can't be received by the server.
I am using my Mac Pro as the server ,and the laptop is connected to the internet via the same wifi as the my iPhones.
So,how can I make a laptop connected to internet via wifi an server?
There are a lot of complications to making something available on the internet from a home machine, and it's not clear from your problem statement where the problem lies. Here are some of the most common gotchas:
Check that the server is accessible from another computer on the same local area network as the server (leave the iOS device out of it at firs - if not, the server is misconfigured. Check firewall settings on the server.
I understand that you want this accessible from devices outside the local area network (ie, you want it to be usable from anywhere, not just your home network). For this, you must configure your router to forward the appropriate port (probably 80, depending on the server software you're using) to the server. This is called "Port Forwarding" or other similar names (depending on the router manufacturer); consult the documentation for your router for information on how to enable it, as the process varies between make and model. Note that some ISP's supply a cable/dsl modem that has it's own firewall in it (for example, comcast business class does this), so you may also have to set up port forwarding on that as well.
You need to specify the external IP address of the server (you can use whatsmyip.com or similar to find it) when connecting to it over the internet, not the LAN IP.
As everything is working locally, the problem is located in the device linking your laptop to the internet : your internet box.
By default, when it receives request from outside, your box will reject them, because this is a security risk (it could allow anyone to access your private network server, and if there is a security breach in a member, this could be a real problem). Moreover, your box has most of the times more than on device connected, so how can it know which device the request it gets is for?
Luckily, there is a way to tell your box "Hey! If you receive a request on this port, forward it to my laptop!". It is called port forwarding. This is quite difficult to explain as every ISP has a different implementation of this. But to set this, you have to connect to your box's administration interface and look for the section related to port forwarding.
Once you're there, you will have to set the port (if you run an HTTP application, it is 80 for example), a protocol (use both in doubt), and finally the destination IP. This is the IP of your computer on the local network. You can get it using ipconfig on Windows.
Once you have set your forward rule, you should be able to acces your app from the internet using either a Dynamic DNS service, or your Internet address, which you can get from websites such as http://www.whatismyip.org

Which high-level API shall I use for managing UDP sockets on iOS? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
In the chapter "Using Sockets and Streams" of the "Network Programming Topics Conceptual Guide", Apple says:
Note: POSIX networking does not activate the cellular radio on iOS.
For this reason, the POSIX networking API is generally discouraged in
iOS.
Also in the chapter "Networking Tips and Pitfalls" of the "Networking Overview Guide", Apple says:
In iOS, using sockets directly using POSIX functions or CFSocket does
not automatically activate the device’s cellular modem or on-demand
VPN.
Okay, so on iOS one should neither use POSIX sockets nor CFSocket, which is just a thin wrapper around POSIX sockets which supports asynchronous networking via RunLoops. No problem. But what API should you use, if you need an UDP Socket?
Further Apple says in the the Chapter "Networking Tips and Pitfalls" of the "Networking Overview Guide":
Avoid Resolving DNS Names Before Connecting to a Host
So ideally there should be an API for managing UDP Sockets, other than POSIX API and CFSocket, which accepts DNS names instead of IP addresses for the destination address.
Maybe I'm blind but I'm unable to find any such API. Any ideas?
Using any third party API (not from Apple) is not interesting, since such an API must base on either Apple API and in that case I can use this Apple API directly. Writing my own wrapper API around POSIX sockets is piece of cake, I've written so many sockets wrappers before, I already know all the nasty pitfalls. Yet I shall not use POSIX API, which is the initial problem here.
I asked Apple exactly the same question and their reply is more or less that there isn't any high level interface for UDP sockets. Regardless of what Apple says in their guides, when using UDP, either use POSIX sockets directly, in combination with an async manager like poll() or select(), or create a POSIX socket (maybe use bind() and/or connect() on it as required) and then wrap it into a CFSocket object using CFSocketCreateWithNative() to get RunLoop integration. This is the best API that exists. All higher level APIs are designed to be used with TCP only.
was attempting the same thing and although the docs say that lower level APIs will not activate the cellular radio and on-demand VPN, turns out its not entirely true for TCP connections.
In the case of UDP, this holds true and your UDP packets don't get sent most of the time. To solve this, just open up a listening socket for TCP using the lower level APIs and this will activate the cellular radio or on-demand VPN and close the socket once you are done.
For TCP, you can use the low-level APIs for server side code on iOS devices and this DOES activate the cellular radio or on-demand VPN but for client side code on iOS devices, it is preferable to use higher level APIs that have been provided. Either way, the radio is active and you don't have to worry about packets not being sent.
BTW, this is what I am currently doing.
Apple has a sample code describing how to use UDP.
Have myself not tried it, but this should give you some good pointers:
https://developer.apple.com/library/mac/#samplecode/UDPEcho/Introduction/Intro.html
Since 2018 Apple has introduced Network Framework which according to Apple is a modern alternative to Sockets and includes high level APIs for managing both TCP and UDP connection

Resources