美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇

代做CMPSC 443、代寫Project 2: Buffer Overflows

時間:2024-03-27  來源:  作者: 我要糾錯



CMPSC 443: Introduction to Computer Security
Spring 2024
Project 2: Buffer Overflows
Due: 11:59 pm (eastern time), March 15, 2022
February 21, 2024
1 Introduction
In this assignment, you will produce Buffer overflow attacks. First, you learn some attacks that invoke
shared functions with arguments obtained from different places in memory (injected by you, or from
environment variables, or from the hard coded strings in the code etc). Successful completion of
this project heavily relies on correct understanding of stacks, heaps, program memory layout and a
function’s stack frame.
2 Prerequisite
Before attempting this project, it is advisable to brush on the basics of stack frame, memory layout
of program, use of GDB Debugger and big-endian vs little-endian. To quickly brush through basics
of GDB debugging, I’d recommend watching this GDB Debugger Tutorial - https://www.youtube.
com/watch?v=J7L2x1ATOgk&t=319s.
3 Project Platforms
For this project, we will use the Linux virtual machine (VM), provided as follows.
For Windows and Apple Intel chip platforms, use this VM:
https://drive.google.com/file/d/1mRiSVBgp-pwDRsD-8yF62jCmd7nMCD2I/view?usp=drive_link.
For this VM, you will have to install the Oracle VirtualBox software and then use the .vbox file to run
the VM.
For Apple M1, M1 Pro, M2 platforms, use this VM:
https://drive.google.com/file/d/13-MY3Zikrx0JlWlSxTRICiurpG9YM4h5/view?usp=sharing
For this VM, you will have to install the UTM Mac software and then use the .utm file to run the VM.
The exploits in this project have been tested on the same VMs, therefore you must use the same
environment for solving your tasks. Running the task binaries in a different VM or environment might
not work.
Note: The password for the VM is posted on CANVAS.
1
4 Background
In the Virtual machine set-up, we have installed few tools and configurations that are essential for the
completion of this project.
Address space layout randomization (ASLR) is set to Zero (Turned off) in the 32-bit Linux
machine.
gdb-peda is a wrapper around the GDB debugger that has many features that help better visualize
operational stack frames, variables, registers etc. when debugging C programs. This is already installed and set-up in the VM provided to you.
GDB command to show 100 lines of the stack starting from the $esp register is -
x/100xw $esp
GDB peda command provides a better visualization of the stack for the same purpose -
context stack 100
The exhaustive list of commands in gdb-peda is shown in this cheat sheet -
https://github.com/kibercthulhu/gdb-peda-cheatsheet/blob/master/gdb-peda%20cheatsheet.
pdf
You are free to use any of these commands for help during your attacks.
GDB is a very popular and important GNU debugger that is used primarily to debug C programs.
It is an essential tool used by computer science engineers. I highly recommend you to spend a couple
of days to get hands-on with the tool if you haven’t used it anytime in the past. Some of the most
important commands that can come handy in this project are as follows -
print var OR p var
Prints the value of the local/global variable
p &var
Prints the address at which var is stored
p sample_function
Prints the pointer address to the method "sample_function"
p exit, p printf, p scanf etc.
Prints the pointer address to the standard C methods like printf, scanf, exit etc.
b 171
Adds a breakpoint at line no 171
run args
Starts a program within GDB with arguments
c
Continues the program until the next breakpoint
2
info locals
Gives information about all the local variables at the moment in the current frame.
info frame
Gives information about the current frame.
5 Code and Compiling
The initial code for the project is available with the Canvas Assignment. You need to download them
into the virtual machines. You can copy the download link and use curl to do that.
The first group of files contains the victim-binary file which is compiled using its source code cse443-
victim-program.c. Other files in this group contain utility functions, Makefile and README.txt to
help you guide through the tasks. You should NOT edit any of these files.
victim-binary
cse443-victim-program.c
cse443-util-program.c
cse443-util-program.h
Makefile
README.txt
The second group of files correspond to each of the five tasks to be executed. They have some initial
code written for your help. You should edit these files appropriately to successfully finish all the
tasks.
cse443-task1-attack.c
cse443-task2-attack.c
cse443-task3-attack.c
cse443-task4-attack.c
cse443-task5-attack.c
The third group of files correspond to other intermediate files and payloads that are generated using
the above two groups of files. For Example, the command ”make task1-binary” will produce two intermediate files ”task1-binary” and ”cse443-task1-attack.o” from the source code ”cse443-task1-attack.c”.
"make task1-binary" produces task1-binary
"make task2-binary" produces task2-binary
"make task3-binary" produces task3-binary
"make task4-binary" produces task4-binary
"make task5-binary" produces task5-binary
"make victim-binary" produces victim-binary (This is not required as you wont make
any changes to cse443-victim-program.c)
Similarly, running the task binaries should produce their corresponding payload files as follows.
"./task1-binary" produces task1-payload
"./task2-binary" produces task2-payload
"./task3-binary" produces task3-payload
"./task4-binary" produces task4-payload
"./task5-binary" produces task5-payload
3
NOTE: Remember! You are only supposed to edit the contents of files mentioned in Group2 to create
corresponding attack binaries and payloads. Editing any file mentioned in Group1 might help you
temporarily in your VM but we will evaluate your code with the original victim binary in a different
setup. Then your code may not be creating successful attacks and this will lead to a 0 score in all
tasks.
6 Exercise Tasks
The project consists of five tasks in total. Every task/attack follows similar execution flow at your
end. Primarily, the victim-binary has at-least 5 buffer overflow vulnerabilities which you will take
advantage of in each attack to generate unexpected and interesting results. To analyse these vulnerabilities, we have provided you the victim’s source code i.e. cse443-victim-program.c!
The tasks are as follows.
1. In Task 1, you will build your very first light-saber by invoking the method make lightsaber.
Observe that the method first lightsaber is invoked through the main function. It has many
local variables including the variable key that is set to the value of another argument argc.
You need to find the buffer overflow vulnerability in first lightsaber and create a payload by
packing enough A’s at the beginning of your string. Find the location of the local variable key
and set it to 0 using this overflow.
Observe that with no attack, the value of key is 2 (because argc is 2) and thus the function
make lightsaber can be never legally called. But with the right overflow attack, you need to
invoke the function make lightsaber with the right value of key=0.
Complete the program cse443-task1-attack.c to build a payload task1-payload using which
the victim-binary prints the message - Congratulations! You have successfully built
your lightsaber. A successful attack will look like the following.
cse443student@cse443student-VirtualBox:~/Desktop/lab2-handout$ ./victim-binary
task1-payload
Welcome to not a Jedi Academy for CMPSC443
TASK1: Try to make your first lightsaber!
Congratulations! You have successfully built your lightsaber.
This is your lightsaber ID := 12937
2. In Task 2, you will use the Force to get access to the Shell! Observe that the method force shell
is invoked through the main function. It has many local variables including the function pointer
variable denoted by functionPtr that is set to point to a method called get this. You need to
find the vulnerability in force shell and create a payload by packing enough A’s at the beginning
of your string. Find the location of the local variable functionPtr and set it to the method called
and get that using this overflow.
Observe that with no attack, the value of functionPtr is set to the address of the function
get this and thus the function and get that can be never legally called. But with the right
overflow attack again, you need to invoke the function and get that.
Complete the program cse443-task2-attack.c to build a payload task2-payload using which
the victim-binary prints the message - Young Jedi! You got the shell - and give access
to a new shell. A successful attack will look like the following.
cse443student@cse443student-VirtualBox:~/Desktop/lab2-handout$ ./victim-binary
task2-payload
4
Welcome to not a Jedi Academy for CMPSC443
TASK1: Try to make your first lightsaber!
TASK2: Try to get to the Shell. May the force be with you!
This is your lightsaber ID := 11254
Young Jedi! You got the shell.
$
3. In Task 3, you will need to complete your Jedi Combat Training by successfully invoking the
method complete training. Observe that the method combat training is invoked through
the main function. You need to find the vulnerability in combat training and create a payload
by packing enough A’s at the beginning of your string. In this attack, you need to spot the return
address of this method and successfully change it to the method complete training using the
overflow.
Observe that with no attack, the method combat training will simply return back to the main
method from where it was initially invoked. But with the right overflow attack again, you need
to return to the function complete training.
Complete the program cse443-task3-attack.c to build a payload task3-payload using which
the victim-binary prints the message - Well Done. Been recognized, your hard-working
has! A successful attack will look like below.
cse443student@cse443student-VirtualBox:~/Desktop/lab2-handout$ ./victim-binary
task3-payload
Welcome to not a Jedi Academy for CMPSC443
TASK1: Try to make your first lightsaber!
TASK2: Try to get to the Shell. May the force be with you!
Try with greater force!
TASK3: Not prepared, you are!
This is your lightsaber ID := 16380
TASK3 has been successfully completed!
Well Done. Been recognized, your hard-working has!
Segmentation fault (core dumped)
4. In Task 4, you will need to collect 5 lightsabers to successfully finish the attack. Observe that
the method collect lightsabers is invoked through the main function. You need to find the
vulnerability in collect lightsabers and create a payload by packing enough A’s at the beginning
of your string. In this attack, you need to spot the return address of this method and successfully
craft a chain of calls to the functions get blue lightsaber and get green lightsaber using the
overflow.
Observe that with no attack, the method collect lightsabers will simply return back to the
main method from where it was initially invoked. But with the right overflow attack again, you
need to carefully craft a sequence of 5 calls to collect 3 BLUE lightsabers and 2 GREEN
lightsabers.
Complete the program cse443-task4-attack.c to build a payload task4-payload. A successful
attack will look like the following.
cse443student@cse443student-VirtualBox:~/Desktop/lab2-handout$ ./victim-binary
task4-payload
Welcome to not a Jedi Academy for CMPSC443
TASK1: Try to make your first lightsaber!
TASK2: Try to get to the Shell. May the force be with you!
5
Try with greater force!
TASK3: Not prepared, you are!
TASK4: Collect five lightsabers to complete this task!
This is your lightsaber ID := 10310
You got a blue lightsaber!
This is your lightsaber ID := 6192
You got a blue lightsaber!
This is your lightsaber ID := 10109
You got a blue lightsaber!
This is your lightsaber ID := 17883
You got a green lightsaber!
This is your lightsaber ID := 17596
You got a green lightsaber!
Segmentation fault (core dumped)
5. In Task 5, you will need to follow the light side and use your skills to print your name to
successfully finish the attack. Observe that the method follow the light is invoked through the
main function. You need to find the vulnerability in follow the light and create a payload by
packing enough A’s at the beginning of your string. In this attack, you need to print your name
at the end of the last print statement in this method using the overflow.
Observe that with no attack, the method follow the light will simply return back to the main
method from where it was initially invoked. So it will only print - Your Jedi Name is :- . But
with the right overflow attack, you need to invoke the C library function printf with a custom
argument string i.e. your name and then invoke the system function exit.
Complete the program cse443-task5-attack.c to build a payload task5-payload using which
the victim-binary invokes the native printf function using your NAME as an argument at the
right place in the code. A successful attack will look like below.
cse443student@cse443student-VirtualBox:~/Desktop/lab2-handout$ gdb -q victimbinary
Reading symbols from victim-binary...done.
gdb-peda$ run task5-payload
Starting program: /home/cse443student/Desktop/lab2-handout/victim-binary task5-
payload
Welcome to not a Jedi Academy for CMPSC443
TASK1: Try to make your first lightsaber!
TASK2: Try to get to the Shell. May the force be with you!
Try with greater force!
TASK3: Not prepared, you are!
TASK4: Collect five lightsabers to complete this task!
TASK5: Print your name !
Your Jedi Name is :- LUKE
[Inferior 1 (process 3072) exited with code 0107]
Warning: not running
gdb-peda$
6
NOTE : Task 5 is very different from other tasks where we need to send a custom argument like
LUKE to the printf function. In Tasks 1-4 we only change return addresses and values of local
variables to achieve our goal. Your attack will be successful within GDB debugger, however,
the same payload may not help in performing a successful attack outside the GDB debugger.
Explain this in your report (refer to Questions section).
7 Questions
1. Draw the function’s stack frame in Task 2 to demonstrate the overflow. Use tools like Paint,
Excel or any other online tool to show the stack frame. Refrain from providing diagrams drawn
using hand.
2. Why does Task 5 fail to run from the command line, but succeed when run in GDB debugger?
3. Why do Tasks 1-4 run both from the command line and GDB debugger the same ?
4. Briefly identify and explain a viable defense mechanism to prevent the attack in Task 3. Precisely
explain how this would prevent the attack you have crafted.
8 Deliverables
Please submit a tar ball containing the following:
1. cse443-task*-attack.c files (4 or 5 files), respective binaries task*-binary (4 or 5 files), payload
files task*-payload (4 or 5 files).
2. A report in PDF containing: (1) Trace of output printed (e.g., shell invocation) from your
execution of each case (2) Screenshot of each completed task and (3) Answers to project questions
9 Grading
The assignment is worth 200 points total broken down as follows.
1. Answers to four questions (40 pts, 10 points each).
2. Packaging of your attack programs, binaries, payloads and the report in the ”tar” file you submit.
Your attack programs build without incident. (20 pts).
3. Completeness of report (20 pts).
4. Task 1 (20 pts), Task 2 (20 pts), Task 3 (20 pts), Task 4 (30 pts) and Task 5 (30 pts).
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 













 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代寫EECS 183 Project 4 代做python
  • 下一篇:代寫COMP9021、代做Python程序語言
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    精品一区在线观看视频| 亚洲专区区免费| a级大片在线观看| 国产精品视频在| 国产精品三级在线观看无码| 九色91porny| 乱老熟女一区二区三区| 午夜在线观看一区| v8888av| 精品无码人妻一区| 日韩综合第一页| 国产性生活毛片| 91丝袜在线观看| 亚洲精品乱码久久久久久久| 中文字幕99页| 中国极品少妇videossexhd| 国产综合内射日韩久| 国产无套精品一区二区三区| 亚洲女则毛耸耸bbw| 在线免费观看a级片| 丰满圆润老女人hd| 久久日免费视频| 国产稀缺精品盗摄盗拍| 原创真实夫妻啪啪av| 中文字幕在线播放视频| 免费看黄色aaaaaa 片| 一卡二卡三卡四卡| 亚洲精品自拍视频在线观看| 永久久久久久久| 大尺度做爰床戏呻吟舒畅| 变态另类丨国产精品| 久久久久99精品成人| 无码国产精品久久一区免费| 受虐m奴xxx在线观看| 国产女人18水真多毛片18精品| 538任你躁在线精品视频网站| 在线观看免费视频黄| 素人fc2av清纯18岁| 国产一区第一页| 亚洲成人av免费在线观看| 一二三四在线观看视频| 最新版天堂资源在线| 午夜国产福利视频| 伊人网综合视频| 人妻少妇精品一区二区三区| 大又大又粗又硬又爽少妇毛片| 亚洲精品自拍视频在线观看| 丰满少妇高潮一区二区| 91porn在线视频| 舐め犯し波多野结衣在线观看| 男女做暖暖视频| 永久免费看mv网站入口78| 在线中文字日产幕| 波多野结衣亚洲一区二区| 久久久久亚洲av成人无码电影| 久久久精品人妻一区二区三区| 手机av在线不卡| 亚洲午夜福利在线观看| 精品人妻一区二区三区香蕉 | 91视频啊啊啊| 国产裸体视频网站| 99精品久久久久| 中文字幕资源站| 亚洲AV成人无码精电影在线| aaaaa级少妇高潮大片免费看| 国偷自产av一区二区三区麻豆| 国产少妇在线观看| 黄色录像二级片| 91嫩草|国产丨精品入口| 手机在线免费看毛片| 欧美三级日本三级| 波多野结衣亚洲色图| www.99re7| 麻豆av免费看| 女尊高h男高潮呻吟| aa片在线观看视频在线播放| 天堂久久久久久| 变态另类丨国产精品| 少妇无套高潮一二三区| 992在线观看| 日本wwwxx| 免费a v网站| 人妻熟人中文字幕一区二区| 日韩va亚洲va欧美va清高| 成人啪啪18免费游戏链接| 国产精品九九视频| 中文幕无线码中文字蜜桃| 91视频青青草| 亚洲精品在线视频免费观看| 欧美性受xxxx黑人| 日韩黄色免费观看| 精品人妻一区二区三区蜜桃视频| 中文天堂资源在线| 性农村xxxxx小树林| 青青青视频在线播放| 亚洲视频天天射| 成人一级片免费看| 亚洲欧洲国产视频| jizz18女人高潮| 又黄又爽的网站| 91麻豆精品成人一区二区| 在线免费观看a级片| 日本在线一级片| www.99热| 老司机福利av| 亚洲一级Av无码毛片久久精品| 国产99在线 | 亚洲| aa一级黄色片| 国产高潮视频在线观看| 婷婷国产成人精品视频| 黑人巨大精品欧美| 香蕉视频污视频| 国产性猛交96| 美女流白浆视频| 亚洲色婷婷一区二区三区| 免费看91的网站| 亚洲人成人无码网www国产| 农村末发育av片一区二区| 69xx绿帽三人行| 少妇愉情理伦片bd| 亚洲精品久久久久久国| 一区二区三区在线观看免费视频| 一二三不卡视频| xxx在线播放| 三级黄色片网站| 精品无码在线视频| 菠萝菠萝蜜网站| 风间由美一二三区av片| 国模私拍在线观看| 韩国三级视频在线观看| 挪威xxxx性hd极品| 成年人的黄色片| 中国美女乱淫免费看视频| a视频免费观看| 美女av免费看| 国产黄色片在线免费观看| 日韩成人毛片视频| 在线观看一区二区三区四区| 性高潮免费视频| www.久久国产| 久草福利资源在线| 18岁成人毛片| 免费无码一区二区三区| 国产美女免费网站| 国产高潮流白浆| 久久精品国产亚洲AV熟女| 少妇人妻好深好紧精品无码| 欧美日韩国产黄色| 国产成人av免费观看| 国产精品无码毛片| 99在线视频免费| 91成人在线观看喷潮蘑菇| 性欧美丰满熟妇xxxx性仙踪林| 中文字幕第二区| www.日本高清| 亚洲成人生活片| 国产综合精品在线| 美女日批在线观看| 国产精品成人一区二区三区电影毛片 | 亚洲区自拍偷拍| 日韩一区二区不卡视频| 日韩精品国产一区| 成人做爰视频网站| 亚洲人成人无码网www国产| 黄色一级片中国| 中文字幕免费在线看线人动作大片| 97超碰免费在线观看| 少妇精品无码一区二区免费视频| 亚洲熟女乱综合一区二区| 欧美午夜激情影院| 中文字幕高清视频| 亚洲av成人精品一区二区三区| 国产精品视频一区二区在线观看| 久久久久9999| 精品熟女一区二区三区| 久久精品亚洲a| 色一情一交一乱一区二区三区| 亚洲成人福利视频| 国产av 一区二区三区| 国产一二三av| 亚洲精品色午夜无码专区日韩| 欧美日韩一区二区区别是什么 | 一区二区三区人妻| 51妺嘿嘿午夜福利| www.中文字幕av| 性高潮久久久久久久| v天堂中文在线| 制服丝袜av在线| 怡红院一区二区| 国产 中文 字幕 日韩 在线| 精品人妻在线视频| 欧美熟妇精品一区二区| 性高潮免费视频| 国产成人无码一区二区在线观看| 精品国产一二区| 日韩免费高清一区二区| 黄瓜视频污在线观看| 欧美性受xxxx黑人| 亚洲二区在线播放| 亚洲香蕉中文网|