代写web | report | security | Network代做 | network代写 | javascript | thread | app代做 | oop | 代做project | Asp | unity作业 | 代做html | css代做 | assignment代写 – Project 3 : Advanced Web

Project 3 : Advanced Web

代写web | report | security | Network代做 | network代写 | javascript | thread | app代做 | oop | 代做project | Asp | unity作业 | 代做html | css代做 | assignment代写 – 这是利用Asp进行训练的代写, 对Asp的流程进行训练解析, 涉及了web/report/security/Network/network/javascript/thread/app/oop/Asp/unity/html/css等代写方面, 这个项目是assignment代写的代写题目

多线程代写 代写多线程 multi-threading代写

Security

Spring 2022

The latest Chrome browser is highly recommended for this project

Objectives

  1. Attack a web application by exploiting its XSS vulnerabilities to infect its users as persistently as possible.
  2. Exploiting the XSS to launch a social engineering attack to trick a simulated user to give up its credentials.
  3. Understand cookie management and how to secure your cookies.

Due Date

Please refer to the Canvas  assignment for how to submit your solution and due date.

Background

As a student of CS6262, you are invited to join the web  security club. This club has an official website
for sharing information and resources. As a prospective member, you need to deliver a pentesting
 report on the website and provide patches on what you find as a qualification test first.
The website is not complicated. It is a simple Content Management System with several features
enabled, e.g. text search, dark mode, rich text editor, etc.
The website ishttps://cs6262.gtisc.gatech.edu. Itintegrates the GT Single Sign On service, so please
sign in with your GT account and it will create a user for you.

Before getting your hands dirty

Lets first have a feel of what the website looks like. When you type cs6262.gtisc.gatech.edu in your
browser (the latest Chrome is recommended), the image below is what you will get. It has two posts
introducing its features. In the following instructions, you will be guided through the whole project.
  1. Sign in first. a. Click Sign in, the blue button on the top right corner. It will redirect you to Georgia Techs login page. b. After sign-in, you will be directed to the homepage. At the top right corner, you can see your username and a dropdown list, which means you have successfully logged in. Read the post of Dark Mode Goes Live to figure out how touse the theme feature.
  2. You should read through all the existing posts to find clues of how to exploit the XSS vulnerabilities of the website.
  3. The My writeups tab will only return your submissionswhich can be used to see your submitted posts for task 4.
  4. The Console tab is the testing tab that will helpyou simulate other users and admins, receiving messages. And one task also resides in that page. This is useful when you need others to click on

your links. a. Message Receiver Endpoint i. This section gives you an endpoint to send/receive messages. That is necessary for XSS attacks. Attackers usually steal cookies and send them to their endpoints. You should use the POST method to send messages to this endpoint. To view the received messages, click the link and refresh when you need to receive a new one. ii. This endpoint will be used for task 4 and task 5.

b. The User/Admin instance's running status tells thecurrent running admin role and user
roles. You can at most create one admin role and one user role.
In order to trigger an XSS attack on the admin side, fill in the URL of your post and submit to
the admin role. It will create or override the currentrunning browser instance, which
means when its messed up, you can submit a URL to override the current one.
In order to trigger an XSS attack on other users sides, fill in the URL of your malicious
payload. The user instances also override the current one when you submit new URLs.
The admin instance will be used for task 4 and task 5.2. The user instance will be used
for task 5.3.
c. The ReDoS section lets you practice application layerDoS.
i. The server is a simple username and password verification website. Your password
should not contain the username, the whole string. When you are able to launch
the ReDoS attack, another request to this page will not respond as it should in a very
short time interval. When your attack succeeds, you should be able to see a hash
string in the result area. Note that the hash stringis correct only when it is under a
ReDoS attack.
ii. Bear in mind that toggle the ReDoS heartbeat when you see a hash string so you
can copy and paste. Because the result is refreshed every 10 seconds.
iii. Check Restart the ReDoS instance to launch the ReDoS server again when you feel
like the server is not responding to your submission.
d. The Information Theft section will show an input boxwhen you are able to login as an
admin. As a regular user, you wont be able to see this form. So, there are two approaches
to access this form. However, it might be easier to go for approach 2.
Here are the two approaches.
i. Login as admin by stealing admins session cookie. Unfortunately, the session
cookie is protected by the httpOnly flag which makes it invisible to JS. You may find
other ways to steal this cookie. But, our server is well configured to prevent this.
ii. Post your username and submit the form directly as admin. The form is protected
by CSRF. Think of ways to find out the endpoint to submit to, read the CSRF token
and send the post request.

