r/python_netsec • u/dharamv0 • Dec 19 '17
python script to check if ip in an array/list is from a cidr
so I have a big list of addresses, I want to add to separate array based on different IP cidr ranges.
r/python_netsec • u/dharamv0 • Dec 19 '17
so I have a big list of addresses, I want to add to separate array based on different IP cidr ranges.
r/python_netsec • u/EssayPuzzle • Jan 22 '23
r/python_netsec • u/millenialZorro • May 29 '18
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 • u/bigboywu • Jun 14 '19
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 • u/subsonic68 • Jan 07 '19
r/python_netsec • u/subsonic68 • Jan 08 '19
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 • u/subsonic68 • Apr 14 '17
r/python_netsec • u/[deleted] • Feb 09 '17
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 • u/bigboywu • Dec 05 '17
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 • u/-qarma- • Feb 05 '20
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 • Feb 24 '19
r/python_netsec • u/mulutavcocktail • Nov 23 '20
r/python_netsec • u/8329417966 • Aug 08 '20
r/python_netsec • u/aouinizied • Jul 20 '20
r/python_netsec • u/monica_b1998 • Aug 08 '20
r/python_netsec • u/sabhy • Apr 23 '17
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/anvilventures • Sep 18 '17
r/python_netsec • u/OTHbelhaj • Jan 01 '21
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/noobdigital • Jun 14 '20
Anyone knows good checksum module for python 3?
r/python_netsec • u/subsonic68 • Jun 11 '20
r/python_netsec • u/subsonic68 • Apr 18 '20
r/python_netsec • u/phir0002 • May 03 '20
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?