I was looking into spoofing a user agent but all that has come up so far is spoofing the browser type. However I can still see what kind of device I am using (tbh I'm not really even sure why someone would want to spoof the browser type). Anyways, I wanted to know if I can spoof my user agent so that it can become another device, or if there are any other methods so that when I use a browser, my device isn't shown. For example, if I own a Mac, does using TOR along with a proxy protecting me from a website like Gmail finding the type of device I am using?
Your device type is explicitly encoded in the user-agent string. Compare these UAs:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
In this example
iPhone idicates, well, an iPhone, and
SCH-I535 is the model number of a Galaxy S3. Consequently, if you change the UA to a custom string, most websites will identify you as a different device. However, there are also many advanced device fingerprinting techniques which are potentially less accurate but also harder to block.
if I own a Mac, does using TOR along with a proxy protecting me from a website like Gmail finding the type of device I am using?
The Tor browser aims for a design that minimizes possibilites for device fingerprinting. However, it can't stop everything. For example, if you're running the browser in full-screen mode, you're giving away your device's screen resolution. You can read the Tor browser docs chapter on fingerprinting for an extensive list of what exact measures they take.
user-agent header can be used to determine what type of machine device you are running. By default, most browsers will send some type of identifying information in that header which includes what browser you are using as well as your machine. For example, using chrome on a MacBook running OSX might cause your user agent to look something like this:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Notice how not only is the web browser identified (Chrome) but also the machine (Intel Mac OS X). If you were to change the user-agent to imitate another operating system it might look like this:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
In this case, the target website might assume you are running windows as a base operating system, still using chrome.
Using Tor or a proxy will not keep a website such as Gmail from knowing what type of device you are using as long as your browser is sending the
user-agent header which identifies it. Browsers will sometimes allow you to send a custom user-agent if you want. Firefox / Tor support this natively while I believe Chrome requires you to use an add-on to do so.