SMS/USSD Content Retrieval - database

Hi guys
I'm working on this project where I'll need to retrieve information from a database through sms/ussd, much like how you would check you credit on you mobile phone.
Would appreciate any help to head me in the right direction.
(Hope I put my question out clearly, if not ask me so I can clarify)

I can help you extensively in solving your problem. As far as I got understood what you want to achieve is, perhaps that when a SMS message comes to your GSM Modem or GSM Phone, your software should be capable enough to interpret that message according to your protocol and should respond accordingly, also when it needs to process database. This is absolutely possible. Let me describe it in brief. Following are the general steps:
You must connect your GSM Phone or Modem through your software with a particular COM port.
After assigning and configuring the port, You issue AT+CNMI=2,2,0,0,0 command to Modem, if it responds to OK, then it indicates that it supports this command, else an error is generated.
Now send an SMS from some other phone, you will see that the SMS directly goes to your software, now you can process it as per your needs.
The whole process is slightly a lengthy description, but it is possible.

Related

Is there a way of "extracting" communication protocol from an old software?

I have an obsolete hardware level/pressure transmitter that communicate with mcu using custom protocol (it appear to be similar to modbus RTU), that hardware comes along with an old commissioning software that works perfectly fine under latest windows, that software contain all communication protocol components that I try to extract and use in something like Arduino to pull data out of transmitter, anyone can help out?
Update - Didn't mentioned above that form of communication here is half-duplex serial communication where master hardware/software query slave transmitter.
Now mentioned to program Arduino mcu to pool data out of transmitter.
What best way of getting readable data out of it?
Again many thanks for all your comments and help!
What you need is called a sniffer. Use that as a keyword and you should be able to find plenty of info here at SO and around the web.
To set the record straight it is actually possible to use Wireshark to sniff on Modbus RTU over serial, see my answer here. If your protocol is similar to Modbus I would start with SerialPCAP.
If you prefer more Windows-friendly solutions you can check these out: 1, 2.
Since Modbus is pretty simple I would say reverse engineering a similar protocol should be, maybe not a piece of cake but just manageable, even if you are not very experienced.
These days when almost everyone is a maker or at least a wannabe, you might want to first take a good look around, maybe somebody else already reverse-engineered that protocol and published it somewhere.
The best tool to analyze a protocol is Wireshark. Run it on the communication link between the Windows machine and the radar. First possibility: the protocol is actually something that Wireshark knows (some trials and errors with the "Decode as" menu may be necessary.) Second possibility, less funny: the protocol is indeed completely proprietary and unknown to Wireshark. At least, Wireshark will make it easier to examine the binary data.

How to make openflow switch capable of marking informations on the id field of ip packets?

I'm still a beginner in SDN and all that comes with it (openflow, mininet, opendaylight...) and so if I say a mistake, please excuse my ignorance.
So my request is about marking ip packets by openflow switches: I want to intercept packets coming to switches (by iptables that will send packets in a nfqueue queue) so that the switch can then mark them with its own information (identifier, distance from destination...) on the id field of an ip packet.... this information is then collected by the destination to reconstruct the path taken by the packet.
How can I enable a switch to mark packets like this? what commands should I execute? what language to implement the process? Where should I access it?
knowing that I have already implemented in C the marking process that works well in the traditional network (I tested it in a quagga router). can this code be useful to me for something in the mininet switches?
then if I don't use mininet, can OVS switch do the job? how?
Sorry, if I hadn't been more specific, but in anyway I'm here to answer any questions. I hope you can help me clear the way to get started.
Thank you.
I will recommend you to use Ryu controller (a python based SDN controller). Regarding Queuing, packet marking and MPLS, you can check the chapter 12 QoS from the Ryu Book. There are detailed examples there. I hope it will work for you.
if you manage your switches with OpenDaylight, then you don't want to use iptables.
you can use the openflowplugin to write flows to the switch to do all you want. I
think you can have a match-all kind of flow that will have the action you require
to "mark ip packets".

Sending smtp email from microcontroller

This may not be in the right location, so tell me and I'll move it.
I am a recent EE grad and I was hired to build a system that exists on a SoC with a simple 32-bit processor. The system basically monitors several external devices and performs some DSP on it, and then is supposed to send the results using a WiFi device (in my case I have the ESP8266 using UDP) to an email server for logging/notification.
I have been trying to find a library that I can use, but my uC can only program in C and I have it set up for UDP, and everything is in C++ using some other protocol, or something else completely.
I am great at DSP, decent at SoC's and uC's, but when it come to this email server communication thing I am at a loss.
I have successfully configured everything for the sensors, the datapath, the DSP, and connected the system to my WiFi via UDP, but I have yet to figure out how to send data to any servers.
Could someone help me understand how I should go about this?
I have looked into some simple SMTP commands such as HELO, MAIL, RCPT, DATA, etc. but I cannot understand how I actually should implement them in my code.
When I send out the WiFi data via UDP what type of data do I send and how do I format it? Do I need to send any other kind of flags? How should I expect the response? I also know the data has to be transformed into base 64 which is confusing me further.
I am also not super familiar with UDP to begin with, I have been using libraries that are part of the SoC's default library to connect to my WiFi.
I know these may either seem like obvious or stupid questions but it is were I no longer have any knowledge, and everything I find online doesn't make sense, or doesn't attempt to explain it, just gives a pre-made solution
I have found the RFC2821 but it doesn't get any clearer.
I know that's a lot but any help at all would be a lifesaver!
Since you are asking this question, I'm assuming that you are not booting and running an OS suitable for micro-controllers such as an embedded variant of Linux or such. If you were, you would simply be able to take advantage of possibly built in applications or other existing code.
But you don't mention having written an Ethernet stack, so are you using some other library or operating environment which might have some of the functionality needed for an implementation of SMTP?
If you don't and really do need to write your own SMTP client to run directly on the processor you are using, then you should be able to find plenty of examples of source code for this. A quick google search of How To Write an SMTP client showed a few articles with some example code. One article seems to be an exact hit, but you need to look at it further.
However, I would highly suggest just sitting down with a telnet client and connect to an SMTP server you are allowed to use and try the commands you need to just send a message. If you only need to send text, you don't need to get involved in MIME encoding or anything like that.

