亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? escape quotes in perl shell.html

?? 黑客培訓教程
?? HTML
字號:
<html>

<head>
<title>Escape Quotes In Shell - by b0iler</title>
</head>

<body bgcolor="black">
<font color="white">

<h1>Escape Quotes In Shell.</h1>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; by b0iler : <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b0iler@hotmail.com : last update July 17th 2002<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Written for :<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://b0iler.eyeonsecurity.net">http://b0iler.eyeonsecurity.net</a> - my site full of other cool tutorials<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://blacksun.box.sk">http://blacksun.box.sk</a> - a legendary site full of original tutorials

<br><br><br>

(requires bash,zsh,other shells with these features.. although even ran under nobody with noshell in /etc/passwd this is still possible.)

<br><br>

This one is fairly useful to have.  Not the most used trick, but a good one to know.  I started researching this after I found a post by zen-parse on an exploit for x-chat : http://online.securityfocus.com/archive/1/76874

<br><br>

What is so cool about this is the use of $IFS (Internal Field Separators) to add a break (space,tab,newline) inbetween commands.  What the $IFS does is determine what the shell uses to seperate arguments.  If $IFS is a space, then a space can be used to seperate arguments, if it is 46s03 then 46s03 can be used to seperate arguments.

<br><br>

This is useful for scripts which filter spaces, or where spaces are not allowed.  zen-parse was forced to use this technique because spaces are not allowed in urls.  (they need to be url encoded into %20).  It is also useful when scripts filter spaces from user input that is printed to the shell.  example (using perl -e so you can test at the command line):

<br><pre>

perl -e '
chomp($userinput=&lt;STDIN>);
$userinput =~ s/\s//g;
$userinput =~ s/\n//g;
print `echo "$userinput"|cat`;
'
</pre><br>

We are just pretending here, actual circumstances will vary.  vary so much that I will just talk about general situations and let you come up with the exploits by combining the info.

<br><br>

In this case we can execute commands by "breaking out" of the quotes with a single ", now we are into normal shell place (no quotes keeping this an argument of echo).  So we can use a metacharacter to stop this command and issue another.  A few avaliable are | ; && but there are many other characters which we can do tricky things at the shell with.

<br><br>

After the ; we will now put the next command we want executed, for this demonstration I'll do ls.  Then lets clean things up with another ".  To go along with the old one we broke out of.  So the final value for $userinput is:

<br><br>

";ls"

<br><br>

And if we need to use a space, we simply put a $IFS in there:

<br><br>

";ls$IFS/etc/"

<br><br>

There is more than just $IFS.  Lets just cut to the chase here.  The shell interprets what is sent, so lets just send some `cmd`.  This will execute the command and return the output right there.  try this for $userinput:

<br><br>

blah`ls`bleh

<br><br>

Simple huh.  But many times the arguments sent to the shell are filtered for the ` character.  Luckily there is the lesser used version of `cmd`, which is $(cmd).  This does the same thing, but gives you different characters which may or maynot be filtered.  So if ` is filtered, and $() is not you can use:

<br><br>

blah$(ls)bleh

<br><br>

What if the classic meta tag filter from various older cgi security papers is implemented to escape dangerous characters?  What then??

<br><pre>

