Posts by Paul Sigonoso • 309 points
14 posts
-
3
votes2
answers679
viewsQ: Regular expression to validate a password with Python
Passwords must contain at least 5 words (word = 1 or more letters), each separated by a hyphen, a space, a dot, a comma or an underscore. Example: a-b-b-c-d-d OR Passwords must be at least 8…
-
2
votes1
answer82
viewsQ: What is the bincount method of numpy for/what?
I read the documentation but I don’t understand what it does: print(np.bincount(np.array([0, 1, 1, 1, 2, 3, 7]))) The exit is: [1 3 1 1 0 0 0 1]…
-
2
votes2
answers181
viewsQ: Reading and processing XML file from a CVE (Common Vulnerabilities and Exposures) database with Python
By using the Annexes lista.txt and cve.xml develop a Python script that: open and read the ". xml" extension file made available at the end; search the file for all occurrences of CVE ID in the…
-
3
votes2
answers145
viewsA: Recursive method to display the representation of an integer in a base
def conv(num,b): convStr = "0123456789abcdefghijklmnopqrstuvwxyz" if num<b: return convStr[num] else: return conv(num//b,b) + convStr[num%b] print (conv(4,2)) #will…
-
1
votes1
answer134
viewsQ: Porting a Python 2 code to Python 3: Scan ICMP with errors
I have the following code: import random import socket import time import ipaddress import struct from threading import Thread def checksum(source_string): sum = 0 count_to = (len(source_string) /…
-
-3
votes1
answer1483
viewsQ: How to create a TCP port scanner using the SYN (TCP SYN) method?
##################################### # Portscan TCP # # # ##################################### # -*- coding: utf-8 -*- #!/usr/bin/python3 import socket ip = input("Digite o IP ou endereco: ")…
-
1
votes1
answer819
viewsQ: How to create an UDP port scanner in python 3?
My code is always "port is opened". My idea is: if the destination responds, the door is open. Otherwise, it may be filtered... ##################################### # Portscan UDP # # #…
-
1
votes1
answer506
viewsQ: How to "generate" multiple TCP clients using Threads in the same script?
I wrote the code of a simple TCP client: from socket import * # Configurações de conexão do servidor # O nome do servidor pode ser o endereço de # IP ou o domínio (ola.python.net) serverHost =…
-
0
votes1
answer118
viewsQ: Creating an ARPING
#!/usr/bin/python3 #Fazer arping de conexao import sys from datetime import datetime from scapy.all import * try: interface = input ("\n[*] Set interface: ") ips = input("[*] Set IP RANGE or…
-
1
votes1
answer418
viewsQ: Sending a payload with scapy
from scapy.all import * ip = IP(dst = "192.168.1.1") tcp = TCP (dport = 80, flags = "S") raw = Raw(b"Olaa") pkt = ip/tcp/raw sr(pkt) ans,unans = sr(pkt) I’m learning to use Python Scapy. I couldn’t…
-
0
votes1
answer177
viewsQ: Implementing a TCP traceroute
I’m trying to understand the code below (found on the Internet): #!/usr/bin/python3 from scapy.all import * target = input("Informe um alvo: ") destport = input("Porta de destino: ") port =…
-
4
votes2
answers337
viewsQ: Data entry without echoing on screen
entrada = input("digite a senha") If I use the function input, what the user keystrokes will be echoed on the screen. How to do so so that nothing is shown on the screen?…
-
7
votes3
answers1045
viewsQ: Fibonacci with parallel execution? Threads?
def recur_fibo(n): """Recursive function to print Fibonacci sequence""" if n <= 1: return n else: return(recur_fibo(n-1) + recur_fibo(n-2)) This code makes the recursive Fibonacci "simple"...…
-
0
votes2
answers284
viewsQ: Error in classes that implement java.io.Serializable
I have some classes that implement java.io.Serializable, when I compile, all present Warning: The serializable class Fat_uc_datastatementsql does not declare a Static final serialVersionUID field of…
javaasked Paul Sigonoso 309