Tasks and Grading Rubric

Note: Fill up the questionnaire and submit required files onto GradeScope.
Task 1. Basic html and javascript Test ( 5 %)

1. In this section we will introduce a few basic HTML and JavaScript knowledge to help you with other tasks. It is for practice purposes. There will be no points in this section. 1.1 DevTools Modern browsers will provide DevTools for frontend developers to debug and tune the performance when developing a website. It can also be used by attackers to explore and collect information. Try pressing F12 in the Chrome browser. DevTools will popup. Here you can run javascript in the console, view the source html of the webpage, and capture the network traffic. It provides many functionalities. Try to explore it by yourself.

1.2 console.log()
console.log() is commonly used to print information into the console of the developer tools
for debugging purposes. Open the devTool and type console.log(yourGTID); You can see
your GTID is printed in the console.
1.3 setInterval
setInterval is used to fire a function given a frequency. It will return an intervalID which can
be passed to clearInterval to cancel the interval.
Question : Given a variable var counter = 5 , make useof setInterval and clearInterval to
reduce the counter to 0 in every second and then stop. You can run your code in devTools
to verify.
var counter = 5 ;
// Your code below
1.4 setTimeout
setTimeout will fire a function after the delay milliseconds. The function will only be fired
once. Similarly you can use the returned timeoutID and clearTimeout to cancel the timeout.
Question : Given a variable var counter = 5, make useof setTimeout to reduce the counter
to 0 in every second and then stop. You can run your code in devTools to verify.
var counter = 5 ;
// Your code below
1.5Promise
A Promise is an object used for async operations in JavaScript. There are three states in a
Promise object: Pending , Fulfilled , and Rejected .Once created, the state of the Promise
object is pending. So the calling function will notbe blocked and continue executing. The
Promise object will eventually be fulfilled or rejected .Then the respective resolve or reject
function will be called. Below is an example of a Promise. Before running the code, can you
tell what the output would be? Can you explain why?
let testPromise = new Promise((resolve, reject) => {
setTimeout(()=>resolve("Promise resolved"), 1000 );
})
testPromise.then(message => {
console.log(message);
})
console.log("Calling function");

2. In this section we will ask you 5 questions related to HTML and javascript. Each question contributes 1% of the total score. Please fill in your answers in the provided questionnaire.

