[Manipulating the Input Manager in Script][1] gives a solution for editor script:

    /// <summary>
         /// Gets all the input axis defined in the project's Input manager
         /// (gets it from ProjectSettings/InputManager.asset)
         /// </summary>
         public static List<string> GetInputAxis()
         {
             var allAxis = new List<string>();
     
             var serializedObject = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset")[0]);
             var axesProperty = serializedObject.FindProperty("m_Axes");
     
             axesProperty.Next(true);
             axesProperty.Next(true);
             while (axesProperty.Next(false))
             {
                 SerializedProperty axis = axesProperty.Copy();
                 axis.Next(true);
                 allAxis.Add(axis.stringValue);
             }
     
             return allAxis;
         }

Unfortunately, *this is only safe in the editor*, and not while the game is running.

  [1]: http://www.plyoung.com/blog/manipulating-input-manager-in-script.html