/nfoeihoefe4f5e7e5FR9

A intelligent Siri Proxy with multiple key storage and key throttling.

Primary LanguageRuby

#--------------------------------------------------
# The Three Little Pigs - Siri Proxy by Jimmy Kane
#--------------------------------------------------
# Author: Dimitrios Kanellopoulos
# Email: jimmykane9@gmail.com,
# Twitter: http://twitter.com/JimmyKane9
# Google+: http://gplus.to/jimmykane
# License: The GNU General Public License
#------------------------------------------------------------------------------------------------------
#It's based on  @kmsbueromoebel 's  proxy, a fork of https://github.com/plamoni/SiriProxy Plamoni's Siri Proxy.
#-------------------------------------------------------------------------------------------------------
# This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#----------------------------------------------------------------------------

--Version 0.5beta--

The Three Little Pigs siri proxy server is an intelligent server with key throttling and database connection.
For tutorial how to run and get started please refer to instructions.txt

Features:

-MySql Database connection support: Supports MySQL database connection for storing configuration,keys and runtime statistics.

-Multiple key support: You can connect more than 1 iPhone4S and store even more keys. The more the keys, the more the clients!

-Key Throttling: Each client uses a different key, if more than one Keys are available. The throttler makes sure that each Key is throttled thus enabling several client registration and assistant object creation.

-KeyLoad Safeguard: Never worry about how many people use your iPhone4S key. Each Key has a maximum keyload. Even when the key is still valid, if the keyload limit is exceeded, the safeguard disables the key and protects the iPhone4S from getting banned.

-KeyLoad Aware: Checks what key is not "Hot" anymore and periodically decreases the load, thus re-enabling Safeguarded Keys

-Web interface and monitoring: Always know what is happening without a CLI! With a web interface you can check statistics such as active connections, valid keys, server load, keyload etc.

-One certificate for all devices: Both Siri Capable devices (currently only iPhone4s) and older devices are using the same certificate and the same port (443 default for SSL)

-One instance of the server: Due to one certificate you can run only one instance of the server.

-Bug Free (I hope...):-) Never worry if the server has crashed. Most of the bugs that were causing the server to crash are fixed now.


Intro and how it works:

This server uses a very simple but clever and precatius tactic to server a larger number of devices and at the same time protects the key.
I editing and forked  @kmsbueromoebel 's server just  because Apple followed a very bad tactic. That was Siri assistant  software restriction to older devices, done only for marketing reason (my humble opinion).

So lets get to the point how does this work?

Step 1: 

Lets say two Siri Capable Devices (currently only iPhone4s) connect to server. The server saves the keys on the Database. 

Each key has assistantid,speechid, sessionValidationData,expired,keyload and date_added columns. Lets see what they are about:

assistantid - The assistant identifier. Unique for each device. In other words this defines your Siri and how it responds. eg. If I gave you my assistantid then Siri would get confused and sometimes respond to you with my nickname. Ugly.

Although it's stored on the database its not used. Each older device that connects on the server creates a new assistantid via using the sessionValidationData.
speechid - The speech identifier. Again unique for each device like above.

sessionValidationData - The most importand field and the only thing needed for using siri on older devices. These validation data is a big string that gets generated every 24 hours on Siri Capable Devices via FairPlayed. These validation data allow only a small number of assistant's to be created and are somehow linked to the original Siri Capable Device

expired - It changed to true when the sessionValidation Data (mentioned above) expire. Default value="False" as enum

keyload - How much the key has been used. The default values is 0 and the maximum value is 1000. Each time a device connects and makes a session the keyload increases by 10. So each key can serve up to 100 connection sessions until it gets overloaded and pauses up for a period of time

Ok the keys are saved what now? 


Each time a older device connects, the server finds the key with the least keyload and uses that to forge the packets with the sessionValidationData in order to be accepted by guzzoni.apple.com (Apple's siri servers)

Each older device that connects uses the sessionValidationData to create a assistant.

After the assistant is created it can use siri via the proxy for speech  recognition and views creation.

When one of the keys are overloaded (reaches the keyload max values) the server then does not forge the packets thus stops misusement of  the key.

After 15 minutes of  the overloaded key drops -100 lets another 10 sessions to be created and so on until the key expires.

This helps a lot to pretend that its a normal everyday use (with some finetuning to the above values and limits) and spoofing/securing the Siri Capable Devices.
Also a webgui can help you monitor the active concurrent connections, and all the above in realtime. You can forget ssh'ing to your VPS and using screen to view how the server is doing.


For more detailed info and tutorial please refer to  http://quartzcoding.blogspot.com/