Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

-1
votes
0answers
34 views

Develop my own SCA/DCA tools for Android testing [on hold]

I want to develop my final year project on automation tool in Python for Android testing both SCA & DCA. But don't know where or how to start. Can someone help? CLI application will work for me. ...
0
votes
0answers
52 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
63 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
137 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
21 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
76 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
26 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
23 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 ...
0
votes
0answers
42 views

Need to install Python on work computers to compile into .exe [migrated]

I developed a Python script that will run offline when needed (only for ~5 min/day) and handle some PHI. I wrote the script on a Mac and have been running it using Atom. I need to get the program on ...
0
votes
0answers
30 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
169 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
27 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
90 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
61 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
297 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
63 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
63 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
33 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
91 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
41 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
51 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
52 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
82 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 ...
1
vote
2answers
54 views

Check uploaded python script for security issues before running it

I would be allowing a user to upload Python scripts and would execute them on my server. The base application is in Java and I am using ProcessBuilder to get Python to run from my Java application. ...
-1
votes
2answers
118 views

Testing RCE and SSRF using Python SimpleHTTPServer [closed]

Is it possible to test RCE and SSRF vulnerabilities using Python SimpleHTTPServer? Or should I use a VPS server?
0
votes
1answer
116 views

Analyzing Apache log with Snort

I need to analyze an Apache log with Snort and others IDS/WAFs (Suricata, mod_security and Shadow Daemon). In order to do so, I was thinking about create TCP packets with the GET and POST requests ...
0
votes
0answers
58 views

python-gnupg sign & verify a tar archive

I am using python-gpg to sign / encrypt / verify / decrypt a tar archive. code snippet - # import private key into gnupghome _pvtKey = urllib2.urlopen(_certurl) _pv_data = _pvtKey.read() gpg....
0
votes
0answers
145 views

How to use binary search for blind SQL injection queries

From what I read online, it's possible to apply binary search to exploit blind SQL injection vulnerabilities, and that is probably what tools like sqlmap use to lower the number of queries that need ...
1
vote
2answers
259 views

Linux command to wipe files on an SD Card?

Are there any commands, tools or python libraries to securely wipe specific files from an SD or micro SD card (devices that use flash memory)? For example, with a regular magnetic hard drive, you can ...
0
votes
1answer
245 views

Why do OpenSSL and Python return different SSL fingerprints?

I use getmail, a tool written in Python, to retrieve my mail via IMAP. Today it suddenly stopped working because it complains about an SSL fingerprint mismatch. (I always specify the fingerprint to ...
2
votes
2answers
232 views

Protecting Python source code on physical product?

How would you protect Python source code on a physical product (like a IoT device), which comes with Ubuntu installed on a mini-PC running Python code? Few methods we thought about: Compiling the ...
0
votes
1answer
248 views

How to avoid XML vulnerabilities in Python?

I am writing a suite of Python 3 applications (including first a command line utility, second an HTTP(S) proxy) which deal with XML. Today I've discovered that there are several vulnerabilities ...
2
votes
1answer
187 views

Is it as safe to use a programming language as a browser? [closed]

To browse the internet on sensitive websites (government websites, banks, etc...), is it as safe to use a modern web browser as a programming language? Specifically, python + requests + beautifulSoup ...
1
vote
1answer
174 views

Developing MIPS exploit in python memory address getting parse as a value [closed]

I am trying to develop an exploit in python. but I am not able to write an proper exploit. Below are the scenarios were i am facing problem. below is the HTTP request which occurs the crash POST /...
3
votes
1answer
472 views

Python - ctypes.cast function call outputs Segmentation Fault error message

Background: Writing a proof of concept of a twitter C&C inspired by Prof Viviek of SPSE similiar to twittor and the project includes a functionality of injecting shellcode and executing it ...
1
vote
1answer
83 views

Fuzzing: Quickly find the exact number of bytes

I'm currently practicing buffer overflow. And I have a question for you regarding fuzzing. I am able to develop a python script that will try several buffer sizes to crash an application. It works ...
0
votes
2answers
154 views

Security-wise, is an in-browser JavaScript implementation fundamentally different from a server-side language (e.g. Python) implementation?

As I understand it, JavaScript implementations running in browsers need to run untrusted code and operate on untrusted data in a secure manner. Language (e.g. Python) implementations running on a ...
4
votes
3answers
607 views

Safely load a pickle file?

In our Python app, we are using pickle.load to load a file named perceptron.pkl. A HP Fortify static scan raises a high vulnerability, "Dynamic Code Evaluation - Unsafe Pickle Deserialization", at the ...
0
votes
0answers
43 views

Are giant shell scripts ideal for the governance of a git repository?

The link below has the repository for a giant shell script that uses pgp keys to validate users ands that is supposed to: Issue digital value tokens - Create, sign, and enforce contracts - ...
0
votes
2answers
297 views

Dictionary Attack on SHA-1 hashes [closed]

The following is a Python code to crack SHA1 hash. This code does not seem to work. import hashlib # plug in the hash that needs to be cracked hash_to_crack = "...
1
vote
1answer
264 views

How to best hash patient names to generate a pseudonym?

I am working on a data acquisition and preprocessing tool for a brain tumor database. The tool preprocesses the data and harmonizes it so it can be united in a one big database. Due to privacy ...
2
votes
1answer
520 views

stdin does not wait for next input after ROP chain

I was trying to exploit a vulnerability in a ctf but I can not make fgets() reopen stdin to put my second stage ROP chain. I am using pwntool but the problem is more socket oriented. I recreated ...
0
votes
2answers
131 views

Is it secure not to set a user in django admin?

Is it possible for someone to hack into my django admin app, if I do not create a user for it, by executing: python manage.py createsuperuser For example, is there a default username-password pair ...
2
votes
1answer
154 views

Is it safe to download an HTML file on an unknown website using something like Python's urllib.urlretrieve?

I know that some sites can infect you with malware just from visiting them. Is this because they run JavaScript in your browser? So would merely downloading the HTML and not running its JavaScript be ...
1
vote
1answer
64 views

Verification of Python(x,y) installer

I'm an Aerospace Engineer just starting out in my field, I'm planning to start using Python, but I've run into a bit of a conundrum. I downloaded Python(x,y)-2.7.10.0.exe Windows installer from here (...
0
votes
1answer
70 views

Encrypt a file in the server and decrypt it in the client without risking the user accessing it?

How can I send an encrypted file from a server to a client, encrypt and use it in the client without risking the user to access it? I saw an answer where the server saved a file in its memory, and ...
2
votes
2answers
79 views

Does opening an arbitrary file in a language (such as Python) pose a security risk?

For example, if a client submits a file to a server, and the server opens the file in read-mode with Python: with open(uploaded_file, "r") as f: # Do something Could the act of opening a file be ...
1
vote
1answer
103 views

Why request and response calls in my burp suite python plugin come in such random order?

So I am trying to write this burp plugin using jython and python for burp suite. Now in the processHttpMessage body, I found before a proper execution of the entire method takes place for one request ...
3
votes
2answers
127 views

What are the implications of making Djangos SECRET_KEY public?

I know the SECRET_KEY for a website made in Django. The owner of the site has accidentally made the settings.py public. What are the implications of making SECRET_KEY public? How can someone use ...
1
vote
1answer
81 views

Best way to secure local REST server?

Currently I have a raspberry pi connected to my home security system. I have written a Python daemon running a HTTP server (very insecure I know, but this is still under construction) so I can send it ...