1

When I receive MMS via gammu it comes over with binary hex code:

Location 100010, folder "Inbox", phone memory, Inbox folder
SMS message
SMSC number          : "+12063130055"
Sent                 : Fri 14 Dec 2018 09:43:16 AM  -0600
Class                : 1
Coding               : 8-bit
Remote number        : "2300"
Status               : Read
User Data Header     : User UDH

8 bit SMS, cannot be displayed here

(hex: 83687474703A2F2F74746E6D6D736765742E6D73672E656E672E742D6D6F62696C652E636F6D2F6D6D732F776170656E633F543D6D61766F64692D362D3133622D38362D312D39632D36363065306366)

When I put the hex code into a hex decoder like: http://www.convertstring.com/EncodeDecode/HexDecode it translates to the following url:

http://ttnmmsget.msg.eng.t-mobile.com/mms/wapenc?T=mavodi-6-13b-86-1-9c-660e0cf

However, when I put this url into a browser it takes me to a blank page. Any idea what could be wrong?

gatorreina
  • 864
  • 5
  • 14

1 Answers1

0

The response from the resulting URL returns a Response Code 308 Unknown, which redirects to the secure https version of the url; upon getting redirected I received a 400 Bad Request:

HTTP/1.1 400 Bad Request
Warning 299 GBA "Generic Bootstrapping Architecture (3GPP TS 33.220) support is required to access the requested resource"
Content-Length   0
Content-Type     text/html; charset=UTF-8
Connection       close

In order to have anything appear you'll need to send the correct headers on the GET request, since the resulting message is displayed. Hopefully that information can steer you in the right direction.

l'L'l
  • 44,951
  • 10
  • 95
  • 146
  • 1
    It requires that your device is authenticated: https://en.wikipedia.org/wiki/Generic_Bootstrapping_Architecture – l'L'l Dec 14 '18 at 17:42
  • Thank you for the replies. When you say device must be authenticated isn't that impossible since the device I am trying to access the page from is a browser on a computer and not the device itself which is a GSM usb modem that is incapable of displaying an MMS or anything for that matter? – gatorreina Dec 14 '18 at 22:08
  • 1
    It’s not impossible since any [3GPP](https://en.wikipedia.org/wiki/3GPP) capable device has the GBA protocol built-in (including GSM devices). There is a way to authenticate via PC through the device if you use an application or browser/extension that can interface with it. – l'L'l Dec 15 '18 at 07:05
  • When I do wget --bind-address=IP.OF.MO.DEM http://ttnmmsget.msg.eng.t-mobile.com/mms/wapenc?T=mavodi-6-13b-86-1-9c-660e0cf it does download a fairly big file with no extension: wapenc?T=mavodi-1-13b-db-1-9d-3fcf1b8 . When I do: file: wapenc?T=mavodi-1-13b-db-1-9d-3fcf1b8 I get: wapenc?T=mavodi-1-13b-db-1-9d-3fcf1b8: DOS executable (COM) Any idea if I ma getting closer or father from obtaining the image sent in the message? – gatorreina Dec 15 '18 at 20:44
  • 1
    I think you are getting closer; without seeing the file you are referring to I can only speculate what it might be composed of. In the past MMS returned from the gateway are `SMIL` messages up until the magic number (`FF D8 FF` in hexadecimal) which signifies the start of the `jpeg` image. If you truncate everything before that point and save the remaining file as `.jpeg` you might find the result you are looking for. – l'L'l Dec 16 '18 at 21:50
  • Yes you are exactly right it is an SMIL message/file. However, although I have downloaded a couple of them and they seem to be exactly what are described here: https://bugs.launchpad.net/ubuntu/+source/ofono/+bug/1360403 I cannot find the sequence FF D8 FF (jpeg magic number) so I am still lost. – gatorreina Dec 16 '18 at 22:05
  • 1
    [This post](https://stackoverflow.com/a/13014037/499581) has a few good tips on how to identify what section in the `SMIL` your image might be according to it's MIME type, etc. There's also a nice guide on [file signatures](https://www.garykessler.net/library/file_sigs.html) that could help also; there's probably already some type of parser out there already that might accomplish what you need. If you want to post an example of the MMS somewhere I'll try and take a look when I get a chance. – l'L'l Dec 17 '18 at 02:49
  • Thanks, the file should be accessible here: https://wetransfer.com/downloads/2d64b2fab5eeada6f34c3cbc8b596fa720181217205049/1c30cd – gatorreina Dec 17 '18 at 23:23
  • 1
    So the image file is from `FF D8 FF` (hex offset `00000290`) until the end of the file; In `bash` you could use the following commands to extract and save the image: `xxd -c1 -p wapenc\?T\=mavodi-6-13b-1f-4-7c-4806803 | tr "\n" " " | sed -n -e 's/.*\(ff d8 ff .*\)/\1/p' | xxd -r -p > image.jpeg`. Another way you could extract the image is to simply remove everything before `FF D8 FF` and save it as a .jpeg — only the information for the image should remain afterward... – l'L'l Dec 18 '18 at 02:25
  • I am confused because I do not see ff db ff. I do however see \377\330\377\340. I am trying to split the file there so that the second part becomes the jpeg and the first part information about the MMS message, but regex does not see the characters \377\330\377\340 although I can see them when I open up the file. – gatorreina Dec 19 '18 at 01:35
  • 1
    How exactly are you viewing the file and/or attempting to truncate it? The command I supplied worked without issue for me on the file you linked ( you shouldn’t need to change anything ); the .jpeg was saved. Try opening up the file in a hex editor and you’ll clearly see the bytes `FF D8 FF` at offset `00000290`. **Note**: the second byte is `D8`, not `DB`. – l'L'l Dec 19 '18 at 03:24
  • I open the file in emacs to look at it. Nevertheless, your command works perfectly and I may end of incorporating it into my perl script -- although doing so with the system() operator is a bit difficult since the command has so many attributes, might need to use backtics. My, initial approach was to try to split up the file but that may not end up being the way to go. It's a work in progress at this point. – gatorreina Dec 19 '18 at 13:43