2.1 <iframe> is an HTML element which allows the websiteto embed content from
another website. The attacker can make use of XSS to dynamically create an iframe and
load phishing content from the attacker's website. In task 5.3, you will be asked to load a
remote page in an iframe in full screen. This question,however, just asks you how to
adjust an iframes layout.
Which of the following options can adjust iframes width and height correctly?
A) <iframe src=https://www.gatech.edu width=100%height=100%></iframe>
B) <iframe src=https://www.gatech.edu width=100pxheight=100px></iframe>
C) <iframe src=https://www.gatech.edu style=width:100%;height:100%></iframe>
D) All of above
2.2 In order for the <a> tag to open a new tab/windowwhen clicked, what value should
you set for the target attribute? (The answer shouldonly contain the value itself). This is
necessary for task 5.3.
2.3 You will see three alerts after running the codebelow. Put the output in sequence. The
answer should be 3 numbers separated by commas with no space, e.g. 1,1,1. Think
about why that is the case. You will use this technique in task 5.2.
for (var i = 0 ; i < 3 ; i++) {
const promise = new Promise((resolve, reject) =>{
setTimeout(resolve, 1000 + i* 1000 )
});
promise.then(() => alert(i));
}
2.4 Which of the following can set jsScript as astring variable correctly? Understanding
how HTML code is parsed is important. This question is related to task 3.
A) <script>let jsScript=<script>a=2</script></script>
B) <script>let jsScript='<script>a=2</script>'</script>
C) <script>let jsScript='<script>a=2<\/script>'</script>
D) None of above
2.5 fetch is an api which makes use of promises tosend web requests. It is supported by
most major web browsers. Studythe use of fetch apiand try to make a POST request to
your Message Receiver Endpointwith the payload bodybeing {username:
your-GT-username}, e.g. {username: abc123} .Then, check your message
receiver endpoint again to see the response. It will be a hash string. Copy this string into
the questionnaire.
Task 2. Exploit the Reflected-XSS ( 10 %)
Find where to exploit a reflected XSS and fill in the questionnaire a URL by visiting which an alert
should trigger.
Concept Review
Reflective XSS is an attack where a website does not return requested data in a safe manner.
Reflective is generally an XSS attack where the attacker sends the victim a link to a reputable
website. BUT, this link contains malicious javascript code. For example,
https://www.facebook.com/login?username=username&password=password<script>steal-your-i
nformation.js</script>
If the website returns the data in an unsafe manner (does not sanitize the output) and the victim
clicks on this link, then the malicious code will be executed in the context of the victims session.
Requirements
The content of the alert doesnt matter. For example,
https://cs6262.gtisc.gatech.edu/endpoint...yourpayloadis what you need to fill in the
questionnaire.
The autograder will visit your URL, If it detects an alert, then you will receive full credit.
Tips
  1. You dont need to log into the website to find this vulnerable point and exploit it.
  2. All inputs are malicious! Look for where you can type and try it with some alerts.
Deliverables
  1. A URL which includes the vulnerable endpoint and your alert payload.
  2. The alert should show the domain as below.
Rubric
Your URL is able to trigger an alert 10%
Your URL fails to trigger an alert 0%
Task 3. Evolve to Persistent Client Side XSS ( 15 %)
After finding the exploitable place from task 2, you understand you can infect others by sending
them links. But sending links is costly and people may not click on them every time.
Therefore, instead of sending a link required in task 2, you find you can actually modify the
payload and let the payload live in this web  app forever. As long as a user clicks on the link you
send once, she is infected persistently unless the payload is cleared.
Concept Review
After learning some types of XSS, you may think how I can make my attack as persistent as
possible on the client's side if the website doesnt have a Stored-XSS vulnerability exposed to
regular users.
As Web technology evolves, more and more applications start to focus on user experience. More
and more web applications, including cross platform Electron applications, are taking over
desktop applications. Some user's non-sensitive data is now stored on the client side, especially
the look and feel preferences of an application, to let the App load faster by remembering the
user's preferences without passing back small data chunks.
You can learn more how prevalent this is nowadays by reading the paperDon't Trust The Locals:
Investigating the Prevalence of Persistent Client-Side Cross-Site Scripting in the Wild
Then, the variable is read by an unsafe sink, e.g. eval, element.innerHTML(data).
Inspect what is stored locally for the web application, cs6262.gtisc.gatech.edu , and how it is
used.
Tools you may need:
  • F12 on the keyboard and go to Application tab to inspect the Storage as highlighted below

####### –

  • The Application tab provides you with a quick look at what local data is stored. That includes local storage, cookies, etc.
  • The Sources tab provides you with static resources, like scripts, html, and css files. That is the place you should focus on debugging JS code.

Requirements Now, modify the payload in the link from task 2 and fill the updated URL in the questionnaire.

The autograder will first visit your URL (NO alert should pop up at this point). Then, it would close the page and reopen to trigger your payload to run (One alert should pop up). Next, it refreshes the page without retriggering your payload (Another alert should pop up). Again, it should detect the alert twice. It should not pop up an alert by onlyvisiting your URL.

