Fortigate | Rest APIs

# Paso 1: Introducir nuestras credenciales en el firewall Fortigate que nos conectaremos. Tener en cuenta que la secret key no soporta caracteres especiales.

curl -k -i -X POST https://x.x.x.x/logincheck -d "username=yyy&secretkey=zzz" --dump-header headers.txt -c cookies.txt

 

 # Paso 2:  Realizar la REST API call mediante curl

curl -k -i -X GET https://x.x.x.x/api/v2/cmdb/router/static -b headers.txt

curl -k -i -X GET https://x.x.x.x/api/v2/cmdb/system/interface -b headers.txt


# Paso 3: Guardar output en un archivo

curl -k -i -X GET https://x.x.x.x/api/v2/cmdb/router/static -b headers.txt --output /home/angel/scripts/fortigate_static_routes.txt

curl -k -i -X GET https://x.x.x.x/api/v2/cmdb/system/interface -b headers.txt --output /home/angel/scripts/fortigate_interfaces.txt


Comentarios

Entradas populares de este blog

EVE-NG: Instalación de EVE-NG

Cisco Security | Bloquear MAC address en un switch

Nornir | Introducción, instalación y primer script básico