See the following GET request headers. I would like some direction regarding forming these GET requests using libcurl in C++.
GET url.aspx?TabID=100000021 HTTP/1.1
Host: url.net
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://url/Login.aspx?BackToStartPage=true
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: erJOJPQYCFBMNUJDDYWOH5; ASP.NET_SessionId=ickaamclvh45; BIGipServer~url~Flexnet-url-Prod.app~url-Prod_pool=rd1o00006a0do80; WebPortalSession=77d0601a4_1; LoginPageCookie=http://url/Login.aspx?CurrentUserLanguageId=1033&CurrentUserTimeZoneId=1129; .ASPXAUTH=92C511D2B670AE9DDC3D55A88BBEF6CAF16FBBF0BFFFB016C20B655BAB1B54428F9C55A8430F806F74211354557A8A918DFD8FE9589BF3F95D0340180E89806C4BDF7813CCD5DC027349F8714B1A319C1E51E8C43
GET url.aspx?TabID=0 HTTP/1.1
Host: url.net
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http:/url.net/Login.aspx?BackToStartPage=true
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: &LGN=MIYDMMBQGUZTS; ASP.NET_SessionId=ickaax45p; url~url~url-url-Prod.app~url-url-Prod_pool=rd1o0000o80; WebPortalSession=77d0601a9_1; LoginPageCookie=http://url.net/Login.aspx?CurrentUserLanguageId=1033&CurrentUserTimeZoneId=1129; .ASPXAUTH=7516499A62192592C485B17AF1D3BDB25DBDE26DF6A1FC179CC3658F3AD1E74E32
Related
I've tried to brute-force a web page that is running behind a reverse proxy. All I have is the username (given) and for passwords -> One of the common passwords in 2022.
When I try to run burp suite, I was unable to even capture the login credentials, this is what I got.
"
GET /main/ HTTP/2
Host: landing.agitated-banzai.xyz
Cache-Control: max-age=0
Authorization: Digest username="duriansandwich", realm="Restricted area", nonce="63ddc119985ff", uri="/main/", response="5da387c460fb0fd84cfd9f599cb198fe", opaque="cdce8a5c95a1427d74df7acbf41c9ce0", qop=auth, nc=00000002, cnonce="aa2dc7750a67681d"
Sec-Ch-Ua: "Chromium";v="105", "Not)A;Brand";v="8"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Linux"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.5195.102 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
"
What is the way about going to solve this?
First URL is presigned. Then with PUT message the gif file is uploaded. Content-Type is set both when presigning and also in PUT message, but in AWS interface gif type is not visible. Why?
PUT request header:
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en,nl;q=0.9,hu;q=0.8,de;q=0.7
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 10912652
Content-Type: image/gif. // <---------------
Host: t44-post-cover.s3.eu-central-1.amazonaws.com
Origin: http://localhost:3000
Pragma: no-cache
Referer: http://localhost:3000/
sec-ch-ua: ".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
x-amz-acl: public-read
If image is uploaded from web interface, gif type is visible.
Content-type is S3 metadata. So to change it, you have to modify the metadata properties of your objects.
I need to send several post requests to my virtual machine. I get examples of packets from pcap file and then modify them to insert my data(I do it because format of data is rather strange). At first, I send an empty post request (variable none) to my server and everything is OK, server responds to me. But then I need to send another post request(variable challenge_responce), but when I do it as the first time, server doesn't responses me.
none = "POST /jsproxy HTTP/1.1
Host: 192.168.37.2
Connection: keep-alive
Content-Length: 0
Pragma: no-cache
Cache-Control: no-cache
Origin: file://
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/44.0.2403.89 Chrome/44.0.2403.89 Safari/537.36
Content-Type: text/plain;charset=UTF-8
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Cookie: username=admin"
challenge_responce = "POST /jsproxy HTTP/1.1
Host: 192.168.37.2
Connection: keep-alive
Content-Length: 117
Pragma: no-cache
Cache-Control: no-cache
Origin: file://
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/44.0.2403.89 Chrome/44.0.2403.89 Safari/537.36
Content-Type: text/plain;charset=UTF-8
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Cookie: username=admin
ДЂДЂДЂДЂДЂДЂДЂ/Rñ±•Â$0[^96“ù¦ĀĀ!##$%^&*()_+:3|~ĀĀĀĀĀĀĀĀ§Ç1&TВЌВЌpMГЇm)[4}(В¤<HГѓ%Гў(Г„Гadmin"
Here is my code:
packet = pcap_next(handle, &header);
Arrcpy(none, ParsePacket(packet, length), 1000);
packet = pcap_next(handle, &header);
Arrcpy(challenge, ParsePacket(packet, length), 1000);
packet = pcap_next(handle, &header);
Arrcpy(challenge_responce, ParsePacket(packet, length), 1000);
boost::asio::ip::tcp::iostream stream("192.168.37.2", "http");
stream << none;
std::string temp;
std::string chPacket;
auto t = stream.rdbuf();
while (std::getline(stream, temp))
chPacket += temp;
auto code = GetChallenge(chPacket);
std::string modChallengeResponce = ModifyChallengeResponce(challenge_responce, length, code, "qazwsx12");
stream << modChallengeResponce;
std::string resq;
while (std::getline(stream, temp))
resq += temp;
std::cout << stream.rdbuf();
How can i fix it?? May be I shoule not use tcp::iostream ??
I'm currently running a Python Flask Application on Amazon Elastic Beanstalk. When I test the application, it all works fine locally (I used Postman to send the GET & POST requests). However, on AWS, it doesn't work because the request that gets to my EC2 instances (behind the load balancer) does not include the Authorization header. It seems like the load balancer strips off the header. Is there something I'm doing wrong here?
Here's a comparison of what I get when I print out the header locally and on Elastic Beanstalk.
Locally
[2017-07-04 13:18:14,650] [INFO] [common.decorators] Headers = Host: localhost:5000
Connection: keep-alive
Content-Length: 151
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Content-Type: application/json
Authorization: Bearer ad9fd4d9-6ce6-497b-855a-dcebebdad65b
Postman-Token: xxxxx
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.8
Elastic Beanstalk:
[2017-07-04 17:27:03,813] [DEBUG] [common.decorators] Headers = Accept-Language: en-US,en;q=0.8
Accept: */*
Host: dev.onetext.com
X-Forwarded-For: 66.30.13.108
Content-Type: application/json
Postman-Token: xxxxx
Connection: keep-alive
Accept-Encoding: gzip, deflate, sdch, br
X-Forwarded-Proto: https
Cache-Control: no-cache
X-Forwarded-Port: 443
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Thanks to the comment added by #notionquest, I found the solution at https://forums.aws.amazon.com/thread.jspa?messageID=729128
I solved this by adding a new file under the .ebextensions folder with the following content:
files:
"/etc/httpd/conf.d/wsgihacks.conf":
mode: "000644"
owner: root
group: root
content: |
WSGIPassAuthorization On
AWS do not accept unserscores (_) in headders, while we can use (-), So Remove underscores from the header variables, example:-
header_var_val = "some value"
replace it with
headervarval = "some value"
It works for me
I'm using cloudfront for a simple javascript asset that is the following:
https://d1syjrf5lltxmn.cloudfront.net/Content/JavaScript/jquery-migrate-1.2.1.min.js
I've got the Origin Domain name and path set to
www.siliconvalley-codecamp.com
Origin type is custom origin, policy i sMatch Viewer, view policy is http and https. Problem is when it hit this (over and over) it keeps returning a 301 and doing another request from my origin server.
I can't figure out why it keeps doing the 301's. I've read others having issues but can not find a solution.
GET https://d1syjrf5lltxmn.cloudfront.net/Content/JavaScript/jquery-migrate- 1.2.1.min.js HTTP/1.1
Host: d1syjrf5lltxmn.cloudfront.net
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36
DNT: 1
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
and the return is:
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Content-Length: 208
Connection: keep-alive
Location: https://www.siliconvalley-codecamp.com/Content/JavaScript/jquery-migrate-1.2.1.min.js
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Fri, 23 Jan 2015 04:18:21 GMT
Age: 10575
X-Cache: Hit from cloudfront
Via: 1.1 f86dab587205f74a0e6f36b42207dec2.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 8h4R0WTOl1wg8LDafMoeAkcvOr1G8ujfAVMgz84Uy_BVE8QlxTbTrQ==
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found here</body>
Origin server setup: