Closed aetasoul closed 5 years ago
Hi,
I guess you let flask handle the request. Flask uses a different template system and doesn't know the tag "module", so you get the "unknown tag" error. You need to let tornado (wssh) handle the request.
Ok, I understand what you mean. But I have never used tornado before and this is the first time that I use Flask.
So, can you help me to implement this request?
I have a file init.py where I create the app object as Flask():
app = Flask(__name__)
After that I have a file called views.py that contains the route to the webssh page.
@app.route('/ssh_modal', methods = ['POST', 'GET'])
def ssh_modal():
return render_template(
'ssh_modal.html'
)
This is the page where I have the button that call the webssh page.
<form action="{{ url_for('ssh_modal') }}" method="POST">
<button class="btn btn-default" type="submit" name="details" value=" {{ ip }}, {{ key }} " href="">SSH Connection</button>
</form>
I have to implement the handle request using tornado in the views.py file?
A simple way is you can use flask to render a page containing an iframe element which renders the webssh page.
Example like this,
@app.route('/ssh_modal', methods = ['GET'])
def ssh_modal():
return render_template(
'ssh_modal.html'
)
ssh_modal.html,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<iframe src="http://webssh-page-url"></iframe>
</body>
</html>
Ok with the iframe is working correctly.
What happends when you press the "Connect" button? Maybe I can implement directly the connection and the terminal to my web application without your page.
I am going to close this issue. If you meet any problem as you continuing your implementation, please open another issue here.
Hi,
I'm trying to implement this web shell to my flask website. I have imported this project into mine.
When I execute the server all load correctly, after that I press the button SSH that call the ssh page (the index.html of this project) and I recive this error:
That is refered to line 61 of index.html:
Removing the
{% module xsrf_form_html() %}
the page load correctly but nothing work about the ssh connection.This is the code that call the page:
Someone know how to solve this please?
Thanks in advance.