close menu

NCERT Solutions for Class 2 Computer Science

computer assignment for class 2

NCERT Solutions for Class 2 Computer Science Book updated for new academic session 2024-25 CBSE and state board students. Grade 2 Computer study material and revision of all chapters including fundamental. All the chapters are simplified to provide a basic knowledge to the students of Grade 2. Chapter Wise Class 2 Computer Science Chapter 1. Know Your Computer Chapter 2. Parts of Computer Chapter 3. Hardware and Software Chapter 4. Input and Output Devices Chapter 5. Using a Keyboard Chapter 6. Mouse Chapter 7. Uses of Computer Chapter 8. MS window Chapter 9. Paint Program

Students of Class 2 can get here Computer Science Book to cover their computer course. If you are a Class 2 Student, this computer book help you a lots. All the related chapters including basics of computer are given here. This is the right place for you where you can get all the study material related to grade 2 students.

In this article you will get computer book of class 2 which includes all the necessary chapters at this stage. This computer science book will be very helpful in class 2 exams and understanding about computer fundamental. Chapters given here are in accordance with the CBSE or Central Board of School Education class 2 standard. We follow the latest CBSE syllabus while preparing study material or revision books, so that students can study through the latest version.

Class 2 Computer Science book, given here, contains 9 chapters. These chapters are based on Know Your Computer, Parts of Computer, Hardware and Software and Input Devices Processing and Output Devices. Following this book students will able to know about using a Keyboard, Mouse, uses of Computer, MS Windows and Paint Program in detail.

Most of the schools like army public school, KVS, JNV and other state board follow the syllabus set by NCERT for Standard 2. So, this book help him a lot. The contents of each chapter is kept easy to understand. Topics are explained through pictures and graphs.

The book for computer science given here is specially designed for a grade 2 students. So keep reading this book and article till the end to get suitable knowledge and high marks in class 2 exam. You can get class 2 computer books in English medium. Having a good book is important to excel in class 2 final exams. This book is the best way to prepare for class 2 based computer knowledge.

Along with the book you can download class 2 computer subject notes. These notes will cover the computer syllabus of class 2. It is regularly updated and revised according to the latest curriculum. Our teachers who teaches computer science in class 2 to help us to create contents and study material. These teachers have ample experience teaching 2nd grade students.

After each chapter, exercises, activities and practice worksheets are given here to enhance the knowledge better. Class 2 teacher knows where students find difficulties to learn with computer science. Teachers systematically and practically prepare notes based on class 2 syllabus. It contains answers to questions and assignments from class 2 computer’s chapters. Students should use these notes and assignments every day to maintain the knowledge in computers. In this book, all important and difficult topics are explained in a way that 2nd graders will enjoy learning.

There is no book issued by NCERT or CBSE for Class 2 Computer Science. Only private publisher’s book are available in bookshops. Different books carry different number of chapters in computer book. The book given here on Tiwari Academy have total of 9 chapters. It includes all the fundamental knowledge which is need in class 2. Student can also practice Worksheets for Class 2 Computer Subjects given here. These worksheets are suitable for faster revision of the 2nd grade curriculum. With this help you can score better in the upcoming exams. We also develop many printable study materials like MCQs, Worksheets, Model Papers, Important Books, and Papers with previous year questions for class 2. Our motive is that students can easily understand computer syllabus.

How many chapters are there in Class 2 NCERT Computer Book?

There is not any book published by NCERT. CBSE prescribes syllabus for kids and school teachers or some private publishers prepare the contents for class 2 computer science. Computer studies is a very important subject in class 2 to get better grades. Tiwari Academy computer book is designed to be easy for 2nd graders to learn. It has total 9 chapters. Nowadays, it is important to use new and innovative methods for teaching 2nd grade students. The use of latest information technology, informatics and interactive technologies makes learning easier in Class 2.

Is Computer Science a tough subject in class 2?

Learning computer science is a fun for the students in primary classes. In this article we have provided class 2 computer book for easy learning. If you face any problem while practicing the book, please contact us for help. We will help you as soon as possible. Can you think of a special question for 2nd degree studies? Feel free to ask in the Discussion section.

Copyright 2024 by Tiwari Academy | A step towards Free Education

google-news

WorksheetsBag.com

WorksheetsBag.com

Worksheets For Class 2 Computer

Computer Worksheets for Class 2 have been designed as per the latest pattern for CBSE, NCERT and KVS for Grade 2. Students are always suggested to solve printable worksheets for Computer Grade 2 as they can be really helpful to clear their concepts and improve problem solving skills.

We at worksheetsbag.com have provided here free PDF worksheets for students in standard 2 so that you can easily take print of these test sheets and use them daily for practice. All worksheets are easy to download and have been designed by teachers of Class 2 for benefit of students and is available for free download.

Computers Worksheets for Class 2

We have provided  chapter-wise worksheets for class 2 Computers  which the students can download in Pdf format for free. This is the best collection of Computers standard 2th worksheets with important questions and answers for each grade 2th Computers chapter so that the students are able to properly practice and gain more marks in Class 2 Computers class tests and exams.

Chapter-wise Class 2 Computers Worksheets Pdf Download

Computer worksheets for class 2 as per cbse ncert pattern.

Parents and students are welcome to download as many worksheets as they want as we have provided all free. As you can see we have covered all topics which are there in your Class 2 Computer book designed as per CBSE, NCERT and KVS syllabus and examination pattern.

These test papers have been used in various schools and have helped students to practice and improve their grades in school and have also helped them to appear in other school level exams.

You can take printout of these chapter wise test sheets having questions relating to each topic and practice them daily so that you can thoroughly understand each concept and get better marks.

As Computer for Class 2 is a very scoring subject, if you download and do these questions and answers on daily basis, this will help you to become a master in this subject.

Benefits of Free Computer Worksheets for Class 2

  • You can improve understanding of your concepts if you solve NCERT Class 2 Computer Worksheet,
  • These CBSE Class 2 Computer worksheets can help you to understand the pattern of questions expected in Computer exams.
  • All worksheets for Computer Class 2 for NCERT have been organized in a manner to allow easy download in PDF format
  • Parents will be easily able to understand the worksheets and give them to kids to solve
  • Will help you to quickly revise all chapters of Class 2 Computer textbook
  • CBSE Class 2 Computer Workbook will surely help to improve knowledge of this subject

These Printable practice worksheets are available for free download for Class 2 Computer. As the teachers have done extensive research for all topics and have then made these worksheets for you so that you can use them for your benefit and have also provided to you for each chapter in your ebook.

The Chapter-wise question bank and revision worksheets can be accessed free and anywhere. Go ahead and click on the links above to download the free CBSE Class 2 Computer Worksheets PDF.

Computer Worksheets For Class 2

You can download free worksheets for Class 2 Computer from https://www.worksheetsbag.com

You can get free PDF downloadable worksheets for Grade 2 Computer from our website which has been developed by teachers after doing extensive research in each topic.

On our website we have provided worksheets for all subjects in Grade 2, all topic wise test sheets have been provided in a logical manner so that you can scroll through the topics and download the worksheet that you want.

You can easily get question banks, topic wise notes and questions and other useful study material from https://www.worksheetsbag.com without any charge

Yes all test papers for Computer Class 2 are available for free, no charge has been put so that the students can benefit from it. And offcourse all is available for download in PDF format and with a single click you can download all worksheets.

https://www.worksheetsbag.com is the best portal to download all worksheets for all classes without any charges.

CBSE Worksheets for Class 2

Related Posts

Worksheets for class 2, worksheets for class 8 mathematics visualising solid shapes, worksheets for class 6 mathematics constructions.

NCERT Books and Solutions for all classes

NCERT Books and Solutions for all classes

Assignments Class 2 Computer Pdf Download

