Сначала мы конвертируем repos
в список питонов. Итак:
repos=["BloodHoundAD/BloodHound.git", "GhostPack/Seatbelt.git", "GhostPack/SharpUp.git", "yeyintminthuhtut/Awesome-Red-Teaming.git",
"byt3bl33d3r/DeathStar.git", "byt3bl33d3r/CrackMapExec.git", "Cn33liz/p0wnedShell.git", "EmpireProject/Empire.git",
"danielmiessler/SecLists.git", "laramies/theHarvester.git"]
Затем мы создаем цикл for в python. В цикле for мы запускаем git clone package
. Вместо использования библиотеки мы можем просто запустить ее через os.system()
.
Следовательно, код цикла for:
for repo in repos:
os.system("git clone http://github.com/{}".format(repo))
Наконец, мы получаем количество репо в списке и распечатываем его, что мы делаем с print ("There are {} repos.".format(str(len(repos))))
Полный код:
import os
repos=["BloodHoundAD/BloodHound.git", "GhostPack/Seatbelt.git", "GhostPack/SharpUp.git", "yeyintminthuhtut/Awesome-Red-Teaming.git",
"byt3bl33d3r/DeathStar.git", "byt3bl33d3r/CrackMapExec.git", "Cn33liz/p0wnedShell.git", "EmpireProject/Empire.git",
"danielmiessler/SecLists.git", "laramies/theHarvester.git"]
for repo in repos:
os.system("git clone http://github.com/{}".format(repo))
print ("There are {} repos.".format(str(len(repos))))