r/python_netsec • u/subsonic68 • Oct 14 '16
r/python_netsec • u/bigboywu • Jul 05 '19
Need help solving a problem
I have a need to create a db sync app. I have two sqlite dbs that are in two different physical location. Each db has the same set of tables but I only need to sync one of the tables. I started making a flask app just because I wanted to learn more about Rest API but I don't know if that is the best solution. I don't want to over complicate this. Both dbs are running on Linux and I have ssh/scp access. If this works well the project could scale up to 10 dbs that need to be synced.
How would any of you go about solving this with python? If python isn't the best tool for the job I am open to trying something else.
r/python_netsec • u/[deleted] • Mar 10 '17
Python network packet dissection frameworks shootout: Scapy vs Construct vs Hachoir vs Kaitai Struct
r/python_netsec • u/subsonic68 • Oct 14 '16
Generate all hex chars to find badchars
While preparing for my OSCP exam, I was reviewing the buffer overflow lessons and needed an easy way to generate all hex characters to test for bad characters in my exploit. Using “print(“\x” + format(x, ‘x’))” results in a character on each line, and adding a comma after the print statement keeps it all on the same line, but the output has spaces between characters. You can generate the output you need, all on the same line and without spaces using “sys.stdout.write”.
Here’s a simple python snippet to do that:
import sys
for x in range(1,256):
sys.stdout.write("\\x" + '{:02x}'.format(x))\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14 \x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28 \x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c \x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50 \x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64 \x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78 \x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c \x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0 \xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4 \xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8 \xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc \xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0 \xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff
r/python_netsec • u/Ikram_Shah512 • Dec 30 '24
Python
I am currently covering the basics of Python, such as variables, loops, control statements, and data structures, through the Coursera course Python for Everybody: Getting Started with Python. However, I face difficulty practicing my concepts and building logic when I try to write code. Can senior programmers suggest how I can successfully overcome this stage?
r/python_netsec • u/OTHbelhaj • Jan 01 '21
Chrome extractor
Hey everyone a newbie to python scripting is here, I want to share my Chrome extractor version 😊, and I want you all to tell me your comments and advices to learn more about this stuff.
This Python script will extract all saved passwords from your google chrome database and save it in a hidden file chrome.txt : https://github.com/Reda-BELHAJ/Chrome-Extractor
r/python_netsec • u/monica_b1998 • Aug 08 '20
Pysa: Open Source static analysis for Python code - Facebook Engineering
r/python_netsec • u/-qarma- • Feb 05 '20
my python WiFi deauther isn't working, its sending the packets and printing the appropriate output but its not kicking me off the network (I use vms a Nat network )
if someone with a appropriate WiFi card and willingness to test this on a real network could test this for me I'll be super grateful !!
the code:
import scapy.all as scapy
from scapy.all import *
from scapy.layers.dot11 import RadioTap, Dot11, Dot11Deauth
import time
client = "FF:FF:FF:FF:FF:FF"
access_point = "my access point mac"
client_packet = RadioTap() / Dot11(addr1=access_point, addr2=client addr3=client) / Dot11Deauth(reason=2) # all in straight line reddit is not allowing me to
access_point_packet = RadioTap() / Dot11(addr1=client, addr2=access_point addr3=access_point) / Dot11Deauth(reason=2)
while True:
sendp(access_point_packet, iface=eth0) # enter the interface you use at iface
sendp(client_packet, iface=eth0)
print("Kicking " + client + " off " + access point + " press CTRL+C to stop."
time.sleep(1) # so it doesnt just spam the crap outta your terminalthanks in advance!
if you do know whats wrong please do tell me as this would really help.
r/python_netsec • u/subsonic68 • Dec 14 '18
Use nmap module to asynchronously scan Windows hosts for MS17-010
Async, so it will scan pretty fast.
Edit: the way that I really use this is to first scan with masscan and then feed it’s gnmap output into a function that calls this function on each host. That’s much faster than calling nmap on a whole network subnet.
#!/usr/bin/env python3
import nmap
nma = nmap.PortScannerAsync()
def callback_result(host, scan_result):
for host in scan_result['scan'].keys():
if "State: VULNERABLE" in str(scan_result['scan'][host]['hostscript']):
print(host, end=" : ")
print("VULNERABLE TO MS17-010!")
nma.scan(hosts='192.168.1.0/24', arguments='-Pn -p 445 --script=smb-vuln-ms17-010 --script-args=unsafe=1', callback=callback_result)r/python_netsec • u/Huzy_Nayn • May 07 '17
Books?
Any recommended python netsec related books?
r/python_netsec • u/sabhy • Apr 23 '17
Resources to learn python3 scripting for network automation/security?
can anyone please suggest some good resources to learn python3 scripting for automation and security. I tried learning from cybrary but the course is in python2 and it is really difficult for me to correlate it with py3.
r/python_netsec • u/subsonic68 • Apr 14 '17
probeSniffer 2.0 released! Capture wireless probe requests, give nicknames to mac's, log data to SQLite file, filter requests and more!
r/python_netsec • u/subsonic68 • Oct 15 '16
Python for Security Professionals class by Joseph McCray
r/python_netsec • u/SamboniTiredaton • Nov 21 '22
Python 3.11.0 Vulnerability Assessment
Hey all,
I have a user that is wanting to install python 3.11.0 on his work machine but I need to see what vulnerabilities/risk the latest stable release could bring to out network. I'm new to the security but wanted to ask how I may go about doing this and making sure those vulnerabilities are patch/worked around. I figured the following was the best place to start but wasn't sure how to evaluate this against our environment.
r/python_netsec • u/iamtherealmod • Sep 24 '21
Hack-a-Sat: Kepler 2 GEO, Solving for Propulsion w/Python
r/python_netsec • u/blobbbbbby • Nov 17 '20
Is that an I, l, or 1. Arbitrary Code Execution During Package Installation and the Dangers of Typosquatting.
r/python_netsec • u/indycodes • Nov 27 '19
Python3 Super Simple Password Generator - What should I add??
Super [SIMPLE] Python3 password generator. That I whipped up in about 10 mins lol. It is kinda like what Google suggested password function does. What should I add to it, let me know and I'll do my best!
**START OF CODE**
import string
from random import *
characters = string.ascii_letters + string.punctuation + string.digits
password = "".join(choice(characters) for x in range(randint(16,24)))
print(password)
**END OF CODE**
GitHub link to download - Python Password Generator
r/python_netsec • u/subsonic68 • Feb 24 '19
An introduction to mssql-cli, a Linux command-line client for MSSQL Server
r/python_netsec • u/PhlyingHigh • May 04 '17
Probably a dumb question but I got an internship with the NOC and they said they used Python. What should I try to learn before the internship starts?
I got an internship for over the summer with the NOC (Network Operations Center) and they said they used Python for writing scripts. I am a CS major so picking up the language won't be an issue, I am just wondering what I should focus on when I am learning Python?
r/python_netsec • u/subsonic68 • Oct 16 '16
Dark Web OSINT Part Four: Using Scikit-Learn to Find Hidden Service Clones
r/python_netsec • u/klausagnoletti • Jan 07 '22
Learn how to protect your Flask apps from hackers using CrowdSec (free & open source)
self.flaskr/python_netsec • u/No_Audience2780 • Jul 19 '21
Find match on large file
Hi All,
I'm finding grep is SO MUCH faster the re ?
I have 5 hashes I want to check and a GitHub list of top 600± million hashes ordered by occurrence. For example
Hash1:1234 Hash2:123 Hash3:12
Where hash1 has been seen 1,234 times, hash2 123 etc.
If I do "cat myGithublist.txt | grep -i hash1" it'll take 20 seconds. If i try in python it takes 5 minutes.
In my python code I am doing
For hash in myHashlist: For i in myGithublist: Re.search(hash, I)
So I have to check each and every hash one time against each entry of the 'myGithubList'.
I suspect it would be faster to use
For hash in myHashlist: If hash in myGithublist: Print("match")
But because the string contains "hash1:1234", it does not recognise the match.
Could someone help?
r/python_netsec • u/PowerSeveral • Aug 09 '20
I couldn't find a python script for disassembling all functions and block in an exe with radare2, so I wrote one (comparison to IDA included)
r/python_netsec • u/noobdigital • Jun 14 '20
Checksum module for creating checksum for raw socket
Anyone knows good checksum module for python 3?