Students can refer to Assignments for Class 2 Computer available for download in Pdf. We have given below links to subject-wise free printable Assignments for Computer Class 2 which you can download easily. All assignments have a collection of questions and answers designed for all topics given in your latest NCERT Books for Class 2 Computer for the current academic session. All Assignments for Computer Grade 2 have been designed by expert faculty members and have been designed based on the type of questions asked in standard 2 class tests and exams. All Free printable Assignments for NCERT CBSE Class 2, practice worksheets, and question banks have been designed to help you understand all concepts properly. Practicing questions given in CBSE NCERT printable assignments for Class 2 with solutions and answers will help you to further improve your understanding. Our faculty have used the latest syllabus for Class 2. You can click on the links below to download all Pdf assignments for class 2 for free. You can get the best collection of Kendriya Vidyalaya Class 2 Computer assignments and questions workbooks below.

Class 2 Computer Assignments Pdf Download

CBSE NCERT KVS Assignments for Computer Class 2 have been provided below covering all chapters given in your CBSE NCERT books. We have provided below a good collection of assignments in Pdf for Computer standard 2th covering Class 2 questions and answers for Computer. These practice test papers and workbooks with question banks for Class 2 Computer Pdf Download and free CBSE Assignments for Class 2 are really beneficial for you and will support in preparing for class tests and exams. Standard 2th students can download in Pdf by clicking on the links below.

Subjectwise Assignments for Class 2 Computer

Assignments Class 2 Computer Pdf Download

Benefits of Solving Class 2 Computer Assignments

  • The best collection of Grade 2 assignments for Computer have been provided below which will help you in getting better marks in class tests and exams.
  • The solved question for Class 2 Computer will help you to gain more confidence to attempt all types of problems in exams
  • Latest NCERT Books for Class 2 Computer have been referred to for designing these assignments
  • We have provided step by step solutions for all questions in the Class 2 assignments so that you can understand the solutions in detail.
  • We have provided single click download links to all chapterwise worksheets and assignments in Pdf.
  • Class 2 practice question banks will support to enhance subject knowledge and therefore help to get better marks in exam

FAQs by Computer Students in Class 2

At https://www.ncertbooksolutions.com is the best website that has the biggest collection of free printable assignments for Class 2 Computer.

We provide here Standard 2 subject-wise assignments which can be easily downloaded in Pdf format for free. Our teachers have provided these Grade 2 Computer test sheets for Computer given in your books.

You can click on the links above and get assignments for Computer in Grade 2, all chapters and topic-wise question banks with solutions have been provided here. You can click on the links to download in Pdf.

We have provided here subject-wise Grade 2 Computer question banks, revision notes and questions for all difficult topics, and other study material. You can download it all without any charge by clicking on the links provided above.

We have provided the best quality question bank for Class 2 for Computer available for Pdf Download. You can download them all and use them offline without the internet.

Related Posts:

Life Processes Class 10 Science MCQ Questions

Related Posts

Assignments Class 2 Pdf Download

Assignments Class 2 Pdf Download

Assignments Class 2 Hindi Pdf Download

Assignments Class 2 Hindi Pdf Download

Assignments Class 2 Social Science Pdf Download

Assignments Class 2 Social Science Pdf Download

CoolGyan-Logo

CBSE Worksheets for Class 2 Computer Science

CBSE Worksheets for Class 2 Computer Science: One of the best teaching strategies employed in most classrooms today is Worksheets. CBSE Class 2 Computer Science Worksheet for students has been used by teachers & students to develop logical, lingual, analytical, and problem-solving capabilities. So in order to help you with that, we at CoolGyan have come up with Kendriya Vidyalaya Class 2 Computer Science Worksheets for the students of Class 2. All our CBSE NCERT Class 2 Computer Science practice worksheets are designed for helping students to understand various topics, practice skills and improve their subject knowledge which in turn helps students to improve their academic performance. These chapter wise test papers for Class 2 Computer Science will be useful to test your conceptual understanding.

CBSE Class 2 Computer Science Worksheets PDF

All the CBSE Worksheets for Class 2 Computer Science provided in this page are provided for free which can be downloaded by students, teachers as well as by parents. We have covered all the Class 2 Computer Science important questions and answers in the worksheets which are included in CBSE NCERT Syllabus. Just click on the following link and download the CBSE Class 2 Computer Science Worksheet. CBSE Worksheets for Class 2 Computers can also use like assignments for Class 2 Computer Science students.

  • Worksheet for Class 2 Computers Assignment 1
  • Worksheet for Class 2 Computers Assignment 2
  • Worksheet for Class 2 Computers Assignment 3
  • Worksheet for Class 2 Computers Assignment 4
  • Worksheet for Class 2 Computers Assignment 5
  • Worksheet for Class 2 Computers Assignment 6
  • Worksheet for Class 2 Computers Assignment 7
  • Worksheet for Class 2 Computers Assignment 8
  • Worksheet for Class 2 Computers Assignment 9
  • Worksheet for Class 2 Computers Assignment 10

Advantages of CBSE Class 2 Computer Science Worksheets

  • By practising NCERT CBSE Class 2 Computer Science Worksheet , students can improve their problem solving skills.
  • Helps to develop the subject knowledge in a simple, fun and interactive way.
  • No need for tuition or attend extra classes if students practise on worksheets daily.
  • Working on CBSE worksheets are time-saving.
  • Helps students to promote hands-on learning.
  • One of the helpful resources used in classroom revision.
  • CBSE Class 2 Computer Science Workbook Helps to improve subject-knowledge.
  • CBSE Class 2 Computers Worksheets encourages classroom activities.

Worksheets of CBSE Class 2 Computer Science are devised by experts of CoolGyan experts who have great experience and expertise in teaching Maths. So practising these worksheets will promote students problem-solving skills and subject knowledge in an interactive method. Students can also download CBSE Class 2 Computer Science Chapter wise question bank pdf and access it anytime, anywhere for free. Browse further to download free CBSE Class 2 Computer Science Worksheets PDF .

Now that you are provided all the necessary information regarding CBSE Class 2 Computer Science Worksheet and we hope this detailed article is helpful. So Students who are preparing for the exams must need to have great solving skills. And in order to have these skills, one must practice enough of Class 2 Computers revision worksheets . And more importantly, students should need to follow through the worksheets after completing their syllabus. Working on CBSE Class 2 Computer Science Worksheets will be a great help to secure good marks in the examination. So start working on Class 2 Computers Worksheets to secure good score.

CBSE WorkSheets for Class 2

cbsencertsolutions

CBSE NCERT Solutions

NCERT and CBSE Solutions for free

MCQ Questions For Class 2 Computers With Answers

Students can refer to the following MCQ Questions for Class 2 Computer with Answers provided below based on the latest curriculum and examination pattern issued by CBSE and NCERT. Our teachers have provided here collection of multiple choice questions for Computers Class 2 covering all topics in your textbook so that students can assess themselves on all important topics and thoroughly prepare for their exams

MCQ Questions for Class 2 Computer with Answers

We have provided below chapter wise MCQ Questions for Class 2 Computer with answers which will help the students to go through the entire syllabus and and practice multiple choice questions provided here with solutions. As Computers MCQs in Class 2 pdf download can be really scoring for students, you should go thorough all problems provided below so that you are able to get more marks in your exams.

MCQ Questions for Class 2 Computer

Our teachers have developed really good  Multiple Choice Questions  covering all important topics in each chapter which are expected to come in upcoming tests and exams, as MCQs are coming in all exams now therefore practice them carefully to get full understanding of topics and get good marks. Download the latest questions with multiple choice answers for Class 2 Computers in pdf or read online for free.

The above  NCERT based MCQs for Class 2 Computers have been designed by our teachers in such a way that it will help you a lot to gain an understanding of each topic. These CBSE NCERT Class 2 Computers Multiple Choice Questions have been developed and are available free for benefit of Class 2 students.

Advantages of  MCQ Questions for Class 2 Computer with Answers

a) MCQs will help the kids to strengthen concepts and improve marks in tests and exams.

b) Multiple Choice Questions for Computers Class 2 have proven to further enhance the understanding and question solving skills.

c) Regular reading topic wise questions with choices will for sure develop very good hold over each chapter which will help in exam preparations.

d) It will be easy to revise all Computers chapters and faster revisions prior to class tests and exams.

