Send/Receive WiFi traffic data - c#

Is it possible to monitor WiFi traffic and send data myself? My goal is to learn how to monitor probe requests, send deauth packets, and other operations similar to AirCrack and the other libraries found on the BackTrack os flavor.

You might have a tough time doing what you want to do in a Windows environment. If you poke around the Aircrack site a bit you'll see that the Windows version is pretty useless in comparison to its Linux counterpart, in large part due to the open source driver availability in Linux and the lack thereof in Windows. You can definitely packet sniff etc. ( http://www.codeproject.com/Articles/12458/SharpPcap-A-Packet-Capture-Framework-for-NET ) but you won't get the robustness that you can get out of a similar application in Linux.

I don't know about sending just random radio signals, but you can certainly monitor the traffic and data. Here is an article which describes how to do it.

AirPcap from Riverbed. USB adapter that can run in monitor mode and has an API for channel switching and more, and you can send Wi-Fi frames if you buy the right adapter. Wireshark has builtin support too. The Alfa cards are a good choice, but only for 'nix

Related

How to control my USB port using C# [duplicate]

This question already has answers here:
Power off an USB device in software on Windows
(5 answers)
Closed 9 years ago.
What I want to write is an application that would be able to access my USB port.
To control when to charge my phone and when not to. And perhaps with time I would like to extend the application to control light bulbs, fans and the television in my room.
I want to learn how to work this out rather than just copy some line of codes and paste. I wish for a quick and very simplified tutorial on this, I would be highly grateful (small language please, You all know am still learning :-)).
The exact job I want to achieve is just to make the port send out power when needed. That is it should be switched off and on using codes if possible.
It isn't possible to change the power status of a USB port from User mode code. It's not a .NET limitation, no user application can change the power status of a USB port. Actually, I think that the power state is controlled by the chipset itself and you can't turn it off without using a specialized chipset.
Besides, if your device short-circuited, you could burn your chipset and your motherboard.
The only (safe) solution is to use an external device that will control a relay to turn power on or off for your devices.
There are multiple answers to similar questions, eg Windows- Power off a USB device in Software
A good option is to use an external device like Arduino (or Netduino), .NET Gadgeteer or any number of external boards. Prices and capabilities vary of course.
If you want to build the device yourself, you can find numerous USB relays with a simple Google search
EDIT
Regarding serial ports, there is almost no relation at all between the two port types. Serial ports are not designed to provide power. You can use tricks to use a pin's voltage to power some external device, although this will lead to problems because there is not enough current to power most devices. Burning the chipset is another likely outcome.
A USB port on the other hand, is explicitly designed to provide power through specific wires which can't be controlled normally. This is why you can charge your phone from a desktop's USB port even if the machine has shut down.
EDIT 2: Sleep-and-charge ports
As Ben Voigt noted, not all USB ports allow charging while shutdown.
There are multiple port types that support charging. Charging ports provide more current than plain ports but shut down when the computer is switched off. Sleep-and-charge ports on the other hand can provide power even when the computer is off.

Java send messages over comm/serial port

Is there a way to send and receive messages over the comm ports on a computer using java? I have an arduino listening on a usb port for messages. I would like to talk to it via a java gui instead of the arduino processing gui. What are some ways i can achieve this? C# works too!
I wrote app for arduino in java using RXTX lib. You can read many tutorial both on RXTX home site and other. For example:
http://arduino.cc/playground/Interfacing/Java
http://rxtx.qbang.org/wiki/index.php/Examples
jUSB might be what you are looking for.
"JavaComm" works pretty well as long as you're on a supported platform (such as Solaris). Do you have operating system requirements?
I was just reading through this site and thought this little gotcha might bite you as you start experimenting. Basically whats happening is that the arduino resets automatically every time serial communications are initiated. This site describes the problem in detail and gives several workarounds depending on your skill and/or comfort level. Have fun hacking.
#GETah
I pretty sure that ardruino just uses serial through the usb port. It still creates a COM port through the usb connection to the ardruino.

Programmable Control of USB Device

I have used the LPT port before with a VB6 library called inpout32.dll. I'm much more familiar with that but it is not used in modern computers, such as laptops.
I need to control a device with on / off capabilities. This would have been very easy with LPT, but I need to work with USB and C# in this case. There are some USB2LPT cables out there on the market, but I read that they can't be programmed the same way.
Has anyone used those cables before? If yes, how can I work with them. Otherwise what are my alternatives?

Use USB to activate MOSFET/Relay

