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

learn more… | top users | synonyms

43
votes
1answer
5k views

I have the ability to run arbitrary Python code on the 'apache' user. What damage can I do?

So, due to bad programming on the part of one of my former colleagues, one of our internal web apps allows the user to upload and run an arbitrary Python file. This recently came to light via an ...
31
votes
2answers
10k views

Does bcrypt have a maximum password length?

I was messing around with bcrypt today and noticed something: hashpw('testtdsdddddddddddddddddddddddddddddddddddddddddddddddsddddddddddddddddd', salt) Output: '$2a$15$jQYbLa5m0PIo7eZ6MGCzr....
18
votes
2answers
2k views

Are python's popen (and similar) functions affected by Shellshock?

Basically which python's functions trigger bash (and might be impacted by shellshock), and which don't ? I have come up with this question by seeing in some scripts the popen() function. My question ...
10
votes
1answer
5k views

Django SECRET_KEY security, how are methods more secure

I am nearing a point where I will deploy my Django application to the hostile environment otherwise known as "the internet" and I'm trying to better understand the ramifications of the Django ...
7
votes
1answer
1k views

Reconstructing bittorrent data from PCAP

I am doing a CTF flag for my school project with a PCAP flag based on this CTF write-up: eindbazen.net - Plaid CTF 2012 - Torrent I setup a local torrent file containing an .mp3 (the audio is my flag'...
6
votes
1answer
343 views

What are the pros and cons of using sha256 to hash a password before passing it to bcrypt?

My apologies if this has already been asked. I recently became aware of the fact that bcrypt truncates passwords to 72 characters. Practically speaking my intuition is that this does not pose any ...
5
votes
2answers
2k views

MongoDB Nosql injection in python code

Here is the code snippet for accessing to MongoDB. client = MongoClient() db = client.test_database collection = db.test # Get data from fields condition = form.getvalue('name') if condition: ...
5
votes
1answer
435 views

How to to make a file private by securing the url that only authenticated users can see

I was wondering if there is a way to secure an image or a file to be hidden when it is not authenticated. Suppose there is an image in my website which can only be seen if that user is authenticated. ...
5
votes
2answers
857 views

How to implement client side encryption for CalDav & CardDav content?

I'm looking for a client-side encryption implementation that would be able to secure CardDav & CalDav data so that they couldn't be compromised even by the hosting provider. Server side: PHP or ...
5
votes
4answers
457 views

Best way to store/retrieve sensitive key files?

We have our web servers running in AWS EC2. We have about 30 API Keys/passwords/etc (sensitive data) which is set in the environment for our app to use. Whenever we deploy, we start a new server ...
4
votes
1answer
2k views

Hiding backdoors in Open Source code in other languages than C and C++?

I am referring to The Underhanded C Contest and Hiding Backdoors in plain sight. They demonstrate, that you can with some cleverness, write Open Source code, publish the code and hide a backdoor in ...
4
votes
1answer
2k views

Using client certificates for website authentication

I was wondering if there currently exists a Content Management System that supports PKI and client certificates for website authentication instead of username/passwords. If not, what's a good place to ...
4
votes
2answers
63 views

Can you block command line prompt but allow Python?

I want to block users for using the command prompt, but I also want to allow them to use Python. However, Python has the os module which users can use to execute commands, like: >>> import ...
4
votes
1answer
87 views

Unable to get correct base for cracking Crypt3 SHA-512 on Linux with Python

I am reading a book and it gives me a simple Python script to crack /etc/shadow passwords that were encrypted with the crypt() function. It then challenges you to amend the Python program to work with ...
4
votes
1answer
97 views

How should I start security testing of python standalone application?

I'm looking for an answer specific to Windows/Linux standalone applications, for instance Dropbox has Windows Application written purely (I think so) in python, What steps should I follow? What are ...
4
votes
1answer
111 views

How do I use a directory of YARA files?

I'm going through the Malware Cookbook PEScanner and they want a path to my YARA files to search on. I currently have a directory full of YARA rules for known pieces of malware. What would be the ...
4
votes
1answer
415 views

Secure Connection between two mobile (Android and/or iOS) devices

I've a Device A which will communicate with multiple devices on a network (BLE and/or NFC). All the devices will be handled a Token upon authentication which somehow needs to be transferred over to ...
4
votes
5answers
537 views

A secure way to encrypt a connection between 2 clients securing against both passive and active adversaries

Recently I got interested in encryption and the methods behind them. So for a fun / school project I am building a program in python to encrypt data between two clients (chat and files). I'm just ...
3
votes
1answer
45 views

Are there any risks to matching user-supplied regex against user-supplied inputs?

I have an IRC bot written in python3 that parses user requests for search and replace. Is there any risk of DoS or other attack by doing this?
3
votes
1answer
96 views

Is recursively encrypting files inside containers of increasingly stronger or equivalent algorithm encryption worth it?

I'm wondering if inserting a container within a container based approach like a recursive TrueCrypt or VeraCrypt container would provide a more secure protection against brute force attacks, I/O ...
3
votes
1answer
52 views

Question about email app in Python and security

I've managed to get my tiny little app to send an email with a click of a button using this code (this is just the email part): http://pastebin.com/nR5g28ct But to avoid some error, I had to allow ...
3
votes
2answers
479 views

Python security hardening

I’m working for a large organization which is using some Windows products that require python to work. Python is used to execute built in utility scripts and the user never recognizes that python is ...
3
votes
2answers
4k views

buffer overflow in python script

I am developing a script to perform an a buffer overflow for an assignment in school. However, I am stuck at a point where my payload works injected through the commandline, but not injected through ...
3
votes
1answer
85 views

Sending a token with a request from one app to another

Say I have an application written in some language and framework (Python + flask, for instance), and have a great deal of the functionality requiring login, and authentication via JWT. Now I want to ...
3
votes
1answer
798 views

Python implementation of AES and SHA256/512 that are FIPS-140-2 validated?

For security purposes I need to use AES encryption and SHA256/512 in my Django/Python project. I know there are various libraries out there that provide different encryption methods but I can't seem ...
3
votes
1answer
350 views

Protecting <a href='{{ my_model.some_url }}'> in Django

In my Django template, I have a link like this: <a href='{{ my_model.some_url }}'> The some_url bit is a Django URLField that a user can influence. Can this be exploited in any way? (What ...
3
votes
1answer
1k views

SQLMap: How to test JavaScript generated field names?

I have a pretty simple HTML page that submits a username and password to the server via POST method: <doctype html> <head> <title>SQLMap dynamic parameters</title> </...
3
votes
1answer
1k views

Study roadmap to write a crypter / backdoor

Recently I came across a site called SecurityTube.net, which has a ton of amazing security stuff. I'm following their Python Scripting Expert videos which are totally worth it. I also came across the ...
3
votes
1answer
77 views

What are some vulnerabilities of environment variables (on any platform)?

I am writing a small cross platform Python application (a package manager to be used internally by my corp), and I'm thinking of using something similar to this answer on Stack Overflow to check for ...
3
votes
1answer
70 views

OS fingerprinting [closed]

I have been asked to write a small tool that detects the running OS on a victim device. The tool should be able to fingerprint Linux versus Android versus iOS. Extra credit for version info. It needs ...
3
votes
1answer
3k views

Why does the tool 'codesign' in OS X 10.11 (El Capitan) report every Python process as “code object is not signed at all”?

If you start any Python process on OS X 10.11 (10.11.0 or 10.11.1) El Capitan, and run the OS built-in tool 'codesign' to verify the process, you will receive an error saying "code object is not ...
3
votes
2answers
139 views

Securely saving credentials for later plain-text authentication

I am developing a Django application where a user logs in with Kerberos, and then has accesses to a number of internal applications. One of these is a file application that connects to a server over ...
3
votes
1answer
143 views

Double socket connection

I'm busy experimenting with TCP socket connnections. I have made a client SOCK_STREAM socket andi've got a few questions: Is there any way that a streaming(TCP) socket can get data from another ...
3
votes
2answers
848 views

Principal DOM Based XSS detect using python

I am working for a project make a XSS scan tool using python. I have a sample url: http://www.foo.bar/index.php?ids=111 I've found that it has a vulnerability by http://www.foo.bar/index.php?ids=">...
3
votes
3answers
2k views

Proper Linux user authentication through PAM aware applications

Currently I'm building an authentication system using Linux PAM for a python daemon process. It will need to authenticate remote users from a variety of front-ends against the local user list. (...
2
votes
2answers
749 views

Can clients execute my python CGI at will?

I have a site where the main database is interacted with via python scripts located in public_html\cgi-bin\. To run commands, various JavaScript scripts, located in \public_html\scripts\, use jQuery ...
2
votes
2answers
1k views

Python exploit question?

Can someone please explain how and why this struct.pack code is used in the below exploit? I'm trying to understand how it triggers the vulnerability. I understand the buffer overflow aspect, I'm ...
2
votes
2answers
150 views

Running untrusted Python code

I have a small OpenWRT router, on which I wish to run a daemon which is a python script. However, even though it is open-source and plain Python, I still don't trust it and I would like to isolate it ...
2
votes
2answers
5k views

Create netcat listener and execute reverse shell in the same script

I'm coding an exploit in python that exploits a command injection vulnerability for a CTF and I'm wondering how could I start a netcat listener and then send the payload to the remote host and once ...
2
votes
1answer
573 views

Unusual design aspects of AWS HMAC-based authentication, v4

I am designing a RESTful API in python. I want to use HMAC authentication. I could not find any suitable HMAC libraries, so I am rolling my own. However I want to use a well-known standard such as AWS ...
2
votes
2answers
934 views

PyCrypto Possible To Check If File Already AES Encrypted?

import os, random, struct from Crypto.Cipher import AES def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): """ Encrypts a file using AES (CBC mode) with the given ...
2
votes
1answer
842 views

Maltego transform samples

I'm playing around with Maltego for target recon and investigation, and have started writing my own transforms in Python. Unfortunately, the current developer documentation is a little light on ...
2
votes
1answer
109 views

How to fuzz service with sending bad data?

I am reading a post about fuzzer in Python, here is the code: # Import the required modulees the script will leverage # This lets us use the functions in the modules instead of writing the code from ...
2
votes
1answer
164 views

After having confirmed a computer is infected by a Botnet.

And having found a server IP that is controlling it. How can I find out the log-in credentials this client uses to log in to a IRC channel / server webpage / control panel. I have found out a python ...
2
votes
0answers
80 views

Any vulnerability in .net implementation for C# object.GetHashCode?

I've already asked this question on SO, but I think that this forum is more appropriate to discuss security issues. My point is that most OO languages has a way to get a unique hash code for an ...
2
votes
0answers
174 views

Assembly decoder with jmp-pop-call technique

This is a part of code in which I cannot figure out the mistake. I am using the jmp-pop-call technique and what I get is "Segmentation Fault". Tried to use GDB but things are really vague. Each byte ...
2
votes
0answers
135 views

Scapy capturing Dot11 headers windows

Is it at all possible to capture Dot11 headers under Scapy in Windows? I'm thinking Winpcap, but I'm not sure how I'm supposed to do that. Any clues?
1
vote
2answers
425 views

Is this sanitizer vulnerable to XSS?

To have a simple and secure editor for text fields of a django app, I have this snippet to sanitize input html into django code: from bs4 import BeautifulSoup def sanitize_html(value): ...
1
vote
2answers
175 views

Security concerns with user Python scripts

I am generating dynamic images in a web service. The current setup is: Request image.py image.py does a database lookup to determine what data to use to generate the image image.py calls a sub-...
1
vote
2answers
88 views

Does this method of password confirmation risk encrypted file integrity?

I'm trying to make a basic encryption/decryption script for personal use, and it works perfectly fine. I'm posting this in the infosec section because my question revolves around how easy it is to ...