1 2 3 4 5 6 7 8
my $abfrage = "rsh $ARGV[0] export SEMAPHOREN_PATH=$remote_sem_path; env | grep SEMA; $net_post_path/netposts $ARGV[1]; ls -lisa SEMAPHOREN_PATH; ipcs -s -a"; printf "Execute [%s]\n", $abfrage; $result = `$abfrage`; print $result;
1 2 3 4 5 6 7 8
my $abfrage = "rsh $ARGV[0] export SEMAPHOREN_PATH=" . '$remote_sem_path' . "; env | grep SEMA; $net_post_path/netposts $ARGV[1]; ls -lisa SEMAPHOREN_PATH; ipcs -s -a"; printf "Execute [%s]\n", $abfrage; $result = `$abfrage`; print $result;
1
2
3
4
5
6
7
8
my $abfrage = "rsh $ARGV[0] export SEMAPHOREN_PATH=$remote_sem_path;
env | grep SEMA;
$net_post_path/netposts $ARGV[1];
ls -lisa \$SEMAPHOREN_PATH;
ipcs -s -a";
printf "Execute [%s]\n", $abfrage;
$result = `$abfrage`;
print $result;
`rsh $ARGV[0] touch /tmp/1 \\; touch /tmp/2`;
my $abfrage = 'rsh \$ARGV[0] export SEMAPHOREN_PATH=\$remote_sem_path && env | grep SEMA && \$net_post_path . "/netposts" \$ARGV[1] ls -lisa SEMAPHOREN_PATH && ipcs -s -a';
my $abfrage = 'rsh '\$ARGV[0]' export SEMAPHOREN_PATH='\$remote_sem_path' && env | grep SEMA && '\$net_post_path' . "/netposts" '\$ARGV[1]' ls -lisa SEMAPHOREN_PATH && ipcs -s -a';
QuoteBackslash found where operator expected at test.pl line 23, near "'rsh '\"
(Missing operator before \?)
String found where operator expected at test.pl line 23, near "]' export SEMAPHOREN_PATH='"
(Missing operator before ' export SEMAPHOREN_PATH='?)
Backslash found where operator expected at test.pl line 23, near "' export SEMAPHOREN_PATH='\"
(Missing operator before \?)
String found where operator expected at test.pl line 23, near "$remote_sem_path' && env | grep SEMA && '"
(Missing operator before ' && env | grep SEMA && '?)
Backslash found where operator expected at test.pl line 23, near "' && env | grep SEMA && '\"
(Missing operator before \?)
String found where operator expected at test.pl line 23, near "$net_post_path' . "/netposts" '"
(Missing operator before ' . "/netposts" '?)
Backslash found where operator expected at test.pl line 23, near "' . "/netposts" '\"
(Missing operator before \?)
String found where operator expected at test.pl line 23, near "]' ls -lisa SEMAPHOREN_PATH && ipcs -s -a'"
(Missing operator before ' ls -lisa SEMAPHOREN_PATH && ipcs -s -a'?)
syntax error at test.pl line 23, near "'rsh '\"
Execution of test.pl aborted due to compilation errors.
1 2 3 4 5 6 7 8 9 10
my $abfrage = qq~ rsh $ARGV[0] " export SEMAPHOREN_PATH=$remote_sem_path env | grep SEMA $net_post_path/netposts $ARGV[1] ls -lisa \\\$SEMAPHOREN_PATH ipcs -s -a " ~; printf "Execute [%s]\n", $abfrage; my $result = `$abfrage`; print $result;´
QuoteDeine Shell wiederum weiß dadurch, dass sie die Variable nicht interpolieren darf und gibt dann $SEMAPHOREN_PATH an die entfernte Shell weiter.
QuoteInsecure dependency in `` while running setgid at rnetposts.pl line 40.
1 2 3
my $abfrage = qq~ps -ef | grep -v grep | grep "rnetposts.pl $ARGV[0] $ARGV[1]"~; printf("abfrage: [%s]\n", $abfrage); my $result = `$abfrage`;