Questions tagged [python]

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

Originally released in 1991, Python is a multi-paradigm programming language. Object-oriented programming and structured programming are fully supported, and many of its features support functional programming and aspect-oriented programming.

An important goal of Python's developers is keeping it fun to use. This is reflected in the language's name—a tribute to the British comedy group Monty Python—and in occasionally playful approaches to tutorials and reference materials, such as examples that refer to spam and eggs (from a famous Monty Python sketch) instead of the standard foo and bar.

Most Python implementations (including CPython) include a read–eval–print loop (REPL), permitting them to function as a command line interpreter for which the user enters statements sequentially and receives results immediately.

The language's core philosophy is summarized in the document The Zen of Python (PEP 20), which includes aphorisms such as:

  • Explicit is better than implicit
  • Simple is better than complex
  • Complex is better than complicated
  • Readability counts

Questions with this tag should relate to or include the Python programming language.


Sources:

411 questions
6
votes
2 answers

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 os >>> os.popen("command to be run eg start "C:/") How can…
AlexanderRD
  • 163
  • 4
3
votes
2 answers

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 from the user and is only being decoded after it…
J. Doe
  • 31
  • 2
2
votes
2 answers

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 from the rest of the system as much as possible.…
matega
  • 379
  • 1
  • 8
2
votes
1 answer

Is there a service that checks PYPI packages?

Knowing that some pypi packages have a history of being malicious, like libpeshnx, libpesh, and libari. Is there some website/service that labels packages as secure or not? for example: node's npm advisores https://www.npmjs.com/advisories if not,…
2
votes
2 answers

Most Secure Way to Install Python on Windows 10

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, WinPython, Miniconda or Anaconda, etc (for…
J. A.
  • 87
  • 1
  • 4
1
vote
0 answers

How does setup.py evaluate a try: except?

I'm experimenting with setup.py inside a vulnerable VM that's running a pypi server with a listener on localhost:PORT My current account does not have write access to the following file : /path/to/a/protected/file What i do have access to, are the…
Segfault
  • 11
  • 2
1
vote
0 answers

MS08-067 not working as expected

I am somewhat new to this and trying to figure out why my program isn't executing as expected. I ran it a number of times with 1 time being completed successfully but not allowing me to connect to the victims machine. I am running the following…
newbieflow
  • 11
  • 2
1
vote
2 answers

Python notebooks and sharing

I'm a beginner when it comes to programming or servers. I installed Python (programming language) as well as Jupyter notebook as part of an online course project. After installation, I was simply following instructions and typed "jupyter notebook"…
1
vote
1 answer

How Can I remove the metadatas of a .py file?

I feel me embarrassed for ask this question, but I've never had a problem like that, I can't remove the metadatas of a Python File. First I've tried with the simple tool of Windows but I didn't get nothing, even when I click "Select All the Items",…
user82937
0
votes
1 answer

clkhash - why is secret secret?

The documentation for clkhash (https://clkhash.readthedocs.io/en/stable/tutorial_api.html) states that "knowledge of this secret is sufficient to reconstruct the PII information from a CLK". My question is, how is that possible, considering that…
0
votes
1 answer

I mistyped a `pip install` command. Could my system have been compromised?

While working on packaging my Python app, I attempted to install it locally from the parent directory by typing the following command: pip install cms/ However, I instead typed the following command: pip install cms Which unintentionally installed…
Jaap Joris Vens
  • 605
  • 5
  • 13
0
votes
1 answer

Spoofing UDP checksum using scapy

I'm trying to play with a security tool using scapy to spoof ASCII characters in a UDP checksum. I can do it, but only when I hardcode the bytes in Hex notation. But I can't convert the ASCII string word into binary notation. This works to send the…
Robert
  • 33
  • 2
  • 6
-2
votes
2 answers

Python 2 or 3 for offensive security?

I have decided to set my sights on the OSCP Certification and, after reading multiple reviews I've decided to take Abraham's advice to heart and sharpen my axe. I have experience with Shell scripting, PHP and Perl, but no experience with Python or…
DKNUCKLES
  • 9,237
  • 2
  • 38
  • 49
-3
votes
1 answer

Timsort python exploit

Is there an exploit for this bug for python's sort implementation? http://envisage-project.eu/proving-android-java-and-python-sorting-algorithm-is-broken-and-how-to-fix-it/
Smit Johnth
  • 1,781
  • 4
  • 17
  • 26
-3
votes
1 answer

How long would this take to hack

Messing around in python3 and i am wondering how safe/ how long would this take to hack/crack? code Here output when password is "admin" and hash amount is 100 Paste bin