Skip to content

Commit

Permalink
Add GONTWIFI simple agorithm (10x ZeroBeat) and improve NET_2G
Browse files Browse the repository at this point in the history
  • Loading branch information
RealEnder committed Jul 21, 2019
1 parent f9c5411 commit e3b305e
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/WirelessMatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "algorithms/PldtKeygen.h"
#include "algorithms/BaseXKeygen.h"
#include "algorithms/EijsinkKeygen.h"
#include "algorithms/GontwifiKeygen.h"
#include <QRegExp>

WirelessMatcher::WirelessMatcher() {
Expand Down Expand Up @@ -451,8 +452,12 @@ QVector<Keygen *> * WirelessMatcher::getKeygens(QString ssid, QString mac) {
keygens->append(new BssidKeygen(ssid, mac, FlagLc | FlagLen8, -2));
}

if (ssid.count(QRegExp("^NET_2G[0-9A-F]{6}$")) == 1) {
if (ssid.count(QRegExp("^NET_2G[0-9A-F]{6}$")) == 1
|| ssid.count(QRegExp("^NET_2G_[0-9]{3}$")) == 1) {
keygens->append(new BssidKeygen(ssid, mac, FlagUc | FlagLen8, -6));
keygens->append(new BssidKeygen(ssid, mac, FlagUc | FlagLen8, -5));
keygens->append(new BssidKeygen(ssid, mac, FlagUc | FlagLen12, -6));
keygens->append(new BssidKeygen(ssid, mac, FlagUc | FlagLen12, -5));
}

if (ssid.count(QRegExp("^OPTIC[0-9a-fA-F]{4}$")) == 1) {
Expand Down Expand Up @@ -658,5 +663,9 @@ QVector<Keygen *> * WirelessMatcher::getKeygens(QString ssid, QString mac) {
if (ssid.count(QRegExp("^Eijsink[0-9]{5}(K5|k5|)$")) == 1)
keygens->append(new EijsinkKeygen(ssid, mac));

if (ssid.startsWith("GONTWIFI")
|| ssid.startsWith("GONT_WIFI"))
keygens->append(new GontwifiKeygen(ssid, mac));

return keygens;
}
33 changes: 33 additions & 0 deletions src/algorithms/GontwifiKeygen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2016 Alex Stanev <[email protected]>
*
* This file is part of Router Keygen.
*
* Router Keygen is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Router Keygen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Router Keygen. If not, see <http://www.gnu.org/licenses/>.
*/

#include "GontwifiKeygen.h"

GontwifiKeygen::GontwifiKeygen(QString ssid, QString mac) :
Keygen(ssid, mac) {
kgname = "Gontwifi";
}

QVector<QString> & GontwifiKeygen::getKeys(){
QString mac = getMacAddress();

results.append("000000" + mac[9] + mac[8] + mac[7] + mac[6]);

return results;
}
32 changes: 32 additions & 0 deletions src/algorithms/GontwifiKeygen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2016 Alex Stanev <[email protected]>
*
* This file is part of Router Keygen.
*
* Router Keygen is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Router Keygen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Router Keygen. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GONTWIFIKEYGEN_H
#define GONTWIFIKEYGEN_H
#include "Keygen.h"

class GontwifiKeygen : public Keygen
{
public:
GontwifiKeygen(QString ssid, QString mac);
private:
QVector<QString> & getKeys();
};

#endif // GONTWIFIKEYGEN_H
13 changes: 13 additions & 0 deletions test/AlgorithmsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "algorithms/PldtKeygen.h"
#include "algorithms/BaseXKeygen.h"
#include "algorithms/EijsinkKeygen.h"
#include "algorithms/GontwifiKeygen.h"
#include "WirelessMatcher.h"
#include "wifi/QScanResult.h"
#include <QDebug>
Expand Down Expand Up @@ -721,6 +722,18 @@ private slots:
QCOMPARE( results.size(),1);
QCOMPARE(results.at(0), QString("95112345"));
}

void Gontwifi() {
QScanResult wifi("GONTWIFI_ABCD", "18:d0:71:AB:CD:EF");
wifi.checkSupport(matcher);
QVector<Keygen *> * keygens = wifi.getKeygens();
QVERIFY2(keygens->size() == 1 , "An algorithm was not detected");
Keygen * keygen = keygens->at(0);
QCOMPARE(typeid(*keygen),typeid(GontwifiKeygen) );
QVector<QString> results = keygen->getResults();
QCOMPARE( results.size(),1);
QCOMPARE(results.at(0), QString("000000DCBA"));
}
};


Expand Down

0 comments on commit e3b305e

Please sign in to comment.