From 2ba17323895b9af97898529e5e84f0e14676d764 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 21 Aug 2019 21:10:21 +0100 Subject: [PATCH] Revert "Module Updates for 2.6.0+ (Wave 1) (#69)" (#70) This reverts commit 0a3e973d9941e6cdfeccb978516c3be6464f5832. --- .gitignore | 1 - DNSMasqSpoof/api/module.php | 9 +- .../scripts/autostart_dnsmasqspoof.sh | 3 + DNSMasqSpoof/scripts/dependencies.sh | 3 + DNSMasqSpoof/scripts/dnsmasqspoof.sh | 3 + DNSspoof/api/module.php | 9 +- DNSspoof/scripts/autostart_dnsspoof.sh | 3 + DNSspoof/scripts/dependencies.sh | 3 +- DNSspoof/scripts/dnsspoof.sh | 3 + Deauth/api/module.php | 12 +- Deauth/scripts/autostart_deauth.sh | 3 +- Deauth/scripts/deauth.sh | 3 +- Deauth/scripts/dependencies.sh | 4 +- KeyManager/api/module.php | 383 ++++++++++-------- KeyManager/scripts/add_host.sh | 3 +- KeyManager/scripts/copy_key.sh | 3 +- KeyManager/scripts/dependencies.sh | 3 +- KeyManager/scripts/generate_key.sh | 3 +- LogManager/api/module.php | 3 +- Occupineapple/api/module.php | 13 +- .../scripts/autostart_occupineapple.sh | 3 + Occupineapple/scripts/dependencies.sh | 3 + Occupineapple/scripts/occupineapple.sh | 3 + OnlineHashCrack/api/module.php | 12 +- OnlineHashCrack/scripts/dependencies.sh | 3 + OnlineHashCrack/scripts/submit_hash.sh | 3 + OnlineHashCrack/scripts/submit_wpa.sh | 3 + Responder/api/module.php | 13 +- Responder/scripts/autostart_responder.sh | 3 + Responder/scripts/dependencies.sh | 3 + Responder/scripts/responder.sh | 3 + SSLsplit/api/module.php | 13 +- SSLsplit/scripts/autostart_sslsplit.sh | 3 +- SSLsplit/scripts/dependencies.sh | 3 +- SSLsplit/scripts/generate_certificate.sh | 3 +- SSLsplit/scripts/sslsplit.sh | 3 +- SiteSurvey/api/module.php | 11 +- SiteSurvey/scripts/capture.sh | 3 + SiteSurvey/scripts/deauth.sh | 3 + SiteSurvey/scripts/dependencies.sh | 7 +- Status/api/module.php | 3 +- dump1090/api/module.php | 9 +- dump1090/scripts/dependencies.sh | 3 +- dump1090/scripts/dump1090.sh | 3 + ettercap/api/module.php | 5 +- ettercap/scripts/dependencies.sh | 3 +- ettercap/scripts/ettercap.sh | 3 +- ngrep/api/module.php | 13 +- ngrep/scripts/dependencies.sh | 7 +- ngrep/scripts/ngrep.sh | 3 + nmap/api/module.php | 19 +- nmap/scripts/dependencies.sh | 12 +- nmap/scripts/nmap.sh | 3 +- p0f/api/module.php | 13 +- p0f/scripts/autostart_p0f.sh | 3 + p0f/scripts/dependencies.sh | 3 + p0f/scripts/p0f.sh | 3 + tcpdump/api/module.php | 13 +- tcpdump/scripts/dependencies.sh | 3 +- tcpdump/scripts/tcpdump.sh | 3 +- tor/scripts/dependencies.sh | 3 +- urlsnarf/api/module.php | 5 +- urlsnarf/scripts/autostart_urlsnarf.sh | 3 +- urlsnarf/scripts/dependencies.sh | 3 +- urlsnarf/scripts/urlsnarf.sh | 3 +- wps/api/module.php | 13 +- wps/scripts/dependencies.sh | 3 + wps/scripts/wps.sh | 3 +- 68 files changed, 445 insertions(+), 289 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9f11b75..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea/ diff --git a/DNSMasqSpoof/api/module.php b/DNSMasqSpoof/api/module.php index 0942bde..6e87dcd 100644 --- a/DNSMasqSpoof/api/module.php +++ b/DNSMasqSpoof/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("dnsmasqspoof.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("dnsmasqspoof.module.installed"))); } protected function getDevice() @@ -64,7 +67,7 @@ class DNSMasqSpoof extends Module private function handleDependencies() { - if (!$this->checkDep("dnsmasq")) { + if (!$this->checkDependency("dnsmasq")) { $this->execBackground("/pineapple/modules/DNSMasqSpoof/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { diff --git a/DNSMasqSpoof/scripts/autostart_dnsmasqspoof.sh b/DNSMasqSpoof/scripts/autostart_dnsmasqspoof.sh index 9fc1eea..1c9ff60 100755 --- a/DNSMasqSpoof/scripts/autostart_dnsmasqspoof.sh +++ b/DNSMasqSpoof/scripts/autostart_dnsmasqspoof.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + if grep addn-hosts /etc/dnsmasq.conf &> /dev/null; then /etc/init.d/dnsmasq stop && /etc/init.d/dnsmasq start else diff --git a/DNSMasqSpoof/scripts/dependencies.sh b/DNSMasqSpoof/scripts/dependencies.sh index 854cd7f..01ca36a 100755 --- a/DNSMasqSpoof/scripts/dependencies.sh +++ b/DNSMasqSpoof/scripts/dependencies.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/DNSMasqSpoof.progress ]] && { exit 0 } diff --git a/DNSMasqSpoof/scripts/dnsmasqspoof.sh b/DNSMasqSpoof/scripts/dnsmasqspoof.sh index ed28f3a..80f704a 100755 --- a/DNSMasqSpoof/scripts/dnsmasqspoof.sh +++ b/DNSMasqSpoof/scripts/dnsmasqspoof.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + if [ "$1" = "start" ]; then echo "no-dhcp-interface=" >> /etc/dnsmasq.conf echo "server=8.8.8.8" >> /etc/dnsmasq.conf diff --git a/DNSspoof/api/module.php b/DNSspoof/api/module.php index 0dd7766..e785019 100644 --- a/DNSspoof/api/module.php +++ b/DNSspoof/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("dnsspoof.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("dnsspoof.module.installed"))); } protected function getDevice() @@ -77,7 +80,7 @@ class DNSspoof extends Module private function handleDependencies() { - if (!$this->checkDep("dnsspoof")) { + if (!$this->checkDependency("dnsspoof")) { $this->execBackground("/pineapple/modules/DNSspoof/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { diff --git a/DNSspoof/scripts/autostart_dnsspoof.sh b/DNSspoof/scripts/autostart_dnsspoof.sh index 478644d..487d6c7 100755 --- a/DNSspoof/scripts/autostart_dnsspoof.sh +++ b/DNSspoof/scripts/autostart_dnsspoof.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYINTERFACE=`uci get dnsspoof.autostart.interface` HOSTSFILE="/etc/pineapple/spoofhost" diff --git a/DNSspoof/scripts/dependencies.sh b/DNSspoof/scripts/dependencies.sh index e85272c..64fff3b 100755 --- a/DNSspoof/scripts/dependencies.sh +++ b/DNSspoof/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master -logger "== DNSSpoof Dependencies Installer" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/DNSspoof.progress ]] && { exit 0 diff --git a/DNSspoof/scripts/dnsspoof.sh b/DNSspoof/scripts/dnsspoof.sh index 92476a8..7761144 100755 --- a/DNSspoof/scripts/dnsspoof.sh +++ b/DNSspoof/scripts/dnsspoof.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYINTERFACE=`uci get dnsspoof.run.interface` HOSTSFILE="/etc/pineapple/spoofhost" diff --git a/Deauth/api/module.php b/Deauth/api/module.php index 89c8bb4..17a753f 100644 --- a/Deauth/api/module.php +++ b/Deauth/api/module.php @@ -1,7 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("deauth.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("deauth.module.installed"))); } protected function getDevice() @@ -71,7 +71,7 @@ class Deauth extends Module private function handleDependencies() { - if (!$this->checkDep("mdk3")) { + if (!$this->checkDependency("mdk3")) { $this->execBackground("/pineapple/modules/Deauth/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -116,7 +116,7 @@ class Deauth extends Module private function refreshStatus() { if (!file_exists('/tmp/Deauth.progress')) { - if (!$this->checkDep("mdk3")) { + if (!$this->checkDependency("mdk3")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; diff --git a/Deauth/scripts/autostart_deauth.sh b/Deauth/scripts/autostart_deauth.sh index 55565bb..5c2179e 100755 --- a/Deauth/scripts/autostart_deauth.sh +++ b/Deauth/scripts/autostart_deauth.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin LOG=/tmp/deauth.log MYPATH='/pineapple/modules/Deauth/' diff --git a/Deauth/scripts/deauth.sh b/Deauth/scripts/deauth.sh index 50141dc..88cc93c 100755 --- a/Deauth/scripts/deauth.sh +++ b/Deauth/scripts/deauth.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin LOG=/tmp/deauth.log MYPATH='/pineapple/modules/Deauth/' diff --git a/Deauth/scripts/dependencies.sh b/Deauth/scripts/dependencies.sh index 96d084f..a4acb86 100755 --- a/Deauth/scripts/dependencies.sh +++ b/Deauth/scripts/dependencies.sh @@ -1,8 +1,8 @@ #!/bin/sh #2015 - Whistle Master -#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib -#export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/Deauth.progress ]] && { exit 0 diff --git a/KeyManager/api/module.php b/KeyManager/api/module.php index 20282c4..bd7d9c7 100644 --- a/KeyManager/api/module.php +++ b/KeyManager/api/module.php @@ -1,17 +1,19 @@ request->action) { - case 'refreshInfo': - $this->refreshInfo(); - break; - case 'refreshOutput': + case 'refreshInfo': + $this->refreshInfo(); + break; + case 'refreshOutput': $this->refreshOutput(); break; - case 'clearOutput': + case 'clearOutput': $this->clearOutput(); break; case 'refreshStatus': @@ -23,217 +25,250 @@ class KeyManager extends Module case 'handleDependenciesStatus': $this->handleDependenciesStatus(); break; - case 'handleKey': - $this->handleKey(); - break; - case 'handleKeyStatus': - $this->handleKeyStatus(); - break; - case 'saveKnownHostsData': - $this->saveKnownHostsData(); - break; - case 'getKnownHostsData': - $this->getKnownHostsData(); - break; - case 'addToKnownHosts': - $this->addToKnownHosts(); - break; - case 'addToKnownHostsStatus': - $this->addToKnownHostsStatus(); - break; - case 'copyToRemoteHost': - $this->copyToRemoteHost(); - break; - case 'copyToRemoteHostStatus': - $this->copyToRemoteHostStatus(); - break; - case 'getSettings': - $this->getSettings(); - break; + case 'handleKey': + $this->handleKey(); + break; + case 'handleKeyStatus': + $this->handleKeyStatus(); + break; + case 'saveKnownHostsData': + $this->saveKnownHostsData(); + break; + case 'getKnownHostsData': + $this->getKnownHostsData(); + break; + case 'addToKnownHosts': + $this->addToKnownHosts(); + break; + case 'addToKnownHostsStatus': + $this->addToKnownHostsStatus(); + break; + case 'copyToRemoteHost': + $this->copyToRemoteHost(); + break; + case 'copyToRemoteHostStatus': + $this->copyToRemoteHostStatus(); + break; + case 'getSettings': + $this->getSettings(); + break; } } - protected function checkDep($dependencyName) - { - return ($this->checkDependency($dependencyName) && ($this->uciGet("keymanager.module.installed"))); - } + protected function checkDependency($dependencyName) + { + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("keymanager.module.installed"))); + } - protected function getDevice() - { - return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'")); - } + protected function getDevice() + { + return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'")); + } - protected function refreshInfo() - { - $moduleInfo = @json_decode(file_get_contents("/pineapple/modules/KeyManager/module.info")); - $this->response = array('title' => $moduleInfo->title, 'version' => $moduleInfo->version); - } + protected function refreshInfo() + { + $moduleInfo = @json_decode(file_get_contents("/pineapple/modules/KeyManager/module.info")); + $this->response = array('title' => $moduleInfo->title, 'version' => $moduleInfo->version); + } private function handleKey() { - if (!file_exists("/root/.ssh/id_rsa")) { - $this->execBackground("/pineapple/modules/KeyManager/scripts/generate_key.sh"); - $this->response = array('success' => true); - } else { - exec("rm -rf /root/.ssh/id_rsa*"); - $this->response = array('success' => true); - } - } + if(!file_exists("/root/.ssh/id_rsa")) + { + $this->execBackground("/pineapple/modules/KeyManager/scripts/generate_key.sh"); + $this->response = array('success' => true); + } + else + { + exec("rm -rf /root/.ssh/id_rsa*"); + $this->response = array('success' => true); + } + } private function handleKeyStatus() { - if (!file_exists('/tmp/KeyManager_key.progress')) { + if (!file_exists('/tmp/KeyManager_key.progress')) + { $this->response = array('success' => true); - } else { + } + else + { $this->response = array('success' => false); } - } + } private function handleDependencies() { - if (!$this->checkDep("ssh-keyscan")) { - $this->execBackground("/pineapple/modules/KeyManager/scripts/dependencies.sh install " . $this->request->destination); - $this->response = array('success' => true); - } else { - $this->execBackground("/pineapple/modules/KeyManager/scripts/dependencies.sh remove"); - $this->response = array('success' => true); - } - } + if(!$this->checkDependency("ssh-keyscan")) + { + $this->execBackground("/pineapple/modules/KeyManager/scripts/dependencies.sh install ".$this->request->destination); + $this->response = array('success' => true); + } + else + { + $this->execBackground("/pineapple/modules/KeyManager/scripts/dependencies.sh remove"); + $this->response = array('success' => true); + } + } private function handleDependenciesStatus() { - if (!file_exists('/tmp/KeyManager.progress')) { + if (!file_exists('/tmp/KeyManager.progress')) + { $this->response = array('success' => true); - } else { + } + else + { $this->response = array('success' => false); } } private function refreshStatus() { - if (!file_exists('/tmp/KeyManager.progress')) { - if (!$this->checkDep("ssh-keyscan")) { - $installed = false; - $install = "Not installed"; - $installLabel = "danger"; - $processing = false; - } else { - $installed = true; - $install = "Installed"; - $installLabel = "success"; - $processing = false; - } + if (!file_exists('/tmp/KeyManager.progress')) + { + if(!$this->checkDependency("ssh-keyscan")) + { + $installed = false; + $install = "Not installed"; + $installLabel = "danger"; + $processing = false; + } + else + { + $installed = true; + $install = "Installed"; + $installLabel = "success"; + $processing = false; + } - if (!file_exists('/tmp/KeyManager_key.progress')) { - if (!file_exists("/root/.ssh/id_rsa")) { - $key = "Not generated"; - $keyLabel = "danger"; - $generated = false; - $generating = false; - } else { - $key = "Generated"; - $keyLabel = "success"; - $generated = true; - $generating = false; - } - } else { - $key = "Generating..."; - $keyLabel = "warning"; - $generated = false; - $generating = true; - } - } else { - $installed = false; - $install = "Installing..."; - $installLabel = "warning"; - $processing = true; + if (!file_exists('/tmp/KeyManager_key.progress')) + { + if(!file_exists("/root/.ssh/id_rsa")) + { + $key = "Not generated"; + $keyLabel = "danger"; + $generated = false; + $generating = false; + } + else + { + $key = "Generated"; + $keyLabel = "success"; + $generated = true; + $generating = false; + } + } + else + { + $key = "Generating..."; + $keyLabel = "warning"; + $generated = false; + $generating = true; + } + } + else + { + $installed = false; + $install = "Installing..."; + $installLabel = "warning"; + $processing = true; - $key = "Not generated"; - $keyLabel = "danger"; - $generating = false; - } + $key = "Not generated"; + $keyLabel = "danger"; + $generating = false; + } - $device = $this->getDevice(); - $sdAvailable = $this->isSDAvailable(); + $device = $this->getDevice(); + $sdAvailable = $this->isSDAvailable(); - $this->response = array("device" => $device, "sdAvailable" => $sdAvailable, "installed" => $installed, "key" => $key, "keyLabel" => $keyLabel, "generating" => $generating, "generated" => $generated, "install" => $install, "installLabel" => $installLabel, "processing" => $processing); - } + $this->response = array("device" => $device, "sdAvailable" => $sdAvailable, "installed" => $installed, "key" => $key, "keyLabel" => $keyLabel, "generating" => $generating, "generated" => $generated, "install" => $install, "installLabel" => $installLabel, "processing" => $processing); + } private function refreshOutput() { - if (file_exists("/tmp/keymanager.log")) { - $output = file_get_contents("/tmp/keymanager.log"); - if (!empty($output)) - $this->response = $output; - else - $this->response = " "; - } else { - $this->response = " "; - } - } + if (file_exists("/tmp/keymanager.log")) + { + $output = file_get_contents("/tmp/keymanager.log"); + if(!empty($output)) + $this->response = $output; + else + $this->response = " "; + } + else + { + $this->response = " "; + } + } - private function clearOutput() - { - exec("rm -rf /tmp/keymanager.log"); - } + private function clearOutput() + { + exec("rm -rf /tmp/keymanager.log"); + } - private function saveKnownHostsData() - { - $filename = '/root/.ssh/known_hosts'; - file_put_contents($filename, $this->request->knownHostsData); - } + private function saveKnownHostsData() + { + $filename = '/root/.ssh/known_hosts'; + file_put_contents($filename, $this->request->knownHostsData); + } - private function getKnownHostsData() - { - $knownHostsData = file_get_contents('/root/.ssh/known_hosts'); - $this->response = array("knownHostsData" => $knownHostsData); - } + private function getKnownHostsData() + { + $knownHostsData = file_get_contents('/root/.ssh/known_hosts'); + $this->response = array("knownHostsData" => $knownHostsData); + } - private function addToKnownHostsStatus() - { - if (!file_exists('/tmp/KeyManager.progress')) { - $this->response = array('success' => true); - } else { - $this->response = array('success' => false); - } - } + private function addToKnownHostsStatus() + { + if (!file_exists('/tmp/KeyManager.progress')) + { + $this->response = array('success' => true); + } + else + { + $this->response = array('success' => false); + } + } - private function addToKnownHosts() - { - $this->uciSet("keymanager.settings.host", $this->request->host); - $this->uciSet("keymanager.settings.port", $this->request->port); + private function addToKnownHosts() + { + $this->uciSet("keymanager.settings.host", $this->request->host); + $this->uciSet("keymanager.settings.port", $this->request->port); - $this->execBackground("/pineapple/modules/KeyManager/scripts/add_host.sh"); - $this->response = array('success' => true); - } + $this->execBackground("/pineapple/modules/KeyManager/scripts/add_host.sh"); + $this->response = array('success' => true); + } - private function copyToRemoteHostStatus() - { - if (!file_exists('/tmp/KeyManager.progress')) { - $this->response = array('success' => true); - } else { - $this->response = array('success' => false); - } - } + private function copyToRemoteHostStatus() + { + if (!file_exists('/tmp/KeyManager.progress')) + { + $this->response = array('success' => true); + } + else + { + $this->response = array('success' => false); + } + } - private function copyToRemoteHost() - { - $this->uciSet("keymanager.settings.host", $this->request->host); - $this->uciSet("keymanager.settings.port", $this->request->port); - $this->uciSet("keymanager.settings.user", $this->request->user); + private function copyToRemoteHost() + { + $this->uciSet("keymanager.settings.host", $this->request->host); + $this->uciSet("keymanager.settings.port", $this->request->port); + $this->uciSet("keymanager.settings.user", $this->request->user); - $this->execBackground("/pineapple/modules/KeyManager/scripts/copy_key.sh " . $this->request->password); - $this->response = array('success' => true); - } + $this->execBackground("/pineapple/modules/KeyManager/scripts/copy_key.sh ".$this->request->password); + $this->response = array('success' => true); + } - private function getSettings() - { - $settings = array( - 'host' => $this->uciGet("keymanager.settings.host"), - 'port' => $this->uciGet("keymanager.settings.port"), - 'user' => $this->uciGet("keymanager.settings.user") - ); - $this->response = $settings; - } + private function getSettings() + { + $settings = array( + 'host' => $this->uciGet("keymanager.settings.host"), + 'port' => $this->uciGet("keymanager.settings.port"), + 'user' => $this->uciGet("keymanager.settings.user") + ); + $this->response = $settings; + } } diff --git a/KeyManager/scripts/add_host.sh b/KeyManager/scripts/add_host.sh index 3d6cc27..6f0350c 100755 --- a/KeyManager/scripts/add_host.sh +++ b/KeyManager/scripts/add_host.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/KeyManager.progress ]] && { exit 0 diff --git a/KeyManager/scripts/copy_key.sh b/KeyManager/scripts/copy_key.sh index 29dd4bf..9504306 100755 --- a/KeyManager/scripts/copy_key.sh +++ b/KeyManager/scripts/copy_key.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/KeyManager.progress ]] && { exit 0 diff --git a/KeyManager/scripts/dependencies.sh b/KeyManager/scripts/dependencies.sh index 6e37820..8b99297 100755 --- a/KeyManager/scripts/dependencies.sh +++ b/KeyManager/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master -logger "== KeyManager Install Script" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/KeyManager.progress ]] && { exit 0 diff --git a/KeyManager/scripts/generate_key.sh b/KeyManager/scripts/generate_key.sh index ac04bc7..1745b97 100755 --- a/KeyManager/scripts/generate_key.sh +++ b/KeyManager/scripts/generate_key.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/KeyManager_key.progress ]] && { exit 0 diff --git a/LogManager/api/module.php b/LogManager/api/module.php index 68aad1f..09b6841 100644 --- a/LogManager/api/module.php +++ b/LogManager/api/module.php @@ -1,6 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("occupineapple.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("occupineapple.module.installed"))); } protected function getDevice() @@ -71,7 +74,7 @@ class Occupineapple extends Module private function handleDependencies() { - if (!$this->checkDeps("mdk3")) { + if (!$this->checkDependency("mdk3")) { $this->execBackground("/pineapple/modules/Occupineapple/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -118,7 +121,7 @@ class Occupineapple extends Module private function refreshStatus() { if (!file_exists('/tmp/Occupineapple.progress')) { - if (!$this->checkDeps("mdk3")) { + if (!$this->checkDependency("mdk3")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -172,7 +175,7 @@ class Occupineapple extends Module private function refreshOutput() { - if ($this->checkDeps("mdk3")) { + if ($this->checkDependency("mdk3")) { if ($this->checkRunning("mdk3")) { exec("cat /tmp/occupineapple.log", $output); if (!empty($output)) { diff --git a/Occupineapple/scripts/autostart_occupineapple.sh b/Occupineapple/scripts/autostart_occupineapple.sh index c2cb97f..7b3d2b4 100755 --- a/Occupineapple/scripts/autostart_occupineapple.sh +++ b/Occupineapple/scripts/autostart_occupineapple.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + LOG=/tmp/occupineapple.log MYPATH='/pineapple/modules/Occupineapple/' diff --git a/Occupineapple/scripts/dependencies.sh b/Occupineapple/scripts/dependencies.sh index 71734b3..6fb5e94 100755 --- a/Occupineapple/scripts/dependencies.sh +++ b/Occupineapple/scripts/dependencies.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/Occupineapple.progress ]] && { exit 0 } diff --git a/Occupineapple/scripts/occupineapple.sh b/Occupineapple/scripts/occupineapple.sh index 2835c3a..f557a2a 100755 --- a/Occupineapple/scripts/occupineapple.sh +++ b/Occupineapple/scripts/occupineapple.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + LOG=/tmp/occupineapple.log MYPATH='/pineapple/modules/Occupineapple/' diff --git a/OnlineHashCrack/api/module.php b/OnlineHashCrack/api/module.php index a019b46..fc14f14 100644 --- a/OnlineHashCrack/api/module.php +++ b/OnlineHashCrack/api/module.php @@ -1,4 +1,6 @@ checkDependency($dependencyName) && ($this->uciGet("onlinehashcrack.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("onlinehashcrack.module.installed"))); } protected function getDevice() @@ -65,9 +67,9 @@ class OnlineHashCrack extends Module private function handleDependencies() { - if(!$this->checkDeps("curl")) + if(!$this->checkDependency("curl")) { - $this->execBackground("/pineapple/modules/OnlineHashCrack/scripts/dependencies.sh install ".$this->request->destination); + $this->execBackground("/pineapple/modules/OnlineHashCrack/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else @@ -93,7 +95,7 @@ class OnlineHashCrack extends Module { if (!file_exists('/tmp/OnlineHashCrack.progress')) { - if(!$this->checkDeps("curl")) + if(!$this->checkDependency("curl")) { $installed = false; $install = "Not installed"; diff --git a/OnlineHashCrack/scripts/dependencies.sh b/OnlineHashCrack/scripts/dependencies.sh index 31dd301..079bc86 100755 --- a/OnlineHashCrack/scripts/dependencies.sh +++ b/OnlineHashCrack/scripts/dependencies.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/OnlineHashCrack.progress ]] && { exit 0 } diff --git a/OnlineHashCrack/scripts/submit_hash.sh b/OnlineHashCrack/scripts/submit_hash.sh index 5a570a2..47db042 100755 --- a/OnlineHashCrack/scripts/submit_hash.sh +++ b/OnlineHashCrack/scripts/submit_hash.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/OnlineHashCrack.progress ]] && { exit 0 } diff --git a/OnlineHashCrack/scripts/submit_wpa.sh b/OnlineHashCrack/scripts/submit_wpa.sh index 7f1c796..907d265 100755 --- a/OnlineHashCrack/scripts/submit_wpa.sh +++ b/OnlineHashCrack/scripts/submit_wpa.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/OnlineHashCrack.progress ]] && { exit 0 } diff --git a/Responder/api/module.php b/Responder/api/module.php index 82cedc4..f3f2832 100644 --- a/Responder/api/module.php +++ b/Responder/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("responder.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("responder.module.installed"))); } protected function checkRunning($processName) @@ -76,7 +79,7 @@ class Responder extends Module private function handleDependencies() { - if (!$this->checkDeps("python")) { + if (!$this->checkDependency("python")) { $this->execBackground("/pineapple/modules/Responder/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -128,7 +131,7 @@ class Responder extends Module private function refreshStatus() { if (!file_exists('/tmp/Responder.progress')) { - if (!$this->checkDeps("python")) { + if (!$this->checkDependency("python")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -183,7 +186,7 @@ class Responder extends Module private function refreshOutput() { - if ($this->checkDeps("python")) { + if ($this->checkDependency("python")) { if ($this->checkRunning("Responder.py")) { if (file_exists("/pineapple/modules/Responder/dep/responder/logs/Responder-Session.log")) { if ($this->request->filter != "") { diff --git a/Responder/scripts/autostart_responder.sh b/Responder/scripts/autostart_responder.sh index 3b2eb86..444a8dd 100755 --- a/Responder/scripts/autostart_responder.sh +++ b/Responder/scripts/autostart_responder.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYINTERFACE=`uci get responder.autostart.interface` diff --git a/Responder/scripts/dependencies.sh b/Responder/scripts/dependencies.sh index 755232d..729ea5b 100755 --- a/Responder/scripts/dependencies.sh +++ b/Responder/scripts/dependencies.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/Responder.progress ]] && { exit 0 } diff --git a/Responder/scripts/responder.sh b/Responder/scripts/responder.sh index 2c3b597..66096fd 100755 --- a/Responder/scripts/responder.sh +++ b/Responder/scripts/responder.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYINTERFACE=`uci get responder.run.interface` diff --git a/SSLsplit/api/module.php b/SSLsplit/api/module.php index 46bdbc4..a720abe 100644 --- a/SSLsplit/api/module.php +++ b/SSLsplit/api/module.php @@ -1,6 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("sslsplit.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("sslsplit.module.installed"))); } protected function getDevice() @@ -93,7 +94,7 @@ class SSLsplit extends Module private function handleDependencies() { - if (!$this->checkDeps("sslsplit")) { + if (!$this->checkDependency("sslsplit")) { $this->execBackground("/pineapple/modules/SSLsplit/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -134,7 +135,7 @@ class SSLsplit extends Module private function refreshStatus() { if (!file_exists('/tmp/SSLsplit.progress')) { - if (!$this->checkDeps("sslsplit")) { + if (!$this->checkDependency("sslsplit")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -214,7 +215,7 @@ class SSLsplit extends Module private function refreshOutput() { - if ($this->checkDeps("sslsplit")) { + if ($this->checkDependency("sslsplit")) { if ($this->checkRunning("sslsplit")) { if (file_exists("/pineapple/modules/SSLsplit/connections.log")) { if ($this->request->filter != "") { diff --git a/SSLsplit/scripts/autostart_sslsplit.sh b/SSLsplit/scripts/autostart_sslsplit.sh index c173cfb4..cf1b8bb 100755 --- a/SSLsplit/scripts/autostart_sslsplit.sh +++ b/SSLsplit/scripts/autostart_sslsplit.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` diff --git a/SSLsplit/scripts/dependencies.sh b/SSLsplit/scripts/dependencies.sh index 6a9b6a8..15fd18c 100755 --- a/SSLsplit/scripts/dependencies.sh +++ b/SSLsplit/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/SSLsplit.progress ]] && { exit 0 diff --git a/SSLsplit/scripts/generate_certificate.sh b/SSLsplit/scripts/generate_certificate.sh index 6a71d97..0cf3e65 100755 --- a/SSLsplit/scripts/generate_certificate.sh +++ b/SSLsplit/scripts/generate_certificate.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/SSLsplit_certificate.progress ]] && { exit 0 diff --git a/SSLsplit/scripts/sslsplit.sh b/SSLsplit/scripts/sslsplit.sh index 7df107f..a009bce 100755 --- a/SSLsplit/scripts/sslsplit.sh +++ b/SSLsplit/scripts/sslsplit.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` diff --git a/SiteSurvey/api/module.php b/SiteSurvey/api/module.php index f102955..e57237d 100644 --- a/SiteSurvey/api/module.php +++ b/SiteSurvey/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("sitesurvey.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("sitesurvey.module.installed"))); } protected function getDevice() @@ -90,7 +93,7 @@ class SiteSurvey extends Module private function handleDependencies() { - if (!$this->checkDeps("mdk3")) { + if (!$this->checkDependency("mdk3")) { $this->execBackground("/pineapple/modules/SiteSurvey/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -111,7 +114,7 @@ class SiteSurvey extends Module private function refreshStatus() { if (!file_exists('/tmp/SiteSurvey.progress')) { - if (!$this->checkDeps("iwlist")) { + if (!$this->checkDependency("iwlist")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; diff --git a/SiteSurvey/scripts/capture.sh b/SiteSurvey/scripts/capture.sh index 476be90..d5095cc 100755 --- a/SiteSurvey/scripts/capture.sh +++ b/SiteSurvey/scripts/capture.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` LOG=/tmp/SiteSurvey.log LOCK=/tmp/SiteSurvey_capture.lock diff --git a/SiteSurvey/scripts/deauth.sh b/SiteSurvey/scripts/deauth.sh index 8e0d5a8..1c8a172 100755 --- a/SiteSurvey/scripts/deauth.sh +++ b/SiteSurvey/scripts/deauth.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` LOG=/tmp/SiteSurvey.log LOCK=/tmp/SiteSurvey_deauth.lock diff --git a/SiteSurvey/scripts/dependencies.sh b/SiteSurvey/scripts/dependencies.sh index 6edfc1b..f8e0def 100755 --- a/SiteSurvey/scripts/dependencies.sh +++ b/SiteSurvey/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master -logger "== SITESURVEY INSTALL SCRIPT" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/SiteSurvey.progress ]] && { exit 0 @@ -12,10 +13,8 @@ touch /tmp/SiteSurvey.progress if [ "$1" = "install" ]; then if [ "$2" = "internal" ]; then opkg update - opkg install mdk3 elif [ "$2" = "sd" ]; then - opkg update - opkg install mdk3 --dest=sd + opkg update fi touch /etc/config/sitesurvey diff --git a/Status/api/module.php b/Status/api/module.php index ebf3232..45b39c4 100644 --- a/Status/api/module.php +++ b/Status/api/module.php @@ -1,6 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("dump1090.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("dump1090.module.installed"))); } protected function getDevice() @@ -68,7 +71,7 @@ class dump1090 extends Module private function handleDependencies() { - if (!$this->checkDep("dump1090")) { + if (!$this->checkDependency("dump1090")) { $this->execBackground("/pineapple/modules/dump1090/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { diff --git a/dump1090/scripts/dependencies.sh b/dump1090/scripts/dependencies.sh index 16f5860..1844f9d 100755 --- a/dump1090/scripts/dependencies.sh +++ b/dump1090/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master -logger "== DUMP1090 INSTALL SCRIPT" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/dump1090.progress ]] && { exit 0 diff --git a/dump1090/scripts/dump1090.sh b/dump1090/scripts/dump1090.sh index a90235d..9df019c 100755 --- a/dump1090/scripts/dump1090.sh +++ b/dump1090/scripts/dump1090.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` OPTIONS='' diff --git a/ettercap/api/module.php b/ettercap/api/module.php index fc4f0f8..e1578c4 100644 --- a/ettercap/api/module.php +++ b/ettercap/api/module.php @@ -1,6 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("ettercap.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("ettercap.module.installed"))); } protected function getDevice() diff --git a/ettercap/scripts/dependencies.sh b/ettercap/scripts/dependencies.sh index 591ccf8..8d8f700 100755 --- a/ettercap/scripts/dependencies.sh +++ b/ettercap/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/ettercap.progress ]] && { exit 0 diff --git a/ettercap/scripts/ettercap.sh b/ettercap/scripts/ettercap.sh index 3229c72..141b8ea 100755 --- a/ettercap/scripts/ettercap.sh +++ b/ettercap/scripts/ettercap.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` MYCMD=`cat /tmp/ettercap.run` diff --git a/ngrep/api/module.php b/ngrep/api/module.php index d2d52ae..0fcb3cf 100644 --- a/ngrep/api/module.php +++ b/ngrep/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("ngrep.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("ngrep.module.installed"))); } protected function getDevice() @@ -71,7 +74,7 @@ class ngrep extends Module private function handleDependencies() { - if (!$this->checkDeps("ngrep")) { + if (!$this->checkDependency("ngrep")) { $this->execBackground("/pineapple/modules/ngrep/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -104,7 +107,7 @@ class ngrep extends Module private function refreshStatus() { if (!file_exists('/tmp/ngrep.progress')) { - if (!$this->checkDeps("ngrep")) { + if (!$this->checkDependency("ngrep")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -144,7 +147,7 @@ class ngrep extends Module private function refreshOutput() { - if ($this->checkDeps("ngrep")) { + if ($this->checkDependency("ngrep")) { if ($this->checkRunning("ngrep")) { $path = "/pineapple/modules/ngrep/log"; diff --git a/ngrep/scripts/dependencies.sh b/ngrep/scripts/dependencies.sh index fc4ce82..c68db49 100755 --- a/ngrep/scripts/dependencies.sh +++ b/ngrep/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master -logger "== Ngrep Install Script" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/ngrep.progress ]] && { exit 0 @@ -18,6 +19,10 @@ if [ "$1" = "install" ]; then opkg install ngrep --dest sd fi + if [ ! -f /usr/lib/libpcap.so ] && [ -f /usr/lib/libpcap.so.1.3 ]; then + ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.1.3 + fi + touch /etc/config/ngrep echo "config ngrep 'module'" > /etc/config/ngrep diff --git a/ngrep/scripts/ngrep.sh b/ngrep/scripts/ngrep.sh index fd98791..03287ab 100755 --- a/ngrep/scripts/ngrep.sh +++ b/ngrep/scripts/ngrep.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYCMD=`cat /tmp/ngrep.run` diff --git a/nmap/api/module.php b/nmap/api/module.php index ff94358..c03146f 100644 --- a/nmap/api/module.php +++ b/nmap/api/module.php @@ -1,7 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("nmap.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("nmap.module.installed"))); } -// protected function getDevice() -// { -// return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'")); -// } + protected function getDevice() + { + return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'")); + } protected function refreshInfo() { @@ -62,7 +62,6 @@ class nmap extends Module private function handleDependencies() { - error_log("handleDependencies()"); if (!$this->checkDependency("nmap")) { $this->execBackground("/pineapple/modules/nmap/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); @@ -93,11 +92,9 @@ class nmap extends Module private function togglenmap() { if (!$this->checkRunning("nmap")) { - error_log("nmap not running"); $full_cmd = $this->request->command . " -oN /tmp/nmap.scan 2>&1"; shell_exec("echo -e \"{$full_cmd}\" > /tmp/nmap.run"); - error_log("calling run script"); $this->execBackground("/pineapple/modules/nmap/scripts/nmap.sh start"); } else { $this->execBackground("/pineapple/modules/nmap/scripts/nmap.sh stop"); diff --git a/nmap/scripts/dependencies.sh b/nmap/scripts/dependencies.sh index a6d8612..d241041 100755 --- a/nmap/scripts/dependencies.sh +++ b/nmap/scripts/dependencies.sh @@ -1,10 +1,8 @@ #!/bin/sh #2015 - Whistle Master -#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib -#export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin - -logger "== RUNNING NMAP INSTALL SCRIPT" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/nmap.progress ]] && { exit 0 @@ -21,9 +19,9 @@ if [ "$1" = "install" ]; then opkg install nmap --dest sd fi -# if [ ! -f /usr/lib/libpcap.so ] && [ -f /usr/lib/libpcap.so.1.3 ]; then -# ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.1.3 -# fi + if [ ! -f /usr/lib/libpcap.so ] && [ -f /usr/lib/libpcap.so.1.3 ]; then + ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.1.3 + fi touch /etc/config/nmap echo "config nmap 'module'" > /etc/config/nmap diff --git a/nmap/scripts/nmap.sh b/nmap/scripts/nmap.sh index ee6d335..3fb1cf0 100755 --- a/nmap/scripts/nmap.sh +++ b/nmap/scripts/nmap.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master -logger "== STARTING NMAP SCRIPT" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` MYCMD=`cat /tmp/nmap.run` diff --git a/p0f/api/module.php b/p0f/api/module.php index 0f21aed..a1ec3a6 100644 --- a/p0f/api/module.php +++ b/p0f/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("p0f.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("p0f.module.installed"))); } protected function getDevice() @@ -65,7 +68,7 @@ class p0f extends Module private function handleDependencies() { - if (!$this->checkDeps("p0f")) { + if (!$this->checkDependency("p0f")) { $this->execBackground("/pineapple/modules/p0f/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -117,7 +120,7 @@ class p0f extends Module private function refreshStatus() { if (!file_exists('/tmp/p0f.progress')) { - if (!$this->checkDeps("p0f")) { + if (!$this->checkDependency("p0f")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -172,7 +175,7 @@ class p0f extends Module private function refreshOutput() { - if ($this->checkDeps("p0f")) { + if ($this->checkDependency("p0f")) { if ($this->checkRunning("p0f")) { $path = "/pineapple/modules/p0f/log"; diff --git a/p0f/scripts/autostart_p0f.sh b/p0f/scripts/autostart_p0f.sh index 9450e76..75657d9 100755 --- a/p0f/scripts/autostart_p0f.sh +++ b/p0f/scripts/autostart_p0f.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYINTERFACE=`uci get p0f.autostart.interface` diff --git a/p0f/scripts/dependencies.sh b/p0f/scripts/dependencies.sh index 84b6d9a..a947526 100755 --- a/p0f/scripts/dependencies.sh +++ b/p0f/scripts/dependencies.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/p0f.progress ]] && { exit 0 } diff --git a/p0f/scripts/p0f.sh b/p0f/scripts/p0f.sh index 1f960be..c641146 100755 --- a/p0f/scripts/p0f.sh +++ b/p0f/scripts/p0f.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + MYTIME=`date +%s` MYINTERFACE=`uci get p0f.run.interface` diff --git a/tcpdump/api/module.php b/tcpdump/api/module.php index 5c4140b..cd8f05c 100644 --- a/tcpdump/api/module.php +++ b/tcpdump/api/module.php @@ -1,6 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("tcpdump.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("tcpdump.module.installed"))); } protected function getDevice() @@ -64,7 +65,7 @@ class tcpdump extends Module private function handleDependencies() { - if (!$this->checkDeps("tcpdump")) { + if (!$this->checkDependency("tcpdump")) { $this->execBackground("/pineapple/modules/tcpdump/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -97,7 +98,7 @@ class tcpdump extends Module private function refreshStatus() { if (!file_exists('/tmp/tcpdump.progress')) { - if (!$this->checkDeps("tcpdump")) { + if (!$this->checkDependency("tcpdump")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -137,7 +138,7 @@ class tcpdump extends Module private function refreshOutput() { - if ($this->checkDeps("tcpdump")) { + if ($this->checkDependency("tcpdump")) { if (file_exists("/tmp/tcpdump_capture.log")) { $output = file_get_contents("/tmp/tcpdump_capture.log"); if (!empty($output)) { diff --git a/tcpdump/scripts/dependencies.sh b/tcpdump/scripts/dependencies.sh index 6ebce72..ae74f08 100755 --- a/tcpdump/scripts/dependencies.sh +++ b/tcpdump/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/tcpdump.progress ]] && { exit 0 diff --git a/tcpdump/scripts/tcpdump.sh b/tcpdump/scripts/tcpdump.sh index 12d95cc..36bda42 100755 --- a/tcpdump/scripts/tcpdump.sh +++ b/tcpdump/scripts/tcpdump.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` MYCMD=`cat /tmp/tcpdump.run` diff --git a/tor/scripts/dependencies.sh b/tor/scripts/dependencies.sh index b2405c7..e2bd6fc 100755 --- a/tor/scripts/dependencies.sh +++ b/tor/scripts/dependencies.sh @@ -2,7 +2,8 @@ # author: catatonicprime # date: March 2018 - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin touch /tmp/tor.progress diff --git a/urlsnarf/api/module.php b/urlsnarf/api/module.php index c0b66f6..40a20a4 100644 --- a/urlsnarf/api/module.php +++ b/urlsnarf/api/module.php @@ -1,6 +1,7 @@ checkDependency($dependencyName) && ($this->uciGet("urlsnarf.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("urlsnarf.module.installed"))); } protected function getDevice() diff --git a/urlsnarf/scripts/autostart_urlsnarf.sh b/urlsnarf/scripts/autostart_urlsnarf.sh index 8f410ef..8678667 100755 --- a/urlsnarf/scripts/autostart_urlsnarf.sh +++ b/urlsnarf/scripts/autostart_urlsnarf.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` MYINTERFACE=`uci get urlsnarf.autostart.interface` diff --git a/urlsnarf/scripts/dependencies.sh b/urlsnarf/scripts/dependencies.sh index d117414..0b9b168 100755 --- a/urlsnarf/scripts/dependencies.sh +++ b/urlsnarf/scripts/dependencies.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin [[ -f /tmp/urlsnarf.progress ]] && { exit 0 diff --git a/urlsnarf/scripts/urlsnarf.sh b/urlsnarf/scripts/urlsnarf.sh index b43fd78..70d2dc8 100755 --- a/urlsnarf/scripts/urlsnarf.sh +++ b/urlsnarf/scripts/urlsnarf.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` MYINTERFACE=`uci get urlsnarf.run.interface` diff --git a/wps/api/module.php b/wps/api/module.php index 3f66b7a..45f8112 100644 --- a/wps/api/module.php +++ b/wps/api/module.php @@ -1,5 +1,8 @@ checkDependency($dependencyName) && ($this->uciGet("wps.module.installed"))); + return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("wps.module.installed"))); } protected function getDevice() @@ -90,7 +93,7 @@ class wps extends Module private function handleDependencies() { - if (!$this->checkDeps("reaver")) { + if (!$this->checkDependency("reaver")) { $this->execBackground("/pineapple/modules/wps/scripts/dependencies.sh install ".$this->request->destination); $this->response = array('success' => true); } else { @@ -111,7 +114,7 @@ class wps extends Module private function refreshStatus() { if (!file_exists('/tmp/wps.progress')) { - if (!$this->checkDeps("iwlist")) { + if (!$this->checkDependency("iwlist")) { $installed = false; $install = "Not installed"; $installLabel = "danger"; @@ -163,7 +166,7 @@ class wps extends Module private function refreshOutput() { - if ($this->checkDeps("reaver") && $this->checkDeps("bully")) { + if ($this->checkDependency("reaver") && $this->checkDependency("bully")) { if ($this->checkRunning("reaver") || $this->checkRunning("bully")) { $path = "/pineapple/modules/wps/log"; diff --git a/wps/scripts/dependencies.sh b/wps/scripts/dependencies.sh index 628372f..0929345 100755 --- a/wps/scripts/dependencies.sh +++ b/wps/scripts/dependencies.sh @@ -1,6 +1,9 @@ #!/bin/sh #2015 - Whistle Master +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin + [[ -f /tmp/wps.progress ]] && { exit 0 } diff --git a/wps/scripts/wps.sh b/wps/scripts/wps.sh index cef2ea4..6aa7d1b 100755 --- a/wps/scripts/wps.sh +++ b/wps/scripts/wps.sh @@ -1,7 +1,8 @@ #!/bin/sh #2015 - Whistle Master - +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib +export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin MYTIME=`date +%s` MYCMD=`cat /tmp/wps.run`