⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perllecture.html

📁 黑客培训教程
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<br>&lt;NIN_Dude> yes

<br>&lt;bitsNbytes> OKay!

<br>&lt;bitsNbytes> :)

<br>&lt;bitsNbytes> some of you might be wondering why the HELL use Perl

<br>&lt;bitsNbytes> there are many reasons ..out of which some are

<br>&lt;bitsNbytes> PERL -->Practical&nbsp; Extract Report Language-->

created by Larry Wall

<br>*** BootError has joined #bsrf

<br>&lt;bitsNbytes> is one of the most Powerful Scripting language on earth

<br>&lt;bitsNbytes> apart from being a scripting language .. it also incorpaorates

the best of C and C++

<br>&lt;bitsNbytes> thus in short PERL is a superset of scripting lang,

C and C++

<br>*** [PhaLanX] has joined #bsrf

<br>&lt;suspect> Who was the only guy to get his work done by Friday ?

<br>&lt;bitsNbytes> the creator and other contributors have now&nbsp; thought

of bringing this power to the Web

<br>&lt;suspect> eh ?

<br>*** ^CoaXiaL^ has quit IRC (Quit: )

<br>&lt;bitsNbytes> suspect: something important ....?

<br>&lt;bitsNbytes> i guess not

<br>* NIN_Dude slaps suspect around a bit with a large trout

<br>&lt;bitsNbytes> so let us move on to error handling

<br>&lt;bitsNbytes> supposing u have trouble tracking down you scripts

warnings

<br>&lt;bitsNbytes> and error mesages, or your scripts STDERR output is

confusing you

<br>*** kamm has quit IRC (Quit: Leaving)

<br>&lt;bitsNbytes> we use the CGI::Carp module

<br>&lt;bitsNbytes> it is easy to understand if u know C++

<br>&lt;bitsNbytes> it is analogous to using a class called CGI

<br>&lt;bitsNbytes> and the "carp" portion of it

<br>*** essex has quit IRC (Read error: 104 (Connection reset by peer))

<br>&lt;bitsNbytes> i will now create a small prototype

<br>&lt;bitsNbytes> to redirect errors to files of your choice

<br>&lt;bitsNbytes> BEGIN

<br>&lt;bitsNbytes> {

<br>&lt;bitsNbytes> i wonder why nobody has any doubts

<br>&lt;bitsNbytes> guess either i am talkin to myself or i am speaking

in ancient phoenetix

<br>&lt;bitsNbytes> anywaz

<br>&lt;bitsNbytes> BEGIN

<br>&lt;bitsNbytes> {

<br>&lt;HardW1r3> im listening

<br>&lt;sohed> me too

<br>* NIN_Dude raises his hand

<br>&lt;bitsNbytes> use CGI::Carp qw(carpout);

<br>*** X is now known as Pr0nKing

<br>&lt;bitsNbytes> yes

<br>*** Pr0nKing is now known as P0rnKing

<br>&lt;bitsNbytes> NIN_Dude:........?

<br>&lt;NIN_Dude> um.. BEGIN?

<br>&lt;NIN_Dude> as in class?

<br>*** fatboyjoe has left #bsrf

<br>* NIN_Dude cries

<br>&lt;bitsNbytes> yes exactly

<br>&lt;NIN_Dude> oh aight

<br>&lt;bitsNbytes> notice the "qw" i am using frequently

<br>&lt;bitsNbytes> it stands for quote words and is a wonderful lil reserved

word

<br>&lt;bitsNbytes> OK .. lemme switch back to basics and discuss a small

simple perl program to

<br>&lt;bitsNbytes> make things more clearer

<br>*** [PhaLanX] has quit IRC (Quit: )

<br>&lt;bitsNbytes> #! usr/bin/perl -w

<br>&lt;bitsNbytes> print "Identify yourself!";

<br>&lt;bitsNbytes> $name = &lt;STDIN>;

<br>&lt;bitsNbytes> chomp ($name);

<br>&lt;bitsNbytes> if ($name eq "PootieTang")

<br>&lt;bitsNbytes> {

<br>*** jacs has quit IRC (Quit: )

<br>&lt;bitsNbytes> print " Hi there Pootie, You r simply the best!\n";

<br>&lt;bitsNbytes> }

<br>&lt;bitsNbytes> else{

<br>&lt;bitsNbytes> print "Who r U $name\n";

<br>&lt;bitsNbytes> }

<br>&lt;NIN_Dude> chomp?

<br>&lt;NIN_Dude> parsin?

<br>&lt;bitsNbytes> coming .. to it

<br>*** Kamikaze has joined #bsrf

<br>&lt;Kamikaze> what is an stdin, stdout, and stderr?

<br>&lt;NIN_Dude> ok

<br>&lt;NIN_Dude> standard

<br>&lt;NIN_Dude> input

<br>* NIN_Dude shuts up

<br>&lt;Kamikaze> aye...........

<br>&lt;bitsNbytes> chomp cuts out the newline character

<br>&lt;Kamikaze> not really much help but thanks anyway

<br>&lt;bitsNbytes> the entire string is taken along with the newline char

also a part of it

<br>&lt;bitsNbytes> so u need to cut it off

<br>&lt;Kamikaze> oh I see the tutorial is underway, sorry for interrupting

<br>&lt;bitsNbytes> there is a function called "chop" also

<br>&lt;NIN_Dude> does chomp cut off the last char or just the newline?

<br>&lt;bitsNbytes> good question NIN

<br>&lt;bitsNbytes> chop does cut off the last char

<br>&lt;bitsNbytes> but not ole chomp

<br>&lt;HardW1r3> dammit this sounds like school

<br>&lt;Kamikaze> lol

<br>&lt;bitsNbytes> it just does away with the&nbsp; \n

<br>&lt;bitsNbytes> hehe

<br>&lt;bitsNbytes> is it clear ;)

<br>&lt;Kamikaze> really sorry for interrupting here but have you covered

website redirection yet?

<br>&lt;bitsNbytes> i have covered basic perl-cgi script and error redirection

<br>&lt;Kamikaze> yeah yeah I know everyones gonna /ignore kamikaze :)

