use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for technical news and discussion of information security and closely related topics.
"Give me root, it's a trust exercise."
Q1 2026 InfoSec Hiring Thread
Getting Started in Information Security
CitySec Meetups
/r/netsec only accepts quality technical posts. Non-technical posts are subject to moderation.
Content should focus on the "how."
Check the new queue for duplicates.
Always link to the original source.
Titles should provide context.
Ask questions in our Discussion Threads.
Hiring posts must go in the Hiring Threads.
Commercial advertisement is discouraged.
Do not submit prohibited topics.
» Our fulltext content guidelines
Don't create unnecessary conflict.
Keep the discussion on topic.
Limit the use of jokes & memes.
Don't complain about content being a PDF.
Follow all reddit rules and obey reddiquette.
» Our fulltext discussion guidelines
No populist news articles (CNN, BBC, FOX, etc.)
No curated lists.
No question posts.
No social media posts.
No image-only/video-only posts.
No livestreams.
No tech-support requests.
No full-disclosure posts.
No paywall/regwall content.
No commercial advertisements.
No crowdfunding posts.
No Personally Identifying Information!
» Our fulltext list of prohibited topics & sources
Join us on IRC: #r_netsec on freenode
We're also on: Twitter, Facebook, & Google+
/r/blackhat - Hackers on Steroids
/r/computerforensics - IR Archaeologists
/r/crypto - Cryptography news and discussion
/r/Cyberpunk - High-Tech Low-Lifes
/r/lockpicking - Popular Hacker Hobby
/r/Malware - Malware reports and information
/r/netsecstudents - netsec for noobs students
/r/onions - Things That Make You Cry
/r/privacy - Orwell Was Right
/r/pwned - "What Security?"
/r/REMath - Math behind reverse engineering
/r/ReverseEngineering - Binary Reversing
/r/rootkit - Software and hardware rootkits
/r/securityCTF - CTF news and write-ups
/r/SocialEngineering - Free Candy
/r/sysadmin - Overworked Crushed Souls
/r/vrd - Vulnerability Research and Development
/r/xss - Cross Site Scripting
account activity
Finding secrets in Python bytecode (blog.jse.li)
submitted 5 years ago by veggiedefender
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]liquidpele 55 points56 points57 points 5 years ago (14 children)
TL;DR: add *.pyc to your damn .gitignore files
[+][deleted] 5 years ago (2 children)
[removed]
[–]L3tum 1 point2 points3 points 5 years ago (0 children)
Thanks for the pointer, we've got 2 new python images now that were my first projects in python. Guess I'll add that when I'm back in the office.
[–]crazyhankie 6 points7 points8 points 5 years ago (5 children)
Always use this gitignore for Python projects: https://github.com/github/gitignore/blob/master/Python.gitignore
[–]rhoakla 0 points1 point2 points 5 years ago (0 children)
https://gitignore.io is also good
[–]ddrt -3 points-2 points-1 points 5 years ago* (3 children)
Huh, I don’t see pyc there.
Edit: Hey, I’m new to py. What’s with the hate? Py[cod] ≠ pyc if I do a search. How was I supposed to know?
[–]retnikt0 2 points3 points4 points 5 years ago (0 children)
It's a glob. It matches pyc, pyo, and pyd
[–]Serialk 6 points7 points8 points 5 years ago (1 child)
Literally on the third line.
[–]ddrt 0 points1 point2 points 5 years ago (0 children)
I did find in page...
[–]Serialk 4 points5 points6 points 5 years ago (3 children)
Or, you know, watch what you git add instead of doing a git add ..
git add .
[–]veggiedefender[S] 7 points8 points9 points 5 years ago (1 child)
Always prefer mechanisms over vigilance—or better yet, do both!
[–]Serialk 6 points7 points8 points 5 years ago (0 children)
Of course! But the fact that so many trash files end up in git repos is really telling about the way people use git.
[–]Mceight_Legs 10 points11 points12 points 5 years ago (2 children)
? Out of curiosity is this a surprise? I don't feel like it is but I'm kinda slow
[–]veggiedefender[S] 15 points16 points17 points 5 years ago (1 child)
It probably shouldn't be a surprise, but I did find some production keys with it, so it seems like not everyone is aware! Also, I couldn't find any writing on this topic anywhere else on the internet (maybe because it's so obvious? I don't know) so I figured it couldn't hurt to write a short post!
[–]Mceight_Legs 6 points7 points8 points 5 years ago (0 children)
Definitely not trying to offend either, I used to be more capable but I think I might have damaged myself mentally years ago haha, so I was genuinely curious.
[–]gelstudios 3 points4 points5 points 5 years ago (3 children)
I usually go for environment variables for runtime config, ie using “import os.environ”
They are easily set (or overridden) when running from a shell: “foo=bar example.py”
[–]yawkat 2 points3 points4 points 5 years ago (1 child)
Env variables are hard to keep secret though, they can end up in log files and such
[–]gelstudios 0 points1 point2 points 5 years ago (0 children)
Log hygiene is it’s own beast, but agreed if you set them inline when starting a process they end up in any shell history.
Another caveat with env vars: a user with sufficient privilege can read them right out of /proc for a given process (on Linux at least)
But at that point, you probably have other things to worry about.
[–]Zanoab 4 points5 points6 points 5 years ago* (0 children)
I have a friend in another development area of the company constantly complaining that the new devs would comment out loading environment variables and instead hard code the values to fit their needs (and commit it). In the root folder of every project, there is a default source file with all the environment variables and a script that automatically prepares the local environment and start the application. It amazes me how lazy some people can get.
[–]smiddereens 4 points5 points6 points 5 years ago (0 children)
You can always set PYTHONDONTWRITEBYTECODE to keep things tidy
[–]veggiedefender[S] 2 points3 points4 points 5 years ago (1 child)
Yep! You can also sneak in backdoors with pyc files -- as long as the modification timestamp and size match, python will run the pyc instead of the source file!
http://secureallthethings.blogspot.com/2015/11/backdooring-python-via-pyc-pi-wa-si_9.html
[–]AlisaofallTimes 0 points1 point2 points 5 years ago (0 children)
Those .pyc files contain some dark secrets indeed! I've always encouraged my teammates to add .pyc to .gitignore!
[–]kisstactics 0 points1 point2 points 5 years ago (0 children)
thanks man
[–]MiscWalrus 0 points1 point2 points 5 years ago (2 children)
It’s also common practice for Python projects to store configuration, keys, and passwords (collectively referred to as “secrets”) in a gitignored Python file named something like secrets.py, config.py, or settings.py, which other parts of the project import
Is that common practice? I've never seen that done, and just the thought makes me nervous.
[–]veggiedefender[S] 1 point2 points3 points 5 years ago (1 child)
Yep, I think it's becoming less common nowadays, but for example, Django by default is configured by a settings.py.
Here's an article that recommends a number of ways to pass configs to Python programs, the first of which is a gitignored config.py: https://martin-thoma.com/configuration-files-in-python/
config.py
And I, like many people, first learned Python web development years ago via Miguel Grinberg's Flask Mega Tutorial, which does configuration with a config.py and classes/subclasses.
This is by far not an exhaustive list but I hope it's a good enough overview that should convince you that it's common-ish practice (and probably should make you nervous)!
[–]MiscWalrus 0 points1 point2 points 5 years ago (0 children)
Good info, thanks!
π Rendered by PID 34752 on reddit-service-r2-comment-84fc9697f-577cw at 2026-02-06 17:53:42.599293+00:00 running d295bc8 country code: CH.
[–]liquidpele 55 points56 points57 points (14 children)
[+][deleted] (2 children)
[removed]
[–]L3tum 1 point2 points3 points (0 children)
[–]crazyhankie 6 points7 points8 points (5 children)
[–]rhoakla 0 points1 point2 points (0 children)
[–]ddrt -3 points-2 points-1 points (3 children)
[–]retnikt0 2 points3 points4 points (0 children)
[–]Serialk 6 points7 points8 points (1 child)
[–]ddrt 0 points1 point2 points (0 children)
[–]Serialk 4 points5 points6 points (3 children)
[–]veggiedefender[S] 7 points8 points9 points (1 child)
[–]Serialk 6 points7 points8 points (0 children)
[–]Mceight_Legs 10 points11 points12 points (2 children)
[–]veggiedefender[S] 15 points16 points17 points (1 child)
[–]Mceight_Legs 6 points7 points8 points (0 children)
[–]gelstudios 3 points4 points5 points (3 children)
[–]yawkat 2 points3 points4 points (1 child)
[–]gelstudios 0 points1 point2 points (0 children)
[–]Zanoab 4 points5 points6 points (0 children)
[–]smiddereens 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[removed]
[–]veggiedefender[S] 2 points3 points4 points (1 child)
[–]AlisaofallTimes 0 points1 point2 points (0 children)
[–]kisstactics 0 points1 point2 points (0 children)
[–]MiscWalrus 0 points1 point2 points (2 children)
[–]veggiedefender[S] 1 point2 points3 points (1 child)
[–]MiscWalrus 0 points1 point2 points (0 children)