Skip to content

Commit

Permalink
HandshakeCrack v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
n3d-b0y authored Mar 9, 2019
1 parent be6b49f commit 6b1ae4d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@ The module automates work with service https://www.onlinehashcrack.com
- WIFI / WPA(2) password recover
- PCAP and CAP dump file to HCCAPX - instantly

**Device:** Tetra
**Device:** Tetra / NANO

**Official topics for discussions:**
```
https://forums.hak5.org/topic/45362-module-handshakecrack/
https://codeby.net/threads/5-wifi-pineapple-handshakecrack.66700/
```

## Install module
**Module installation for Tetra:**

```
opkg update && opkg install git git-http
cd /pineapple/modules/
git clone https://github.com/n3d-b0y/HandshakeCrack.git HandshakeCrack
chmod +x -R /pineapple/modules/HandshakeCrack/scripts
```

**Module installation for NANO:**
```
opkg update && opkg --dest sd install install git git-http
cd /sd/modules/
git clone https://github.com/n3d-b0y/HandshakeCrack.git HandshakeCrack
chmod +x -R /sd/modules/HandshakeCrack/scripts
```
37 changes: 28 additions & 9 deletions api/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
*/
namespace pineapple;

putenv('LD_LIBRARY_PATH='.getenv('LD_LIBRARY_PATH').':/sd/lib:/sd/usr/lib');
putenv('PATH='.getenv('PATH').':/sd/usr/bin:/sd/usr/sbin');

class HandshakeCrack extends Module
{
const LOG_FILE_SEND_HANDSHAKE = '/tmp/handshakesend.log';
const BASH_SCRIP_SEND_HANDSHAKE = '/pineapple/modules/HandshakeCrack/scripts/handshake.sh';
const BASH_SCRIP_CONVERTER = '/pineapple/modules/HandshakeCrack/scripts/converter.sh';
const PYTHON_SCRIPT_PARSEG_PCAP = '/pineapple/modules/HandshakeCrack/scripts/parser_pcap.py';
const PATH_MODULE = '/pineapple/modules/HandshakeCrack';
const PATH_MODULE_SD = '/sd/modules/HandshakeCrack';
const BASH_SCRIP_SEND_HANDSHAKE = '/scripts/handshake.sh';
const BASH_SCRIP_CONVERTER = '/scripts/converter.sh';
const PYTHON_SCRIPT_PARSEG_PCAP = '/scripts/parser_pcap.py';

public function route()
{
Expand Down Expand Up @@ -51,6 +55,16 @@ public function route()
}
}

protected function getPathModule() {
$isAvailable = $this->isSDAvailable();

if ($isAvailable) {
return self::PATH_MODULE_SD;
}

return self::PATH_MODULE;
}

protected function getInfo()
{
$moduleInfo = @json_decode(file_get_contents("/pineapple/modules/HandshakeCrack/module.info"));
Expand Down Expand Up @@ -121,15 +135,20 @@ private function setSettings()
private function getHandshakeFiles()
{
exec("find -L /pineapple/modules/ -type f -name \"*.**cap\" 2>&1", $dir1);
exec("find -L /tmp/ -type f -name \"*.**cap\" 2>&1", $dir2);
exec("find -L /sd/modules/ -type f -name \"*.**cap\" 2>&1", $dir2);
exec("find -L /tmp/ -type f -name \"*.**cap\" 2>&1", $dir3);

if (stristr($dir2[0], ' No such file or ')) {
$dir2 = [];
}

$this->response = array("files" => array_merge($dir1, $dir2));
$this->response = array("files" => array_merge($dir1, $dir2, $dir3));
}

private function getHandshakeInfo()
{
if (!empty($this->request->path)) {
exec('python ' . self::PYTHON_SCRIPT_PARSEG_PCAP . ' -i ' . $this->request->path, $output);
exec('python ' . $this->getPathModule() . self::PYTHON_SCRIPT_PARSEG_PCAP . ' -i ' . $this->request->path, $output);
$outputArr = preg_split('/\s+/', $output[0]);

if (!empty($outputArr)) {
Expand All @@ -147,13 +166,13 @@ private function getHandshakeInfo()

private function sendHandshake()
{
exec(self::BASH_SCRIP_SEND_HANDSHAKE . " " . $this->request->file, $output);
exec($this->getPathModule() . self::BASH_SCRIP_SEND_HANDSHAKE . " " . $this->request->file, $output);
$this->response = array('output' => $output);
}

private function converter()
{
exec(self::BASH_SCRIP_CONVERTER . " " . $this->request->file, $output);
exec($this->getPathModule() . self::BASH_SCRIP_CONVERTER . " " . $this->request->file, $output);

$this->response = array('output' => $output[0]);
}
Expand Down
2 changes: 1 addition & 1 deletion js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ registerController('HandshakeCrack_IsConnected', ['$api', '$scope', '$rootScope'
} else {
isConnected();
}
}, 5000);
}, 3000);
}]);

registerController('HandshakeCrack_Dependencies', ['$api', '$scope', '$rootScope', '$interval', function ($api, $scope, $rootScope, $interval) {
Expand Down
3 changes: 2 additions & 1 deletion module.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"author": "n3d.b0y",
"description": "The module uses the service functionality https://www.onlinehashcrack.com",
"devices": [
"nano",
"tetra"
],
"title": "Handshake Crack",
"version": "1.0"
"version": "1.1"
}

0 comments on commit 6b1ae4d

Please sign in to comment.