Pentesting Lateral Movement: Chrome Bookmark Extraction usando Python
R.Eric Kiser
Como probador de penetración, es importante recopilar la mayor cantidad de información posible sobre los usuarios o sistemas comprometidos. Una técnica útil para moverse lateralmente es descubrir los recursos de acceso frecuente del usuario extrayendo sus marcadores de Google Chrome. Con los marcadores obtenidos, puede usar un script para recopilar información o, si tiene acceso remoto a la GUI, visitar manualmente cada página para ver si se pueden extraer las contraseñas.
Tendremos que importar algunos módulos para extraer los datos. osy shutilse importan para acceder al sistema de archivos y copiar archivos. import sysy import tempfilese importan para comprobar la plataforma y crear un directorio temporal.
import os
import sys
import shutil
import tempfile
bookmarks_file = os.path.expanduser('~/Library/Application Support/Google/Chrome/Default/Bookmarks')
if sys.platform == 'win32':
bookmarks_file = os.path.expandvars(r'%LOCALAPPDATA%\Google\Chrome\User Data\Default\Bookmarks')
elif sys.platform == 'darwin':
bookmarks_file = os.path.expanduser('~/Library/Application Support/Google/Chrome/Default/Bookmarks')
if not os.path.exists(bookmarks_file):
print('Error: unable to locate your bookmarks file')
sys.exit(1)
temp_dir = tempfile.mkdtemp()
try:
shutil.copy2(bookmarks_file, temp_dir)
bookmarks_file = os.path.join(temp_dir, os.path.basename(bookmarks_file))
with open(bookmarks_file, 'r') as f:
data = f.read()
with open('bookmarks.html', 'w') as f:
f.write(data)
finally:
shutil.rmtree(temp_dir)
print ("bookmarks successfully downloaded in the current working directory")

![¿Qué es una lista vinculada, de todos modos? [Parte 1]](https://post.nghiatu.com/assets/images/m/max/724/1*Xokk6XOjWyIGCBujkJsCzQ.jpeg)



































