~brand-nmapsi4/nmapsi4/master

« back to all changes in this revision

Viewing changes to src/platform/profile/defaultProfile.cpp

  • Committer: Francesco Cecconi
  • Date: 2011-12-18 11:02:04 UTC
  • Revision ID: git-v1:60a69e132c8ffeb2727e558b2b2e8ac1713e332e
Removed nmapsi4-logr (dedicate repository) but it could be deprecated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2011 by Francesco Cecconi                               *
 
3
 *   francesco.cecconi@gmail.com                                           *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License.        *
 
8
 *                                                                         *
 
9
 *   This program is distributed in the hope that it will be useful,       *
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
12
 *   GNU General Public License for more details.                          *
 
13
 *                                                                         *
 
14
 *   You should have received a copy of the GNU General Public License     *
 
15
 *   along with this program; if not, write to the                         *
 
16
 *   Free Software Foundation, Inc.,                                       *
 
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
18
 ***************************************************************************/
 
19
 
 
20
#include "mainwin.h"
 
21
 
 
22
QHash<QString, QString> nmapClass::defaultScanProfile() const 
 
23
{
 
24
    // preload StringList with default static Scan profile
 
25
    // use QHash::insert(key,value) for new value
 
26
    // use QHash::value(key) for value from a key
 
27
    QHash<QString, QString> tmpStaticProfileMap_;
 
28
    
 
29
    if (!uid) 
 
30
    {
 
31
        tmpStaticProfileMap_.insert(tr("Quick Scan"),"-T4 -F --traceroute");
 
32
        tmpStaticProfileMap_.insert(tr("Intense Scan"),"-T4 -A -v --traceroute");
 
33
        tmpStaticProfileMap_.insert(tr("Intense Scan, all TCP ports"),"-p 1-65535 -T4 -A -v --traceroute");
 
34
        // profile for full mode
 
35
        tmpStaticProfileMap_.insert(tr("Intense scan plus UDP"),"-sS -sU -T4 -A -v --traceroute");
 
36
        tmpStaticProfileMap_.insert(tr("Slow comprehensive scan"),
 
37
                                    "-sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --traceroute");
 
38
    } 
 
39
    else 
 
40
    {
 
41
        // for user mode
 
42
        tmpStaticProfileMap_.insert(tr("Quick Scan"),"-T4 -F");
 
43
        tmpStaticProfileMap_.insert(tr("Intense Scan"),"-T4 -A -v");
 
44
        tmpStaticProfileMap_.insert(tr("Intense Scan, all TCP ports"),"-p 1-65535 -T4 -A -v");
 
45
    }
 
46
 
 
47
    return tmpStaticProfileMap_;
 
48
}
 
49
 
 
50
void nmapClass::setQuickProfile()
 
51
{
 
52
    this->resetOptions();
 
53
    comboTiming->setCurrentIndex(4);
 
54
    comboDNSResolv->setCurrentIndex(0);
 
55
    comboVerbosity->setCurrentIndex(1);
 
56
}
 
57
 
 
58
void nmapClass::setNormalProfile()
 
59
{
 
60
    this->resetOptions();
 
61
    comboTiming->setCurrentIndex(4);
 
62
    comboDNSResolv->setCurrentIndex(0);
 
63
    comboVerbosity->setCurrentIndex(1);
 
64
    versionBox->setChecked(true);
 
65
}
 
66
 
 
67
void nmapClass::setFullVersionProfile()
 
68
{
 
69
    this->resetOptions();
 
70
    comboTiming->setCurrentIndex(4);
 
71
    checkOS->setChecked(true);
 
72
    versionBox->setChecked(true);
 
73
    comboVerbosity->setCurrentIndex(1);
 
74
    comboDNSResolv->setCurrentIndex(0);
 
75
}
 
76
 
 
77
void nmapClass::setQuickVersionProfile()
 
78
{
 
79
    this->resetOptions();
 
80
    comboTiming->setCurrentIndex(4);
 
81
    checkOS->setChecked(true);
 
82
    comboDNSResolv->setCurrentIndex(0);
 
83
}
 
84
 
 
85
void nmapClass::resetOptions()
 
86
{
 
87
    versionBox->setChecked(false);
 
88
    checkOS->setChecked(false);
 
89
    comboTiming->setCurrentIndex(0);
 
90
    comboDNSResolv->setCurrentIndex(0);
 
91
    comboVerbosity->setCurrentIndex(0);
 
92
}