Projects STRLCPY sub3suite Commits 07d898b2
🤬
  • icon/s3s.png
  • ■ ■ ■ ■
    sub3suite/src/dialogs/ActiveConfigDialog.cpp
    skipped 64 lines
    65 65  }
    66 66   
    67 67  /* for ip... */
    68  -ActiveConfigDialog::ActiveConfigDialog(QWidget *parent, ip::ScanConfig *config) :
     68 +ActiveConfigDialog::ActiveConfigDialog(QWidget *parent, reverseip::ScanConfig *config) :
    69 69   QDialog(parent),
    70 70   ui(new Ui::ActiveConfigDialog),
    71 71   m_configIP(config),
    skipped 804 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/dialogs/ActiveConfigDialog.h
    skipped 14 lines
    15 15  #include "src/modules/active/DNSScanner.h"
    16 16  #include "src/modules/active/SSLScanner.h"
    17 17  #include "src/modules/active/URLScanner.h"
    18  -#include "src/modules/active/IPScanner.h"
     18 +#include "src/modules/active/ReverseIPScanner.h"
    19 19   
    20 20   
    21 21  namespace Ui {
    skipped 9 lines
    31 31   ActiveConfigDialog(QWidget *parent = nullptr, dns::ScanConfig *config = nullptr);
    32 32   ActiveConfigDialog(QWidget *parent = nullptr, ssl::ScanConfig *config = nullptr);
    33 33   ActiveConfigDialog(QWidget *parent = nullptr, url::ScanConfig *config = nullptr);
    34  - ActiveConfigDialog(QWidget *parent = nullptr, ip::ScanConfig *config = nullptr);
     34 + ActiveConfigDialog(QWidget *parent = nullptr, reverseip::ScanConfig *config = nullptr);
    35 35   ~ActiveConfigDialog();
    36 36   
    37 37   private slots:
    skipped 15 lines
    53 53   dns::ScanConfig *m_configDns = nullptr;
    54 54   ssl::ScanConfig *m_configSSL = nullptr;
    55 55   url::ScanConfig *m_configURL = nullptr;
    56  - ip::ScanConfig *m_configIP = nullptr;
     56 + reverseip::ScanConfig *m_configIP = nullptr;
    57 57   
    58 58   QStringListModel *m_customNameserverListModel;
    59 59   
    skipped 19 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/items/IPItem.cpp
    skipped 41 lines
    42 42   
    43 43   /* domains */
    44 44   for(int i = 0; i < item->domains->rowCount(); i++)
    45  - ip.domains.insert(item->domains->child(i, 1)->text());
     45 + ip.domains.insert(item->domains->child(i, 0)->text());
    46 46   
    47 47   return ip;
    48 48  }
    skipped 38 lines
    87 87   /* domains */
    88 88   QJsonArray domains;
    89 89   for(int i = 0; i < item->domains->rowCount(); i++)
    90  - domains.append(item->domains->child(i, 1)->text());
     90 + domains.append(item->domains->child(i, 0)->text());
    91 91   ip.insert("domains", domains);
    92 92   
    93 93   ip.insert("item_info", item_info);
    skipped 33 lines
    127 127   item->privacyInfo_threat->setText(ip.value("privacyInfo_threat").toString());
    128 128   
    129 129   /* domains */
    130  - int count = 0;
    131  - foreach(const QJsonValue &value, ip.value("domains").toArray()){
    132  - item->domains->appendRow({new QStandardItem(QString::number(count)),
    133  - new QStandardItem(value.toString())});
    134  - count++;
    135  - }
     130 + foreach(const QJsonValue &value, ip.value("domains").toArray())
     131 + item->domains->appendRow(new QStandardItem(value.toString()));
    136 132   
    137 133   QJsonObject item_info = ip.value("item_info").toObject();
    138 134   item->comment = item_info["comment"].toString();
    skipped 3 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/items/IPToolItem.cpp
     1 +#include "IPToolItem.h"
     2 + 
     3 +#include <QJsonArray>
     4 +#include <QJsonObject>
     5 +#include <QJsonDocument>
     6 + 
     7 + 
     8 +s3s_struct::IPTool iptool_to_struct(s3s_item::IPTool *item){
     9 + s3s_struct::IPTool ip;
     10 + 
     11 + ip.ip = item->text();
     12 + 
     13 + foreach(const QString &port, item->set_ports)
     14 + ip.ports.insert(port);
     15 + 
     16 + return ip;
     17 +}
     18 + 
     19 +QJsonObject iptool_to_json(s3s_item::IPTool *item){
     20 + QJsonObject item_info;
     21 + item_info.insert("last_modified", item->last_modified);
     22 + item_info.insert("comment", item->comment);
     23 + 
     24 + QJsonObject ip;
     25 + 
     26 + ip.insert("ip", item->text());
     27 + /* domains */
     28 + QJsonArray ports;
     29 + foreach(const QString &port, item->set_ports)
     30 + ports.append(port);
     31 + ip.insert("ports", ports);
     32 + 
     33 + ip.insert("item_info", item_info);
     34 + 
     35 + return ip;
     36 +}
     37 + 
     38 +void json_to_iptool(const QJsonObject &ip, s3s_item::IPTool *item){
     39 + item->setText(ip.value("ip").toString());
     40 + 
     41 + foreach(const QJsonValue &value, ip.value("ports").toArray())
     42 + item->addPort(value.toString());
     43 + 
     44 + QJsonObject item_info = ip.value("item_info").toObject();
     45 + item->comment = item_info["comment"].toString();
     46 + item->last_modified = item_info["last_modified"].toString();
     47 +}
     48 + 
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/items/IPToolItem.h
     1 +#ifndef IPTOOLITEM_H
     2 +#define IPTOOLITEM_H
     3 + 
     4 + 
     5 +#include "src/utils/utils.h"
     6 + 
     7 +#include <QStandardItem>
     8 +#include <QDate>
     9 +#include <QSet>
     10 + 
     11 +#define JSON_ARRAY "arr"
     12 + 
     13 +namespace s3s_struct {
     14 +struct IPTool {
     15 + QString ip;
     16 + QSet<QString> ports;
     17 +};
     18 +}
     19 + 
     20 +namespace s3s_item {
     21 + 
     22 +class IPTool: public QStandardItem {
     23 + 
     24 +public:
     25 + IPTool(): QStandardItem(),
     26 + ports(new QStandardItem)
     27 + {
     28 + }
     29 + ~IPTool()
     30 + {
     31 + }
     32 + 
     33 +public:
     34 + QStandardItem *ports;
     35 + QSet<QString> set_ports;
     36 + 
     37 + /* summary */
     38 + QString last_modified;
     39 + QString comment;
     40 + 
     41 + void setValues(const s3s_struct::IPTool &ip){
     42 + this->setText(ip.ip);
     43 + 
     44 + /* open ports */
     45 + foreach(const QString &port, ip.ports){
     46 + if(!set_ports.contains(port)){
     47 + set_ports.insert(port);
     48 + ports->setText(ports->text()+port+" ");
     49 + }
     50 + }
     51 + 
     52 + /* last modified */
     53 + last_modified = QDate::currentDate().toString();
     54 + }
     55 + 
     56 + void setValues(const QString &ip, const QString &port){
     57 + this->setText(ip);
     58 + 
     59 + /* open ports */
     60 + if(!set_ports.contains(port)){
     61 + set_ports.insert(port);
     62 + ports->setText(ports->text()+port+" ");
     63 + }
     64 + 
     65 + /* last modified */
     66 + last_modified = QDate::currentDate().toString();
     67 + }
     68 + 
     69 + void addPort(const QString &port){
     70 + /* open ports */
     71 + if(!set_ports.contains(port)){
     72 + set_ports.insert(port);
     73 + ports->setText(ports->text()+port+" ");
     74 + }
     75 + 
     76 + /* last modified */
     77 + last_modified = QDate::currentDate().toString();
     78 + }
     79 +};
     80 +}
     81 + 
     82 +s3s_struct::IPTool iptool_to_struct(s3s_item::IPTool*);
     83 + 
     84 +QJsonObject iptool_to_json(s3s_item::IPTool*);
     85 + 
     86 +void json_to_iptool(const QJsonObject&, s3s_item::IPTool*);
     87 + 
     88 +#endif // IPTOOLITEM_H
     89 + 
  • ■ ■ ■ ■ ■
    sub3suite/src/main.cpp
    skipped 85 lines
    86 86   qRegisterMetaType<QSslCertificate>("QSslCertificate");
    87 87  }
    88 88   
     89 +void create_desktop_file(){
     90 + if(QDir::isAbsolutePath("/usr/share/applications/")){
     91 + QFile file("/usr/share/applications/sub3suite.desktop");
     92 + if(file.open(QIODevice::WriteOnly | QIODevice::Text)){
     93 + file.write("[Desktop Entry]\n");
     94 + file.write("Type=Application\n");
     95 + file.write("Exec="+QCoreApplication::applicationFilePath().toUtf8()+"\n");
     96 + file.write("Name=Sub3 Suite\n");
     97 + file.write("GenericName=Advance Intelligence Gathering Tool\n");
     98 + file.write("Icon="+QCoreApplication::applicationDirPath().toUtf8()+"/icon/s3s.png\n");
     99 + file.write("Terminal=false\n");
     100 + file.close();
     101 + }
     102 + else
     103 + qWarning() << "Couldnt open /usr/share/applications/sub3suite.desktop for write";
     104 + }
     105 + else
     106 + qWarning() << "Path /usr/share/applications/ not available";
     107 +}
     108 + 
    89 109  ///
    90 110  /// a custom messagehandler for logging messages to log file
    91 111  ///
    skipped 23 lines
    115 135   
    116 136   QString date = QDateTime::currentDateTime().toString("dd-MM-yyyy");
    117 137   QFile logfile(QApplication::applicationDirPath()+"/logs/"+date+".log");
     138 + logfile.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
     139 + QFileDevice::ReadUser | QFileDevice::WriteUser |
     140 + QFileDevice::ReadGroup | QFileDevice::WriteGroup |
     141 + QFileDevice::ReadOther | QFileDevice::WriteOther);
    118 142   
    119 143   if(logfile.open(QIODevice::WriteOnly | QIODevice::Append)){
    120 144   QTextStream ts(&logfile);
    skipped 36 lines
    157 181   bool is_priv = false;
    158 182   bool is_dark_theme = false;
    159 183   bool is_light_theme = false;
    160  - int font_size = NULL;
     184 + int font_size = 0;
    161 185  }
    162 186   
    163  -/*
    164  -namespace s3s_tool {
    165  -}
    166  -namespace s3s_enum {
    167  -}
    168  -*/
    169 187   
    170 188  int main(int argc, char *argv[])
    171 189  {
    skipped 37 lines
    209 227   qInfo() << "* Sub3 Suite ";
    210 228   qInfo() << "**************************************************************************************";
    211 229   
     230 + QFile::setPermissions(QGuiApplication::applicationDirPath()+"/sub3suite.ini",
     231 + QFileDevice::ReadOwner | QFileDevice::WriteOwner |
     232 + QFileDevice::ReadUser | QFileDevice::WriteUser |
     233 + QFileDevice::ReadGroup | QFileDevice::WriteGroup |
     234 + QFileDevice::ReadOther | QFileDevice::WriteOther);
     235 + 
     236 + QFile::setPermissions(QGuiApplication::applicationDirPath()+"/keys.ini",
     237 + QFileDevice::ReadOwner | QFileDevice::WriteOwner |
     238 + QFileDevice::ReadUser | QFileDevice::WriteUser |
     239 + QFileDevice::ReadGroup | QFileDevice::WriteGroup |
     240 + QFileDevice::ReadOther | QFileDevice::WriteOther);
     241 + 
     242 + if(CONFIG.value("is_first_run").toBool()){
     243 + CONFIG.setValue("is_first_run", false);
     244 + CONFIG.setValue("s3s", QCoreApplication::applicationFilePath());
     245 +#if defined (Q_OS_LINUX)
     246 + create_desktop_file();
     247 + qDebug() << "sub3suite.desktop file created!";
     248 +#endif
     249 + }
     250 + 
     251 + 
     252 + /* check s3s path */
     253 + if(CONFIG.value("s3s").toString() != QCoreApplication::applicationFilePath()){
     254 + CONFIG.setValue("s3s", QCoreApplication::applicationFilePath());
     255 +#if defined (Q_OS_LINUX)
     256 + create_desktop_file();
     257 + qDebug() << "sub3suite.desktop file changed!";
     258 +#endif
     259 + }
     260 + 
    212 261   check_priv();
    213 262   log_device_info();
    214 263   registerMetaTypes();
    skipped 27 lines
    242 291   stylesheet.setFileName(":/themes/res/themes/default.css");
    243 292   s3s_global::is_dark_theme = true;
    244 293   }
    245  - if(CONFIG.value(CFG_VAL_THEME).toString() == "light"){
     294 + else{
    246 295   stylesheet.setFileName(":/themes/res/themes/light.css");
    247 296   s3s_global::is_light_theme = true;
    248 297   }
    skipped 37 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/models/ExplorerModel.cpp
    skipped 9 lines
    10 10   
    11 11   /* active Results ExplorerModel */
    12 12   activeHost(new QStandardItem("Hostnames")),
     13 + activeIP(new QStandardItem("IP-Addresses")),
    13 14   activeWildcard(new QStandardItem("Wildcards")),
    14 15   activeDNS(new QStandardItem("DNS")),
    15 16   activeA(new QStandardItem("A")),
    skipped 57 lines
    73 74   enums->setForeground(Qt::white);
    74 75   custom->setForeground(Qt::white);
    75 76   activeHost->setForeground(Qt::white);
     77 + activeIP->setForeground(Qt::white);
    76 78   activeWildcard->setForeground(Qt::white);
    77 79   activeDNS->setForeground(Qt::white);
    78 80   activeA->setForeground(Qt::white);
    skipped 32 lines
    111 113   }
    112 114   
    113 115   activeHost->setIcon(QIcon(":/img/res/icons/domain.png"));
     116 + activeIP->setIcon(QIcon(":/img/res/icons/ip.png"));
    114 117   activeWildcard->setIcon(QIcon(":/img/res/icons/wildcard.png"));
    115 118   activeDNS->setIcon(QIcon(":/img/res/icons/dns.png"));
    116 119   activeA->setIcon(QIcon(":/img/res/icons/ipv4.png"));
    skipped 44 lines
    161 164   activeSSL->appendRow(activeSSL_sha256);
    162 165   activeSSL->appendRow(activeSSL_altNames);
    163 166   active->appendRow(activeHost);
     167 + active->appendRow(activeIP);
    164 168   active->appendRow(activeWildcard);
    165 169   active->appendRow(activeURL);
    166 170   active->appendRow(activeDNS);
    skipped 35 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/models/ExplorerModel.h
    skipped 5 lines
    6 6   
    7 7  enum ExplorerType {
    8 8   activeHost,
     9 + activeIP,
    9 10   activeWildcard,
    10 11   activeDNS,
    11 12   activeDNS_A,
    skipped 48 lines
    60 61   
    61 62   /* active Results Explorer */
    62 63   QStandardItem *activeHost;
     64 + QStandardItem *activeIP;
    63 65   QStandardItem *activeWildcard;
    64 66   QStandardItem *activeDNS;
    65 67   QStandardItem *activeA;
    skipped 41 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/models/ProjectModel.cpp
    skipped 11 lines
    12 12   explorer(new ExplorerModel),
    13 13   /* active Results Model */
    14 14   activeHost(new QStandardItemModel),
     15 + activeIP(new QStandardItemModel),
    15 16   activeWildcard(new QStandardItemModel),
    16 17   activeDNS(new QStandardItemModel),
    17 18   activeA(new QStandardItemModel),
    skipped 74 lines
    92 93   delete activeA;
    93 94   delete activeDNS;
    94 95   delete activeWildcard;
     96 + delete activeIP;
    95 97   delete activeHost;
    96 98   delete explorer;
    97 99  }
    98 100   
    99 101  void ProjectModel::setHeaderLabels(){
    100 102   activeHost->setHorizontalHeaderLabels({QObject::tr(" Host"), QObject::tr(" IPv4"), QObject::tr(" IPv6")});
     103 + activeIP->setHorizontalHeaderLabels({QObject::tr(" IP-Address"), QObject::tr(" Ports")});
    101 104   activeWildcard->setHorizontalHeaderLabels({QObject::tr(" Wildcard"), QObject::tr(" IPv4"), QObject::tr(" IPv6")});
    102 105   activeDNS->setHorizontalHeaderLabels({QObject::tr(" DNS Records")});
    103 106   activeA->setHorizontalHeaderLabels({QObject::tr(" A DNS Records")});
    skipped 39 lines
    143 146   
    144 147  void ProjectModel::clearModels(){
    145 148   activeHost->clear();
     149 + activeIP->clear();
    146 150   activeWildcard->clear();
    147 151   activeDNS->clear();
    148 152   activeA->clear();
    skipped 31 lines
    180 184   raw->clear();
    181 185   
    182 186   map_activeHost.clear();
     187 + map_activeIP.clear();
    183 188   map_activeWildcard.clear();
    184 189   map_activeDNS.clear();
    185 190   map_activeSSL.clear();
    skipped 5 lines
    191 196   map_enumMX.clear();
    192 197   map_enumSSL.clear();
    193 198   map_enumEmail.clear();
     199 + set_activeA.clear();
     200 + set_activeAAAA.clear();
     201 + set_activeNS.clear();
     202 + set_activeMX.clear();
     203 + set_activeTXT.clear();
     204 + set_activeCNAME.clear();
     205 + set_activeSRV.clear();
    194 206   
    195 207   this->setHeaderLabels();
    196 208  }
    197 209   
    198 210  int ProjectModel::getItemsCount(){
    199 211   return activeHost->rowCount()+
     212 + activeIP->rowCount()+
    200 213   activeWildcard->rowCount()+
    201 214   activeDNS->rowCount()+
    202 215   activeA->rowCount()+
    skipped 34 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/models/ProjectModel.h
    skipped 23 lines
    24 24  #include "src/items/SSLItem.h"
    25 25  #include "src/items/HostItem.h"
    26 26  #include "src/items/RawItem.h"
     27 +#include "src/items/IPToolItem.h"
    27 28  #include "src/items/WildcardItem.h"
    28 29  #include "src/modules/active/DNSScanner.h"
    29 30  #include "src/modules/active/SSLScanner.h"
    skipped 46 lines
    76 77   
    77 78   /* active Results Model */
    78 79   QStandardItemModel *activeHost;
     80 + QStandardItemModel *activeIP;
    79 81   QStandardItemModel *activeWildcard;
    80 82   QStandardItemModel *activeDNS;
    81 83   QStandardItemModel *activeA;
    skipped 35 lines
    117 119   
    118 120   /* item's maps */
    119 121   QMap<QString, s3s_item::HOST*> map_activeHost;
     122 + QMap<QString, s3s_item::IPTool*> map_activeIP;
    120 123   QMap<QString, s3s_item::Wildcard*> map_activeWildcard;
    121 124   QMap<QString, s3s_item::DNS*> map_activeDNS;
    122 125   QMap<QString, s3s_item::SSL*> map_activeSSL;
    skipped 15 lines
    138 141   
    139 142   /* for active results */
    140 143   void addActiveHost(const s3s_struct::HOST &host);
     144 + void addActiveIP(const s3s_struct::IPTool &ip);
     145 + void addActiveIP(const QString &ip, unsigned short port);
    141 146   void addActiveWildcard(const s3s_struct::Wildcard &wildcard);
    142 147   void addActiveDNS(const s3s_struct::DNS &dns);
    143 148   void addActiveRecord(const s3s_struct::DNS &dns);
    skipped 39 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/models/ProjectModel_serialization.cpp
    skipped 30 lines
    31 31   qDebug() << "Saving Project: " << info.path;
    32 32   
    33 33   QFile file(info.path);
     34 + file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
     35 + QFileDevice::ReadUser | QFileDevice::WriteUser |
     36 + QFileDevice::ReadGroup | QFileDevice::WriteGroup |
     37 + QFileDevice::ReadOther | QFileDevice::WriteOther);
    34 38   if(file.open(QIODevice::WriteOnly))
    35 39   {
    36 40   /* compress the data then save */
    skipped 22 lines
    59 63   qDebug() << "Saving Project Copy: " << info.path;
    60 64   
    61 65   QFile file(info.path);
     66 + file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
     67 + QFileDevice::ReadUser | QFileDevice::WriteUser |
     68 + QFileDevice::ReadGroup | QFileDevice::WriteGroup |
     69 + QFileDevice::ReadOther | QFileDevice::WriteOther);
    62 70   if(file.open(QIODevice::WriteOnly))
    63 71   {
    64 72   /* compress the data then save */
    skipped 46 lines
    111 119   qDebug() << "Opening Project: " << info.path;
    112 120   
    113 121   QFile file(info.path);
     122 + file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
     123 + QFileDevice::ReadUser | QFileDevice::WriteUser |
     124 + QFileDevice::ReadGroup | QFileDevice::WriteGroup |
     125 + QFileDevice::ReadOther | QFileDevice::WriteOther);
    114 126   if(!file.open(QIODevice::ReadOnly)){
    115 127   qWarning() << "Failed To Open Project File.";
    116 128   return;
    skipped 38 lines
    155 167   map_activeHost.insert(item->text(), item);
    156 168   }
    157 169   
     170 + /* active ip */
     171 + foreach(const QJsonValue &value, data["active_IP"].toArray()){
     172 + s3s_item::IPTool *item = new s3s_item::IPTool;
     173 + json_to_iptool(value.toObject(), item);
     174 + activeIP->appendRow({item, item->ports});
     175 + map_activeIP.insert(item->text(), item);
     176 + this->addActiveIP(iptool_to_struct(item));
     177 + }
     178 + 
    158 179   /* active Wildcards */
    159 180   foreach(const QJsonValue &value, data["active_wildcard"].toArray()){
    160 181   s3s_item::Wildcard *item = new s3s_item::Wildcard;
    skipped 178 lines
    339 360   QJsonArray active_SSL_sha256_array;
    340 361   QJsonArray active_SSL_altNames_array;
    341 362   QJsonArray active_Host_array;
     363 + QJsonArray active_IP_array;
    342 364   QJsonArray active_wildcard_array;
    343 365   QJsonArray active_SSL_array;
    344 366   QJsonArray active_DNS_array;
    skipped 87 lines
    432 454   active_Host_array.append(host_to_json(item));
    433 455   }
    434 456   
     457 + /* active IP */
     458 + for(int i = 0; i < activeIP->rowCount(); ++i){
     459 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(activeIP->itemFromIndex(activeIP->index(i, 0)));
     460 + active_IP_array.append(iptool_to_json(item));
     461 + }
     462 + 
    435 463   /* active Wildcard */
    436 464   for(int i = 0; i < activeWildcard->rowCount(); ++i){
    437 465   s3s_item::Wildcard *item = static_cast<s3s_item::Wildcard*>(activeWildcard->itemFromIndex(activeWildcard->index(i, 0)));
    skipped 68 lines
    506 534   
    507 535   QJsonObject data;
    508 536   data.insert("active_Host", active_Host_array);
     537 + data.insert("active_IP", active_IP_array);
    509 538   data.insert("active_wildcard", active_wildcard_array);
    510 539   data.insert("active_dns", active_DNS_array);
    511 540   data.insert("active_SSL", active_SSL_array);
    skipped 42 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/models/ProjectModel_slots.cpp
    skipped 23 lines
    24 24   modified = true;
    25 25  }
    26 26   
     27 +void ProjectModel::addActiveIP(const s3s_struct::IPTool &ip){
     28 + if(map_activeIP.contains(ip.ip))
     29 + {
     30 + s3s_item::IPTool *item = map_activeIP.value(ip.ip);
     31 + item->setValues(ip);
     32 + return;
     33 + }
     34 + 
     35 + s3s_item::IPTool *item = new s3s_item::IPTool;
     36 + item->setValues(ip);
     37 + activeIP->appendRow({item, item->ports});
     38 + map_activeIP.insert(ip.ip, item);
     39 + modified = true;
     40 +}
     41 + 
     42 +void ProjectModel::addActiveIP(const QString &ip, unsigned short port){
     43 + if(map_activeIP.contains(ip))
     44 + {
     45 + s3s_item::IPTool *item = map_activeIP.value(ip);
     46 + item->addPort(QString::number(port));
     47 + return;
     48 + }
     49 + 
     50 + s3s_item::IPTool *item = new s3s_item::IPTool;
     51 + item->setValues(ip, QString::number(port));
     52 + activeIP->appendRow({item, item->ports});
     53 + map_activeIP.insert(ip, item);
     54 + modified = true;
     55 +}
     56 + 
    27 57  void ProjectModel::addActiveWildcard(const s3s_struct::Wildcard &wildcard){
    28 58   if(map_activeWildcard.contains(wildcard.wildcard))
    29 59   {
    skipped 325 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/IPScanner.cpp
    1  -/*
    2  - Copyright 2020-2022 Enock Nicholaus <[email protected]>. All rights reserved.
    3  - Use of this source code is governed by GPL-3.0 LICENSE that can be found in the LICENSE file.
    4  - 
    5  - @brief :
    6  -*/
    7  - 
    8  -#include "IPScanner.h"
    9  -#include "src/utils/s3s.h"
    10  - 
    11  - 
    12  -ip::Scanner::Scanner(ip::ScanArgs *args): AbstractScanner(nullptr),
    13  - m_args(args)
    14  -{
    15  - connect(this, &ip::Scanner::next, this, &ip::Scanner::lookup);
    16  -}
    17  -ip::Scanner::~Scanner(){
    18  -}
    19  - 
    20  -void ip::Scanner::lookupFinished(QHostInfo info){
    21  - switch(info.error()){
    22  - case QHostInfo::UnknownError:
    23  - break;
    24  - 
    25  - case QHostInfo::NoError:
    26  - if(info.addresses().isEmpty() || info.hostName().isNull())
    27  - break;
    28  - 
    29  - if(info.addresses().at(0).toString() == info.hostName())
    30  - break;
    31  - 
    32  - emit scanResult(info.addresses().at(0).toString(), info.hostName());
    33  - break;
    34  - 
    35  - default:
    36  - log.message = info.errorString();
    37  - log.target = info.addresses().at(0).toString();
    38  - emit scanLog(log);
    39  - break;
    40  - }
    41  - 
    42  - /* send results and continue scan */
    43  - m_args->progress++;
    44  - emit scanProgress(m_args->progress);
    45  - emit next();
    46  -}
    47  - 
    48  -void ip::Scanner::lookup(){
    49  - QString target = getTarget(m_args);
    50  - 
    51  - if(!(target == nullptr))
    52  - QHostInfo::lookupHost(target,this, &ip::Scanner::lookupFinished);
    53  - else
    54  - emit quitThread();
    55  -}
    56  - 
    57  -QString ip::getTarget(ip::ScanArgs *args){
    58  - QMutexLocker(&args->mutex);
    59  - 
    60  - if(!args->targets.isEmpty())
    61  - return args->targets.dequeue();
    62  - else
    63  - return nullptr;
    64  -}
    65  - 
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/IPScanner.h
    1  -#ifndef IPSCANNER_H
    2  -#define IPSCANNER_H
    3  - 
    4  -#include "AbstractScanner.h"
    5  -#include "PortScanner.h"
    6  -#include "PingScanner.h"
    7  -#include <QQueue>
    8  -#include <QMutex>
    9  -#include <QHostInfo>
    10  - 
    11  -namespace ip {
    12  - 
    13  -struct ScanStat { // scan statistics
    14  - int nameservers = 0;
    15  - int targets = 0;
    16  - int threads = 0;
    17  - int resolved = 0;
    18  - int failed = 0;
    19  -};
    20  - 
    21  -struct ScanConfig { // scan configurations
    22  - QQueue<QString> nameservers;
    23  - port::ScanArgs *portScanConfig;
    24  - ping::ScanArgs *pingScanConfig;
    25  - int threads = 50;
    26  - int timeout = 3000;
    27  - 
    28  - bool setTimeout = false;
    29  - bool noDuplicates = false;
    30  - bool autoSaveToProject = false;
    31  -};
    32  - 
    33  -struct ScanArgs { // scan arguments
    34  - QMutex mutex;
    35  - ip::ScanConfig *config;
    36  - QQueue<QString> targets;
    37  - QHostAddress nameserver;
    38  - int progress;
    39  -};
    40  - 
    41  - 
    42  -class Scanner : public AbstractScanner{
    43  - Q_OBJECT
    44  - 
    45  - public:
    46  - explicit Scanner(ip::ScanArgs *args);
    47  - ~Scanner() override;
    48  - 
    49  - private slots:
    50  - void lookup() override;
    51  - void lookupFinished(QHostInfo);
    52  - 
    53  - signals:
    54  - void next(); // next lookup
    55  - void scanResult(QString ip, QString hostname); // send active enumerated results
    56  - 
    57  - private:
    58  - ip::ScanArgs *m_args;
    59  -};
    60  - 
    61  -QString getTarget(ip::ScanArgs *args);
    62  - 
    63  -}
    64  - 
    65  -#endif // IPSCANNER_H
    66  - 
  • ■ ■ ■ ■
    sub3suite/src/modules/active/PingScanner.cpp
    skipped 24 lines
    25 25   m_mutex.unlock();
    26 26   
    27 27   log.target = m_target;
    28  - QByteArray target = m_target.toLocal8Bit();
    29 28   
    30 29   /* start scan */
    31 30  #if defined(Q_OS_UNIX)
    skipped 1 lines
    33 32   emit scanLog(log);
    34 33  #endif
    35 34  #if defined(Q_OS_WIN)
     35 + QByteArray target = m_target.toLocal8Bit();
    36 36   gDestination = target.data();
    37 37   if(ping() == -1)
    38 38   emit scanLog(log);
    skipped 21 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/modules/active/PingScanner_unix.cpp
    skipped 12 lines
    13 13   socklen_t dst_addr_len;
    14 14   uint16_t id = (uint16_t)getpid();
    15 15   uint16_t seq = random();
    16  - int optlevel = 0, option = 0;
    17 16   
    18 17   /* get ping type */
    19 18   int ip_version = IP_V4;
    skipped 301 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/modules/active/PortScanner.cpp
    skipped 40 lines
    41 41   m_wait.wait(&m_mutex);
    42 42   
    43 43   /* check if received stop signal */
    44  - if(stop)
    45  - break;
     44 + if(stop){
     45 + delete socket;
     46 + return;
     47 + }
    46 48   
    47 49   m_mutex.unlock();
    48 50   
    skipped 13 lines
    62 64   m_target = getTarget(m_args);
    63 65   }
    64 66   
    65  - socket->deleteLater();
     67 + delete socket;
    66 68  }
    67 69   
    68 70  void port::Scanner::scanner_syn(){
     71 +#if defined(SYN_SCAN)
     72 + 
    69 73  #if defined(Q_OS_WIN)
    70 74   if(init_syn_scan() == -1)
    71 75   return;
    skipped 60 lines
    132 136  #if defined (Q_OS_UNIX)
    133 137   m_target = port::getTarget(m_args);
    134 138   while(m_target != nullptr) {
     139 + m_mutex.lock();
     140 + 
     141 + /* if received pause signal lock the thread, dont unlock until resume signal*/
     142 + if(pause)
     143 + m_wait.wait(&m_mutex);
     144 + 
     145 + /* check if received stop signal */
     146 + if(stop)
     147 + break;
     148 + 
     149 + m_mutex.unlock();
     150 + 
    135 151   log.target = m_target;
    136 152   QByteArray ba = m_target.toLocal8Bit();
    137 153   
    138 154   // start scan
    139  - if(start_syn_unix(ba.data(), m_args->target_ports.values()) == -1)
     155 + if(start_syn_scan(ba.data(), m_args->target_ports.values()) == -1)
    140 156   emit scanLog(log);
    141 157   
    142 158   // next target
    143 159   m_target = getTarget(m_args);
    144 160   }
    145 161  #endif // UNIX
     162 +#endif // SYN SCAN
    146 163  }
    147 164   
    148 165  QString port::getTarget(port::ScanArgs *args){
    skipped 8 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/PortScanner.h
    skipped 9 lines
    10 10  #include <QWaitCondition>
    11 11   
    12 12  #if defined(Q_OS_WIN)
     13 +#include <WinSock2.h>
     14 +#endif
    13 15   
     16 +#if defined(SYN_SCAN)
     17 + 
     18 +#if defined(Q_OS_WIN)
    14 19  #include <WinSock2.h>
    15 20  #include <Windows.h>
    16 21  #include <pcap.h>
    skipped 87 lines
    104 109   
    105 110  #endif // UNIX
    106 111   
     112 +#endif // SYN SCAN
     113 + 
    107 114  namespace port {
    108 115   
    109 116  enum ScanType{
    skipped 57 lines
    167 174   void scanner_syn();
    168 175   
    169 176   /* for syn scanner */
     177 +#if defined(SYN_SCAN)
    170 178   
    171  -#if defined(Q_OS_WIN)
     179 +#if defined(Q_OS_WIN_)
    172 180   pcap_t* fp = nullptr;
    173 181   char device_name[200];
    174 182   char *source_ip_address = nullptr;
    skipped 42 lines
    217 225   
    218 226   static struct in_addr dest_ip;
    219 227  #endif // UNIX
     228 + 
     229 +#endif // SYN SCAN
    220 230  };
    221 231   
    222 232  QString getTarget(port::ScanArgs *args);
    skipped 5 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/PortScanner_unix.cpp
    1 1  #include "PortScanner.h"
    2 2   
     3 +#if defined(SYN_SCAN)
     4 + 
    3 5  #if defined(Q_OS_UNIX)
    4 6   
    5 7  struct in_addr port::Scanner::dest_ip;
    skipped 304 lines
    310 312   
    311 313  #endif // UNIX
    312 314   
     315 +#endif // SYN SCAN
     316 + 
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/PortScanner_win.cpp
    1 1  #include "PortScanner.h"
    2 2   
     3 +#if defined(SYN_SCAN)
    3 4  #if defined(Q_OS_WIN)
    4 5   
    5 6  int port::Scanner::start_syn_scan(QList<u_short> target_ports) {
    skipped 412 lines
    418 419   }
    419 420  }
    420 421  #endif // WINDOWS
     422 +#endif // SYN SCAN
    421 423   
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/ReverseIPScanner.cpp
     1 +/*
     2 + Copyright 2020-2022 Enock Nicholaus <[email protected]>. All rights reserved.
     3 + Use of this source code is governed by GPL-3.0 LICENSE that can be found in the LICENSE file.
     4 + 
     5 + @brief :
     6 +*/
     7 + 
     8 +#include "ReverseIPScanner.h"
     9 +#include "src/utils/s3s.h"
     10 + 
     11 + 
     12 +reverseip::Scanner::Scanner(reverseip::ScanArgs *args): AbstractScanner(nullptr),
     13 + m_args(args)
     14 +{
     15 +}
     16 +reverseip::Scanner::~Scanner(){
     17 +}
     18 + 
     19 +void reverseip::Scanner::lookup(){
     20 + m_target = getTarget(m_args);
     21 + while(m_target != nullptr) {
     22 + m_mutex.lock();
     23 + 
     24 + /* if received pause signal lock the thread, dont unlock until resume signal*/
     25 + if(pause)
     26 + m_wait.wait(&m_mutex);
     27 + 
     28 + /* check if received stop signal */
     29 + if(stop)
     30 + break;
     31 + 
     32 + m_mutex.unlock();
     33 + 
     34 + QHostInfo info = QHostInfo::fromName(m_target);
     35 + switch(info.error()){
     36 + case QHostInfo::UnknownError:
     37 + break;
     38 + 
     39 + case QHostInfo::NoError:
     40 + if(info.addresses().isEmpty() || info.hostName().isNull())
     41 + break;
     42 + 
     43 + if(info.addresses().at(0).toString() == info.hostName())
     44 + break;
     45 + 
     46 + emit scanResult(info.addresses().at(0).toString(), info.hostName());
     47 + break;
     48 + 
     49 + default:
     50 + log.message = info.errorString();
     51 + log.target = info.addresses().at(0).toString();
     52 + emit scanLog(log);
     53 + break;
     54 + }
     55 + 
     56 + /* scan progress */
     57 + m_args->progress++;
     58 + emit scanProgress(m_args->progress);
     59 + 
     60 + /* get next target */
     61 + m_target = getTarget(m_args);
     62 + }
     63 + emit quitThread();
     64 +}
     65 + 
     66 +QString reverseip::getTarget(reverseip::ScanArgs *args){
     67 + QMutexLocker(&args->mutex);
     68 + 
     69 + if(!args->targets.isEmpty())
     70 + return args->targets.dequeue();
     71 + else
     72 + return nullptr;
     73 +}
     74 + 
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/modules/active/ReverseIPScanner.h
     1 +#ifndef IPSCANNER_H
     2 +#define IPSCANNER_H
     3 + 
     4 +#include "AbstractScanner.h"
     5 +#include "PortScanner.h"
     6 +#include "PingScanner.h"
     7 +#include <QQueue>
     8 +#include <QMutex>
     9 +#include <QHostInfo>
     10 + 
     11 +namespace reverseip {
     12 + 
     13 +struct ScanStat { // scan statistics
     14 + int nameservers = 0;
     15 + int targets = 0;
     16 + int threads = 0;
     17 + int resolved = 0;
     18 + int failed = 0;
     19 +};
     20 + 
     21 +struct ScanConfig { // scan configurations
     22 + QQueue<QString> nameservers;
     23 + port::ScanArgs *portScanConfig;
     24 + ping::ScanArgs *pingScanConfig;
     25 + int threads = 50;
     26 + int timeout = 3000;
     27 + 
     28 + bool setTimeout = false;
     29 + bool noDuplicates = false;
     30 + bool autoSaveToProject = false;
     31 +};
     32 + 
     33 +struct ScanArgs { // scan arguments
     34 + QMutex mutex;
     35 + reverseip::ScanConfig *config;
     36 + QQueue<QString> targets;
     37 + QHostAddress nameserver;
     38 + int progress;
     39 +};
     40 + 
     41 + 
     42 +class Scanner : public AbstractScanner{
     43 + Q_OBJECT
     44 + 
     45 + public:
     46 + explicit Scanner(reverseip::ScanArgs *args);
     47 + ~Scanner() override;
     48 + 
     49 + private slots:
     50 + void lookup() override;
     51 + 
     52 + signals:
     53 + void scanResult(QString ip, QString hostname); // send active enumerated results
     54 + 
     55 + public slots:
     56 + virtual void onStopScan() override {
     57 + stop = true;
     58 + }
     59 + 
     60 + void onPauseScan() override {
     61 + m_mutex.lock();
     62 + pause = true;
     63 + m_mutex.unlock();
     64 + }
     65 + 
     66 + void onResumeScan() override {
     67 + m_mutex.lock();
     68 + pause = false;
     69 + m_mutex.unlock();
     70 + m_wait.wakeAll();
     71 + }
     72 + 
     73 + private:
     74 + reverseip::ScanArgs *m_args;
     75 + QString m_target;
     76 + bool stop = false;
     77 + bool pause = false;
     78 + QWaitCondition m_wait;
     79 + QMutex m_mutex;
     80 +};
     81 + 
     82 +QString getTarget(reverseip::ScanArgs *args);
     83 + 
     84 +}
     85 + 
     86 +#endif // IPSCANNER_H
     87 + 
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/project/Project_actions.cpp
    skipped 16 lines
    17 17   model->activeHost->clear();
    18 18   model->map_activeHost.clear();
    19 19   break;
     20 + case ExplorerType::activeIP:
     21 + model->activeIP->clear();
     22 + model->map_activeIP.clear();
     23 + break;
    20 24   case ExplorerType::activeWildcard:
    21 25   model->activeWildcard->clear();
    22 26   model->map_activeWildcard.clear();
    skipped 230 lines
    253 257   case ExplorerType::activeDNS_MX:
    254 258   case ExplorerType::activeDNS_TXT:
    255 259   case ExplorerType::activeDNS_CNAME:
     260 + case ExplorerType::activeDNS_SRV:
    256 261   case ExplorerType::activeSSL_sha1:
    257 262   case ExplorerType::activeSSL_sha256:
    258 263   case ExplorerType::activeSSL_altNames:
    skipped 35 lines
    294 299   break;
    295 300   default:
    296 301   break;
    297  - }
    298  - break;
    299  - case ExplorerType::activeDNS_SRV:
    300  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    301  - QString name(proxyModel->index(i, 0).data().toString());
    302  - QString target(proxyModel->index(i, 1).data().toString());
    303  - QString port(proxyModel->index(i, 2).data().toString());
    304  - 
    305  - if(!target.isEmpty())
    306  - name.append(",").append(target);
    307  - if(!port.isEmpty())
    308  - name.append(",").append(port);
    309  - 
    310  - file.write(name.append(NEWLINE).toUtf8());
    311 302   }
    312 303   break;
    313 304   case ExplorerType::activeHost:
    skipped 124 lines
    438 429   file.write(document.toJson());
    439 430   }
    440 431   break;
     432 + case ExplorerType::activeIP:
     433 + {
     434 + QJsonArray array;
     435 + for(int i = 0; i != proxyModel->rowCount(); ++i){
     436 + QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
     437 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(model->activeIP->itemFromIndex(model_index));
     438 + array.append(iptool_to_json(item));
     439 + }
     440 + QJsonDocument document;
     441 + document.setArray(array);
     442 + file.write(document.toJson());
     443 + }
     444 + break;
    441 445   case ExplorerType::activeSSL:
    442 446   {
    443 447   QJsonArray array;
    skipped 144 lines
    588 592   case ExplorerType::activeDNS_MX:
    589 593   case ExplorerType::activeDNS_TXT:
    590 594   case ExplorerType::activeDNS_CNAME:
     595 + case ExplorerType::activeDNS_SRV:
    591 596   case ExplorerType::activeSSL_sha1:
    592 597   case ExplorerType::activeSSL_sha256:
    593 598   case ExplorerType::activeSSL_altNames:
    skipped 37 lines
    631 636   break;
    632 637   }
    633 638   break;
    634  - case ExplorerType::activeDNS_SRV:
    635  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    636  - QString name(proxyModel->index(i, 0).data().toString());
    637  - QString target(proxyModel->index(i, 1).data().toString());
    638  - QString port(proxyModel->index(i, 2).data().toString());
    639  - 
    640  - if(!target.isEmpty())
    641  - name.append(",").append(target);
    642  - if(!port.isEmpty())
    643  - name.append(",").append(port);
    644  - 
    645  - clipboardData.append(name.append(NEWLINE));
    646  - }
    647  - break;
    648 639   case ExplorerType::activeHost:
    649 640   switch (result_type) {
    650 641   case RESULT_TYPE::JSON:
    skipped 116 lines
    767 758   QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
    768 759   s3s_item::DNS *item = static_cast<s3s_item::DNS*>(model->activeDNS->itemFromIndex(model_index));
    769 760   array.append(dns_to_json(item));
     761 + }
     762 + QJsonDocument document;
     763 + document.setArray(array);
     764 + clipboardData.append(document.toJson());
     765 + }
     766 + break;
     767 + case ExplorerType::activeIP:
     768 + {
     769 + QJsonArray array;
     770 + for(int i = 0; i != proxyModel->rowCount(); ++i){
     771 + QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
     772 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(model->activeIP->itemFromIndex(model_index));
     773 + array.append(iptool_to_json(item));
    770 774   }
    771 775   QJsonDocument document;
    772 776   document.setArray(array);
    skipped 983 lines
    1756 1760   if((i->parent() == model->activeHost->invisibleRootItem()->index()) && (i->column() == 0)){
    1757 1761   model->map_activeHost.remove(i->data().toString());
    1758 1762   model->activeHost->removeRow(i->row());
     1763 + }
     1764 + }
     1765 + break;
     1766 + case ExplorerType::activeIP:
     1767 + for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i){
     1768 + if((i->parent() == model->activeHost->invisibleRootItem()->index()) && (i->column() == 0)){
     1769 + model->map_activeIP.remove(i->data().toString());
     1770 + model->activeIP->removeRow(i->row());
    1759 1771   }
    1760 1772   }
    1761 1773   break;
    skipped 323 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/project/Project_contextmenu.cpp
    skipped 163 lines
    164 164   menu.addAction(tr("Send NS to NS-Enum"), this, [=](){this->action_send_selected_toEnum(ENUMERATOR::NS);})->setIcon(QIcon(":/img/res/icons/ns.png"));
    165 165   }
    166 166   break;
     167 + case ExplorerType::activeIP:
    167 168   case ExplorerType::activeDNS_A:
    168 169   case ExplorerType::activeDNS_AAAA:
    169 170   case ExplorerType::passive_A:
    170 171   case ExplorerType::passive_AAAA:
    171  - menu.addAction(tr("Open in Browser"), this, [=](){this->action_openInBrowser();})->setIcon(QIcon(":/img/res/icons/browser.png"));
    172  - menu.addSeparator();
    173  - menu.addAction(tr("Send IpAddress to OSINT"), this, [=](){this->action_send_selected_toEngine(TOOL::OSINT, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    174  - menu.addAction(tr("Send IpAddress to RAW"), this, [=](){this->action_send_selected_toEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    175  - menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->action_send_selected_toEngine(TOOL::IP, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    176  - menu.addSeparator();
    177  - menu.addAction(tr("Send IpAddress to IP-Enum"), this, [=](){this->action_send_selected_toEnum(ENUMERATOR::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
     172 + if(m_selectionModel->columnIntersectsSelection(0, m_selectionModel->currentIndex().parent())){
     173 + menu.addAction(tr("Open in Browser"), this, [=](){this->action_openInBrowser();})->setIcon(QIcon(":/img/res/icons/browser.png"));
     174 + menu.addSeparator();
     175 + menu.addAction(tr("Send IpAddress to OSINT"), this, [=](){this->action_send_selected_toEngine(TOOL::OSINT, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
     176 + menu.addAction(tr("Send IpAddress to RAW"), this, [=](){this->action_send_selected_toEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
     177 + menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->action_send_selected_toEngine(TOOL::IP, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
     178 + menu.addSeparator();
     179 + menu.addAction(tr("Send IpAddress to IP-Enum"), this, [=](){this->action_send_selected_toEnum(ENUMERATOR::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
     180 + }
    178 181   break;
    179 182   case ExplorerType::activeDNS_NS:
    180 183   case ExplorerType::passive_NS:
    skipped 149 lines
    330 333   menu_send->addAction(tr("Send MX to MX-Enum"), this, [=](){this->action_send_mx();})->setIcon(QIcon(":/img/res/icons/mx.png"));
    331 334   menu_send->addAction(tr("Send NS to NS-Enum"), this, [=](){this->action_send_ns();})->setIcon(QIcon(":/img/res/icons/ns.png"));
    332 335   break;
     336 + case ExplorerType::activeIP:
    333 337   case ExplorerType::activeDNS_A:
    334 338   case ExplorerType::activeDNS_AAAA:
    335 339   case ExplorerType::passive_A:
    skipped 186 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/project/Project_slots.cpp
    skipped 43 lines
    44 44   a_collapse.setDisabled(true);
    45 45   ui->treeViewTree->setSortingEnabled(true);
    46 46   }
     47 + if(index == model->explorer->activeIP->index()){
     48 + proxyModel->setSourceModel(model->activeIP);
     49 + ui->treeViewTree->setProperty(SITEMAP_TYPE, ExplorerType::activeIP);
     50 + ui->comboBoxFilter->addItems({"IP Address", "Ports"});
     51 + ui->comboBoxFilter->show();
     52 + 
     53 + a_expand.setDisabled(true);
     54 + a_collapse.setDisabled(true);
     55 + ui->treeViewTree->setSortingEnabled(true);
     56 + }
    47 57   if(index == model->explorer->activeDNS->index()){
    48 58   ui->treeViewTree->setIndentation(15);
    49 59   
    skipped 298 lines
    348 358   item_comment = &item->comment;
    349 359   }
    350 360   break;
     361 + case ExplorerType::activeIP:
     362 + {
     363 + ui->label_item_type->setText("IP-Address");
     364 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(model->activeIP->itemFromIndex(proxyModel->mapToSource(index)));
     365 + ui->label_item_modified->setText(item->last_modified);
     366 + ui->plainTextEdit_item_comment->setPlainText(item->comment);
     367 + item_comment = &item->comment;
     368 + }
     369 + break;
    351 370   case ExplorerType::activeWildcard:
    352 371   {
    353 372   ui->label_item_type->setText("Wildcard");
    skipped 119 lines
    473 492   s3s_item::HOST *item = static_cast<s3s_item::HOST*>(model->activeHost->itemFromIndex(model_index));
    474 493   QJsonDocument document;
    475 494   document.setObject(host_to_json(item));
     495 + ui->plainTextEditJson->setPlainText(document.toJson());
     496 + return;
     497 + }
     498 + }
     499 + break;
     500 + case ExplorerType::activeIP:
     501 + {
     502 + QModelIndex model_index = proxyModel->mapToSource(index);
     503 + if(model_index.parent() == model->activeIP->invisibleRootItem()->index()){
     504 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(model->activeIP->itemFromIndex(model_index));
     505 + QJsonDocument document;
     506 + document.setObject(iptool_to_json(item));
    476 507   ui->plainTextEditJson->setPlainText(document.toJson());
    477 508   return;
    478 509   }
    skipped 167 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/tools/host/HostTool.h
    skipped 56 lines
    57 57   QElapsedTimer m_timer;
    58 58   QMap<QString,QString> m_failedScans;
    59 59   QMap<QString, s3s_item::HOST*> set_subdomain;
     60 + QMap<QString, s3s_item::IPTool*> set_ports;
    60 61   host::ScanConfig *m_scanConfig;
    61 62   host::ScanArgs *m_scanArgs;
    62 63   host::ScanStat *m_scanStats;
    skipped 38 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/host/HostTool_actions.cpp
    skipped 15 lines
    16 16  void HostTool::clearResults(){
    17 17   /* clear the results */
    18 18   switch (ui->comboBoxOption->currentIndex()) {
    19  - case 0: // DNS
     19 + case 0: // DNS RESOLVE
    20 20   m_model_dns->clear();
    21 21   m_model_dns->setHorizontalHeaderLabels({tr(" Host"), tr(" IPv4"), tr(" IPv6")});
    22 22   set_subdomain.clear();
    23 23   break;
    24  - case 1:
     24 + case 1: // PORT
    25 25   m_model_port->clear();
    26 26   m_model_port->setHorizontalHeaderLabels({tr(" Host"), tr(" IP"), tr(" Ports")});
     27 + set_ports.clear();
    27 28   break;
    28  - case 2:
     29 + case 2: // PING
    29 30   m_model_ping->clear();
    30 31   m_model_ping->setHorizontalHeaderLabels({tr(" Host"), tr(" IP"), tr(" Time(ms)")});
    31 32   break;
    skipped 23 lines
    55 56   break;
    56 57   case 1: // PORT
    57 58   for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i){
    58  - set_subdomain.remove(i->data().toString());
     59 + set_ports.remove(i->data().toString());
    59 60   m_model_port->removeRow(i->row());
    60 61   }
    61 62   break;
    62 63   case 2: // PING
    63  - for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i){
    64  - set_subdomain.remove(i->data().toString());
     64 + for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i)
    65 65   m_model_ping->removeRow(i->row());
    66  - }
    67 66   }
    68 67   
    69 68   ui->labelResultsCount->setNum(proxyModel->rowCount());
    skipped 22 lines
    92 91   case RESULT_TYPE::IP:
    93 92   for(int i = 0; i != proxyModel->rowCount(); ++i){
    94 93   QString ipv4(proxyModel->index(i, 1).data().toString());
    95  - QString ipv6(proxyModel->index(i, 2).data().toString());
    96 94   if(!ipv4.isEmpty())
    97 95   file.write(ipv4.append(NEWLINE).toUtf8());
    98  - if(!ipv6.isEmpty())
    99  - file.write(ipv6.append(NEWLINE).toUtf8());
     96 + if(ui->comboBoxOption->currentIndex() == 0){
     97 + QString ipv6(proxyModel->index(i, 2).data().toString());
     98 + if(!ipv6.isEmpty())
     99 + file.write(ipv6.append(NEWLINE).toUtf8());
     100 + }
    100 101   }
    101 102   break;
    102 103   
    skipped 12 lines
    115 116   }
    116 117   break;
    117 118   
    118  - case RESULT_TYPE::JSON:
    119  - {
    120  - QJsonDocument document;
    121  - QJsonArray array;
    122  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    123  - QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
    124  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
    125  - array.append(host_to_json(item));
    126  - }
    127  - document.setArray(array);
    128  - file.write(document.toJson());
    129  - break;
    130  - }
    131  - 
    132 119   default:
    133 120   break;
    134 121   }
    skipped 36 lines
    171 158   for(int i = 0; i != proxyModel->rowCount(); ++i)
    172 159   {
    173 160   QString ipv4(proxyModel->index(i, 1).data().toString());
    174  - QString ipv6(proxyModel->index(i, 2).data().toString());
    175 161   if(!ipv4.isEmpty())
    176 162   clipboardData.append(ipv4).append(NEWLINE);
    177  - if(!ipv6.isEmpty())
    178  - clipboardData.append(ipv6).append(NEWLINE);
     163 + if(ui->comboBoxOption->currentIndex() == 0){
     164 + QString ipv6(proxyModel->index(i, 2).data().toString());
     165 + if(!ipv6.isEmpty())
     166 + clipboardData.append(ipv6).append(NEWLINE);
     167 + }
    179 168   }
    180 169   break;
    181 170   
    skipped 13 lines
    195 184   }
    196 185   break;
    197 186   
    198  - case RESULT_TYPE::JSON:
    199  - {
    200  - QJsonDocument document;
    201  - QJsonArray array;
    202  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    203  - QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
    204  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
    205  - array.append(host_to_json(item));
    206  - }
    207  - document.setArray(array);
    208  - clipboardData.append(document.toJson());
    209  - }
    210  - break;
    211  - 
    212 187   default:
    213 188   break;
    214 189   }
    skipped 56 lines
    271 246  /// sending results...
    272 247  ///
    273 248   
    274  -void HostTool::sendToProject(){
    275  - for(int i = 0; i != proxyModel->rowCount(); ++i)
    276  - {
    277  - QModelIndex index = proxyModel->mapToSource(proxyModel->index(i ,0));
    278  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(index));
    279  - project->addActiveHost(host_to_struct(item));
     249 +void HostTool::sendToProject() {
     250 + if(ui->comboBoxOption->currentIndex() == 0){
     251 + for(int i = 0; i != proxyModel->rowCount(); ++i){
     252 + QModelIndex index = proxyModel->mapToSource(proxyModel->index(i ,0));
     253 + s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(index));
     254 + project->addActiveHost(host_to_struct(item));
     255 + }
    280 256   }
     257 + if(ui->comboBoxOption->currentIndex() == 1){
     258 + for(int i = 0; i != proxyModel->rowCount(); ++i){
     259 + QModelIndex index = proxyModel->mapToSource(proxyModel->index(i ,1));
     260 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(m_model_port->itemFromIndex(index));
     261 + project->addActiveIP(iptool_to_struct(item));
     262 + }
     263 + }
     264 + 
    281 265  }
    282 266   
    283  -void HostTool::sendSelectedToProject(){
    284  - foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
    285  - if(index.column())
    286  - continue;
    287  - QModelIndex model_index = proxyModel->mapToSource(index);
    288  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
    289  - project->addActiveHost(host_to_struct(item));
     267 +void HostTool::sendSelectedToProject() {
     268 + if(ui->comboBoxOption->currentIndex() == 0){
     269 + foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
     270 + if(index.column())
     271 + continue;
     272 + QModelIndex model_index = proxyModel->mapToSource(index);
     273 + s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
     274 + project->addActiveHost(host_to_struct(item));
     275 + }
    290 276   }
     277 + if(ui->comboBoxOption->currentIndex() == 1){
     278 + foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
     279 + if(index.column() == 1){
     280 + QModelIndex model_index = proxyModel->mapToSource(index);
     281 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(m_model_port->itemFromIndex(model_index));
     282 + project->addActiveIP(iptool_to_struct(item));
     283 + }
     284 + }
     285 + }
     286 + 
    291 287  }
    292 288   
    293 289  void HostTool::sendToEngine(const TOOL &engine, const RESULT_TYPE &result_type){
    skipped 8 lines
    302 298   case RESULT_TYPE::IP:
    303 299   for(int i = 0; i != proxyModel->rowCount(); ++i){
    304 300   targets.insert(proxyModel->index(i, 1).data().toString());
    305  - targets.insert(proxyModel->index(i, 2).data().toString());
     301 + if(ui->comboBoxOption->currentIndex() == 0)
     302 + targets.insert(proxyModel->index(i, 2).data().toString());
    306 303   }
    307 304   break;
    308 305   default:
    skipped 105 lines
    414 411   /* getting the targets */
    415 412   for(int i = 0; i != proxyModel->rowCount(); ++i){
    416 413   targets.insert(proxyModel->index(i, 1).data().toString());
    417  - targets.insert(proxyModel->index(i, 2).data().toString());
     414 + if(ui->comboBoxOption->currentIndex() == 0)
     415 + targets.insert(proxyModel->index(i, 2).data().toString());
    418 416   }
    419 417   
    420 418   /* sending the targets */
    skipped 42 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/host/HostTool_contextmenu.cpp
    skipped 22 lines
    23 23   QMenu saveMenu(this);
    24 24   saveMenu.setTitle(tr("Save"));
    25 25   saveMenu.setIcon(QIcon(":/img/res/icons/save.png"));
    26  - saveMenu.addAction(tr("as JSON"), this, [=](){this->saveResults(RESULT_TYPE::JSON);});
    27 26   saveMenu.addAction(tr("as CSV"), this, [=](){this->saveResults(RESULT_TYPE::CSV);});
    28 27   saveMenu.addSeparator();
    29 28   saveMenu.addAction(tr("Subdomain"), this, [=](){this->saveResults(RESULT_TYPE::SUBDOMAIN);});
    skipped 3 lines
    33 32   QMenu copyMenu(this);
    34 33   copyMenu.setTitle(tr("Copy"));
    35 34   copyMenu.setIcon(QIcon(":/img/res/icons/copy.png"));
    36  - copyMenu.addAction(tr("as JSON"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAINIP);});
    37  - copyMenu.addAction(tr("as CSV"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAINIP);});
     35 + copyMenu.addAction(tr("as CSV"), this, [=](){this->copyResults(RESULT_TYPE::CSV);});
    38 36   copyMenu.addSeparator();
    39 37   copyMenu.addAction(tr("Subdomain"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAIN);});
    40 38   copyMenu.addAction(tr("Ip"), this, [=](){this->copyResults(RESULT_TYPE::IP);});
    skipped 14 lines
    55 53   menu.addMenu(&copyMenu);
    56 54   menu.addMenu(&extractMenu);
    57 55   menu.addSeparator();
    58  - menu.addAction(tr("Send To Project"), this, [=](){this->sendToProject();})->setIcon(QIcon(":/img/res/icons/project.png"));
    59  - menu.addSeparator();
     56 + if(ui->comboBoxOption->currentIndex() == 0 || ui->comboBoxOption->currentIndex() == 1){
     57 + menu.addAction(tr("Send To Project"), this, [=](){this->sendToProject();})->setIcon(QIcon(":/img/res/icons/project.png"));
     58 + menu.addSeparator();
     59 + }
    60 60   menu.addAction(tr("Send IpAddress to OSINT"), this, [=](){this->sendToEngine(TOOL::OSINT, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    61 61   menu.addAction(tr("Send IpAddress to RAW"), this, [=](){this->sendToEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    62 62   menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->sendToEngine(TOOL::IP, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    skipped 37 lines
    100 100   menu.addSeparator();
    101 101   menu.addAction(tr("Save"), this, [=](){this->saveSelectedResults();})->setIcon(QIcon(":/img/res/icons/save.png"));
    102 102   menu.addAction(tr("Copy"), this, [=](){this->copySelectedResults();})->setIcon(QIcon(":/img/res/icons/copy.png"));
    103  - if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent()))
     103 + if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent())){
    104 104   menu.addMenu(&extractMenu);
    105  - menu.addSeparator();
     105 + menu.addSeparator();
     106 + }
    106 107   menu.addAction(tr("Send To Project"), this, [=](){this->sendSelectedToProject();})->setIcon(QIcon(":/img/res/icons/project.png"));
    107 108   menu.addSeparator();
    108 109   if(selectionModel->columnIntersectsSelection(1, selectionModel->currentIndex().parent()) ||
    109  - selectionModel->columnIntersectsSelection(2, selectionModel->currentIndex().parent())){
     110 + (selectionModel->columnIntersectsSelection(2, selectionModel->currentIndex().parent()) &&
     111 + ui->comboBoxOption->currentIndex() == 0)){
    110 112   menu.addAction(tr("Send IpAddress to OSINT"), this, [=](){this->sendSelectedToEngine(TOOL::OSINT, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    111 113   menu.addAction(tr("Send IpAddress to RAW"), this, [=](){this->sendSelectedToEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    112 114   menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->sendSelectedToEngine(TOOL::IP, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    skipped 20 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/host/HostTool_results.cpp
    skipped 26 lines
    27 27   
    28 28   ui->labelResultsCount->setNum(proxyModel->rowCount());
    29 29   m_scanStats->resolved++;
     30 + 
     31 + /* save to Project model */
     32 + if(m_scanConfig->autoSaveToProject){
     33 + s3s_struct::HOST s3s_host;
     34 + s3s_host.host = host;
     35 + s3s_host.ipv4 = ip;
     36 + project->addActiveHost(s3s_host);
     37 + }
    30 38  }
    31 39   
    32 40  void HostTool::onScanResult_port(QString hostname, QString ip, u_short port){
     41 + if(set_ports.contains(hostname)){
     42 + s3s_item::IPTool *item = set_ports.value(hostname);
     43 + item->addPort(QString::number(port));
     44 + return;
     45 + }
     46 + 
     47 + s3s_item::IPTool *item = new s3s_item::IPTool;
     48 + item->setValues(ip, QString::number(port));
     49 + 
    33 50   m_model_port->appendRow({new QStandardItem(hostname),
    34  - new QStandardItem(ip),
    35  - new QStandardItem(QString::number(port))});
     51 + item, item->ports});
     52 + 
     53 + set_ports.insert(hostname, item);
    36 54   
    37 55   ui->labelResultsCount->setNum(proxyModel->rowCount());
    38 56   m_scanStats->resolved++;
     57 + 
     58 + /* save to Project model */
     59 + if(m_scanConfig->autoSaveToProject)
     60 + project->addActiveIP(ip, port);
    39 61  }
    40 62   
    41 63  void HostTool::onScanResult_dns(s3s_struct::HOST host){
    skipped 34 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/ip/IPTool.cpp
    skipped 17 lines
    18 18   
    19 19  IPTool::IPTool(QWidget *parent, ProjectModel *project) : AbstractTool(parent, project),
    20 20   ui(new Ui::IPTool),
    21  - m_scanConfig(new ip::ScanConfig),
    22  - m_scanArgs(new ip::ScanArgs),
    23  - m_scanStats(new ip::ScanStat),
     21 + m_scanConfig(new reverseip::ScanConfig),
     22 + m_scanArgs(new reverseip::ScanArgs),
     23 + m_scanStats(new reverseip::ScanStat),
    24 24   m_portscannerArgs(new port::ScanArgs),
    25 25   m_pingscannerArgs(new ping::ScanArgs),
    26 26   m_targetListModel(new QStringListModel),
    skipped 233 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/ip/IPTool.h
    skipped 14 lines
    15 15   
    16 16  #include "../AbstractTool.h"
    17 17  #include "src/utils/utils.h"
    18  -#include "src/modules/active/IPScanner.h"
     18 +#include "src/modules/active/ReverseIPScanner.h"
    19 19  #include "src/modules/active/PortScanner.h"
    20 20  #include "src/modules/active/PingScanner.h"
    21 21   
    skipped 34 lines
    56 56   Ui::IPTool *ui;
    57 57   QElapsedTimer m_timer;
    58 58   QMap<QString,QString> m_failedScans;
    59  - QMap<QString, s3s_item::HOST*> set_subdomain;
    60  - ip::ScanConfig *m_scanConfig;
    61  - ip::ScanArgs *m_scanArgs;
    62  - ip::ScanStat *m_scanStats;
     59 + QMap<QString, s3s_item::IPTool*> set_ports;
     60 + reverseip::ScanConfig *m_scanConfig;
     61 + reverseip::ScanArgs *m_scanArgs;
     62 + reverseip::ScanStat *m_scanStats;
    63 63   port::ScanArgs *m_portscannerArgs;
    64 64   ping::ScanArgs *m_pingscannerArgs;
    65 65   QStringListModel *m_targetListModel;
    skipped 18 lines
    84 84   void saveSelectedResults();
    85 85   void copyResults(const RESULT_TYPE&);
    86 86   void copySelectedResults();
    87  - /* extracting subdomain names */
    88  - void extract(bool subdomain, bool tld);
    89  - void extractSelected(bool subdomain, bool tld);
    90 87   /* sending results to other parts */
    91 88   void sendToProject();
    92 89   void sendSelectedToProject();
    skipped 8 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/tools/ip/IPTool_actions.cpp
    skipped 15 lines
    16 16  void IPTool::clearResults(){
    17 17   /* clear the results */
    18 18   switch (ui->comboBoxOption->currentIndex()) {
    19  - case 0: // DNS
     19 + case 0: // REVERSE IP
    20 20   m_model_dns->clear();
    21 21   m_model_dns->setHorizontalHeaderLabels({tr(" IP"), tr(" Hostname")});
    22  - set_subdomain.clear();
    23 22   break;
    24  - case 1:
     23 + case 1: // PORT
    25 24   m_model_port->clear();
    26 25   m_model_port->setHorizontalHeaderLabels({tr(" IP"), tr(" Ports")});
     26 + set_ports.clear();
    27 27   break;
    28  - case 2:
     28 + case 2: // PING
    29 29   m_model_ping->clear();
    30 30   m_model_ping->setHorizontalHeaderLabels({tr(" IP"), tr(" Time(ms)")});
    31 31   break;
    skipped 16 lines
    48 48   QModelIndexList selectedIndexes = model_selectedIndexes.indexes();
    49 49   switch (ui->comboBoxOption->currentIndex()) {
    50 50   case 0: // DNS
    51  - for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i){
    52  - set_subdomain.remove(i->data().toString());
     51 + for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i)
    53 52   m_model_dns->removeRow(i->row());
    54  - }
    55 53   break;
    56 54   case 1: // PORT
    57 55   for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i){
    58  - set_subdomain.remove(i->data().toString());
     56 + set_ports.remove(i->data().toString());
    59 57   m_model_port->removeRow(i->row());
    60 58   }
    61 59   break;
    62 60   case 2: // PING
    63  - for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i){
    64  - set_subdomain.remove(i->data().toString());
     61 + for(QModelIndexList::const_iterator i = selectedIndexes.constEnd()-1; i >= selectedIndexes.constBegin(); --i)
    65 62   m_model_ping->removeRow(i->row());
    66  - }
    67 63   }
    68 64   
    69 65   ui->labelResultsCount->setNum(proxyModel->rowCount());
    skipped 16 lines
    86 82   switch(result_type){
    87 83   case RESULT_TYPE::SUBDOMAIN:
    88 84   for(int i = 0; i != proxyModel->rowCount(); ++i)
    89  - file.write(proxyModel->index(i, 0).data().toString().append(NEWLINE).toUtf8());
     85 + file.write(proxyModel->index(i, 1).data().toString().append(NEWLINE).toUtf8());
    90 86   break;
    91 87   
    92 88   case RESULT_TYPE::IP:
    93  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    94  - QString ipv4(proxyModel->index(i, 1).data().toString());
    95  - QString ipv6(proxyModel->index(i, 2).data().toString());
    96  - if(!ipv4.isEmpty())
    97  - file.write(ipv4.append(NEWLINE).toUtf8());
    98  - if(!ipv6.isEmpty())
    99  - file.write(ipv6.append(NEWLINE).toUtf8());
    100  - }
     89 + for(int i = 0; i != proxyModel->rowCount(); ++i)
     90 + file.write(proxyModel->index(i, 0).data().toString().append(NEWLINE).toUtf8());
    101 91   break;
    102 92   
    103  - case RESULT_TYPE::CSV:
    104  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    105  - QString host(proxyModel->index(i, 0).data().toString());
    106  - QString ipv4(proxyModel->index(i, 1).data().toString());
    107  - QString ipv6(proxyModel->index(i, 2).data().toString());
    108  - 
    109  - if(!ipv4.isEmpty())
    110  - host.append(",").append(ipv4);
    111  - if(!ipv6.isEmpty())
    112  - host.append(",").append(ipv6);
    113  - 
    114  - file.write(host.append(NEWLINE).toUtf8());
    115  - }
    116  - break;
    117  - 
    118  - case RESULT_TYPE::JSON:
    119  - {
    120  - QJsonDocument document;
    121  - QJsonArray array;
    122  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    123  - QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
    124  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
    125  - array.append(host_to_json(item));
    126  - }
    127  - document.setArray(array);
    128  - file.write(document.toJson());
    129  - break;
    130  - }
    131  - 
    132 93   default:
    133 94   break;
    134 95   }
    skipped 29 lines
    164 125   switch(result_type){
    165 126   case RESULT_TYPE::SUBDOMAIN:
    166 127   for(int i = 0; i != proxyModel->rowCount(); ++i)
    167  - clipboardData.append(proxyModel->index(i, 0).data().toString()).append(NEWLINE);
     128 + clipboardData.append(proxyModel->index(i, 1).data().toString()).append(NEWLINE);
    168 129   break;
    169 130   
    170 131   case RESULT_TYPE::IP:
    171 132   for(int i = 0; i != proxyModel->rowCount(); ++i)
    172  - {
    173  - QString ipv4(proxyModel->index(i, 1).data().toString());
    174  - QString ipv6(proxyModel->index(i, 2).data().toString());
    175  - if(!ipv4.isEmpty())
    176  - clipboardData.append(ipv4).append(NEWLINE);
    177  - if(!ipv6.isEmpty())
    178  - clipboardData.append(ipv6).append(NEWLINE);
    179  - }
    180  - break;
    181  - 
    182  - case RESULT_TYPE::CSV:
    183  - for(int i = 0; i != proxyModel->rowCount(); ++i)
    184  - {
    185  - QString host(proxyModel->index(i, 0).data().toString());
    186  - QString ipv4(proxyModel->index(i, 1).data().toString());
    187  - QString ipv6(proxyModel->index(i, 2).data().toString());
    188  - 
    189  - if(!ipv4.isEmpty())
    190  - host.append(",").append(ipv4);
    191  - if(!ipv6.isEmpty())
    192  - host.append(",").append(ipv6);
    193  - 
    194  - clipboardData.append(host).append(NEWLINE);
    195  - }
    196  - break;
    197  - 
    198  - case RESULT_TYPE::JSON:
    199  - {
    200  - QJsonDocument document;
    201  - QJsonArray array;
    202  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    203  - QModelIndex model_index = proxyModel->mapToSource(proxyModel->index(i, 0));
    204  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
    205  - array.append(host_to_json(item));
    206  - }
    207  - document.setArray(array);
    208  - clipboardData.append(document.toJson());
    209  - }
     133 + clipboardData.append(proxyModel->index(i, 0).data().toString()).append(NEWLINE);
    210 134   break;
    211 135   
    212 136   default:
    skipped 13 lines
    226 150   clipboard->setText(data.trimmed());
    227 151  }
    228 152   
    229  -void IPTool::extract(bool subdomain, bool tld){
    230  - QClipboard *clipboard = QGuiApplication::clipboard();
    231  - QSet<QString> extracts;
    232  - 
    233  - /* extracting and saving to a set to avoid repeatition */
    234  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    235  - if(subdomain)
    236  - extracts.insert(proxyModel->index(i, 0).data().toString().split(".").at(0));
    237  - if(tld)
    238  - extracts.insert(proxyModel->index(i, 0).data().toString().split(".").last());
    239  - }
    240  - 
    241  - /* setting the data to clipboard */
    242  - QString data;
    243  - foreach(const QString &extract, extracts)
    244  - data.append(extract).append(NEWLINE);
    245  - clipboard->setText(data.trimmed());
    246  -}
    247  - 
    248  -void IPTool::extractSelected(bool subdomain, bool tld){
    249  - QClipboard *clipboard = QGuiApplication::clipboard();
    250  - QSet<QString> extracts;
    251  - 
    252  - /* extracting and saving to a set to avoid repeatition */
    253  - foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
    254  - if(index.column())
    255  - continue;
    256  - 
    257  - if(subdomain)
    258  - extracts.insert(index.data().toString().split(".").at(0));
    259  - if(tld)
    260  - extracts.insert(index.data().toString().split(".").last());
    261  - }
    262  - 
    263  - /* setting the data to clipboard */
    264  - QString data;
    265  - foreach(const QString &extract, extracts)
    266  - data.append(extract).append(NEWLINE);
    267  - clipboard->setText(data.trimmed());
    268  -}
    269  - 
    270 153  ///
    271 154  /// sending results...
    272 155  ///
    skipped 2 lines
    275 158   for(int i = 0; i != proxyModel->rowCount(); ++i)
    276 159   {
    277 160   QModelIndex index = proxyModel->mapToSource(proxyModel->index(i ,0));
    278  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(index));
    279  - project->addActiveHost(host_to_struct(item));
     161 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(m_model_port->itemFromIndex(index));
     162 + project->addActiveIP(iptool_to_struct(item));
    280 163   }
    281 164  }
    282 165   
    skipped 2 lines
    285 168   if(index.column())
    286 169   continue;
    287 170   QModelIndex model_index = proxyModel->mapToSource(index);
    288  - s3s_item::HOST *item = static_cast<s3s_item::HOST*>(m_model_dns->itemFromIndex(model_index));
    289  - project->addActiveHost(host_to_struct(item));
     171 + s3s_item::IPTool *item = static_cast<s3s_item::IPTool*>(m_model_port->itemFromIndex(model_index));
     172 + project->addActiveIP(iptool_to_struct(item));
    290 173   }
    291 174  }
    292 175   
    skipped 4 lines
    297 180   switch (result_type) {
    298 181   case RESULT_TYPE::SUBDOMAIN:
    299 182   for(int i = 0; i != proxyModel->rowCount(); ++i)
    300  - targets.insert(proxyModel->index(i, 0).data().toString());
     183 + targets.insert(proxyModel->index(i, 1).data().toString());
    301 184   break;
    302 185   case RESULT_TYPE::IP:
    303  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    304  - targets.insert(proxyModel->index(i, 1).data().toString());
    305  - targets.insert(proxyModel->index(i, 2).data().toString());
    306  - }
     186 + for(int i = 0; i != proxyModel->rowCount(); ++i)
     187 + targets.insert(proxyModel->index(i, 0).data().toString());
    307 188   break;
    308 189   default:
    309 190   break;
    skipped 45 lines
    355 236   switch (result_type) {
    356 237   case RESULT_TYPE::SUBDOMAIN:
    357 238   foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
    358  - if(index.column() == 0)
     239 + if(index.column() == 1)
    359 240   targets.insert(index.data().toString());
    360 241   }
    361 242   break;
    362 243   case RESULT_TYPE::IP:
    363 244   foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
    364  - if(index.column())
     245 + if(index.column() == 0)
    365 246   targets.insert(index.data().toString());
    366 247   }
    367 248   break;
    skipped 44 lines
    412 293   QSet<QString> targets;
    413 294   
    414 295   /* getting the targets */
    415  - for(int i = 0; i != proxyModel->rowCount(); ++i){
    416  - targets.insert(proxyModel->index(i, 1).data().toString());
    417  - targets.insert(proxyModel->index(i, 2).data().toString());
    418  - }
     296 + for(int i = 0; i != proxyModel->rowCount(); ++i)
     297 + targets.insert(proxyModel->index(i, 0).data().toString());
    419 298   
    420 299   /* sending the targets */
    421 300   switch (tool) {
    skipped 11 lines
    433 312   
    434 313   /* getting the targets */
    435 314   foreach(const QModelIndex &index, selectionModel->selectedIndexes()){
    436  - if(index.column())
     315 + if(index.column() == 0)
    437 316   targets.insert(index.data().toString());
    438 317   }
    439 318   
    skipped 23 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/ip/IPTool_contextmenu.cpp
    skipped 22 lines
    23 23   QMenu saveMenu(this);
    24 24   saveMenu.setTitle(tr("Save"));
    25 25   saveMenu.setIcon(QIcon(":/img/res/icons/save.png"));
    26  - saveMenu.addAction(tr("as JSON"), this, [=](){this->saveResults(RESULT_TYPE::JSON);});
    27  - saveMenu.addAction(tr("as CSV"), this, [=](){this->saveResults(RESULT_TYPE::CSV);});
    28  - saveMenu.addSeparator();
    29  - saveMenu.addAction(tr("Subdomain"), this, [=](){this->saveResults(RESULT_TYPE::SUBDOMAIN);});
     26 + if(ui->comboBoxOption->currentIndex() == 0)
     27 + saveMenu.addAction(tr("Subdomain"), this, [=](){this->saveResults(RESULT_TYPE::SUBDOMAIN);});
    30 28   saveMenu.addAction(tr("Ip"), this, [=](){this->saveResults(RESULT_TYPE::IP);});
    31 29   
    32 30   /* copy menu */
    33 31   QMenu copyMenu(this);
    34 32   copyMenu.setTitle(tr("Copy"));
    35 33   copyMenu.setIcon(QIcon(":/img/res/icons/copy.png"));
    36  - copyMenu.addAction(tr("as JSON"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAINIP);});
    37  - copyMenu.addAction(tr("as CSV"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAINIP);});
    38  - copyMenu.addSeparator();
    39  - copyMenu.addAction(tr("Subdomain"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAIN);});
     34 + if(ui->comboBoxOption->currentIndex() == 0)
     35 + copyMenu.addAction(tr("Subdomain"), this, [=](){this->copyResults(RESULT_TYPE::SUBDOMAIN);});
    40 36   copyMenu.addAction(tr("Ip"), this, [=](){this->copyResults(RESULT_TYPE::IP);});
    41 37   
    42  - /* extract menu */
    43  - QMenu extractMenu(this);
    44  - extractMenu.setTitle(tr("Extract"));
    45  - extractMenu.setIcon(QIcon(":/img/res/icons/extract.png"));
    46  - extractMenu.addAction(tr("Subdomain(*.)"), this, [=](){this->extract(true, false);});
    47  - extractMenu.addAction(tr("Top level domain(.*)"), this, [=](){this->extract(false, true);});
    48 38   
    49 39   /* main menu */
    50 40   QMenu menu(this);
    skipped 2 lines
    53 43   menu.addSeparator();
    54 44   menu.addMenu(&saveMenu);
    55 45   menu.addMenu(&copyMenu);
    56  - menu.addMenu(&extractMenu);
    57  - menu.addSeparator();
    58  - menu.addAction(tr("Send To Project"), this, [=](){this->sendToProject();})->setIcon(QIcon(":/img/res/icons/project.png"));
    59 46   menu.addSeparator();
     47 + if(ui->comboBoxOption->currentIndex() == 1){
     48 + menu.addAction(tr("Send To Project"), this, [=](){this->sendToProject();})->setIcon(QIcon(":/img/res/icons/project.png"));
     49 + menu.addSeparator();
     50 + }
    60 51   menu.addAction(tr("Send IpAddress to OSINT"), this, [=](){this->sendToEngine(TOOL::OSINT, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    61 52   menu.addAction(tr("Send IpAddress to RAW"), this, [=](){this->sendToEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    62  - menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->sendToEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
     53 + menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->sendToEngine(TOOL::IP, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    63 54   menu.addSeparator();
    64  - menu.addAction(tr("Send Hostname to OSINT"), this, [=](){this->sendToEngine(TOOL::OSINT, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    65  - menu.addAction(tr("Send Hostname to RAW"), this, [=](){this->sendToEngine(TOOL::RAW, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    66  - menu.addAction(tr("Send Hostname to BRUTE"), this, [=](){this->sendToEngine(TOOL::BRUTE, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    67  - menu.addAction(tr("Send Hostname to HOST"), this, [=](){this->sendToEngine(TOOL::HOST, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    68  - menu.addAction(tr("Send Hostname to DNS"), this, [=](){this->sendToEngine(TOOL::DNS, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    69  - menu.addAction(tr("Send Hostname to SSL"), this, [=](){this->sendToEngine(TOOL::SSL, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    70  - menu.addAction(tr("Send Hostname to URL"), this, [=](){this->sendToEngine(TOOL::URL, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    71  - menu.addSeparator();
     55 + if(ui->comboBoxOption->currentIndex() == 0){
     56 + menu.addAction(tr("Send Hostname to OSINT"), this, [=](){this->sendToEngine(TOOL::OSINT, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     57 + menu.addAction(tr("Send Hostname to RAW"), this, [=](){this->sendToEngine(TOOL::RAW, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     58 + menu.addAction(tr("Send Hostname to BRUTE"), this, [=](){this->sendToEngine(TOOL::BRUTE, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     59 + menu.addAction(tr("Send Hostname to HOST"), this, [=](){this->sendToEngine(TOOL::HOST, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     60 + menu.addAction(tr("Send Hostname to DNS"), this, [=](){this->sendToEngine(TOOL::DNS, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     61 + menu.addAction(tr("Send Hostname to SSL"), this, [=](){this->sendToEngine(TOOL::SSL, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     62 + menu.addAction(tr("Send Hostname to URL"), this, [=](){this->sendToEngine(TOOL::URL, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
     63 + menu.addSeparator();
     64 + }
    72 65   menu.addAction(tr("Send IpAddress to IP-Enum"), this, [=](){this->sendToEnum(ENUMERATOR::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    73 66   
    74 67   /* showing the context menu... */
    skipped 10 lines
    85 78   /* getting the selected items... */
    86 79   selectionModel = ui->tableViewResults->selectionModel();
    87 80   
    88  - /* extract menu */
    89  - QMenu extractMenu(this);
    90  - extractMenu.setTitle(tr("Extract"));
    91  - extractMenu.setIcon(QIcon(":/img/res/icons/extract.png"));
    92  - extractMenu.addAction(tr("Subdomain(*.)"), this, [=](){this->extractSelected(true, false);});
    93  - extractMenu.addAction(tr("Top level domain(.*)"), this, [=](){this->extractSelected(false, true);});
    94  - 
    95 81   /* main menu */
    96 82   QMenu menu(this);
    97 83   
    skipped 2 lines
    100 86   menu.addSeparator();
    101 87   menu.addAction(tr("Save"), this, [=](){this->saveSelectedResults();})->setIcon(QIcon(":/img/res/icons/save.png"));
    102 88   menu.addAction(tr("Copy"), this, [=](){this->copySelectedResults();})->setIcon(QIcon(":/img/res/icons/copy.png"));
    103  - if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent()))
    104  - menu.addMenu(&extractMenu);
    105 89   menu.addSeparator();
    106 90   menu.addAction(tr("Send To Project"), this, [=](){this->sendSelectedToProject();})->setIcon(QIcon(":/img/res/icons/project.png"));
    107 91   menu.addSeparator();
    108  - if(selectionModel->columnIntersectsSelection(1, selectionModel->currentIndex().parent()) ||
    109  - selectionModel->columnIntersectsSelection(2, selectionModel->currentIndex().parent())){
     92 + if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent())){
    110 93   menu.addAction(tr("Send IpAddress to OSINT"), this, [=](){this->sendSelectedToEngine(TOOL::OSINT, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    111 94   menu.addAction(tr("Send IpAddress to RAW"), this, [=](){this->sendSelectedToEngine(TOOL::RAW, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    112 95   menu.addAction(tr("Send IpAddress to IP"), this, [=](){this->sendSelectedToEngine(TOOL::IP, RESULT_TYPE::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    113 96   menu.addSeparator();
    114 97   }
    115  - if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent())){
     98 + if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent()) &&
     99 + ui->comboBoxOption->currentIndex() == 0){
    116 100   menu.addAction(tr("Send Hostname to OSINT"), this, [=](){this->sendSelectedToEngine(TOOL::OSINT, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    117 101   menu.addAction(tr("Send Hostname to RAW"), this, [=](){this->sendSelectedToEngine(TOOL::RAW, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    118 102   menu.addAction(tr("Send Hostname to BRUTE"), this, [=](){this->sendSelectedToEngine(TOOL::BRUTE, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    skipped 3 lines
    122 106   menu.addAction(tr("Send Hostname to URL"), this, [=](){this->sendSelectedToEngine(TOOL::URL, RESULT_TYPE::SUBDOMAIN);})->setIcon(QIcon(":/img/res/icons/domain.png"));
    123 107   menu.addSeparator();
    124 108   }
    125  - if(selectionModel->columnIntersectsSelection(1, selectionModel->currentIndex().parent()) ||
    126  - selectionModel->columnIntersectsSelection(2, selectionModel->currentIndex().parent()))
     109 + if(selectionModel->columnIntersectsSelection(0, selectionModel->currentIndex().parent()))
    127 110   menu.addAction(tr("Send IpAddress to IP-Enum"), this, [=](){this->sendSelectedToEnum(ENUMERATOR::IP);})->setIcon(QIcon(":/img/res/icons/ip.png"));
    128 111   
    129 112   /* showing the context menu... */
    skipped 3 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/tools/ip/IPTool_results.cpp
    skipped 27 lines
    28 28  }
    29 29   
    30 30  void IPTool::onScanResult_port(QString ip, u_short port){
    31  - m_model_port->appendRow({new QStandardItem(ip),
    32  - new QStandardItem(QString::number(port))});
     31 + if(set_ports.contains(ip)){
     32 + s3s_item::IPTool *item = set_ports.value(ip);
     33 + item->addPort(QString::number(port));
     34 + return;
     35 + }
     36 + 
     37 + s3s_item::IPTool *item = new s3s_item::IPTool;
     38 + item->setValues(ip, QString::number(port));
     39 + 
     40 + m_model_port->appendRow({item, item->ports});
     41 + 
     42 + set_ports.insert(ip, item);
    33 43   
    34 44   ui->labelResultsCount->setNum(proxyModel->rowCount());
    35 45   m_scanStats->resolved++;
     46 + 
     47 + /* save to Project model */
     48 + if(m_scanConfig->autoSaveToProject)
     49 + project->addActiveIP(ip, port);
    36 50  }
    37 51   
    38 52  void IPTool::onScanResult_dns(QString ip, QString hostname){
    skipped 7 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/src/tools/ip/IPTool_scan.cpp
    skipped 71 lines
    72 72   for(ushort i = from; i < to; i++)
    73 73   m_portscannerArgs->target_ports << i;
    74 74   }
    75  - m_portscannerArgs->timeout = m_scanArgs->config->timeout;
    76 75   m_portscannerArgs->target_ips = m_scanArgs->targets;
     76 + m_portscannerArgs->timeout = m_scanArgs->config->timeout;
    77 77   }
    78 78   break;
    79 79   
    80 80   case 2: // PING SCAN
    81 81   {
    82  - m_pingscannerArgs->targets = m_scanArgs->targets;
    83 82   m_pingscannerArgs->progress = 0;
     83 + m_pingscannerArgs->targets = m_scanArgs->targets;
    84 84   m_pingscannerArgs->timeout = m_scanArgs->config->timeout;
    85 85   }
    86 86   }
    skipped 4 lines
    91 91   switch (ui->comboBoxOption->currentIndex()) {
    92 92   case 0: // ACTIVE DNS
    93 93   {
    94  - ip::Scanner *scanner = new ip::Scanner(m_scanArgs);
     94 + reverseip::Scanner *scanner = new reverseip::Scanner(m_scanArgs);
    95 95   QThread *cThread = new QThread;
    96 96   scanner->startScan(cThread);
    97 97   scanner->moveToThread(cThread);
    98  - connect(scanner, &ip::Scanner::scanResult, this, &IPTool::onScanResult_dns);
    99  - connect(scanner, &ip::Scanner::scanProgress, ui->progressBar, &QProgressBar::setValue);
    100  - connect(scanner, &ip::Scanner::scanLog, this, &IPTool::onScanLog);
     98 + connect(scanner, &reverseip::Scanner::scanResult, this, &IPTool::onScanResult_dns);
     99 + connect(scanner, &reverseip::Scanner::scanProgress, ui->progressBar, &QProgressBar::setValue);
     100 + connect(scanner, &reverseip::Scanner::scanLog, this, &IPTool::onScanLog);
    101 101   connect(cThread, &QThread::finished, this, &IPTool::onScanThreadEnded);
    102  - connect(cThread, &QThread::finished, scanner, &ip::Scanner::deleteLater);
     102 + connect(cThread, &QThread::finished, scanner, &reverseip::Scanner::deleteLater);
    103 103   connect(cThread, &QThread::finished, cThread, &QThread::deleteLater);
    104  - connect(this, &IPTool::stopScanThread, scanner, &ip::Scanner::onStopScan);
    105  - connect(this, &IPTool::pauseScanThread, scanner, &ip::Scanner::onPauseScan);
    106  - connect(this, &IPTool::resumeScanThread, scanner, &ip::Scanner::onResumeScan, Qt::DirectConnection);
     104 + connect(this, &IPTool::stopScanThread, scanner, &reverseip::Scanner::onStopScan, Qt::DirectConnection);
     105 + connect(this, &IPTool::pauseScanThread, scanner, &reverseip::Scanner::onPauseScan, Qt::DirectConnection);
     106 + connect(this, &IPTool::resumeScanThread, scanner, &reverseip::Scanner::onResumeScan, Qt::DirectConnection);
    107 107   cThread->start();
    108 108   break;
    109 109   }
    skipped 113 lines
  • ■ ■ ■ ■ ■
    sub3suite/src/utils/Config.h
    skipped 10 lines
    11 11  #ifndef CONFIG_H
    12 12  #define CONFIG_H
    13 13   
     14 +#include <QApplication>
    14 15  #include <QSettings>
    15 16  #include <QDebug>
    16 17   
    skipped 49 lines
    66 67  {
    67 68   public:
    68 69   static QSettings &apiKeys(){
    69  - static QSettings settings("keys.ini", QSettings::IniFormat);
     70 + static QSettings settings(QGuiApplication::applicationDirPath()+"/keys.ini", QSettings::IniFormat);
    70 71   return settings;
    71 72   }
    72 73   static QSettings &general(){
    73  - static QSettings settings("sub3suite.ini", QSettings::IniFormat);
     74 + static QSettings settings(QGuiApplication::applicationDirPath()+"/sub3suite.ini", QSettings::IniFormat);
    74 75   return settings;
    75 76   }
    76 77   static QSettings &donors(){
    skipped 23 lines
  • ■ ■ ■ ■ ■ ■
    sub3suite/sub3suite.pro
    skipped 52 lines
    53 53   src/dialogs/EnumConfigDialog.cpp \
    54 54   src/dialogs/WordlistDialog_choose.cpp \
    55 55   src/dialogs/WordlistDialog_generate.cpp \
     56 + src/items/IPToolItem.cpp \
     57 + src/modules/active/ReverseIPScanner.cpp \
    56 58   src/tools/ip/IPTool_actions.cpp \
    57 59   src/tools/ip/IPTool_contextmenu.cpp \
    58 60   src/tools/ip/IPTool_results.cpp \
    skipped 13 lines
    72 74   src/tools/dns/DNSTool_actions.cpp \
    73 75   src/tools/dns/DNSTool_contextmenu.cpp \
    74 76   src/tools/dns/DNSTool_results.cpp \
    75  - src/tools/dns/DNsTool_scan.cpp \
     77 + src/tools/dns/DNSTool_scan.cpp \
    76 78   src/tools/osint/OsintTool_actions.cpp \
    77 79   src/tools/osint/OsintTool_contextmenu.cpp \
    78 80   src/tools/osint/OsintTool_modules.cpp \
    skipped 47 lines
    126 128   src/enums/ssl/SSLEnum_scan.cpp \
    127 129   src/enums/asn/ASNEnum.cpp \
    128 130   src/enums/email/EmailEnum.cpp \
    129  - src/enums/ip/IpEnum.cpp \
     131 + src/enums/ip/IPEnum.cpp \
    130 132   src/enums/mx/MXEnum.cpp \
    131 133   src/enums/ns/NSEnum.cpp \
    132 134   src/enums/ssl/SSLEnum.cpp \
    skipped 6 lines
    139 141   src/items/MXItem.cpp \
    140 142   src/items/NSItem.cpp \
    141 143   src/models/ExplorerModel.cpp \
    142  - src/modules/active/IPScanner.cpp \
    143 144   src/modules/active/PingScanner.cpp \
    144 145   src/modules/active/PingScanner_unix.cpp \
    145 146   src/modules/active/PingScanner_win.cpp \
    skipped 139 lines
    285 286   src/dialogs/SaveProjectDialog.h \
    286 287   src/dialogs/StartupDialog.h \
    287 288   src/dialogs/EnumConfigDialog.h \
     289 + src/items/IPToolItem.h \
     290 + src/modules/active/ReverseIPScanner.h \
    288 291   src/tools/ip/IPTool.h \
    289 292   src/tools/url/URLTool.h \
    290 293   src/tools/ssl/SSLTool.h \
    skipped 12 lines
    303 306   src/items/MXItem.h \
    304 307   src/items/NSItem.h \
    305 308   src/models/ExplorerModel.h \
    306  - src/modules/active/IPScanner.h \
    307 309   src/modules/active/PingScanner.h \
    308 310   src/modules/active/URLScanner.h \
    309 311   src/modules/active/utils/iphdr.h \
    skipped 174 lines
    484 486   res.qrc
    485 487   
    486 488  win32 {
    487  - INCLUDEPATH += ../vendor/npcap/include
    488  - LIBS += -L"lib" -lAdvapi32
    489  - 
    490  - contains(QT_ARCH, i386) {
    491  - LIBS += -L"$$PWD/../vendor/npcap/lib" -lPacket -lwpcap
    492  - } else {
    493  - LIBS += -L"$$PWD/../vendor/npcap/lib/x64" -lPacket -lwpcap
    494  - }
     489 + LIBS += -lAdvapi32
    495 490  }
     491 + 
     492 +#
     493 +# FOR WINDOWS SYN SCAN
     494 +#win32 {
     495 +# INCLUDEPATH += ../vendor/npcap/include
     496 +# LIBS += -L"lib" -lAdvapi32
     497 +#
     498 +# contains(QT_ARCH, i386) {
     499 +# LIBS += -L"$$PWD/../vendor/npcap/lib" -lPacket -lwpcap
     500 +# } else {
     501 +# LIBS += -L"$$PWD/../vendor/npcap/lib/x64" -lPacket -lwpcap
     502 +# }
     503 +#}
    496 504   
    497 505  # setting the icon...
    498 506  RC_ICONS = res/icons/main_logo.ico
    skipped 6 lines
Please wait...
Page is in error, reload to recover