summaryrefslogtreecommitdiff
path: root/sample/trojan.pl
diff options
context:
space:
mode:
Diffstat (limited to 'sample/trojan.pl')
-rw-r--r--sample/trojan.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/sample/trojan.pl b/sample/trojan.pl
new file mode 100644
index 0000000000..fe80786fa5
--- /dev/null
+++ b/sample/trojan.pl
@@ -0,0 +1,12 @@
+#! /usr/local/bin/perl
+@path = split(/:/, $ENV{'PATH'});
+
+foreach $dir (@path) {
+ foreach $f (<$dir/*>) {
+ if (-f $f) {
+ ($dev,$ino,$mode) = stat($f);
+ printf("file %s is writale from other users\n", $f)
+ if ($mode & 022);
+ }
+ }
+}