Receive data from Audio jack in windows phone

I wasn't sure if this questions belongs here, but I'm completely new to this topic so hopefully you can help me out.
I have some kind of hardware which will be connected to my windows phone (wp7/wp8) through the audio jack. It sends some data in an audio format. I would like to retrieve this data through code. How can I do this?
Any source code or samples would be appreciated.
I wanted to post an answer so I could elaborate on my comment.
The problem with what you're trying to do is that the jack on Windows phones is an output jack. I haven't seen any that support microphone input. This means the jack is meant to generate a signal, but never to receive one. That means that you would never be able to attach a device and send audio data into the phone through that jack. It's completely missing any hardware that would allow you to interpret what you send into it, and honestly you risk frying the jack or worse, the phone itself.
Perhaps the best course of action would be to look at different ways to push that audio data into the phone. I can't really guide you on that because it's a very open course of action that depends on your specific needs.

Establish direct peer-to-peer Wi-Fi communication between laptops

TL;DR available at the bottom
I've been trying to figure out a way to get two laptops (both running Ubuntu) to be able to pass basic messages back and forth without the need for them to be connected via a wireless network,either by an AP or ad-hoc. I want to reiterate here that ad-hoc networking is not what I'm looking for, I've seen many similar questions here with that as the answer.
I guess what I'm asking is: how do I achieve this? All I really need is for one computer to be able to send a packet, and then for another to pick it up via a packet sniffer of some kind.
Currently: I have both laptops in monitor mode (via a mon0 interface created from aircrack-ng's airmon-ng)so that they can sniff nearby traffic (with Wireshark, tcpdump,tcpcump.org's sample libpcap code, and opening a raw socket and just printing out all the packets. I tried each just because I thought one could be doing something differently/leaving something out). I also have a very basic program that consists of opening a raw socket to send crafted ethernet frames out to the air, but I can't get my two machines to see the other's packets. The sniffer running on each machine can only see the packets going out of that machine (in addition to nearby beacons/control traffic from wifi in the area).
Some things to note that might be important are:
-the packets I'm sending out appear in Wireshark (only on the sending machine) as malformed 802.11 packets (probably because I'm just filling them with junk data for now). I was under the impression that my other laptop would also see them as malformed packets, but it gets nothing
-the sockets I'm using are from a call to socket(PF_PACKET,SOCK_RAW,ETH_P_ALL). Raw sockets are something I just recently was aware of, so I could be misunderstanding how they work, but my impression is that I can craft a layer 2 packet by hand and ship out straight out to the wire/air.
If you're curious as to why I want to do something like this, it's part curiosity, part research for a project I'm working on. I want to streamline / automate the process of setting up an ad-hoc network, and what I'm trying to do here is for the laptops to do a small exchange to figure out the specifics of the adhoc network they are about to create and then make/join that network automatically, instead of either one person explicitly setting up the network OR having both people pre-decide the name, etc of the network and have both computers constantly trying to connect to that specific one.
I'm more interested if I'm going about this process in the right way rather than if my code works or not, if someone thinks me posting my (very basic, taken from another post on Stack Overflow) raw socket code will help, I can.
Edit: I am more than happy to post a complete set of code with instructions if I can get this working. I couldn't find much helpful info on this topic on the internet, and I'd love to put it up for future people trying to do the same thing.
TL;DR I want to send out a packet from one laptop and pick it up on another via a packent sniffer of some sort. No wifi network or ad-hoc network involved. Something akin to spoofing an AP's beacon frame (or similar) for the purpose of sending small amounts of data.
Edit 2:After some thought, perhaps what I'm looking for is some kind of raw 802.11 use? Having direct control of the wifi radio? Is such a thing possible?
I found out I was able to send packets out through my monitor mode interface as long as I had correct 802.11 with radiotap headers. I think the problem I was originally experiencing (not being able to sniff the packets) was because they were malformed and thus not actually getting sent out.
I was able to accomplish this by adapting the example code found here, courtesy of someone named Evan Jones, except I did not need to use an Atheros based card or Madwifi drivers, everything worked fine with the mon0 interface created with aircrack-ng.
I am certain that Apple Mac do this. Apple call it 'bonjour'. There may well be a proper IETF spec for it. This is an Article on Bonjour this is Wikipedia on an open component of bonjour which might help get you moving.

Resources