I am working on a personal project involving sending simple signals from my computer to a circuit via USB. Basically I am using the USB signal as the gate signal for a MOSFET which will in turn activate a relay to turn on/off various AC peripherals. For example if I want to turn on a light bulb for 5 seconds every minute I would be sending a 1 down the first wire for the first 5 seconds of every minute.
This is my problem: I have no idea how to manually send a 0/1 down a specific wire on a USB cable, or even interact with a USB port at all :(
So I guess there are multiple parts to this question, is it possible to interact directly with the bits being sent via a USB port? If so how would I do this? I am familiar with C++ and C#, so I really hope that you can do it in one of those...
Thanks!
edit Hmm so it looks like the USB port actually only has one 5V pin so direct USB interaction wont work. Going to take a look at a parallel adapter and get back on it.
USB is a bad fit for anything that doesn't have a USB interface at the other end of the wire. If you don't want to get into building your own USB device, I'd suggest buying a USB to serial adapter, which gives you two directly-controllable output lines (the flow control lines), or a USB to parallel adapter, which gives you more than 8 lines.
Chris Johnson's answer has a link to instructions for Windows serial port programming. You'll want to look at section 7 -- the SETDTR, CLRDTR, SETRTS, and CLRRTS are your flow control line toggles (for the DTR and RTS lines, respectively).
As far as hardware goes, a "1" (SET) value on a flow control line is +3 to +15 volts on the line, and a "0" is -3 to -15. Actual voltages can vary between devices; measure it to be sure. (EDITED; I got the 1 and 0 mixed up. The control lines use the opposite convention from the data lines.)
Here are Wikipedia pages for voltage characteristics and pinouts.
EDIT: Having done some more research on USB-to-parallel adapters, I don't think they will give the needed level of control. For best results, you'll need a PCI or PCMCIA parallel card, or a parallel port built into the motherboard.
I'm not a Windows programmer, but this library might be useful for controlling the parallel port's lines from Windows.
The easiest thing to do for this application is to use serial port emulation, either with a USB-Serial cable, or with a USB-Serial converter chip (e.g. the FTDI FT232) in your hardware device.
Either way, this allows you to interact with your USB device as you would a serial port (see, e.g. here for how to do this in C++ in Windows)
Much like Chris suggested, you can get a USB slave device from FTDI. $27 at digikey will get you a small board with all the fine wiring already done.
However, for your purposes the bit-banging mode described on page 39 of the datasheet would be much better than the UART mode (UARTs generate pulses at several kilohertz, you want to have the voltage stay at the level you set it to).
Hopefully your MOSFET will turn on with a 3V signal since the FTDI will put out approximately 3.1-3.2V for a high output.
Also, make sure you use the latest drivers from FTDI... a couple years ago they had drivers (WHQL-certified even) that caused frequent BSOD, and I've often found that driver CDs that come with hardware are several years out of date.
I built something very similar to what you are doing (I was running a car window motor from a usb device, used a mossfet H bridge (the HDR1X8 on the diagram) to drive the motor.). You need a USB to I/O device this is what I used (I got a U421, they fit perfectly over the center line of a breadboard, the 401 works well with breadboards too if you don't have a split one.
They give you a dll and you just link in to it with your code. its just as simple as making a call to WriteA and WriteB for writing out to your mosfet device. Be warned logic level lines are not meant to drive current so you will need to hook this up to a transistor if you expect any kind of medium to large current flow. See App1 in the application notes of the menu on the usbmicro site to see the proper way to hook it up.
Use a USB prototype board. It usually comes with a software SDK.
Check out these links from my web site:
1.You can use a usb to serial converter. All you need to know is here
2.You can use programming to access the usb directly but for this one you have to have a driver already installed for you device. Details are here

Getting started with writing a desktop app that talks to an iPhone

I'm thinking of writing an app to selectively transfer photos/music to and from my iPhone, mostly for fun and personal convenience. However, I'm stuck at the very beginning -- where do I look to find information on how to do this?
Pretty much every link I see talks about developing applications that run on the iPhone, but nothing about desktop app for interfacing with an iPhone.
I'm on Windows (no access to a Mac, but I'll take suggestions for that for when I eventually acquire one), and I'm most familiar with C#, but other languages are definitely an option.
Can anybody offer me a few pointers on getting started? Thanks.
Edit: to clarify further, I don't need information on how to write applications that run ON the iphone. There are plenty of resources out for that. :) What I'm looking for it some pointers on how to "talk" to an iPhone or an iPod through the USB cord, if that's even possible.
Edit #2: I found libmobiledevice library that effectively does what I'm talking about on Linux. I don't think I'm too keen on attempting to port it over to Windows, though. :)
I found what I was looking for: SharePodLib. Thanks, everyone.
I recommend and have used the following options:
Option 1:
Run a small and light webserver in the iPhone and of course, use HTTP to transfer. I recommend mongoose websever, i've tried it with very simple and very heavy load. Also here, you can find an actual drag and drop project to deploy this webserver in the iPhone.
Option 2:
Use something like Bonjour, this is something very useful if you want the "smart" discovery of your device in the network, maybe for opportunistic peer discovery. You can check here and here, to understand how to get bonjour to run in the iPhone and use it to exploit discovery and sharing.
Hope it helps!!
Unfortunately, there's no no way to sync an iPhone app with a Mac app over USB, at least in the current SDK. As already stated, you'll have to either sync over HTTP or use the local network. You might want to check out ZSync, a Cocoa library for bonjour syncing (I haven't used it, and it's in early development stages, but it looks interesting).
Unfortunately there is no officially sanctioned method to do what you describe. In Apple's view the only application that should have visibility of that information is iTunes. There are applications out there that appear to be able to do this, but I suspect they have reverse engineered the USB protocol and are thus open to being locked out if the protocol changes.

Categories