Free Printable  MCQs in PDF of CBSE Class 2 Computers are designed by our school teachers and provide best study material as per CBSE NCERT standards.

MCQ Questions for Class 2 Computer with Answers

You can easily get MCQs for Computers from https://www.cbsencertsolutions.com

The MCQs for Class 2 Computers with Answers have been developed based on current  NCERT textbook  issued by CBSE.

Yes – These Multiple Choice Questions for Class 2 Computers with Answers are free to print and use them later.

MCQs cover the topics of all chapters given in NCERT Book for Class 2 Computers.

No – All MCQs for Computers are free to read for all students.

Just scroll and read the free MCQs.

Yes – you can download free MCQs in PDF for Computers in standard MCQs format with Answers.

Related Posts

Mcq question for class 12 chemistry chapter 12 aldehydes, ketones and carboxylic acids, mcq question for class 12 english flamingo chapter 6 aunt jennifer’s tigers (adrienne rich), mcq question for class 12 biology chapter 4 reproductive health.

AssignmentsBag.com

AssignmentsBag.com

Assignments For Class 2 Computer

Assignments for Class 2 Computer have been developed for Standard 2 students based on the latest syllabus and textbooks applicable in CBSE, NCERT and KVS schools. Parents and students can download the full collection of class assignments for class 2 Computer from our website as we have provided all topic wise assignments free in PDF format which can be downloaded easily. Students are recommended to do these assignments daily by taking printouts and going through the questions and answers for Grade 2 Computer. You should try to do these test assignments on a daily basis so that you are able to understand the concepts and details of each chapter in your Computer book and get good marks in class 2 exams.

Assignments for Class 2 Computer as per CBSE NCERT pattern

All students studying in Grade 2 Computer should download the assignments provided here and use them for their daily routine practice. This will help them to get better grades in Computer exam for standard 2. We have made sure that all topics given in your textbook for Computer which is suggested in Class 2 have been covered ad we have made assignments and test papers for all topics which your teacher has been teaching in your class. All chapter wise assignments have been made by our teachers after full research of each important topic in the textbooks so that you have enough questions and their solutions to help them practice so that they are able to get full practice and understanding of all important topics. Our teachers at https://www.assignmentsbag.com have made sure that all test papers have been designed as per CBSE, NCERT and KVS syllabus and examination pattern. These question banks have been recommended in various schools and have supported many students to practice and further enhance their scores in school and have also assisted them to appear in other school level tests and examinations. Its easy to take print of thee assignments as all are available in PDF format.

Some advantages of Free Assignments for Class 2 Computer

  • Solving Assignments for Computer Class 2 helps to further enhance understanding of the topics given in your text book which will help you to get better marks
  • By solving one assignment given in your class by Computer teacher for class 2 will help you to keep in touch with the topic thus reducing dependence on last minute studies
  • You will be able to understand the type of questions which are expected in your Computer class test
  • You will be able to revise all topics given in the ebook for Class 2 Computer as all questions have been provided in the question banks
  • NCERT Class 2 Computer Workbooks will surely help you to make your concepts stronger and better than anyone else in your class.
  • Parents will be able to take print out of the assignments and give to their child easily.

All free Printable practice assignments are in PDF single lick download format and have been prepared by Class 2 Computer teachers after full study of all topics which have been given in each chapter so that the students are able to take complete benefit from the worksheets. The Chapter wise question bank and revision assignments can be accessed free and anywhere. Go ahead and click on the links above to download free CBSE Class 2 Computer Assignments PDF.

Assignments For Class 2 Computer

You can download free assignments for class 2 Computer from https://www.assignmentsbag.com

You can get free PDF downloadable assignments for Grade 2 Computer from our website which has been developed by teachers after doing extensive research in each topic.

On our website we have provided assignments for all subjects in Grade 2, all topic wise test sheets have been provided in a logical manner so that you can scroll through the topics and download the worksheet that you want.

You can easily get question banks, topic wise notes and questions and other useful study material from https://www.assignmentsbag.com without any charge

Yes all test papers for Computer Class 2 are available for free, no charge has been put so that the students can benefit from it. And offcourse all is available for download in PDF format and with a single click you can download all assignments.

https://www.assignmentsbag.com is the best portal to download all assignments for all classes without any charges.

Related Posts

Assignments For Class 6 Mathematics Ratio And Proportion

Assignments For Class 6 Mathematics Ratio and Proportion

Assignments For Class 2 Moral Science

Assignments For Class 2 Moral Science

Assignments For Class 10 Mathematics Quadratic Equation

Assignments For Class 10 Mathematics Quadratic Equation

WorkSheets Buddy

Download Math, Science, English and Many More WorkSheets

Worksheets for Class 2 Computer Science

Cbse worksheets for class 2 computer science.

CBSE Worksheets for Class 2 Computer Science: One of the best teaching strategies employed in most classrooms today is Worksheets. CBSE Class 2 Computer Science Worksheet for students has been used by teachers & students to develop logical, lingual, analytical, and problem-solving capabilities. So in order to help you with that, we at WorksheetsBuddy have come up with Kendriya Vidyalaya Class 2 Computer Science Worksheets for the students of Class 2. All our CBSE NCERT Class 2 Computer Science practice worksheets are designed for helping students to understand various topics, practice skills and improve their subject knowledge which in turn helps students to improve their academic performance. These chapter wise test papers for Class 2 Computer Science will be useful to test your conceptual understanding.

CBSE Class 2 Computer Science Worksheets PDF

All the CBSE Worksheets for Class 2 Computer Science provided in this page are provided for free which can be downloaded by students, teachers as well as by parents. We have covered all the Class 2 Computer Science important questions and answers in the worksheets which are included in CBSE NCERT Syllabus. Just click on the following link and download the CBSE Class 2 Computer Science Worksheet. CBSE Worksheets for Class 2 Computers can also use like assignments for Class 2 Computer Science students.

  • Worksheet for Class 2 Computers Assignment 1
  • Worksheet for Class 2 Computers Assignment 2
  • Worksheet for Class 2 Computers Assignment 3
  • Worksheet for Class 2 Computers Assignment 4
  • Worksheet for Class 2 Computers Assignment 5
  • Worksheet for Class 2 Computers Assignment 6
  • Worksheet for Class 2 Computers Assignment 7
  • Worksheet for Class 2 Computers Assignment 8
  • Worksheet for Class 2 Computers Assignment 9
  • Worksheet for Class 2 Computers Assignment 10

Advantages of CBSE Class 2 Computer Science Worksheets

  • By practising NCERT CBSE Class 2 Computer Science Worksheet , students can improve their problem solving skills.
  • Helps to develop the subject knowledge in a simple, fun and interactive way.
  • No need for tuition or attend extra classes if students practise on worksheets daily.
  • Working on CBSE worksheets are time-saving.
  • Helps students to promote hands-on learning.
  • One of the helpful resources used in classroom revision.
  • CBSE Class 2 Computer Science Workbook Helps to improve subject-knowledge.
  • CBSE Class 2 Computers Worksheets encourages classroom activities.

Worksheets of CBSE Class 2 Computer Science are devised by experts of WorksheetsBuddy experts who have great experience and expertise in teaching Maths. So practising these worksheets will promote students problem-solving skills and subject knowledge in an interactive method. Students can also download CBSE Class 2 Computer Science Chapter wise question bank pdf and access it anytime, anywhere for free. Browse further to download free CBSE Class 2 Computer Science Worksheets PDF .

Now that you are provided all the necessary information regarding CBSE Class 2 Computer Science Worksheet and we hope this detailed article is helpful. So Students who are preparing for the exams must need to have great solving skills. And in order to have these skills, one must practice enough of Class 2 Computers revision worksheets . And more importantly, students should need to follow through the worksheets after completing their syllabus.  Working on CBSE Class 2 Computer Science Worksheets will be a great help to secure good marks in the examination. So start working on Class 2 Computers Worksheets to secure good score.

CBSE WorkSheets for Class 2

New user? Create an account .

Brilliantly

Content & links.

Verified by Sur.ly

Help us customize the learning for you, Become a member today!

