*:first-child {
margin-top: 0 !important;
}

body>*:last-child {
margin-bottom: 0 !important;
}

/* BLOCKS
=============================================================================*/

p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}

/* HEADERS
=============================================================================*/

h1, h2, h3, h4, h5, h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
font-size: inherit;
}

h1 {
font-size: 28px;
color: #000;
}

h2 {
font-size: 24px;
border-bottom: 1px solid #ccc;
color: #000;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777;
font-size: 14px;
}

body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
margin-top: 0;
padding-top: 0;
}

a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
margin-top: 0;
padding-top: 0;
}

h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
margin-top: 10px;
}

/* LINKS
=============================================================================*/

a {
color: #4183C4;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

/* LISTS
=============================================================================*/

ul, ol {
padding-left: 30px;
}

ul li > :first-child,
ol li > :first-child,
ul li ul:first-of-type,
ol li ol:first-of-type,
ul li ol:first-of-type,
ol li ul:first-of-type {
margin-top: 0px;
}

ul ul, ul ol, ol ol, ol ul {
margin-bottom: 0;
}

dl {
padding: 0;
}

dl dt {
font-size: 14px;
font-weight: bold;
font-style: italic;
padding: 0;
margin: 15px 0 5px;
}

dl dt:first-child {
padding: 0;
}

dl dt>:first-child {
margin-top: 0px;
}

dl dt>:last-child {
margin-bottom: 0px;
}

dl dd {
margin: 0 0 15px;
padding: 0 15px;
}

dl dd>:first-child {
margin-top: 0px;
}

dl dd>:last-child {
margin-bottom: 0px;
}

/* CODE
=============================================================================*/

pre, code, tt {
font-size: 12px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}

code, tt {
margin: 0 0px;
padding: 0px 0px;
white-space: nowrap;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}

pre>code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent;
}

pre {
background-color: #f8f8f8;
border: 1px solid #ccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px;
}

pre code, pre tt {
background-color: transparent;
border: none;
}

