Commit f7b133c9 authored by sdrfnord's avatar sdrfnord

Fixed.

parent e2868f06
......@@ -17,6 +17,7 @@ from ConfigParser import ConfigParser
# ToDo
# * Read MAC address of target and compare to last time if a MAC address is present for target after ping.
# * Add option to run just validation during normal operation.
class scout():
def __init__(self,
......@@ -54,7 +55,7 @@ class scout():
return repr(data)
def _is_alive(self, hostname):
return True if os.system('fping -c 2 -q -T5 "%s"' % hostname) == 0 else False
return True if os.system('ping -c 1 "%s"' % hostname) == 0 else False
def _is_preboot(self, ssh_version_string):
""" True if something like SSH-2.0-dropbear_2012.55. """
......@@ -91,12 +92,8 @@ class scout():
try:
ssh_version_string = self._netcat(hostname, port)
except socket.error:
if self._disk_unlocked == True:
print "Server should be booting now."
sys.exit(0)
else:
print "SSH server not responding."
sys.exit(1)
print "SSH server not responding."
sys.exit(1)
if self._is_normal_os(ssh_version_string):
logging.info('Normal SSH Server is present. Unlocking seems to be not necessary.')
sys.exit(1)
......@@ -105,7 +102,7 @@ class scout():
else: # Dropbear
time.sleep(3) # Dropbear needs a bit time to start.
logging.info('Preparing pre-boot integrity check ')
if os.system('cat %s | ssh %s cat ">" /root/hashdeep' % (
if os.system('cat %s | ssh %s "cat > /root/hashdeep"' % (
os.path.join(self._base_config_path, self._hash_check_program), self._ssh_parms)
) != 0:
raise Exception('Could not copy hashdeep over to %s.' % hostname)
......@@ -131,10 +128,14 @@ class scout():
os.system('comm -13 "%s" "%s" | cut -d "," -f 3' % (self._hash_file, self._hash_file_old))
if not re.match(r'YES', raw_input('\nDo you want to continue anyway (YES/NO)? ')):
self._exit_gracefully(child)
sys.exit(1)
else:
self._unlock_disks(hostname, child)
else:
self._unlock_disks(hostname, child)
if self._disk_unlocked == True:
print "Server should be booting now."
sys.exit(0)
else:
logging.info('Host offline. Waiting ')
......
#!/bin/bash
# Script to easily set your wireless card in promiscuous mode and show the IEEE 802.11 frames that are flowing around you.
# Always exit on errors
set -e
# Undefined variables, we don't like you
# set -u
# ERR traps are inherited by shell functions, command substitutions and
......@@ -22,7 +20,11 @@ if [[ "$1" == "start" ]]; then
if [[ -z "`airmon-ng |grep mon0`" ]]; then
airmon-ng start wlan0
fi
airodump-ng --manufacturer --uptime mon0
# airodump-ng --manufacturer --uptime mon0
airodump-ng --uptime mon0
if [[ $? != 0 ]]; then
airodump-ng --uptime mon0
fi
elif [[ "$1" == "stop" ]]; then
killall 'airodump-ng'
airmon-ng stop mon0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment