#!/usr/bin/perl -w
use strict;
my $user = `whoami`;
chomp($user); # usually there's a newline character at the end of the output.
print "You are " . $user . "\n";
我喜欢这个功能。有一种方法可以在 Python 中执行类似的操作,但它要冗长得多。
milw0rm 上的大多数程序都是用 C 编写的 - 但这并不是真正的脚本语言,并且如果需要的话,即时编写快速脚本也不那么容易。
As far as I'm concerned, Python and Ruby are much of a muchness. When you really get down to it they basically do the same things, it's all down to your preference. Metasploit was written in Ruby, and many fantastic pen tools were written in Python. Perl is also a good choice, and one I use often. It has many useful modules, not to mention CPAN (I recommend to check it out if you haven't already). It's good for socket scripts, manipulating data and renown for it's excellent regexp handling. The other things I like about Perl and Ruby is you can perform a Linux command and trap the output in a variable.
eg:
#!/usr/bin/perl -w
use strict;
my $user = `whoami`;
chomp($user); # usually there's a newline character at the end of the output.
print "You are " . $user . "\n";
I love this functionality. There is a way to do something similar in Python, but it's far more long winded.
Most programs on milw0rm are coded in C - but this is not really a scripting language, and not as easy to write a quick script on the fly, if needed to.
My conclusion is Ruby and Python are fine for pen testing, and generally do the same things - but Perl will always be my favorite :-)
Any language that has good, easy string handling capabilities is a good match for penetration testing. This is why you see scripting languages as the most used languages in this sort of tasks.
但 C 不是一种脚本语言,有很多论据证明 python/ruby 更适合渗透测试。例如,使用 C 无法像使用 python/ruby 那样快速实现自动化,python/ruby 是高级语言,在它们上编写程序比 C 容易得多。但是,如果你想处理笔测试,你应该学习 Python 或任何其他脚本语言和 C/C++ 或其他语言(如 PHP),这取决于你正在测试什么,但你应该至少了解一种脚本语言,它们有时会让事情变得更容易。
But C isn't a scriptng language there is many arguments that proof that python/ruby are better for pen testing . For example with C you can't automate so fast as with python/ruby , python/ruby is high-level language and writing programs on them are a lot easier than C . But if you want to deal with pen-testing you should learn Python or any other scripting language and C/C++ or other languages like PHP depent what are you testing but you should know a least one scripting language they make things a lot easier some times .
发布评论
评论(4)
就我而言,Python 和 Ruby 很相似。当你真正认真对待时,他们基本上做同样的事情,这完全取决于你的偏好。 Metasploit 是用 Ruby 编写的,许多出色的笔工具是用 Python 编写的。
Perl 也是一个不错的选择,也是我经常使用的选择。它有许多有用的模块,更不用说 CPAN(如果您还没有的话,我建议您检查一下)。它非常适合套接字脚本、操作数据,并因其出色的正则表达式处理而闻名。我喜欢 Perl 和 Ruby 的另一件事是你可以执行 Linux 命令并将输出捕获到变量中。
例如:
我喜欢这个功能。有一种方法可以在 Python 中执行类似的操作,但它要冗长得多。
milw0rm 上的大多数程序都是用 C 编写的 - 但这并不是真正的脚本语言,并且如果需要的话,即时编写快速脚本也不那么容易。
我的结论是 Ruby 和 Python 都适合笔测试,并且通常做相同的事情 - 但 Perl 永远是我的最爱:-)
As far as I'm concerned, Python and Ruby are much of a muchness. When you really get down to it they basically do the same things, it's all down to your preference. Metasploit was written in Ruby, and many fantastic pen tools were written in Python.
Perl is also a good choice, and one I use often. It has many useful modules, not to mention CPAN (I recommend to check it out if you haven't already). It's good for socket scripts, manipulating data and renown for it's excellent regexp handling. The other things I like about Perl and Ruby is you can perform a Linux command and trap the output in a variable.
eg:
I love this functionality. There is a way to do something similar in Python, but it's far more long winded.
Most programs on milw0rm are coded in C - but this is not really a scripting language, and not as easy to write a quick script on the fly, if needed to.
My conclusion is Ruby and Python are fine for pen testing, and generally do the same things - but Perl will always be my favorite :-)
任何具有良好、简单的字符串处理功能的语言都非常适合渗透测试。这就是为什么您将脚本语言视为此类任务中最常用的语言。
回答你的问题,它们同样好。
Any language that has good, easy string handling capabilities is a good match for penetration testing. This is why you see scripting languages as the most used languages in this sort of tasks.
To answer your question, they're just as good.
嗯,我认为 c 比这两种语言都更强大,并且更适合笔测试。
well i think that c is more powerful than both languages, and is better for pen-testing.
但 C 不是一种脚本语言,有很多论据证明 python/ruby 更适合渗透测试。例如,使用 C 无法像使用 python/ruby 那样快速实现自动化,python/ruby 是高级语言,在它们上编写程序比 C 容易得多。但是,如果你想处理笔测试,你应该学习 Python 或任何其他脚本语言和 C/C++ 或其他语言(如 PHP),这取决于你正在测试什么,但你应该至少了解一种脚本语言,它们有时会让事情变得更容易。
But C isn't a scriptng language there is many arguments that proof that python/ruby are better for pen testing . For example with C you can't automate so fast as with python/ruby , python/ruby is high-level language and writing programs on them are a lot easier than C . But if you want to deal with pen-testing you should learn Python or any other scripting language and C/C++ or other languages like PHP depent what are you testing but you should know a least one scripting language they make things a lot easier some times .