NEKO

关于一些乱七八糟的毛病

2017/12/27

requests模块出毛病+nat主机ping不通虚拟机

真是醉了
晚自习的时候requests用的还好好的,回到宿舍,就:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
C:\Anaconda3\python.exe C:/Users/kuraraneko/Documents/python代码/test.py
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\util\connection.py", line 83, in create_connection
raise err
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Anaconda3\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Anaconda3\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Anaconda3\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Anaconda3\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "C:\Anaconda3\lib\http\client.py", line 964, in send
self.connect()
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 166, in connect
conn = self._new_conn()
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x00000244EF01D358>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\requests\adapters.py", line 438, in send
timeout=timeout
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Anaconda3\lib\site-packages\requests\packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=34770): Max retries exceeded with url: http://www.baidu.com/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x00000244EF01D358>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/kuraraneko/Documents/python代码/test.py", line 46, in <module>
r=requests.get(url)
File "C:\Anaconda3\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Anaconda3\lib\site-packages\requests\sessions.py", line 518, in request
resp = self.send(prep, **send_kwargs)
File "C:\Anaconda3\lib\site-packages\requests\sessions.py", line 639, in send
r = adapter.send(request, **kwargs)
File "C:\Anaconda3\lib\site-packages\requests\adapters.py", line 500, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=34770): Max retries exceeded with url: http://www.baidu.com/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x00000244EF01D358>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)))

Process finished with exit code 1

这都tm是啥
我记得我似乎使用过360网络急救箱

w(゚Д゚)w

解决方法:
1.

1
2
3
4
5
6
7
8
import requests
proxies = {
"http": None,
"https": None,
}
url='http://www.baidu.com'
r=requests.get(url,proxies=proxies)
print(r.text)

2.w10下,打开网络共享中心->Internet选项->连接->局域网设置->
把代理服务器关了(但连宽带时点上面那个设置)

然而我打算玩下pentesterlab的时候发现主机连不上,然后我发现主机ping不通我的虚拟机了,(nat模式),fuck。

解决方法:
打开网络共享中心->更改适配器设置->VMware Network Adapter VMnet8->属性->…(TCP/IPV4)->属性->选择自动获得IP地址

vmmare无法使用一些ova虚拟机

更改ova后缀名为zip,解压.

1
2
3
4
E:\vmmare>vmware-vdiskmanager.exe -r C:\Users\kuraraneko\Desktop\Freshly\Freshly-disk1.vmdk -t 0 C:\Users\kuraraneko\Desktop\Freshly\freshly.vmdk
Creating disk 'C:\Users\kuraraneko\Desktop\Freshly\freshly.vmdk'
Convert: 100% done.
Virtual disk conversion successful.

-t的参数为0-3
文件夹中会出现一个新的freshly.vmdk
从别的vmware虚拟机镜像中复制来一个vmx文件,用vmware打开这个vmx文件,然后重定位vmdk文件尾当前的freshly.vmdk. over

w10下python3的flask,django爆unicode错误

18/8/9
今天终于解决了困扰我好久的问题,w10下py2跑flask没问题,但py3跑flask就爆unicode错误,py2、py3跑django都不行.结果是因为计算机名字里有中文,窒息.

原文作者: n3k0

发表日期: December 27th 2017, 11:24:17

发出嘶吼: 没有魔夜2玩我要死了

CATALOG
  1. 1. requests模块出毛病+nat主机ping不通虚拟机
  2. 2. vmmare无法使用一些ova虚拟机
  3. 3. w10下python3的flask,django爆unicode错误