Python Web Call Error

Asked 2 years ago, Updated 2 years ago, 17 views

Hello, I am studying a book called Introduction to Python Hacking. I have to make a web call to create a password cracking program, but the web call is getting an error. I wrote the code exactly as it came out of the book, but there is an error. Python version is 2.7.6. The url used for the call was opened by me using APM and WordPress. When you enter the address, the screen appears normally.

Web Call Code ->

import urllib

import urllib2

url = "http://server/wordpress/wp-login.php"

values = {'log': 'python', 'pwd': 'python1'}
headers = {'User-Agent': 'Mozilla/4.0(compatible;MISE 5.5; Windows NT)'}
data = urllib.urlencode(values)

request = urllib2.Request(url, data, headers)
response = urllib2.urlopen(request)

print "#URL:%s" % response.geturl()
print "#CODE:%s" % response.getcode() print "#INFO:%s" % response.info() print "#DATA:%s" % response.read()

And this is the error. ->

Traceback (most recent call last): File "C:\Users\adg68\Desktop\Seoyeongu\Document\IT Related Information Set\Python Hacking Introduction Book\Python Hacking Introduction Example\Example6-5 Web Page Call Examplepy", line 11, in response = urllib2.urlopen(request) File "C:\Python27\lib\urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout) File "C:\Python27\lib\urllib2.py", line 404, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 422, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 382, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 1214, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1184, in do_open raise URLError(err) URLError:urlopenerror [Errno10060] Connection failed because there was no response from the connected member, or

Error code URLError:urlopenerror [Errno10060] Connection failed because there was no response from the connected member, or

In this part, <> was not input, so it was written like that, but it was originally URLError:<~~>.

python

2022-09-21 23:06

1 Answers

The error message is not a valid url, so there is no response.

http://server/wordpress/wp-login.php There is no such address.

Of course, you should change it to the correct address and proceed with the test.

In addition, the ID and password should be changed to accessible.

Looking at the example of the book, it's more of a brute attack than a crack.

So it's a random substitution. Nowadays, websites do not work because they lock their accounts themselves or notify users of mail if they make a set number of mistakes in a row.

This is an example of a simple http handling degree.


2022-09-21 23:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.