Debug Commands - New
Debug Commands - New
Debug Commands - New
Remember to enter the correct vdom or global configuration tree before configuring anything:
config global
config vdom
edit <vdom-name>
To find a CLI command within the configuration, you can use the pipe sign “|” with “grep” (similar to
“include” on Cisco devices). Note the “-f” flag to show the whole config tree in which the keywords was
found, e.g.:
show | grep -f ipv6
1
show full-configuration | grep -f ipv6
General Information
The very basics:
1 get system interface physical #overview of hardware interfaces
4 fnsysctl ifconfig <nic-name> #kind of hidden command to see more interface stats such as
5 errors
9 diagnose sys top-summary #top easier, incl. CPU and mem bars. Forks are displayed by [x13]
1 or whatever
0
1
1 diagnose autoupdate versions #lists the attack definition versions, last update, etc.
5 diagnose debug crashlog read #shows crashlog, a status of 0 indicates a normal close of a
1 process!
DHCP
execute dhcp lease-list
execute dhcp lease-clear <ip address>
execute dhcp lease-clear all
Session Table
Display the current active sessions:
get system session list #rough view with NAT, only IPv4
diagnose sys session list #show the session table with the filter just set
Di?VPN
TO FLUSH THE TUNNELS
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, and execute the below commands simultaneously on all the 3 putty
sessions
Putty1:
------------------------------
Putty2:
---------------------------
>>Simultaneously open an another session of putty, start the logging and run the below command
Putty3:
--------------------
get vpn ike gateway <name>
get vpn ipsec tunnel name <name>
Scenario2: [If the tunnel is up and traffic is not passing through it]
------------------------------------------------------------------------
>>open puyty client, start the session logging
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, run the below commands and initiate a ping from source to destination
Putty1:
---------------------
Putty2:
---------------------
>>Simultaneously open an another session of putty, start the logging and run the below command
diagnose sniffer packet any "host <remote-gw> and esp" 6 0 a
Putty3:
--------------------
get vpn ike gateway <name>
Log
For investigating the log entries (similar to the GUI), use the following filters, etc.:
execute log filter reset
HIGH CPU
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
If vdom
config vdom
MEMORY USAGE
Below are some of the recommended actions that will help to save memory resource:
(2) Using 'all_default' IPS sensor in your firewall policy is not recommended.
Please configure the profile to scan for specific OS, applications and protocols of appropriate severity.
For e.g if you have only windows PC and servers in your environment, you can select OS = Windows, and
select only relevant applications. If you do not want to scan for low and medium severity you can specify
the correct severity options as high and critical. By doing this you will reduce the number of predefined
IPS signatures the unit has to match the flow with.
If you would like to set session ttl for a particular port, please follow the following KB article:
http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD30171
(4)Reducing some of the global timer can also reduce load, please run the following commands:
config system global
set tcp-halfclose-timer 30
set tcp-halfopen-timer 10
set tcp-timewait-timer 1
end
(5)If you are using extended database for virus scan, please change it to normal
config antivirus settings
set default-db normal
end
SSL-VPN
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands and then initiate the connection via
Forticlient
diag debug reset
diag debug application fnbamd -1
diag debug appl sslvpn -1
diag debug enable
Wait until you observe the disconnection. Once the connection gets disconnected the disable the logs by
using
And also enable logging in the FortiClient by following the below path:
File --> Settings --> Logging --> select Log Level as debug from the dropdown
L2TP
>>open putty client, start the session logging
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
Wait till you get the unsuccessful message, and execute the below command to stop the logs
VIP
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands and ping the VIP external IP
>>Simultaneously open an another session of putty, start the logging and execute the below command
diagnose sniffer packet any "host x.x.x.x and icmp" 6 0 a ------------where x.x.x.x is the public IP address of
the external PC
http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD36043
>>connect to your fortigate, execute the below commands and try to open the Dashboard section in the
GUI
Putty1:
Wait till the page opens and disable the logs by executing
diagnose debug application httpsd 0
diagnose web-ui debug disable
WAD----5.6
wait for 5-10 sec and then stop the logs by using
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>Simultaneously open an another session of putty, start the logging and execute the below command
TRAFFIC SHAPING
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
CONSOLE LOGS
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
You can copy paste the commands directly to putty. Please run them few minutes
before you connect with the device that has the issue with, user should browse too.
To disable debug:
diag debug disable (can be typed even when interrupted by printed text)
diag debug reset
MODEM ISSUES
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
(1)
For troubleshooting will need:
- the PIN code (if is required).
- the APN name
- provider name
- name of service or it's description
- authentication data (username, password)
- used authentication method (pap, chap, ms-chap ...)
- serial number of modem (or version of used firmware)
(2)
# Is it detected on the USB as a modem?
fnsysctl cat /proc/bus/usb/devices
show system modem
show system 3g-modem custom
(3)
# Is it detected correctly?
diagnose sys modem detect
diag sys modem external-modem
diag sys modem query
diag sys modem cmd ati
(4)
# Is it supported model?
fnsysctl cat /etc/modem_list.conf
# Alternatively check the list version only
diagnose autoupdate versions | grep -A 3 Modem
###
(5)
# Is it detected on the USB as a modem?
fnsysctl cat /proc/bus/usb/devices
show system modem
show system 3g-modem custom
(6)
# If the modem is detected as a modem.
# Have to respond at least on one serial console.
# Unfortunatelly don't know on which one.
# One by one check ALL of them if the modem is responding
# If one port is selected (responded for ATI command), can be set as port for communication
(7)
### Dialling process debug
diag debug reset
diagnose debug console timestamp enable
diagnose debug app ppp -1
diagnose debug app modem -1
diagnose debug app lted -1
diag debug enable
# and
execute modem dial
# To finish
HA
Debugzone: debugzone is where the config changes are first stored before applying them to the running
config.
Checksum: It contains the checksum of the configuration that is actually running in the device
FOR ---5.2
>>open putty client, start the session logging
http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD36043
>>connect to your fortigate, and capture the output of the below commands from both the devices
(Slave and Master):
To connect Slave unit, execute the below command from CLI of Master unit.
exec ha manage ?
exec ha manage <slave_id>? : If suppose slave_id is 1
exec ha manage 1
Manual HA synchronization
5.4/5.6
>>connect to your fortigate, and capture the output of the below commands from both the devices
(Slave and Master):
To connect Slave unit, execute the below command from CLI of Master unit.
exec ha manage ?
exec ha manage <slave_id>? : If suppose slave_id is 1
exec ha manage 1
Manual synchronization
execute ha synchronize start
HASYNC/HATALK
>>open putty client, start the session logging
http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD36043
>>connect to your fortigate, and capture the output of the below commands from both the devices
(Slave and Master):
wait for couple of minutes, and then disable the logs by executing
SNMP
Putty1:
-----------------
wait for 2-3min, and then disable the debug by executing the below command
Putty2:
------------------
wait for 2-3min, and then stop the sniffer by pressing ctrl+c
FSSO
#diag sniffer packet internal “port 8000 and host <collector agent ip>” 4 0 a
FSSO TROUBLESHOOTING
# diagnose sniffer packet any 'host <server ip> and tcp port 445' 3
LDAP
for ex: if the ldap server is "Ldap123" with username "test" and password "test123", the above
command will be as below
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands and then try to authenticate
Once the issue is observed, wait for some time and then disable the logs by executing
TACACS+
for ex: if the tacacs+ server is "tacacs123" with username "test" and password "test123", the above
command will be as below
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands and then try to authenticate
Putty1:
-------------------
Once the issue is observed, wait for some time and then disable the logs by executing
Putty2:
------------------
diagnose sniffer packet any “host x.x.x.x” 6 0 a ----------where x.x.x.x is the tacacs+ server IP
Wait for some time and then stop the sniffer by pressing ctrl+c
https://blog.synack.co.uk/2017/10/15/pcap-tacacs-pcap-file/
RADIUS
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands and then try to authenticate
Putty1:
--------------------
Putty2:
---------------------------
diagnose test authserver radius <server_name> <chap | pap | mschap | mschap2> <username>
<password>
for ex: if the radius server is "radius123", using “mschap” with username "test" and password "test123",
the above command will be as below
diag test authserver radius radius123 mschap test test123
after executing the above, execute the below command to disable the debug
URL FILTER
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands and then try to access the URL
Wait until the page throws a message , and then stop the debug by executing
IPS
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands simultaneously on all the putty sessions
during the time of the issue
Putty1:
-------------------
diagnose debug reset
diagnose debug enable
diagnose debug console timestamp enable
diagnose debug application ppp -1
wait for some time and the disable the logs by executing
Putty2:
-------------
diagnose sniffer packet wan1 "none" 6 0 a
Putty3:
-------
DDNS
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, and execute the below commands
DLP
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
Once the file is uploaded, stop the debug by executing the below commands
INTERNET SLOWNESS
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, execute the below commands during the time of the issue:
Assume wan1 is connected to your ISP, you can find wan1 speed setting by running following CLI:
Putty-2
You can see the IP by executing the below commands in the command prompt
NETSCAN
Netscan process is the network vulnerability scanner. The Network Vulnerability Scan helps you to
protect your network assets by scanning them for security weaknesses.
(more info here: http://help.fortinet.com/fos50hlp/52data/Content/FortiOS/fortigate-managing-
devices-52/Devices_vscan.htm )
We tried to stop the process using the following command, but these commands don't exist, altogether
execute netscan import
execute netscan list
execute netscan start scan
execute netscan status
#execute netscan stop
WEBCACHE
Please provide the output of the following by opening multiple SSH sessions to the firewall:
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
>>connect to your fortigate, and execute the below commands and try to make a call
Putty1:
-------------------
Putty2:
--------------------
diag sniffer packet any 'host x.x.x.x' 6 0 a x -----where x.x.x.x is the source IP of the phone you are
making a call from
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
Putty1:
----------------------------
Wait for some time and then disable the logs by executing
Putty2:
--------------------
diag sniffer packet any "host x.x.x.x" 6 0 a -------where x.x.x.x is the remote VC device
Wait for some time and then disable the sniffer by pressing ctrl+c
ALERT EMAIL
>>connect to your fortigate, execute the below commands during the time of the issue:
Wait for some time and then stop the logs by executing
DISK ISSUES
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
Once the output is collected please turn off debug using below commands:
Note: If you do not get the output immediately then please let the command run until there is any
output.
SSD UPGRADE
- Kindly run the below command and check FGT's current SSD disk firmware Version is SFPS918A or
SFPS925C.
Note: If the FortiGate has any VDOM’s configured, the below commands must be performed in the
global context (meaning typing “config global <enter>” before)
- If yes, SSD disk firmware update is needed. Please find enclosed special firmware. Follow steps to
apply:
- Verify MD5 checksum (d02f295754a1c29e05ede549d8a6c8d1 FGT_100D-v5-build9134-FORTINET.out)
- Backup running configuration.
- back-up the logs stored on the SSD if they are required to be retained. The CLI command to backup the
logs is:
# exec backup memory alllogs ftp <ip address> <user> <password>
- upload this firmware from System information widget the same way as it was normal firmware update
- it will result in reboot 2 times!
- after that, FortiGate will boot up to the same firmware as it is running
- Attached file is compatible only with 5.2.x firmware!! If you use another version, please let me know
and I will send you compatible image.
- After you finish the upgrade, please run following commands to verify:
# diag hard smartctl -a /dev/sda (SSD Firmware version should be than SFPS928G instead of current
SFPS918A or SFPS925C)
# diag hard deviceinfo disk
Please schedule maintenance window as SSD firmware upgrade will result in 5 - 10 minutes outage. I will
wait for your feedback.
>> From the logs I can see multiple process are in "D" state.
>> Processes can get stuck in D state in case they are waiting for I/O disk operation. If there is some
problem with the file system or disk, this can result in multiple processes stuck.
>> Kindly provide the output of below mentioned command for further trouble shooting.
Note: If the FortiGate has any VDOM’s configured, the below commands must be performed in the
global context (meaning typing “config global <enter>” before)
FORTICLOUD
http://kb.fortinet.com/kb/documentLink.do?externalID=FD36043
Putty1:
-------------------
putty2:
-----------------------
Putty3:
----------------------------
VULNERABILITIES
Based on the description i understand that you have following vulnerabilities discovered and wanted to
Fix
1.May i know to which IP the Scan was initiated ? Was the scan done for fortigate public ip ?
2.Is there any https,SSH or ssl vpn enabled on fortigate public IP ? If yes may i know its corresponding
port numbers ?
3.Could you please attach us the IP where the scan was done and the ports for which the scan was
done ?
FORTITOKEN
Could you please remove the fortitokens from the users if already assigned?
Next delete the existing tokens, once done execute below query in the command line
INT-FTG1-DC2 # diag firewall iprope lookup 161.71.6.8 64428 194.170.244.55 44300 tcp port17
diag firewall ipropr [Ke list
<No.> Number, hexadecimal.
Kindly Provide below mentioned details during the time of the issue for further troubleshooting .
On fortigate
Putty 1: