All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions.
Archeological excavation is supervised by the government or the ruler where ruins of previous nations, Islamic or non-Islamic, are excavated, then shown to the public. However, people have various purposes when it comes to visiting those sites:
Sometimes, to learn a lesson, or to inspect nations' history and culture ;especially, if they were Islamic and manifest the greatness of the Islamic history. Further, visiting those sites for this purpose is valid and lawful because the Holy Quran contains many a verse calling for contemplating the ruins of previous nations. For example, Allah, The most Exalted, Said (What means): "Many were the Ways of Life that have passed away before you: travel through the earth, and see what was the end of those who rejected Truth." [Al-Imran/137]. And He Said regarding Thamud's nation (What means):" Now such were their houses, - in utter ruin, - because they practised wrong- doing. Verily in this is a Sign for people of knowledge. [An-Naml/52]. In addition, Allah said regarding Lot's (PBUH) nation (What means): "And We have left thereof an evident Sign, for any people who (care to) understand. [Al-Ankabut/35].
However, if the ruins were non-Islamic, and visited for the purpose of glorifying and worshiping , then this constitutes a violation of Sharia.
Yet, the workers in the field of excavation under the supervision of the Ministry of Antiquities are free from any liability, since the Prophet (PBUH) has permitted that when he said (What means): "One fifth is compulsory to be paid (as Zakah) on buried Treasure.” {Agreed upon}. Therefore, paying ruins' Zakah is obligatory and this includes the permission to own and sell those ruins by the one who found them unless they were idols and statutes. If this is the case, trading with them is prohibited.
In conclusion, it is prohibited for a person to carry out archeological excavations for personal benefit since this violates laws and regulations established to preserve the common interest of the country. And Allah Knows Best.