Skip to content

Instantly share code, notes, and snippets.

View YashIndane's full-sized avatar
💻
Integrating technologies </>

Yash Indane YashIndane

💻
Integrating technologies </>
View GitHub Profile
import requests
#this also works
#mul = requests.get("http://<ip>/cgi-bin/mul.py?a=3&b=8")
mul = requests.get(
"http://<ip>/cgi-bin/mul.py",
params = [
('a', 3),
('b', 8)
@YashIndane
YashIndane / cgiwebpage.html
Created September 17, 2021 06:48
HTML page for cgi demonstration
<html>
<head>
<title>CGI DEMO</title>
</head>
<body>
<form action="http://<ip>/cgi-bin/cgicode.py">
<p>Type your command</p></br>
@YashIndane
YashIndane / cgicode.py
Created September 9, 2021 09:33
This is a sample code on how to receive data from a form (HTML). The `name` has the command and that is run and output is printed along with status.
#!/usr/bin/python3
import cgi
import subprocess
print('content-type:text/html')
print()
form_values = cgi.FieldStorage()