Already have an account? Sign in

Uses of Computer Worksheets for Class 2

The computer is quite essential nowadays because you can see the computer everywhere in schools, homes, hospitals, offices and every other place. You will need to know how you should use it and what things you can do with it. Class 2 is when the student gets their basic knowledge about computers, and that is, the use of computer worksheets can be beneficial for them.

The worksheet will include some interactive questions for the student such as-

What type of activities can you do on the computer?

(a)Solve Sum

(b)Get information

(c)Play Music and games

(d)All of the above

Place where the computer is not used.

(c)Hospitals

(d)None of these

Which is the portable form of computer that is used for day-to-day activities?

These are some types of questions that the students may get using the computer worksheet for class 2. They must learn about these things because in the coming year if you will not have the knowledge of computers, then it will become hard for you to get a job or anything because nowadays, you will see the use of computers everywhere.

  • Computer-a Smart Machine
  • General Information about Computers
  • Parts of Computer
  • Uses of Computer
  • Learning to use Keyboard and Mouse
  • Latest Developments in the field of IT

Olympiad Worksheets

  • Math Worksheets
  • Science Worksheets
  • English Worksheets
  • Hindi Worksheets
  • General Knowledge Worksheets
  • Computer Worksheets
  • Logical Reasoning Worksheets

CS102: Introduction to Computer Science II

Course introduction.

  • Time: 51 hours
  • Free Certificate

Course Syllabus

First, read the course syllabus. Then, enroll in the course by clicking "Enroll me". Click Unit 1 to read its introduction and learning outcomes. You will then see the learning materials and instructions on how to use them.

computer assignment for class 2

Unit 1: The Building Blocks of Object-Oriented Programming

Being familiar with both C++ and Java, you are ready to explore more advanced topics in Object-Oriented (OO) Programming. We will begin by discussing the motivation behind programming with objects, learning the essential characteristics of OO Programming languages and identifying the advantages and disadvantages of various major programming frameworks. The unit will also provide a general history of OO Programming and review major characteristics of OO Programming. By the end of this unit, you will be able to discuss different programming paradigms and identify the main properties of OO Programming. Completing this unit should take you approximately 12 hours.

Unit 2: C++ and Java Differences

To understand a language, it helps to know what motivated its development, its principle concepts (which we call its "programming paradigm"), and how it relates to other languages. If you have completed CS101: Introduction to Computer Science I and the first unit of this course, you should have a strong grasp of Java and C++, their uses, and a basic understanding of object-oriented programming. In this unit, we will outline the similarities and differences between these two languages, noting how each is used in the industry. We will also take an in-depth look at the basic building blocks of each language in order to draw a distinction between the two and further acquaint you with both languages. While there are many syntactual similarities between Java and C++, they are not necessarily translated one to another easily. As you study, pay close attention to the distinctions between the two. Completing this unit should take you approximately 6 hours.

Unit 3: C++ Standard Template Library

Nearly every C++ programmer uses the C++ Standard Template Library (STL), a powerful and highly useful library of generic-typed data structures and algorithms. In this unit, we will learn how and why the STL was originally developed. The unit will also introduce you to the history and basics of templates and generic programming before presenting the structures (Containers, Iterators, and Functors) and algorithms that the Standard Template Library contains. By the end of this unit, you will be familiar with the STL, its uses, and its structures and algorithms.

Completing this unit should take you approximately 7 hours.

Unit 4: Java Container Library

Java's Container Library is comparable to C++ Standard Template Library. Both provide a set of data containers and associated operations. As you build systems of increasing complexity, you will notice that you use certain data structures and operations on the data and structures over and over again. Experience over decades of computer science has identified a common set. Those have been collected into a group of classes of generic data type. This group is the Standard Template Library in C++ and the Container Library in Java. What we have is a set of trusted modules that have been tested and tested, over and over again, by many people engaging with numerous applications. They are also optimized for speed. There is no reason to write these from scratch. Having already examined the C++ Standard Template Library, we now take a deep look at the Java Container Library.

Completing this unit should take you approximately 5 hours.

Unit 5: Exceptions

A programmer must ensure the correct execution of their code, regardless of the situation the code encounters. In other words, if a run-time error occurs, the program should present the user with relevant information and then quit gracefully. The built-in C++ and Java structures used to accomplish this goal are known as exceptions. This unit will introduce you to the concept of throwing and catching exceptions when something goes wrong while your software is running, explain how exceptions are used in C++ and Java, and teach you how to handle the errors that exceptions catch. By the end of this unit, you will be able to write programs that perform gracefully whenever run-time errors occur.

Completing this unit should take you approximately 6 hours.

Unit 6: Recursion

Often considered one of the more conceptually difficult concepts within the field of computer science, recursion – the act of a function invoking itself – is a powerful and relevant tool. In this unit, we will take an in-depth look at recursion, learning how to develop recursive processes, the role that recursion plays in common data structures, and what happens inside the computer when a function is invoked recursively. By the end of this unit, you will recognize situations that require recursion and be able to apply it appropriately.

Recursion can be a difficult concept for students new to computer science. If you feel anxious, your best best is to use examples. In this unit, we will use recursion to write a program to express factorials (N!). This straightforward example will give you an overview of all the major components of recursion. Many good examples are also illustrated through the unit, particularly in the sections that discuss the Towers of Hanoi and the Merge Sort.

Unit 7: Searching and Sorting

As a computer programmer, you need to know how to search and sort data. This will require you to leverage what you have learned in a number of different computer science areas, drawing from your earlier study of data structures and algorithms. In this unit, we will identify the importance of searching and sorting, learn a number of popular searching and sorting algorithms, and determine how to analyze and appropriately apply them. By the end of this unit, you will recognize instances in which you need a searching or sorting algorithm and be able to apply one efficiently.

Completing this unit should take you approximately 8 hours.

Course Feedback Survey

Please take a few minutes to give us feedback about this course. We appreciate your feedback, whether you completed the whole course or even just a few resources. Your feedback will help us make our courses better, and we use your feedback each time we make updates to our courses.

If you come across any urgent problems, email [email protected].

computer assignment for class 2

Certificate Final Exam

Take this exam if you want to earn a free Course Completion Certificate.

To receive a free Course Completion Certificate, you will need to earn a grade of 70% or higher on this final exam. Your grade for the exam will be calculated as soon as you complete it. If you do not pass the exam on your first try, you can take it again as many times as you want, with a 7-day waiting period between each attempt.

Once you pass this final exam, you will be awarded a free Course Completion Certificate .

computer assignment for class 2

Due: Sat May 25 11:59 pm Late submissions accepted until Sun May 26 11:59 pm

Assignment by Michael Chang & Julie Zelenski idea originated by Randal Bryant & David O'Hallaron (CMU). Modifications by Nick Troccoli, Brynne Hurst, Kathleen Creel and Jonathan Kula.

Learning Goals

This assignment focuses on understanding assembly code representations of programs. You will be building your skills with:

  • reading and tracing assembly code
  • understanding how data access, control structures, and function calls translate between C and assembly
  • reverse-engineering
  • understanding the challenges of writing secure and robust systems
  • understanding privacy, trust, and the role of the ethical penetration tester
  • mastering the gdb debugger!

You have been hired as a security expert for Stanford Bank (a fictional on-campus bank). They need you to investigate reports of infiltration and security issues and replicate the issues so that they can fix them.

There are three parts to this assignment, each of which can be completed independently:

  • an ATM withdrawal program containing some vulnerabilities - you'll need to use your C and assembly skills to find and demonstrate how to exploit these vulnerabilities.
  • A dataset that you will use to deanonymize bank users.
  • The SecureVault program, a new product designed by the bank to provide increased security to the master vault. You'll be given an executable of the SecureVault program (no C code provided!) to show that it is possible to reverse engineer this program and break into the master vault without being told the passwords.

These problems are like C/assembly "puzzles" to solve, and we hope you enjoy solving them and exploring this material as much as we enjoyed creating them!

