diff --git a/error.log b/error.log new file mode 100644 index 0000000..e69de29 diff --git a/fix_perms.sh b/fix_perms.sh new file mode 100755 index 0000000..f261c43 --- /dev/null +++ b/fix_perms.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo chown -R www-data:www-data . 2>>error.log \ No newline at end of file diff --git a/run_clear.sh b/run_clear.sh new file mode 100755 index 0000000..ade0ec3 --- /dev/null +++ b/run_clear.sh @@ -0,0 +1,3 @@ +#!/bin/bash +rm -f error.log 2>>./error.log +rm -f scans/* 2>>./error.log \ No newline at end of file diff --git a/run_scan.php b/run_scan.php index 8f62243..2b54684 100644 --- a/run_scan.php +++ b/run_scan.php @@ -8,10 +8,11 @@ } $file_name = date("Ymd-Hi-s") . ".xml"; - $run_cmd = "nmap -oX scans/$file_name --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl $post_cmd &"; + $run_cmd = "bash ./run_scan.sh nmap -oX scans/$file_name --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl $post_cmd"; $web_name = "/nmaprincesspi/scans/$file_name"; echo $web_name; $exec = shell_exec($run_cmd); + echo $exec; ?> \ No newline at end of file diff --git a/run_scan.sh b/run_scan.sh new file mode 100755 index 0000000..27e7d51 --- /dev/null +++ b/run_scan.sh @@ -0,0 +1,2 @@ +#!/bin/bash +eval "$* 2>>./error.log 1>/dev/null&" \ No newline at end of file