Tips

  1. Read the post Dark Mode on the website.
  2. You may need to log into the website to find the vulnerable point and exploit it. More details are described on the website.
  3. The vulnerability is exploitable even if the victim has not logged in.
  4. In this task, you dont need to submit a post yet, which is for task 4.
  5. The default dark mode style sheet is "https://bootswatch.com/4/cyborg/bootstrap.min.css".You can reset it if you feel the website is messed up. Or, you can go to the Application tab->Application->Storage->Clear site data to reset everything.

FAQ

  1. Your URL should NOT trigger any alerts when visiting it directly. And, you dont need to trigger your payload to execute in your exploit code .The autograder will do that for you. This task is trying NOT to draw the users attention (e.g. popups, alerts, and theme changing) when the user clicks on your URL. The alerts are for grading purposes.
  2. If your payload doesnt work when you think it should, you can inspect the HTML element it creates and see if theres anything incomplete. Look for where it is consumed. You can set a debugger to step through the execution.https://www.w3schools.com/js/js_strings. unity 代写3D unity”> Asp may give a hint for those who cannot fix the syntax error of your payload.
  3. Remember to leverage task 2’s result to inject your payload. When the page reloads, your payload can be read and executed.

Deliverables

  1. A URL which includes the vulnerable endpoint and your malicious payload.
Rubric
  1. Your URL is able to trigger an alert after reopen 7%
  2. Your URL is able to trigger an alert after refresh 8%
Task 4. Exploit the Stored-XSS ( 20 %)
The website, https://cs6262.gtisc.gatech.edu, allowsusers to create articles. As a user, one
needs to submit the post to a moderator who is the admin of the website for approval. This might
be an interesting point to investigate whether you can inject something so when the admin is
reviewing your post, thereby you can hijack the admins login session. This website uses a rich text
editor which not only enables styled content, but sanitizes the user's input while preserving its
style.
In this task, you will submit a post with an injected payload that launches XSS attached to an
admin user. Then, you need to steal some information that is only visible to an admin.
Concept Review
Stored XSS is an attack where a website does not store data in a safe manner. An attacker could
then store malicious code within the website's database. Said code could be executed whenever a
user visits that website. So, a post for an admins approval seems like something you will be
interested in. If you can steal the admins login session cookie, you can login as her to see what
she can see.
Recall from the lecture that when a cookie has httpOnly ,it is not exposed to the document object.
That is to say, this cookie is not accessible to JavaScript. What would you need to do to read
information out as the cookies owner?
This httpOnly flag is a good way to prevent JavaScript from reading sensitive cookies. However, it
doesnt mean it can mitigate XSS attacks. Attackers, having malicious scripts running in the
victims browser, are still able to send requests and forward the responses to themselves.
Even though the website is protected by CSRF tokens, attackers can still manage to post
malicious payload pretending to be the user.
Requirements
  1. Exploit the rich text editor to inject another XSS payload. Such payloads should NOT trigger an alert for a successful exploit. Your payload SHOULDset a global variable window.gotYou=true for the autograder to read.
  2. You will steal admins cookies such that you can login as admin to generate your unique hash string. Or, if you cannot steal the session cookie, you need to find a workaround to get the hash still. You will need to use the Message ReceiverEndpoint to receive the stolen **information.
  3. Please DO NOT put any comments in your final code submission.
  4. Please put a semicolon at the end of each statement. Workflow**
  5. Log into the website with your own credentials.
  6. Inspect your session cookie to check if it has httpOnly set. a. If not, an XSS payload can steal it, so you can log into the website as another one. b. If yes, you need to find another way to get the hash.
  1. Create a new post and find the vulnerable point of the editor. The editor has two modes. a. What you see is what you got mode. Try to type in some inputs and see how the editor deals with it. b. Code editing mode. Try to type in some JS code with

    ·【原创】+【高质量】+【诚信】是学霸CS代写坚守的原则, google排名靠前的制胜法宝

    ·【口碑】先交付代码,帮助本机运行无误后再补交余款

    ·【承诺】代码本地run不了,全额退款。

    ·【定价高?】尽管提出,合理范围内肯定能接受