perl脚本解密(我怎么可以加密或隐藏的密码在一个Perl脚本)

本文目录
- 我怎么可以加密或隐藏的密码在一个Perl脚本
- Perl脚本实现将附件(等下我会粘贴)中的日志中成功匹配解析
- perl脚本问题求指教!
- Perl脚本中有这么个语句,不是很理解, 希望懂的人给解释一下,谢谢
- 求解释这个perl脚本,非常感谢
我怎么可以加密或隐藏的密码在一个Perl脚本
按“Win+R”组合键打开“运行”对话框,输入“cmd”打开命令提示符窗口。
然后输入“md g:\jm..\”并按回车键,在G盘(根据你的实际情况输入相应的目录)下新建一个名为“jm.”的文件夹。这个文件夹就是我们即将用来存放隐藏文件的文件夹。
Perl脚本实现将附件(等下我会粘贴)中的日志中成功匹配解析
#!/usr/bin/perl
open(IN,"$ARGV")||die "$!";
open(OUT,"》$ARGV")||die "$!";
print OUT"User\tip\tport\tlogin\n";
while(《IN》){
chomp;
next if(!/^sshd.*ssh3$/);
my($fh,$user,$ip,$port)=$_=~/^sshd\: (.+) password for (.+) from (.+) port (\d+) ssh3$/ ;
print OUT"$user\t$ip\t$port\t$fh\n";
}
close IN;
close OUT;
perl脚本问题求指教!
perl脚本的内容仅包括如下这部分:
#!/usr/bin/perl
# write by huabo, 2009-11-20
use warnings;
use strict;
#open the svn passwd file
open (FILE, "passwd") or die ("Cannot open the passwd file!!!n");
#clear the apache passwd file
open (OUT_FILE, "》webpasswd") or die ("Cannot open the webpasswd file!!!n");
close (OUT_FILE);
#begin
foreach (《FILE》) {
if($_ =~ m/^.*=/) {
$_ =~ s/=//;
`htpasswd -b webpasswd $_`;
}
}
至于:
# chmod +x PtoWP.pl
# ./PtoWP.pl
是你应对这个perl脚本在CentOS下做权限修改,并执行的命令。
Adding password for user pm
Adding password for user server_group
Adding password for user client_group
Adding password for user test_group
上面这部分是执行之后的输出结果。
这个脚本的目的是将SVN的账户信息同步到apache里去。
Perl脚本中有这么个语句,不是很理解, 希望懂的人给解释一下,谢谢
$a=parameter;
$parameter="123";
print $$a;
结果 : 123
.连接字符串用的。比如
$a="123";
$b="456";
$c=$a.$b;
$c = "123456"
求解释这个perl脚本,非常感谢
warning:Use of uninitialized value in pattern match (m//) at processMonitor.pl line 38
上面这个warn是因为while循环条件里面少了东西,这里应该是《PS》这个句柄
另外,那个exec要执行logger,这个程序有的不在/bin目录下,而在/usr/bin目录下
这个程序大致意思是查看指定的程序是在ps列表中出现的次数
例如,你在命令行执行这个程序
./processMonitor.pl ps klogd
就可以在生成的log文件中看到结果了
下面给你稍微加了些注释,如果基本语法比较熟悉的话,应该可以看懂了
#!/usr/bin/perl -w
#
#name: processMonitor.pl
#written by trizsolo
#usage: ./processMonitor.pl args args args
#you can add as many processes as needed for args
#or use the defaults... syslogd is always checked
#----------------------------
my $user=’root’;
my $host=`hostname`;
chomp($host);
my $date=`date`;
chomp($date);
my $logfile="$host" . ’.log’;#以主机名加log后缀的形式命名日志文件
our @proc_list=@ARGV;
# Default list of processes
if(@proc_list==0)#如果不在命令行指定程序名,则默认查看下面的三个程序
{
# check for arguments
@proc_list=(’inetd’, ’sendmail’, ’chkMounts.pl’);
}
push(@proc_list, ’syslogd’);
# add syslogd to check
# ---------- open logfile and determine Operating System --------------
#以添加的方式打开日志文件,并把要查看的程序名称,日期及系统信息添加到日志文件
open(LOG, "》》$logfile") or die "Can’t open $logfile to write: $!";
print LOG "Searching for: @proc_list on $date!\n";
chomp($os=`uname -r`);
print LOG "OS on this server is $os\n";
close(LOG);
# ---------------- call "ps" & analyse output --------------------
#初始化哈希计数表,用来统计指定程序在列表中出现的次数
foreach my $process (@proc_list)
{
$event_count {$process} = 0;
}
#使用管道,使ps的输出作为下面匹配的目标
open(PS, "/bin/ps auwx |") or die "Can’t run ps: __FILE__ $!";
$/="\n";
# record seperator
#这个while原来少了东西,应该有上面打开的句柄《PS》
while(《PS》)
{
foreach my $process(@proc_list)
{
if($_ =~(m/$process/i))
{
$event_count {$process}++;
}
}
}
close(PS);
再次打开日志文件,把上面遍历ps列表后的信息写入日志文件
open(LOG,"》》$logfile") or die "Cannot open $logfile: $!";
# Add line to log to nagios if needed
foreach $process(@proc_list)
{
if($event_count {$process} ==0)
{
print LOG "Process $process is NOT running!\n";
#这里的logger有的在/usr/bin目录下
system("/bin/logger -p warn Process: $process is NOT running!\n")
== 0 or die "Cannot complete cmd: $! : $?";
}
else
{
print LOG "Process $process occurred $event_count{$process} times!\n";
}
}
close(LOG);
exit 0;
#EOF

更多文章:
sometime(英语词组 sometimes, some times, sometime和some time的区别)
2026年1月12日 03:00
acquisition词组(雅思词汇应用:达到雅思7分不得不知道的词组!)
2026年1月31日 17:15
finder 翻译(英语翻译 怎么翻译顺口 Be a better deal finder!)
2025年12月29日 04:15
网页视频下载器手机版(iPhone 手机有什么浏览器可以下载网页链接视频)
2025年9月11日 07:15
嵌入式开发板6818属于armv8架构(工业arm板,像三星6818开发板能做吗)
2026年7月4日 15:00
苹果imgplay怎么导入字体(imgplay字体特效怎么加描边)
2025年10月18日 07:15
headfirstjava中文版pdf(有木有关于Java虚拟机的书籍推荐感激不尽)
2025年12月29日 01:45
51单片机接口线怎么连(USB接口怎么接51单片机最小系统的引脚的求大神赐教)
2026年4月22日 12:15
查找替换中的任意数字和任意字符的区别?表示任意 字符 的正则表达式 符号
2026年9月13日 16:30
background image属性(cssbackground-image属性怎么用)
2025年10月6日 02:30
paper软件下载(小红车wallpaper电脑端怎么下载)
2025年12月21日 15:15
accepting of(下面的句子里accepting是什么从句啊)
2025年12月6日 23:45
editorial assignment什么意思啊(Assignment 代表什么意思)
2025年12月11日 14:15