perl -e '
chomp($userinput=&lt;STDIN>);
$userinput =~ s/\s//g;
$userinput =~ s/\n//g;
$userinput =~ s/([;&;t>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g;  #or any regex that forgets to filter \
print `echo "$userinput"|cat`;
'
</pre><br>

Now we can do what rfp did, and escape the escape this regex puts in.. or we can look for other methods of exploitation.  Infact after reading the man pages for bash I found that bash also support \nnn encoding, where nnn is the octal value for the ascii character.  This will work perfect to evade these filters and still print any character.  do a man ascii to find out the octal value of the characters you want.  I think this should work for $useriput:

<br><br>

blah\140ls\140bleh

<br><br>

You should have guessed it.. 140 is the octal representation of ` (which as we know executes the command).  So this is the same thing to bash as: blah`ls`bleh.

<br><br>

The reason why it is not getting filtered by the s/([;&lt;>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g; is because the regex is looking for `, \140 is not `, it is just the characters \ 1 4 0 in a string.  But when the shell goes to interpret the string sent, it sees this and interprets it into `.  How nice.

<br><br>

Again, just to make it clear.  In perl the string \140 will get by ` filters, because it is not a `.  But once it is interpreted by the shell into a ` it becomes useable.  Perl does have the same \nnn encoding, but "\140" and '\140' are two different things to perl (all languages).  Remember that "$var" gets interpreted, '$var' does not.  user input does not get interpreted automaticly, it is a string (ie. '\140).  Hopefully no one got too confused.  Simple idea once you grasp it.

<br><br>

This same theory allows things like the string '\n' to get sent to the shell and get interpreted into a newline.  Look for other places where you can use this type of stuff.

<br><br>

One pitfall you may have already thought to this is the inability to break out of '' in the shell.  Since nothing is interpreted inside '$userinput' on the bash end none of our tricks really work.  The only one is to hope the script does not filter for ' so you can get out and do some magic.  Or hope that you can escape the escape in something like s/([badchars])/\\$1/g;

<br><br>

To escape you would simply put something like \' in the $userinput of the second example.  This will make the \' sent in to the regex to turn out like \\', thus escaping the escape the regex tries putting on.

<br><br>

That is pretty much all the tricks I can share.  Other things are common sense or need to be figured out on a situation to situation basis.  I would like to point out that whenever an external program is called from perl with any form of user input spechial attention needs to be provided to how that program handles data and any spechial features that program may have.

<br><br>

For example a root exploit in sperl was released in aug of 2000 [1] because user suppied data was sent to the /bin/mail command, which has a feature were if you have ~! on line it will call apon the shell and issue commands.  This is the same principale here, only difference is we are looking at the shell itself and not a "regular" program.  Since the shell is used so often it is a good target for a discussion.

<br><br>

The same logic here can also be applied to shell scripts, both local and running as CGI.

<br><br>

[1]http://www.securitybugware.org/mUNIXes/4609.html

<br><br><br>

<b>[-----]</b><br><br>

<a href="http://b0iler.eyeonsecurity.net">http://b0iler.eyeonsecurity.net</a>&nbsp; Is my homepage, full of good tutorials, code, advisories, and other security related topics.&nbsp; Come and check out the message board some friends and I have started, many great disscussions to be had there.&nbsp; <a href="http://rawt.daemon.sh/wwwboard/">http://rawt.daemon.sh/wwwboard/</a>

<br><br>
<b>[-----]</b>

<br><br><br><br>

</body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美电影在哪看比较好| 午夜精品久久久久久久99樱桃| 91官网在线观看| 色综合久久综合网97色综合 | 国产一区二区美女| 久久精品av麻豆的观看方式| 日韩成人一区二区三区在线观看| 亚洲午夜激情av| 日韩成人午夜精品| 精品一区二区三区免费毛片爱| 久久福利视频一区二区| 国产高清不卡一区| 91视频国产观看| 精品日韩成人av| 中文字幕亚洲成人| 日韩精品一卡二卡三卡四卡无卡| 午夜精品久久久久久不卡8050| 午夜久久久影院| 高清成人在线观看| 欧美乱妇15p| 中文字幕一区二区三区四区| 亚洲男人电影天堂| 国产乱码一区二区三区| 色综合一区二区三区| 欧美成人精品1314www| 亚洲色大成网站www久久九九| 亚洲国产精品人人做人人爽| 国产成人综合亚洲91猫咪| 欧美日韩中文另类| 亚洲欧美偷拍三级| 国产美女av一区二区三区| 精品视频999| 亚洲欧洲一区二区在线播放| 美腿丝袜亚洲综合| 日韩一区二区在线看| 亚洲电影你懂得| 欧美中文字幕一区二区三区亚洲 | 亚洲电影一级片| 91视频精品在这里| 亚洲欧美偷拍另类a∨色屁股| 国产精品18久久久久久久久 | 婷婷综合五月天| 在线看日本不卡| 亚洲午夜免费视频| 欧美日韩一区二区三区视频| 亚洲欧洲国产日韩| 欧美亚洲综合久久| 三级不卡在线观看| 日韩欧美三级在线| 国产一区二区三区久久悠悠色av | 亚洲第一二三四区| 欧美日本精品一区二区三区| 亚洲动漫第一页| 欧美电影免费观看高清完整版在线观看| 亚洲午夜激情网站| 久久综合九色综合97婷婷女人 | 久久久午夜电影| 99视频在线观看一区三区| 亚洲国产成人av| 久久久噜噜噜久久中文字幕色伊伊| 奇米精品一区二区三区在线观看 | 狠狠久久亚洲欧美| 国产精品久99| 在线成人高清不卡| 成人91在线观看| 六月丁香婷婷久久| 亚洲视频一区在线| 久久久久久日产精品| 99re热这里只有精品视频| 日本午夜精品视频在线观看| 欧美国产日本韩| 精品久久久久久久人人人人传媒 | 91一区二区三区在线观看| 91成人免费网站| 经典一区二区三区| 亚洲3atv精品一区二区三区| 久久女同互慰一区二区三区| 欧美体内she精高潮| 成人午夜看片网址| 国产乱码一区二区三区| 久久爱另类一区二区小说| 日韩电影免费在线看| 丝袜美腿高跟呻吟高潮一区| 国产精品国产三级国产aⅴ无密码| 精品久久久久香蕉网| 在线播放91灌醉迷j高跟美女 | 日韩亚洲欧美一区| 91婷婷韩国欧美一区二区| 国产精品一卡二卡在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 午夜在线电影亚洲一区| 亚洲成人1区2区| 日本不卡123| 韩日av一区二区| 久久99精品国产麻豆不卡| 久久精品国产一区二区| 国产91丝袜在线播放0| 成人性生交大片免费看视频在线 | 日韩精品综合一本久道在线视频| 91香蕉视频污在线| 欧美三级欧美一级| 欧美本精品男人aⅴ天堂| 26uuu国产一区二区三区| 国产欧美一区二区精品久导航 | 欧美色视频一区| 精品国内片67194| 国产精品电影一区二区| 亚洲国产成人91porn| 国产美女一区二区| 欧美日韩专区在线| 椎名由奈av一区二区三区| 天堂在线亚洲视频| 成人免费av在线| 91精品国产综合久久香蕉的特点 | 久久99精品国产麻豆婷婷洗澡| 国产成人久久精品77777最新版本| 丰满白嫩尤物一区二区| 欧美日韩精品欧美日韩精品| 国产精品成人免费| 黑人精品欧美一区二区蜜桃| 欧美日韩在线播| 亚洲欧美自拍偷拍| 国产黄色精品网站| 欧美一区二区免费视频| 亚洲一区二区三区四区在线观看 | 日韩欧美国产小视频| 亚洲欧美日韩精品久久久久| 成人中文字幕在线| 久久久久国产一区二区三区四区| 亚洲va中文字幕| 欧美日韩国产高清一区二区| 亚洲人成影院在线观看| 成人午夜激情在线| 亚洲图片激情小说| 在线影视一区二区三区| 午夜av区久久| 亚洲精品在线三区| 风间由美一区二区三区在线观看| 亚洲精品一区二区三区影院| 另类成人小视频在线| 亚洲精品在线观看视频| 粉嫩在线一区二区三区视频| 国产精品国产三级国产有无不卡 | 天天色天天操综合| 日韩美女视频在线| 成人午夜视频在线观看| 亚洲精品一二三| 欧美一级免费观看| 国产老妇另类xxxxx| 中文字幕一区二区三区不卡在线| 日本高清视频一区二区| 免费高清在线视频一区·| 26uuu另类欧美| 欧美日韩一卡二卡| 国产一区二区三区香蕉| 亚洲欧洲日韩av| 欧美成人一区二区三区片免费| 成人ar影院免费观看视频| 婷婷丁香久久五月婷婷| 国产精品久久三| 日韩精品一区二区三区视频播放 | 国产在线麻豆精品观看| 亚洲欧洲在线观看av| 久久丝袜美腿综合| 91精品国产91久久久久久最新毛片| 丁香婷婷综合五月| 国产一区二区三区蝌蚪| 美女被吸乳得到大胸91| 亚洲精品国产视频| 中文字幕佐山爱一区二区免费| 精品蜜桃在线看| 日韩欧美在线网站| 欧美成人r级一区二区三区| 欧美日韩电影一区| 欧美亚洲一区三区| 欧美日韩视频一区二区| 在线综合视频播放| 在线亚洲精品福利网址导航| 99re成人精品视频| 国产精品一区在线观看乱码| 国内成人精品2018免费看| 久久国产婷婷国产香蕉| 精品一区二区在线视频| 国产一区二区不卡老阿姨| 激情另类小说区图片区视频区| 午夜久久久影院| 国产一区中文字幕| 成人午夜激情影院| 欧美日韩一级大片网址| 日韩欧美一区在线| 精品粉嫩aⅴ一区二区三区四区 | 美女mm1313爽爽久久久蜜臀| 在线不卡的av| 9l国产精品久久久久麻豆| 日韩不卡一二三区| 日韩精品1区2区3区| 国产一区视频网站| 欧美性受xxxx| 久久午夜羞羞影院免费观看| 国产精品电影院|