mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-24 18:16:24 +01:00
standardize whitespace
git-svn-id: file:///home/svn/framework3/trunk@9413 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
be44066098
commit
eaf4329829
@ -40,7 +40,6 @@ function hexdump($data, $htmloutput = false, $uppercase = false, $return = false
|
||||
} else {
|
||||
$ascii .= '.';
|
||||
}
|
||||
|
||||
# Add extra column spacing
|
||||
if ($j === 7) {
|
||||
$hexi .= ' ';
|
||||
@ -298,6 +297,9 @@ function my_cmd($cmd) {
|
||||
return shell_exec($cmd);
|
||||
}
|
||||
|
||||
function is_windows() {
|
||||
return (strtoupper(substr(PHP_OS,0,3)) == "WIN");
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
@ -507,6 +509,9 @@ if (!function_exists('stdapi_sys_process_get_processes')) {
|
||||
function stdapi_sys_process_get_processes($req, &$pkt) {
|
||||
my_print("doing get_processes");
|
||||
$list = array();
|
||||
if (is_windows()) {
|
||||
# meh
|
||||
} else {
|
||||
# This command produces a line like:
|
||||
# 1553 root /sbin/getty -8 38400 tty1
|
||||
$output = my_cmd("ps a -w -o pid,user,cmd --no-header 2>/dev/null");
|
||||
@ -514,6 +519,7 @@ function stdapi_sys_process_get_processes($req, &$pkt) {
|
||||
foreach ($lines as $line) {
|
||||
array_push($list, preg_split("/\s+/", trim($line)));
|
||||
}
|
||||
}
|
||||
foreach ($list as $proc) {
|
||||
$grp = "";
|
||||
$grp .= tlv_pack(create_tlv(TLV_TYPE_PID, $proc[0]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user