2020-04-29 20:41:51 -04:00
|
|
|
---
|
|
|
|
id: 5ea9997bbec2e9bc47e94db3
|
|
|
|
title: Developing a Banner Grabber
|
|
|
|
challengeType: 11
|
|
|
|
videoId: CeGW761BIsA
|
2021-10-01 12:24:12 +08:00
|
|
|
bilibiliIds:
|
|
|
|
aid: 633014533
|
|
|
|
bvid: BV1Sb4y127H9
|
|
|
|
cid: 409036288
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: developing-a-banner-grabber
|
2020-04-29 20:41:51 -04:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --question--
|
|
|
|
|
|
|
|
## --text--
|
|
|
|
|
|
|
|
Fill in the blanks to complete the `banner` function below:
|
|
|
|
|
|
|
|
```py
|
|
|
|
def banner(ip, port):
|
|
|
|
s = socket.socket()
|
|
|
|
s.__A__((ip, __B__))
|
|
|
|
print(s.recv(1024))
|
2020-04-29 20:41:51 -04:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --answers--
|
|
|
|
|
|
|
|
A: `connect`
|
|
|
|
|
|
|
|
B: `port`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
A: `getsockname`
|
|
|
|
|
|
|
|
B: `'1-1024'`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
A: `connect`
|
|
|
|
|
|
|
|
B: `int(port)`
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
3
|
2020-04-29 20:41:51 -04:00
|
|
|
|