<br>&lt;bitsNbytes> and will come to that just in a few moments

<br>&lt;bitsNbytes> actually i have a hell lot to say

<br>&lt;bitsNbytes> and very lil time i suppose

<br>*** P0rnKing is now known as X

<br>&lt;bitsNbytes> how long do the lectures go on usually

<br>* Kamikaze shuts up and listens up

<br>&lt;bitsNbytes> this is the first time i am delivering one

<br>&lt;Kamikaze> as long as it takes till ppl are satisfactory

<br>&lt;Kamikaze> satisfied^

<br>&lt;bitsNbytes> k..fine

<br>&lt;bitsNbytes> so is the basic structire of a perl prog clear

<br>&lt;sohed> yes

<br>&lt;Kamikaze> nope I missed it :)

<br>*** s4m1k has joined #bsrf

<br>&lt;bitsNbytes> then i revert back to the main topic of discussion

<br>* Kamikaze will really shutup now... promise

<br>*** ExposedTruth has quit IRC (Quit: )

<br>&lt;bitsNbytes> now back to CGI_Perl

<br>&lt;bitsNbytes> man the connection here in India sux

<br>&lt;bitsNbytes> it is crawling

<br>&lt;bitsNbytes> let us have a nice Graphical Interactivity

<br>&lt;Kamikaze> I'm now reading 'Teach yourself C in 21 days'

<br>*** fatboyjoe has joined #bsrf

<br>&lt;bitsNbytes> hmm

<br>&lt;Kamikaze> oops wrong chan

<br>&lt;Kamikaze> shite

<br>*** s4m1k has quit IRC (Quit: [x]chat)

<br>&lt;Kamikaze> it's best if I leave

<br>*** Kamikaze has left #bsrf

<br>&lt;bitsNbytes> any doubts so far

<br>&lt;bitsNbytes> any damn doubt that may be troubling anyone

<br>&lt;NIN_Dude> what if it's not running UNIX?

<br>&lt;bitsNbytes> then anyway u have to find a way to get ur program

on the server

<br>&lt;bitsNbytes> the web server..in the right location

<br>&lt;bitsNbytes> the right path i mean

<br>&lt;bitsNbytes> i am not familiar with the procedure for windowz tho

<br>&lt;bitsNbytes> only when it is on the server .. can ur&nbsp; script

be of any use

<br>&lt;bitsNbytes> i have told .. how to get it running on UNIX

<br>&lt;bitsNbytes> ok .. comin to where I left

<br>&lt;bitsNbytes> the function for redirecting error messages

<br>&lt;bitsNbytes> u have to try this&nbsp; .. code and learn

<br>&lt;bitsNbytes> coz i have made it rigfht now

<br>*** fatboyjoe has left #bsrf

<br>&lt;bitsNbytes> so .. u get my point...;)

<br>&lt;bitsNbytes> BEGIN {

<br>&lt;bitsNbytes> use CGI::Carp qw(carpout)

<br>&lt;bitsNbytes> open (LOG, ">>/var/local/cgi-logs/junk-error")

<br>&lt;bitsNbytes> or die "Unable to append to junk-error: $!\n";

<br>&lt;bitsNbytes> carpout(*LOG);

<br>&lt;bitsNbytes> }

<br>&lt;bitsNbytes> the carpout parameter is to carp-out or blurt out warnings

or error returns

<br>&lt;bitsNbytes> die is like exit()

<br>&lt;bitsNbytes> to handle fatal errors

<br>&lt;bitsNbytes> u can use

<br>&lt;bitsNbytes> use CGI::Carp qw(fatalsToBrowser);