Note: check out our assignment overview video on Canvas ; it goes over the different parts of the assignment, what to expect, and tips and tricks! Note the overview video is from this quarter last year, but the assignment is the same (save for the fact that questions 2 and 3 are exchanged).

Spring 2024: Lecture 22 (Mon 5/20) is necessary to work on questions 3 and 4 in part 2 of this assignment.

A few reminders:

  • The working on assignments page contains info about the assignment process.
  • The collaboration policy page outlines permitted assignment collaboration, emphasizing that you are to do your own independent thinking, design, writing, and debugging. Even without any code being submitted, you should not be doing any joint debugging/development, sharing or copying written answers, sharing specific details about SecureVault behavior, etc. If you are having trouble completing the assignment on your own, please reach out to the course staff; we are here to help!

To get started on this assignment, clone the starter project using the command

View Full Starter File List

  • vault : Your SecureVault executable program, custom-generated for each student.
  • custom_tests : The file where you will add custom tests to reproduce vulnerabilities in the provided ATM withdrawal program.
  • input.txt : A blank text file where you should add the passwords for each SecureVault level, one per line. See the section on SecureVault for more information.
  • readme.txt : A file where you should add answers to short written questions for all three parts of the assignment.
  • .gdbinit : A gdb configuration file you can optionally use to run certain gdb commands each time gdb launches. See the section on using GDB in SecureVault for more information.
  • samples : A symbolic link to the shared directory for this assignment. It contains:
  • atm : The executable ATM program, which you will explore for vulnerabilities.
  • atm.c : The C source code for the ATM program, which you will explore for vulnerabilities. Note that you're not able to edit or recompile this code/executable.
  • checkins.csv : A file containing public social media location check-in data for various locations on Stanford campus over the past three months.
  • search_checkins : An executable program to search the check-in data.
  • bank : a folder containing the following:
  • customers.db : A file with the list of all users and balances for the ATM program.
  • transactions.csv : A file with ATM transaction information from the past three months at the Stanford campus ATM.
  • SANITY.INI and sanity.py : Files to configure and run sanity check. You can ignore these files.
  • wordlist : A list of dictionary words used for SecureVault.
  • tools : Contains symbolic links to the sanitycheck and submit programs for testing and submitting your work. ( codecheck is not needed on this assignment)

You will be using gdb frequently on this assignment. Here are essential resources as you work - note that you should make sure you have downloaded the CS107 GDB configuration file mentioned in the Getting Started Guide if you didn't previously do so.

Open Getting Started Guide Open GDB Guide Open Lab5 GDB Tips Open Lab6 GDB Tips

1. ATM Security

Stanford Bank recently updated the ATM software to a version with some additional features. The IT team reviewed the new code and thought it all looked good, but having now installed it in production, they are observing some suspicious activity. The bank has called you because your superior C and assembly skills are just what's needed to investigate and resolve these problems!

In the samples folder, they have provided you the code ( atm.c ) and compiled executable ( atm ), which you can examine/run but cannot recompile or edit (since they want to ensure you work with the same executable installed on the ATMs themselves). The ATM program is invoked with an amount and the credentials for a particular account. If the credential is authorized and the account has sufficient funds, the amount is withdrawn and dispersed in cash. Accounts must maintain a minimum balance of $50, and the ATM is supposed to maintain bank security by rejecting unauthorized access. Every time you run the program, it will print out information to the terminal about the transaction that took place, or the error that occurred, if any. For example, if you ask to withdraw $100 from your account balance of $107, it should be denied with an error message because that would bring your current $107 balance below the required minimum of $50. If you try to sneak cash from another account or use a fake name, your credential should get rejected as unauthorized.

Here are a few examples - try it out yourself! Note that $USER automatically acts as your SUNET ID, and every account balance is set to be $107. Also, each time you run the program anew, all balances return to their original starting levels. No money actually changes hands in this ATM, which is a blessing given its security flaws.

Expand ATM Sample Runs

The bank has identified three anomalies in the ATM program behavior that they need your help investigating. For each of the anomalies (a), (b), and (c) below, you will need to do the following:

  • include a test case in your custom_tests file to showcase how to reproduce the vulnerability. Note that there may be more than one way to trigger a vulnerability.
  • A concise description of the underlying defect in the code.
  • An explanation of exactly how you constructed your test case to exploit it.
  • Your recommendation for fixing it. The bank is not looking for a major rewrite/redesign, so in your proposed changes you should directly address the vulnerability with minimal other disruption. Note that there may be more than one possible remedy for fixing each issue. Also make sure you do not remove intended functionality of the bank program, and account for any potential additional security issues introduced by your proposed fix .

NOTE: when running your own custom tests, make sure to inspect the output to ensure your tests are causing the behavior you expect! The sanitycheck tool itself does not verify that the tests cause the specified exploits.

As you work through your investigation, you will need to review the source code for the atm program. The program is roughly 175 lines of C code of similar complexity to what you have been writing this quarter, and is decomposed and fairly readable, though sorely lacking in comments. You should find that the program's approach seems reasonable and the code is sincere in its attempt to operate correctly. As you're reading, take a minute to reflect on how far your awesome C skills have come to let you read through this provided program!

NOTE: when running the ATM program under GDB, make sure you are in the samples folder first before running gdb atm .

a) Negative Balances

A prior version of the ATM program restricted a withdrawal to be at most the full account balance, allowing the customer to drain their account to $0, but no further. The current version has changed the withdraw function to require a non-zero minimum balance. The expected behavior should be that all account balances stay above this minimum. However, the bank saw an (otherwise ordinary) withdrawal transaction that not only caused an account to go below the minimum, but also overdrew so far as to end up with a negative balance. Oops, that's definitely not supposed to happen! Review the C code for the withdraw function, specifically the changes from the old version. It seems to work in many cases, but apparently not all. Read carefully through this function to try and discover the flaw - your understanding of signed and unsigned integers will be useful here! Once you have found the vulnerability, determine a command to make a withdrawal as yourself that withdraws more money than is present in your account . Put this command in custom_tests , and answer the specified readme questions.

b) Unauthorized Account Access

The bank has also received a customer complaint about an unauthorized withdrawal from their account. It seems that another user with different credentials was able to successfully withdraw money from the aggrieved customer's account. Moreover, the credential used appears to be entirely fake - no such user exists in the database! A user should not be able to access a different customer's account and especially not by supplying a bogus credential! Review the C code for the find_account function that is responsible for matching the provided username to their account number. It seems to work properly when the username matches an existing account, but not when the username doesn't match an existing account. Trace through line by line how the function executes when called with an invalid username that is not in the database. What lines are executed? Once you do this, you'll find that the function appears to behave unpredictably. Your next task is to examine the generated assembly to determine precisely how the function will behave - your understanding of the %rax / %eax register will be useful here! Once you have found the vulnerability, determine a command with a designed bogus name credential to withdraw $40 from one of the CS107 staff member's accounts. Put this command in custom_tests , and answer the specified readme questions. (The samples/bank/customers.db file contains information about all valid users and their balances, and the first 15 users in the database are staff accounts.)

c) Accessing The Master Vault

The most worrisome issue is repeated illicit withdrawals from the master vault account, account number 0. The name on the master account is not an actual user, so this account cannot be accessed using the simple username-based credential. Instead, the user must specify two account arguments, the account's number and its secret passcode, as a form of heightened security, like this:

At first the bank thought the vault passcode had been leaked, but changing the passcode did nothing to thwart the attack. In a fit of desperation, the bank removed the vault passcode file altogether, figuring this would disable all access to the vault, yet the rogue user continues to make withdrawals from it! It seems that the high-security passcode authentication may have its own security flaw! The code that handles this authentication is in the lookup_by_number and read_secret_passcode functions. These functions work correctly in many situations, but fail in certain edge cases. Remember that it seems that in certain cases supplied credentials are accepted despite the lack of a saved passcode file . The vulnerability is subtle in the C code, so you should also use GDB to examine the code at the assembly level and diagram out the memory on the stack for these functions . This problem is similar to the stack diagramming/exploit problem from lab6 - revisit that problem if you need a refresher! Your exploit should not involve reading from any file. Once you have found the vulnerability, determine a command to withdraw $300 from the bank vault despite its disabled passcode . Put this command in custom_tests , and answer the specified readme questions.