kbd {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #DDDDDD;
background-image: linear-gradient(#F1F1F1, #DDDDDD);
background-repeat: repeat-x;
border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;
border-image: none;
border-radius: 2px 2px 2px 2px;
border-style: solid;
border-width: 1px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 10px;
padding: 1px 4px;
}

/* QUOTES
=============================================================================*/

blockquote {
border-left: 4px solid #DDD;
padding: 0 15px;
color: #777;
}

blockquote>:first-child {
margin-top: 0px;
}

blockquote>:last-child {
margin-bottom: 0px;
}

/* HORIZONTAL RULES
=============================================================================*/

hr {
clear: both;
margin: 15px 0;
height: 0px;
overflow: hidden;
border: none;
background: transparent;
border-bottom: 4px solid #ddd;
padding: 0;
}

/* TABLES
=============================================================================*/

table th {
font-weight: bold;
}

table th, table td {
border: 1px solid #ccc;
padding: 6px 13px;
}

table tr {
border-top: 1px solid #ccc;
background-color: #fff;
}

table tr:nth-child(2n) {
background-color: #f8f8f8;
}

/* IMAGES
=============================================================================*/

img {
max-width: 100%
}
-->

pwnable.kr-fd-Writeup

  • 根据题目描述Mommy! what is a file descriptor in Linux? 知该题与Linux系统下的文件描述有关;
  • ssh远程登录如下:
  • 根据题目提示,ls -l查看文件及权限如下,由下图,用户fd只具有读文件fd.c的权限(尝试sudo chmod增加权限,但失败):
  • cat fd.c读取fd.c中的内容,可得到如下代码:
 fd@ubuntu:~$ cat fd.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char buf[];
int main(int argc, char* argv[], char* envp[]){
if(argc<){
printf("pass argv[1] a number\n");
return ;
}
int fd = atoi( argv[] ) - 0x1234;
int len = ;
len = read(fd, buf, );
if(!strcmp("LETMEWIN\n", buf)){
printf("good job :)\n");
system("/bin/cat flag");
exit();
}
printf("learn about Linux file IO\n");
return ; } fd@ubuntu:~$
  • 分析上述代码,执行system("/bin/cat flag");语句,即可获得flag;
  • 执行system("/bin/cat flag");需要使buf == "LETMEWIN";
  • 继续分析,需要buf通过read函数读入"LETMEWIN\n",有read函数的定义,需要使fd==0;
  • 则有atoi( argv[1] ) == 0x1234(即十进制下的4660),由atoi函数的定义,需要argv[1] == "4660";
  • 进而由LinuxC下argv[]的相应定义可以构造输入,LinuxC下argc,argv[]的意义请参考http://www.cnblogs.com/WangAoBo/p/6366600.html
  • echo "LETMEWIN" | ./fd 4660

如下,flag为:mommy! I think I know what a file descriptor is!!

2017-2-4 22:24;39

pwnable.kr-fd-Writeup的更多相关文章

  1. pwnable.kr之fd

    题目如图: 在终端输入:ssh fd@pwnable.kr -p2222 连接到远程终端,如图: 输入ls -l,查看文件: 输入whoami,查看自身用户名称: 根据题目意思我们只要打开flag文件 ...

  2. 黑客练手入门| pwnable.kr—幼儿瓶—01:fd

    目录 前言 pwnable.kr介绍 该怎么玩 幼儿瓶第一道题:fd 0x00 问题描述 0x01 源码分析 0x02 解题方法 0x03 知识点总结 前言 担心有人不知道pwnable.kr是什么, ...

  3. pwnable.kr 第一题fd

    使用ssh fd@pwnable.kr -p2222连接输入密码guest 1 fd@prowl:~$ ls -al 2 total 40 3 drwxr-x--- 5 root fd 4096 Oc ...

  4. pwnable.kr simple login writeup

    这道题是pwnable.kr Rookiss部分的simple login,需要我们去覆盖程序的ebp,eip,esp去改变程序的执行流程   主要逻辑是输入一个字符串,base64解码后看是否与题目 ...

  5. pwnable.kr的passcode

    前段时间找到一个练习pwn的网站,pwnable.kr 这里记录其中的passcode的做题过程,给自己加深印象. 废话不多说了,看一下题目, 看到题目,就ssh连接进去,就看到三个文件如下 看了一下 ...

  6. pwnable.kr详细通关秘籍(二)

    i春秋作家:W1ngs 原文来自:pwnable.kr详细通关秘籍(二) 0x00 input 首先看一下代码: 可以看到程序总共有五步,全部都满足了才可以得到flag,那我们就一步一步来看 这道题考 ...

  7. 【pwnable.kr】 unlink

    pwnable.kr 第一阶段的最后一题! 这道题目就是堆溢出的经典利用题目,不过是把堆块的分配与释放操作用C++重新写了一遍,可参考<C和C++安全编码一书>//不是广告 #includ ...

  8. 【pwnable.kr】lotto

    pwnable.好像最近的几道题都不需要看汇编. ssh lotto@pwnable.kr -p2222 (pw:guest) 直接down下来源码 #include <stdio.h> ...

  9. 【pwnable.kr】coin1

    pwnable从入门到放弃又一发 说是一道pwnable,其实是一道coding... nc pwnable.kr 9007 连接上看看,玩硬币? 老子是来拿flag的,谁来哄孩子来了!!! 算了,f ...

  10. 【pwnable.kr】 mistake

    又一道pwnable,我还没放弃.. ssh mistake@pwnable.kr -p2222 (pw:guest) 源代码如下: #include <stdio.h> #include ...

随机推荐

  1. Quick Cocos2dx 与 DragonBones

    照着官方的例子试验了一下DragonBone的使用,代码如下: local AnotherScene = class("AnotherScene", function() retu ...

  2. openstack名称发音收集

    MariaDB:    maria['mɛərɪr] Corosync:    coro[kə'roʊ]    sync[sɪŋk] pacemaker:    [ˈpesˌmekɚ] galera: ...

  3. ApexSql Log

    网址:https://www.apexsql.com/,可免费试用14天   安装成功后,点击new,配置DB连接:   选择要分析的Log文件:   进行过滤设置:     基本设置:时间,DML和 ...

  4. iOS开发——NSArray中的字符串排序

     NSArray *arr = @[@"fjhsf",@"wert",@"fdg",@"asd",@"fs g ...

  5. Git for Windows 工具下载及配置

    前言,关于git工具的帖子:http://cn.v2ex.com/t/225027 最终选择了git for windows这个工具,路径为:https://git-for-windows.githu ...

  6. 每个Javascript开发者都应当知道的那些事

    每个Javascript开发者都应当知道的那些事 2015-06-07 前端大全 (点击上方蓝字,可快速关注我们) Javascript是一种日益增长的语言,特别是现在ECMAScript规范按照每年 ...

  7. 刷新UITableView

    [from]http://www.superqq.com/blog/2015/08/18/ios-development-refresh-uitableview/ UITableView对于iOS开发 ...

  8. 轻轻的扩展了一下IEnumerable<T>

    今天用EF写东西玩,觉得IEnumerable里面除了where().select(),是不是能添加点其他方法呢. 想做就做,F12到方法定义: public static IEnumerable&l ...

  9. Python3基础 map 与 lambda表达式配合 将指定系列元素乘2

    镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.-------------------------------------- ...

  10. Selenium2(java)环境搭建 一

    Selenium2(java)环境搭建 1.下载JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2 ...