Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: I didnt get the NULL values
Post: I didnt get the NULL values

I want to extract the segment len from a TCP header so I made this code: def tcp_len_list(s): a = [len(p[TCP].payload) if p.haslayer(TCP) else None for p in s] return aThe problem...
salwa17 General Coding Help 0 1,578 Jul-10-2020, 02:54 PM
    Thread: how to count a retransmission packets from pcap file?
Post: how to count a retransmission packets from pcap fi...

How can count the retransmission packets from a pcap file without using pyshark please ? I use this code with pyshark : def pyshark_retran_packet(inputfile): capture = pyshark.FileCap...
salwa17 General Coding Help 0 2,817 Jul-04-2020, 11:22 PM
    Thread: How to extract MSS (maximum size segment) from a pcap file ?
Post: How to extract MSS (maximum size segment) from a p...

I want to extract the MSS (Maximum Size Segment)from a pcap file but I got only 0 while I have Not NULL values in this field: def is_tcp_options(packet): if packet.haslayer(TCP): if packe...
salwa17 General Coding Help 0 1,669 Jun-29-2020, 09:06 AM
    Thread: Counter of the duplicated packets from a pcap file
Post: RE: Counter of the duplicated packets from a pcap ...

@ Gribouillis: Yes I know. I just re-explaining my need regarding your explanation: "Finally, remove the groups with only one packet" So with your code, I got the whole of packets if I want only the ...
salwa17 General Coding Help 8 4,211 Jun-26-2020, 11:31 PM
    Thread: Counter of the duplicated packets from a pcap file
Post: RE: Counter of the duplicated packets from a pcap ...

s_ip is the ip of the server and c_ip is of the client. So if p[IP].src == s_ip i will count the duplicated packets coming from the server with sCount += 1 and if p[IP].src == c_ip i will count the d...
salwa17 General Coding Help 8 4,211 Jun-26-2020, 09:13 PM
    Thread: Counter of the duplicated packets from a pcap file
Post: RE: Counter of the duplicated packets from a pcap ...

Thank you so much for your help. Wow your solution is very simple. My goal is like you described it but instead to remove the duplicated packet I want to count them. That's wht my duplication_pkt_co...
salwa17 General Coding Help 8 4,211 Jun-26-2020, 08:47 PM
    Thread: Counter of the duplicated packets from a pcap file
Post: Counter of the duplicated packets from a pcap file

I want to count the duplicated packets from a pcap file. Duplicated packets are the packets whose the sequence number were already seen previously For that I extract firstly the list of the sequence n...
salwa17 General Coding Help 8 4,211 Jun-26-2020, 07:47 PM
    Thread: Two operations in two ranges
Post: RE: Two operations in two ranges

Oh sorry : I indented it correctly: def reg_val_list_binary(s): r = [0, 0, 0, 254, 179, 0, 2, 0, 0, 0] v = [] w = [] if v in (0, len(r) - 1): r = [int...
salwa17 General Coding Help 3 2,112 Jun-22-2020, 03:40 PM
    Thread: Two operations in two ranges
Post: Two operations in two ranges

I have to operations for two ranges. I want to do someting like: for variable in [0, len(list)-1] do operation 1 and do operation 2 for the second value which is len(list) and in the end append all th...
salwa17 General Coding Help 3 2,112 Jun-22-2020, 03:08 PM
    Thread: Python: for and if loop
Post: RE: Python: for and if loop

@deanhystad : I think that you are right about my problem with the binary2 function. Its the loop which causes problem. How can I resolve this problem plz ? Func_code contains certainely 3 and 1 v...
salwa17 General Coding Help 4 2,281 Jun-20-2020, 03:15 PM
    Thread: Python: for and if loop
Post: Python: for and if loop

I made this function to code some values according to func_code value but it does not work as aaspected: def reg_val_list_binary2(s): r = [] for i in func_code(s): try: ...
salwa17 General Coding Help 4 2,281 Jun-19-2020, 12:40 PM
    Thread: How to extract protocol from a pcap file ?
Post: How to extract protocol from a pcap file ?

I developed this code to extract all protocols (transport and application) from a pcap file: load_layer('http') load_layer('tls') load_contrib("modbus") def find_proto(s): def expand(x): yield ...
salwa17 Networking 0 2,220 Apr-02-2020, 10:02 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020