On a newly installed WHM/cPanel server if you access a folder inside a domain which doesn’t have a index page in it, the server will throw you the complete directly structure. This can be bad as this exposes information about your website structure which can help hackers.
To disable this server wide, open WHM and search for Apache Configuration.
Then click Global Configuration,
Scroll down to the Directory “/” Options and uncheck Indexes and click Save.
On the next page click Rebuild Configuration and Restart Apache.