The command to do this is
alter index index_name rebuild tablespace your_tablespace_name;
You can generate the alter index statements by running a query like the following
select 'alter index ' || index_name || ' rebuild tablespace your_tablespace_name;' from user_indexes
where tablespace_name = 'SYSTEM';
You should also investigate WHY most of your indexes are in the system tablespace. Most likely one or more ids has a default tablespace of SYSTEM. To find such users, run the query,
select username from dba_users where default_tablespace='SYSTEM';
Then switch any application users to another default tablespace.
alter user user_name default tablespace your_tablespace_name;