1
/***************************************************************************
2
* Copyright (C) 2007-2011 by Francesco Cecconi *
3
* francesco.cecconi@gmail.com *
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. *
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. *
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
***************************************************************************/
23
#include "ui_mainwin.h"
26
#include <QtGui/QMainWindow>
27
#include <QtGui/QMessageBox>
28
#include <QtGui/QToolButton>
29
#include <QtGui/QTextDocument>
30
#include <QtGui/QSplitter>
31
#include <QtCore/QHash>
32
#include <QtCore/QPointer>
33
#include <QtCore/QTimer>
34
#include <QtCore/QDir>
35
#include <QtCore/QDate>
36
#include <QtCore/QTime>
37
#include <QtNetwork/QHostInfo>
38
#include <QtNetwork/QHostAddress>
39
#include <QtWebKit/QWebView>
40
#include <QtGui/QCompleter>
41
#include <QtGui/QStringListModel>
44
#include "profilemain.h"
45
#include "loghistory.h"
46
#include "staticDefine.h"
47
#include "nmapsi4Debug.h"
48
#include "addparameterstobookmark.h"
49
#include "memorytools.h"
51
#include "utilities.h"
52
#include "hostTools.h"
53
#include "qpushbuttonorientated.h"
54
#include "vulnerability.h"
55
#include "nsemanager.h"
56
#include "discovermanager.h"
57
#include "parsermanager.h"
59
// define class namespace
60
using namespace memory;
67
class nmapClass : public QMainWindow, public Ui::MainWindow
71
friend class parserManager;
72
friend class vulnerability;
73
friend class nseManager;
74
friend class discoverManager;
82
void preScanLookup(const QString hostname);
86
QFile* create_logFile(const QString Path);
87
QStringList check_extensions();
88
QStringList loadExtensions();
92
bool checkViewOS(const QString OSline, QTreeWidgetItem *itemOS) const;
93
void setTreeWidgetValues();
95
void updateComboPar();
96
void updateComboBook();
97
void restoreGlobalProfile();
98
QHash<QString, QString> defaultScanProfile() const;
99
void loadHistoryDefault();
100
void restoreSettings();
101
void setTreeSettings();
102
void setDefaultAction();
103
void setDefaultSplitter();
104
void defaultComboValues();
105
void createToolButtonSetup();
106
void setQuickProfile();
107
void setNormalProfile();
108
void setFullVersionProfile();
109
void setQuickVersionProfile();
110
void updateCompleter();
115
QListWidgetItem *scanW;
116
QListWidgetItem *toolW;
117
QListWidgetItem *discoverW;
118
QListWidgetItem *fileW;
119
QListWidgetItem *timingW;
124
QString logSessionFile;
139
QList<QTreeWidgetItem*> mainTreeElem;
140
QHash<QString, QPushButtonOrientated*> _collectionsButton;
143
QToolButton *menuSetup;
145
utilities *_utilities;
146
parserManager *_parser;
147
QPointer<QCompleter> _completer;
148
QPointer<QCompleter> _completerVuln;
149
QPointer<QStringListModel> _hostModel;
150
QPointer<QStringListModel> _vulnModel;
151
vulnerability* _vulnerability;
152
nseManager* _nseManager;
153
discoverManager* _discoverManager;
160
void update_portCombo();
161
void update_scanCombo();
162
void update_inputcheck();
163
void update_discover();
164
void update_timing();
165
void update_options();
166
void update_comboVerbosity();
170
void checkFullScreen();
171
void updateMenuBar();
172
void updateIconsBox();
174
void callParFromBook();
175
void monitorRuntimeEvent();
176
void updateScanCounter(int hostNumber);
177
//update and log slots
178
void startProfile_ui();
182
void updateFontHost();
183
void callSearchHistory();
184
void saveBookMarks();
185
void saveBookMarksPar(const QString profileName, const QString profilePar);
186
void deleteBookMark();
187
void deleteBookMarkPar();
188
void optionListCreate();
189
void optionListUpdate();
190
void updateSezScan();
192
void updateSezVuln();
193
void updateDiscoverVuln();
194
void updateTabLook();
195
void updateTabTrace();
197
void loadDefaultProfile();
199
void detailsOptions();
202
void bookOptionsPar();
207
void menuServiceMain();
208
void slotParSelected();
209
void slotHostSelected();
210
void saveUiSettings();
212
void saveGlobalProfile();
213
void removeGlobalProfile();
214
void startAddParBook_ui();