2. Dataset Aggregation

Separate from the faulty ATM software, Stanford Bank believes that someone was able to gain access to their account logs and get a list of ATM transaction information for their Stanford campus ATM. The company believes that this poses little threat because the transaction logs have limited recorded data. However, you are concerned that this data can be combined with other available data in dangerous ways, such as to learn private information. For instance, knowing someone's history of large (or small) transactions might tell you about their financial situation; knowing memberships in clubs or organizations might tell you about social relationships and webs of networks. Your task is to combine this data with another dataset you have found of public location check-ins to show the harms of a potential data breach. To aid in investigating your concerns, the bank has made the ATM transaction data available to you in the samples/bank/transactions.csv file. This file has one account transaction per line, and each transaction occurred at the Stanford campus ATM. Each line has the following format:

For example, here is one line from the file that represents a withdrawal of $15 on 2/15/21 at 4:54PM:

Transactions with the same account identifier are guaranteed to be for the same bank account, but the identifier doesn't give any information about whose account it is (intentionally done by the bank to obfuscate the data).

You have already downloaded a publicly-available location checkins dataset from an online social network, in the file samples/checkins.csv . It is too large to read through manually, so you also already created a program search_checkins that displays that checkin data and lets you search through it more easily. Run the program ( samples/search_checkins ) for instructions on how to use it.

Show the risks of dataset aggregation and express your concerns to the bank managers by answering the following questions in your readme.txt . Note that you are not expected to create any additional programs to parse or otherwise process these datasets with code - the intent is for you to skim the transactions.csv file by hand and use it along with the search_checkins program to answer the following questions.

  • a) The likely user who made multiple large transactions?
  • b) Two (there may be more, but you must identify only two) likely members of the Stanford SecurityStars Club, which has a club meeting on the 15th of each month where people must bring $15 to pay their membership dues? (Assume they are procrastinators in withdrawing the money)
  • How were you able to de-anonymize the transactions data?
  • Beyond encrypting the data, what recommendations would you give to Stanford Bank to further anonymize or obfuscate the account data in the case of accidental data breaches?
  • Use one or more of the four models of privacy discussed in lecture to explain why disclosure of the information that can be aggregated here is (or is not) a violation of privacy.

3. SecureVault

Stanford Bank is rolling out a new tool, SecureVault, to provide increased security at the master vault at each of their branches. Employees must enter four secret passwords into this program to gain access to the master vault. For extra security, the bank creates a different SecureVault program for each branch with different expected passwords; the bank headquarters does not give the source code to any of the branches; and the program triggers an alarm that notifies the central system each time an incorrect password is entered. They are confident that this means only someone who is told the password can get access, and any potential intruders will be detected by the alarm system. They have hired you to test this. Your task is to show that you can reverse engineer the program to gain access to the bank vault without being told the password, and without alerting central security.

Do not start by running SecureVault and entering passwords to "see what will happen" . You will quickly learn that what happens is the alarm goes off and it deducts points :-) When started, SecureVault waits for input and when you enter the wrong password, it will raise the alarm and notify the central system, deducting points. Thoroughly read the SecureVault information below before attempting to enter any passwords! There is a lot of information below, but it is included to help provide useful tips for you to work through this part of the assignment.

Without the original source code, all you know is that SecureVault has four "levels" of security, each with a different password. If the user enters the correct password, it deactivates the level and the program proceeds on. But given the wrong input, SecureVault raises an alarm by printing a message, alerting central security and terminating. To reach the master vault, one needs to successfully disarm each of its levels.

This is where the bank needs your help. Each of you is assigned a different generated SecureVault executable unique to you, generated just as they would be for each bank branch. Your mission is to apply your best assembly detective skills to reverse engineer the SecureVault executable to work out the input required to pass each level and reach the master vault, thus proving the insecurity of the bank's approach.

Specifically, you must fill in your input.txt file with the passwords to defuse each level in order, 1 per line, for each level you have solved. You must also answer the following questions in your readme.txt file. Make sure to verify your input.txt file (with appropriate protections!) to ensure proper formatting and that all lines are entered correctly before submitting! We will test by running ./vault input.txt on your submission, using the original SecureVault program generated for you. Here are the readme questions to work through as you go:

  • What tactics did you use to suppress/avoid/disable alarms?
  • level_1 contains an instruction near the start of the form mov $<multi-digit-hex-value>,%edi . Explain how this instruction fits into the operation of level_1 . What is this hex value and for what purpose is it being moved? Why can this instruction reference %edi instead of the full %rdi register?
  • level_2 contains a jg that is not immediately preceded by a cmp or test instruction. Explain how a branch instruction operates when not immediately preceded by a cmp or test . Under what conditions is this particular jg branch taken?
  • Explain how the loop in the winky function of level_3 is exited.
  • Explain how the mycmp function is used in level_4 . What type of data is being compared and what ordering does it apply?
  • How would you describe Stanford Bank’s trust model? (In other words: who among the bank headquarters, the bank branches, and you was trusted?) Justify your answer.

SecureVault Information

From the SecureVault assembly, you will work backwards to construct a picture of the original C source in a process known as reverse-engineering . Note that you don't necessarily need to recreate the entire C source; your goal is to work out a correct input to pass the level. This requires a fairly complete exploration of the code path you follow to deactivate the level, but any code outside that path can be investigated on a need-to-know basis. Once you understand what makes your SecureVault program "tick", you can supply each level with the password it requires to disarm it. The levels get progressively more complex, but the expertise you gain as you move up from each level increases as well. One confounding factor is that SecureVault raises an alarm whenever it is given invalid input. Each time the alarm goes off (except for a free pass the first time), it notifies central security (the CS107 staff) and points are deducted from your score. Thus, there are consequences to setting off the alarm -- you must be careful!

The bank has confirmed to you a few things about how the SecureVault programs operate:

  • If you start SecureVault with no command-line argument, it reads input typed at the console.

If you give an argument to SecureVault, such as input.txt :

SecureVault will read all lines from that file and then switch over to reading from the console. This feature allows you to store inputs for solved levels in input.txt and avoid retyping them each time.

Alarms can be triggered when executing at the shell or within gdb. However, gdb offers you tools you can use to intercept the alarms, so your safest choice is to work under gdb and employ preventive measures.

  • It is not possible to know for sure whether the central system (course staff) is notified about an alarm. You must use your investigative skills and best defensive measures!
  • The central system will give you a free pass (no point deduction) the first time they are notified about an alarm.
  • The SecureVault program in your repository was lovingly created just for you and is unique to your id. It is said that it can detect if an impostor attempts to run it and won't play along.
  • The SecureVault program is designed for the myth computers (running on the console or logged in remotely). There is a rumor that it will refuse to run anywhere else.
  • It seems as though the function names were left visible in the object code, with no effort to disguise them. Thus, a function name of initialize_vault or read_five_numbers can be a clue. Similarly, it seems to use the standard C library functions, so if you encounter a call to qsort or sscanf , it is the real deal.
  • There is one important restriction: Do not use brute force!   You could write a program to try every possible input to find a solution. But this is trouble because a) you lose points on each incorrect guess which raises an alarm, b) trying all possible inputs will take an eternity and risk saturating the network, and c) part of your submission requires answering questions that show you understanding of the assembly code, which guessing will not provide :)

Using tools such as gdb , objdump and new tools nm and strings is critical to effectively investigating and disarming each level. Once you are familiar with the tools at your disposal, first work to reliably prevent alarms from triggering , then proceed with disarming each of the levels .

Step 1: Familiarity with Tools