<br>&lt;bitsNbytes> die "Fatal Error here!!";

<br>&lt;bitsNbytes> Even if the error occurs before u get the HTTP header

out

<br>&lt;bitsNbytes> the module will try to take care of this to avoid the

dreaded "500 server error"

<br>&lt;bitsNbytes> how many of u r on a *NIX box

<br>&lt;sohed> now?

<br>&lt;bitsNbytes> yeah

<br>&lt;bitsNbytes> or maybe do use a nix box freq.

<br>*** snider has joined #bsrf

<br>*** ChanServ sets mode: +o snider

<br>&lt;sohed> i use it frequently but not right now

<br>&lt;bitsNbytes> anyway .. even after taking care of errors if you happen

to get the 500 server error

<br>&lt;bitsNbytes> it means two things

<br>&lt;bitsNbytes> on a Unix system either you dont have the right permissions

<br>&lt;bitsNbytes> u can check that with the ls -l and assign the script

(on the server of course) a 0755 pemission

<br>&lt;bitsNbytes> 0755 if u owned it

<br>*** Satori has joined #bsrf

<br>&lt;bitsNbytes> and 0555 owned by the designated user, assuming u r

the SU

<br>&lt;bitsNbytes> SU = super user

<br>*** Dustin has joined #bsrf

<br>&lt;Dustin> kernel question:

<br>&lt;bitsNbytes> also name it with a .cgi extension or .plx ext

<br>&lt;Dustin> the docs in one place say to use 2.7.2.3 to compile 2.4.6

<br>&lt;Dustin> in another it says NOT to use it

<br>&lt;Dustin> what gcc version do i need?

<br>&lt;Dustin> 2.7.2.3 or 2.91.66 ?

<br>&lt;bitsNbytes> tho not necessary some servers identify the ext also

<br>*** suspect has quit IRC (Ping timeout: 180 seconds)

<br>&lt;bitsNbytes> Dustin: The latest

<br>&lt;bitsNbytes> in ur case 2.7 will do

<br>&lt;Dustin> i compiled a while ago with 2.96. something and got lots

of errors

<br>&lt;bitsNbytes> i maean 2.7.2.3

<br>&lt;Dustin> ok

<br>&lt;bitsNbytes> wht errors

<br>&lt;Dustin> even though it says "*gcc 2.7.2.3 is no longer supportes*"

<br>&lt;Dustin> uhm,

<br>&lt;bitsNbytes> yeah module and version dependencies are quite annoying

and can be solved best by trial and error

<br>*** zwanderer has joined #bsrf

<br>&lt;Dustin> let me rephrase it: it complied badly

<br>&lt;Dustin> x wouldnt start, lots of cryptic x errors

<br>&lt;bitsNbytes> heheh i know it happens

<br>&lt;bitsNbytes> anyway.. we are here for something else

<br>&lt;bitsNbytes> a lecture is in progress

<br>&lt;Dustin> oh shit

<br>&lt;bitsNbytes> so .. if u plz

<br>*** SkyLemon has joined #bsrf

<br>&lt;bitsNbytes> are the others listening

<br>&lt;SkyLemon> Hello, I need some help: What is the file on linux that

you edit to shutdown any services / close ports??

<br>&lt;NIN_Dude> ...

<br>&lt;bitsNbytes> for any queries regarding linux plz post them on messg

board or mail me at tejanshu@rediffmail.com

<br>*** Jesteruk has joined #bsrf

<br>&lt;bitsNbytes> but plz do not go off the track

<br>*** suspect has joined #bsrf

<br>&lt;Jesteruk> hum...hello peeps

<br>&lt;NIN_Dude> just keep going bits

<br>&lt;bitsNbytes> yeah .. ..

<br>&lt;Jesteruk> damn it i missed the lecture

<br>&lt;bitsNbytes> a simple silly thing

<br>&lt;Jesteruk> never poo poo a lecture dude

<br>* NIN_Dude kills jester

<br>&lt;bitsNbytes> if u want to compile a perl prog

<br>&lt;Jesteruk> ah i see, nah i only write iot for CGI purposes

<br>&lt;NIN_Dude> STFU

<br>&lt;bitsNbytes> just use perl -wc cgi-script name=joe number=10

<br>&lt;bitsNbytes> at the command prompt

<br>*** HardW1r3 has quit IRC (Ping timeout: 180 seconds)

<br>*** SkyLemon has quit IRC (Quit: )

<br>&lt;bitsNbytes> this checks the validity of the program as well as

runs with the mock input

<br>&lt;Jesteruk> aaah i see..i didnt know that

<br>&lt;Jesteruk> i got an apache web server setup..PHP mySQL support,

and perl..i test em that way, didn't know you could simulate it liek that

thru DOS prompt

<br>&lt;bitsNbytes> well u know&nbsp; now ;)

<br>&lt;NIN_Dude> DOS?

<br>&lt;Jesteruk> aye, NIN

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -