Welcome, Guest. Please login or register.

Author Topic: Fortigate hacks  (Read 1333 times)

redpineapple

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Fortigate hacks
« on: August 28, 2015, 09:39:03 AM »
So this is how I have Fortigates working:

In libcli:

Code: [Select]
# Fortigate
$cmd{'FortiOS'}{'ropr'} = '\$.$';
$cmd{'FortiOS'}{'enpr'} = '\$.$';
$cmd{'FortiOS'}{'conf'} = 'show full-configuration';
$cmd{'FortiOS'}{'strt'} = '^config';
$cmd{'FortiOS'}{'more'} = '--More--';

Code: [Select]
                my $l = '';
                my $mcol = 0;
                my $promptmatch = "$cmd{$os}{'enpr'}";
                &misc::Prt("MORE:");
                do{
                        ($pre, $match) = $session->waitfor("/$cmd{$os}{more}|$promptmatch/i");
                        $pre =~ s/\x08|\x1b\[16D\s*|\x1b\[42D\s*//g;                                    # Get rid of backspaces after more prompt and potential \r
                        $l .= $pre;
                        $session->put(" ") if $match eq "$cmd{$os}{more}";
                        &misc::Prt(".");
                        &misc::Prt("\nMORE:") unless $mcol % 78;
                        $mcol++;
                }while($match !~ /$promptmatch/i);

Maybe it will save someone some time!!!!

Kasper

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Fortigate hacks
« Reply #1 on: August 28, 2015, 03:42:05 PM »
Since I also have FortiGate devices this is very helpful.
I would love to know on what line I should insert this code to get it working.

Thanks

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: Fortigate hacks
« Reply #2 on: August 30, 2015, 02:49:42 AM »
Will this work with Fortigates using VDOMs?
I'm assuming this is for backups.

redpineapple

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Fortigate hacks
« Reply #3 on: August 31, 2015, 11:57:19 AM »
Yes,  this is for backups.

You need to copy a version of your oid in sysobj to one that is similar to .1.3.6.1.4.1.12356

copy:
1.3.6.1.4.1.12356.101.1.2001.def   1.3.6.1.4.1.12356.101.1.2003.def
1.3.6.1.4.1.12356.101.1.30400.def to 1.3.6.1.4.1.12356.101.1.30401.def

Lines need to be modified at @334 and @1173