Here are some helpful tools to gather general information:

  • nm : use the nm utility ( nm vault ) to print what's called the "symbol table" of the executable, which contains the names of functions and global variables and their addresses. The names may give you a sense of the structure of the SecureVault program.
  • strings : use the strings utility ( strings vault ) to print all the printable strings contained in the executable, including string constants. See if any of these strings seem relevant in determining the passwords.
  • gdb lets you single-step by assembly instruction, examine (and change!) memory and registers, view the runtime stack, disassemble the object code, set breakpoints, and more. Live experimentation on the executing SecureVault program is the most direct way to become familiar in what's happening at the assembly level.
  • Compiler Explorer : pull up tools like the Compiler Explorer interactive website from lab, or gcc on myth , to compile and explore the assembly translation of any code you'd like. For example, if you're unsure how to a particular C construct translates to assembly, how to access a certain kind of data, how break works in assembly, or how a function pointer is invoked by qsort , write a C program with the code in question and trace through its disassembly. Since you yourself wrote the test program, you also don't have to fear it setting off any alarms :-) You can compile directly on myth using a copy of a Makefile from any CS107 assignment/lab as a starting point, and then use gdb or objdump to poke around.

GDB Suggestions

GDB is absolutely invaluable on this assignment. Here are some suggestions on how to maximize your use of gdb in addition to the tips in lab5 and lab6 :

  • Expand your gdb repertoire. The labs have introduced you to handy commands such as break , x , print , info , disassemble , display , watch , and stepi/nexti . Here are some additional commands that you might find similarly useful: jump , kill , and return . Within gdb, you can use help name-of-command to get more details about any gdb command. See the quick gdb reference card for a summary of many other neat gdb features.

Get fancy with your breakpoints. You can breakpoints by function name, source line, or address of a specific instruction. Use commands to specify a list of commands to be automatically executed whenever a given breakpoint is hit. These commands might print a variable, dump the stack, jump to a different instruction, change values in memory, return early from a function, and so on. Breakpoint commands are particularly useful for installing actions you intend to be automatically and infallibly completed when arriving at a certain place in the code. (hint!)

gdb kill workaround : gdb 9.2 (current version on myth as of 04/2021) has a bug when attempting to use kill in the commands sequence for a breakpoint that creates a cascade of problems --can cause gdb itself to crash or hang. The gdb command signal SIGKILL can be used as an alternate means to kill a program from a commands sequence that doesn't trip this bug.

Use a .gdbinit file . The provided file named .gdbinit in the assignment folder can be used to set a startup sequence for gdb. In this text file, you enter a sequence of commands exactly as you would type them to the gdb command prompt. Upon starting, gdb will automatically execute the commands from it. This will be a convenient place to put gdb commands to execute every time you start the debugger. Hint: wouldn't this be useful for creating breakpoints with commands that you want to be sure are always in place when running the SecureVault program? The .gdbinit file we give you in the starter repo has only one command to echo Successfully executing commands from .gdbinit in current directory . If you see this message when you start gdb, it confirms the .gdbinit file has been loaded. If you see an error message about auto-loading .gdbinit being declined when starting gdb, this means you haven't installed the CS107 GDB configuration file - see the top of this page for instructions.

  • Custom gdb commands . Use define to add your own gdb "macros" for often-repeated command sequences. You can add defines to your .gdbinit file so you have access to them in subsequent gdb sessions as well.
  • Fire up tui mode (maybe...). The command layout asm followed by layout reg will give you a split window showing disassembly and register values. This layout will display current values for all registers in the upper pane, the sequence of assembly instructions in the middle pane, and your gdb command line at the bottom. As you single-step with si , the register values will update automatically (those values that changed are highlighted) and the middle pane will follow instruction control flow. This is a super-convenient view of what is happening at the machine level, but sadly, you have to endure a number of quirks and bugs to use it. The tui mode can occasionally crash gdb itself, killing off gdb and possibly the SecureVault program while it's at it. Even when tui is seemingly working, the display has a habit of turning wonky, often fixable by the refresh command (use this early and often!) but not always. A garbled display could cause you to misunderstand the program state, misidentify where your SecureVault is currently executing, or accidentally execute a gdb command you didn't intend. Any alarm suppression mechanism that requires you, the fallible human, to take the right action at a critical time could easily be waylaid by interference, so don't attempt tui before you have invincible automatic protection against alarms. Selective use of auto-display expressions (introduced in lab6) is a great alternative with less disruption. You can exit tui using ctrl-x a and re-enter it again (this doesn't require leaving gdb and losing all your state).

Step 2: General Investigation and Preventing Alarms

Once you are familiar with the tools at your disposal, your next step is to gather general information about how the SecureVault program works to figure out how to reliably prevent alarms from triggering . There are simple manual blocks that give some measure of protection, but it is best to go further to develop an invincible guard. Feel free to use any technique at your disposal, such as leveraging gdb features, tweaking the global program state, modifying your setup, tricking the SecureVault program into running in a safe manner, etc. Avoiding the alarm entirely is one straightforward approach to ensure that we won't hear about it, but there are ways to selectively disable just the transmission portion to the central system (course staff) . Once you figure how to set up appropriate protection against alarms, you will then be free to experiment with the levels without worry. Note that the program can only trigger an alarm when it is "live", i.e., executing in shell or running with gdb .

Step 3: Disarming Levels

Your next task is to approach each level individually to figure out a password that disarms it. There may be more than one password for each level; your task is to enter your 4 passwords, one per line, starting with level 1, into your input.txt file. Here are key tips for how to approach your reverse engineering exploration:

  • Run the program live in GDB (with appropriate alarm protections!) and step through to better understand its behavior. Reading and diagramming the assembly by hand is useful to an extent, but quickly becomes infeasible with larger programs.
  • Break the assembly into chunks. For instance, if it calls any functions, that's a good stopping point to orient yourself and understand the assembly just up to that point.
  • Use gdb to verify your hypotheses. Verify key assumptions you make about the vault behavior to ensure you're on the right track. One helpful trick is you can change register contents while running gdb. E.g. if you think "I believe if %rdi stored this, it would do that", then try it! You can do p $rdi = val to change register contents mid-program. Or if you think something is a char * , cast and print it out, e.g. p (char *)$rdi .
  • Document your knowns and unknowns. If you run into a situation where you are stuck due to seemingly-conflicting assumptions, document them and re-verify them. If you have multiple conflicting assumptions, at least one must not be the case.
  • Use compiler explorer to see what code looks like in assembly. If you think you happened upon e.g. a loop, if statement, etc. try using compiler explorer to type in some code quickly and see what that code looks like in assembly. If it resembles the assembly you're seeing, perhaps that can help you better understand its structure.
  • Use library functions to your advantage. If you spot a call to what looks like a library function, it's the real deal. Use the man page for that function to learn about what parameters it takes in, what it does, and what it returns. This can give you key information about the types of data in different registers - e.g. if you see a call to strlen , then the value put into %rdi must be of type char * , and what's stored in %rax afterwards must be a size_t string length.
  • When tracing an unknown function, before dissecting its behavior first learn about the input/output of the function and what role it plays. Does it return anything? What parameters does it take in? If it has a return value, is it checked to be something in particular? Going into a function with an idea of what must be returned for you to continue with the vault can help you focus on understanding how to achieve that.

Sanity Check

The default sanitycheck test cases are ATM inputs and one test case that reports the line count of your input.txt file. This sanitycheck is configured to only allow test cases for ATM in your custom_tests file. The SecureVault executable is not run by sanitycheck.

Once you are finished working and have saved all your changes, check out the guide to working on assignments for how to submit your work. We recommend you do a trial submit in advance of the deadline to allow time to work through any snags. You may submit as many times as you would like; we will grade the latest submission. Submitting a stable but unpolished/unfinished version is like an insurance policy. If the unexpected happens and you miss the deadline to submit your final version, this previous submit will earn points. Without a submission, we cannot grade your work.

We would also appreciate if you filled out this homework survey to tell us what you think once you submit. We appreciate your feedback!

