Part 2
nmap 10.10.124.121
wireshark
ping PC to VM
pip3 install flask
nano sample_app.py
from flask import Flask
from flask import request
sample = Flask(__name__)
@sample.route("/")
def main():
return "You are calling me from " + request.remote_addr + "\n"
if _name_ == "__main__":
sample.run(host="0.0.0.0", port=8080)
[ctl + o to save; check name press enter]
[ctl + x to Exit]
python3 sample_app.py
http://0.0.0.0:8080/
open new terminal nmap IP ADDRESS
curl http://0.0.0.0:8080
_________________________________________
cd Desktop
touch user-input.sh
ls
nano user-input.sh
#!/bin/bash
echo -n "Enter Your Name: "
read userName
echo "Yourname is $userName."
bash user-input.sh
ls -l user-input.sh
chmod a+x user-input.sh [To make a file executable for all users]
ls -l user-input.sh
[rwxr-xr-x] owner-group-user
mv user-input.sh user-input
./user-input
___________
0 Comments