2020-08-13 12:00:20 +02:00
|
|
|
---
|
|
|
|
id: 5ea9997bbec2e9bc47e94db3
|
|
|
|
challengeType: 11
|
|
|
|
videoId: CeGW761BIsA
|
|
|
|
---
|
|
|
|
|
2020-12-16 00:37:30 -07: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-08-13 12:00:20 +02:00
|
|
|
```
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
## --answers--
|
|
|
|
|
|
|
|
A: `connect`
|
|
|
|
|
|
|
|
B: `port`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
A: `getsockname`
|
|
|
|
|
|
|
|
B: `'1-1024'`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
A: `connect`
|
|
|
|
|
|
|
|
B: `int(port)`
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
|
|
|
|
# --solutions--
|
2020-08-13 12:00:20 +02:00
|
|
|
|