For this assignment, here is a tentative point breakdown (out of 119):

  • custom_tests (24 points) Each successful attack test case earns 8 points. We will test by running tools/sanitycheck custom_tests on your submission. Your custom_tests should contain 3 test cases, one for each ATM attack.
  • readme.txt (55 points) The written questions will be graded on the understanding of the issues demonstrated by your answers and the thoroughness and correctness of your conclusions.
  • Input.txt (40 points) Each SecureVault level you have solved earns 10 points. We will test by running ./vault input.txt on your submission. The input.txt file in your submission should contain one line for each level you have solved, starting from level 1. Malformed entries in your input.txt or wrong line-endings will cause grading failures. To avoid surprises, be sure that you have verified your input.txt in the same way we will in grading (i.e., ./vault input.txt ).
  • SecureVault alarms triggered (up to 6 points deducted) Each alarm notification (beyond the first one) that reaches the staff results in a 1 point deduction, capped at 6 points total.

Post-Assignment Check-in

How did the assignment go for you? We encourage you to take a moment to reflect on how far you've come and what new knowledge and skills you have to take forward. Once you finish this assignment, your assembly skills will be unstoppable, and you will have a better understanding of trust, privacy and security! You successfully found vulnerabilities in a program using its source and assembly, and reverse engineered a complex program without having access to its source at all. Rock on!

To help you gauge your progress, for each assignment/lab, we identify some of its takeaways and offer a few thought questions you can use as a self-check on your post-task understanding. If you find the responses don't come easily, it may be a sign a little extra review is warranted. These questions are not to be handed in or graded. You're encouraged to freely discuss these with your peers and course staff to solidify any gaps in you understanding before moving on from a task.

  • What are some of the gdb commands that allow re-routing control in an executing program?
  • What is the main indication that an assembly passage contains a loop?
  • What makes someone a trustworthy fiduciary or guardian of personal data? How and why should an institution like a bank protect the privacy of its customers?
  • Explain the difference between a function's return value and its return address.
  • Consider the mechanics of function pointer work at the assembly level. How is a call through a function pointer the same/different when compared to an ordinary function call?
  • For performance reasons, the compiler prefers storing local variables in registers whenever possible. What are some reasons that force the compiler to store a local variable on the stack instead?
  • For the instruction sequence below, what must be true about values of op1 and op2 for the branch to be taken? What changes if ja is substituted for jg ? cmp op1,op2 jg target

TechConnect: *Online: Develop in Swift: Build a Color Picker App

This event will take place online via Zoom. Must register with a valid email address.

Learn how to create iPhone apps for Apple from scratch with Xcode, an app-building software. This class will cover the different kinds of projects you can make, along with practice on how to design iOS apps.

If you are taking this class online, you will need a Mac computer with Xcode downloaded in order to get the most out of this class. If this class is in-person, Mac computers will be provided for those without them.

You will receive an email 2 hours prior to the start of the class with the link to join the virtual class. 

*Please note that some people using older or less common email addresses have experienced issues with receiving emails from TechConnect. Using a Gmail account will prevent this in most instances.

  • Audience: Adults

COMMENTS

  1. Class 2 Computer Science Book

    NCERT Solutions for Class 2 Computer Science Book updated for new academic session 2024-25 CBSE and state board students. Grade 2 Computer study material and revision of all chapters including fundamental. All the chapters are simplified to provide a basic knowledge to the students of Grade 2. Chapter Wise Class 2 Computer Science. Chapter 1.

  2. Class 2 Computer Worksheets Download Pdf with Solutions

    We have provided below free printable Class 2 Computer Worksheets for Download in PDF. The worksheets have been designed based on the latest NCERT Book for Class 2 Computer. These Worksheets for Grade 2 Computer cover all important topics which can come in your standard 2 tests and examinations.Free printable worksheets for CBSE Class 2 Computer, school and class assignments, and practice test ...

  3. Class 2 Computer Assignments Download Pdf with Solutions

    We have provided below free printable Class 2 Computer Assignments for Download in PDF. The Assignments have been designed based on the latest NCERT Book for Class 2 Computer. These Assignments for Grade 2 Computer cover all important topics which can come in your standard 2 tests and examinations.Free printable Assignments for CBSE Class 2 Computer, school and class assignments, and practice ...

  4. Computer Worksheets for Class 2 Free PDF download

    Chapter-wise Class 2 Computers Worksheets Pdf Download. CBSE Class 2 Computers Practice Keyboard Worksheet. CBSE Class 2 Computers Practice Worksheet Set A. CBSE Class 2 Computers Practice Worksheet Set C. CBSE Class 2 Computers Practice Worksheet Set D. CBSE Class 2 Computers Practice Worksheet Set E.

  5. Assignments Class 2 Computer Pdf Download

    All Assignments for Computer Grade 2 have been designed by expert faculty members and have been designed based on the type of questions asked in standard 2 class tests and exams. All Free printable Assignments for NCERT CBSE Class 2, practice worksheets, and question banks have been designed to help you understand all concepts properly.

  6. CBSE Worksheets for Class 2 Computer Science -CoolGyan

    Worksheets of CBSE Class 2 Computer Science are devised by experts of CoolGyan experts who have great experience and expertise in teaching Maths. So practising these worksheets will promote students problem-solving skills and subject knowledge in an interactive method. Students can also download CBSE Class 2 Computer Science Chapter wise ...

  7. MCQ Questions for Class 2 Computer Free PDF

    Advantages of MCQ Questions for Class 2 Computer with Answers. a) MCQs will help the kids to strengthen concepts and improve marks in tests and exams. b) Multiple Choice Questions for Computers Class 2 have proven to further enhance the understanding and question solving skills. c) Regular reading topic wise questions with choices will for sure ...

  8. Assignments For Class 2 Computer

    Assignments for Class 2 Computer have been developed for Standard 2 students based on the latest syllabus and textbooks applicable in CBSE, NCERT and KVS schools. Parents and students can download the full collection of class assignments for class 2 Computer from our website as we have provided all topic wise assignments free in PDF format ...

  9. Worksheets for Class 2 Computer Science

    Worksheets of CBSE Class 2 Computer Science are devised by experts of WorksheetsBuddy experts who have great experience and expertise in teaching Maths. So practising these worksheets will promote students problem-solving skills and subject knowledge in an interactive method. Students can also download CBSE Class 2 Computer Science Chapter wise ...

  10. Uses of Computer Worksheets for Class 2

    Class 2 is when the student gets their basic knowledge about computers, and that is, the use of computer worksheets can be beneficial for them. The worksheet will include some interactive questions for the student such as-. What type of activities can you do on the computer? Place where the computer is not used.

  11. CS102: Introduction to Computer Science II

    Free Certificate. This course is a continuation of CS101: Introduction to Computer Science I. It will introduce you to a number of more advanced Computer Science topics, laying a strong foundation for future study and achievement in the discipline. We will begin with a comparison between Java, the programming language used in the previous ...

  12. PDF HOLIDAY HW CLASS II

    SUMMER HOLIDAY HOMEWORK- CLASS II Give me the joys of summer, Of SUMMER QUEEN so fair, With wealth of lovely flowers And fruits and sun-kissed air! Let's have fun and work together during this summer break. E.V.S 1. Let us all make colourful and beautiful flash cards according to our Roll nos.- Roll no 1 to 5 - Types of families and My school

  13. CS 1073 Assignment #6 (pdf)

    Computer-science document from University of New Brunswick, 2 pages, Fall 2023 CS 1073 Assignment #6 Expected Completion Date: Friday December 1st Associated Quiz Date: Tuesday December 5th , 2:30pm or 3:30pm Question 1 will be submitted in class on the day at the Start of Class. Assignments not in at the start will receiv

  14. CS107 Assignment 5: Banking on Security

    A few reminders: The working on assignments page contains info about the assignment process.; The collaboration policy page outlines permitted assignment collaboration, emphasizing that you are to do your own independent thinking, design, writing, and debugging. Even without any code being submitted, you should not be doing any joint debugging/development, sharing or copying written answers ...

  15. *Online: Develop in Swift: Build a Color Picker App

    This event will take place online via Zoom. Must register with a valid email address. Learn how to create iPhone apps for Apple from scratch with Xcode, an app-building software. This class will cover the different kinds of projects you can make, along with practice on how to design iOS apps. If you are taking this class online, you will need a Mac computer with Xcode downloaded in order to ...