Ask Your Question

linuxbegginer's profile - activity

2024-03-22 14:06:57 +0000 received badge  Popular Question (source)
2023-12-19 23:20:06 +0000 received badge  Notable Question (source)
2023-12-19 23:20:06 +0000 received badge  Popular Question (source)
2023-10-12 00:47:53 +0000 received badge  Famous Question (source)
2023-07-13 08:54:26 +0000 received badge  Notable Question (source)
2023-03-19 11:08:49 +0000 received badge  Notable Question (source)
2023-03-19 11:08:49 +0000 received badge  Popular Question (source)
2022-12-28 13:59:19 +0000 received badge  Popular Question (source)
2022-06-20 15:43:35 +0000 commented answer Extracting timestamp in lua

Thanks Chuckc :)

2022-06-20 15:43:00 +0000 marked best answer Extracting timestamp in lua

I am trying to extract the timestamp so I figure the following fields:

abs_time, utc_time, cls_time, rel_time

are containing the timestamp I need. Unfortunately, I got errors. According to Wireshark's official website:

https://www.wireshark.org/docs/wsdg_h...

One can extract those fields from the "pinfo" variable.

local function init_listener()
     local tap = Listener.new("ip",filter_packets)
     local ipid = Field.new("ip.id")
     function tap.reset()
         packets = 0;
     end
     function tap.packet(pinfo,tvb,ip)    
         -- as requested, double check with the previous code results. 

         -- tried this didn't worked.. 
         local val1 = pinfo.abs_time

         -- also want to extract those in the same manner .. 
         local val2 = pinfo.utc_time
         local val3 = pinfo.cls_time
         local val4 = pinfo.rel_time
         -- omitted
     end
     function tap.draw()
         print("Applying filter: " .. "\"" .. filter_packets .. "\"",packets)
     end
 end

So I have two questions :

  1. Is it true that those fields hold the timestamp of a packet header?
  2. How do I extract those fields in lua script?
2022-06-20 15:11:36 +0000 commented answer Extracting timestamp in lua

pinfo.cols.abs_time This one returns just a string called "abs_time" which isn't helping... I don't know if frame.time

2022-06-20 15:11:12 +0000 commented answer Extracting timestamp in lua

pinfo.cols.abs_time This one returns just a string called "abs_time" which isn't helping... I don't know if frame.time

2022-06-19 20:11:38 +0000 edited question Extracting timestamp in lua

Extracting timestamp in lua I am trying to extract the timestamp so I figure the following fields: abs_time, utc_time,

2022-06-19 20:10:34 +0000 edited question Extracting timestamp in lua

Extracting timestamp in lua I am trying to extract the timestamp so I figure the following fields: abs_time, utc_time,

2022-06-19 20:10:34 +0000 received badge  Editor (source)
2022-06-19 20:09:48 +0000 asked a question Extracting timestamp in lua

Extracting timestamp in lua I am trying to extract the timestamp so I figure the following fields: abs_time, utc_time,

2022-06-04 17:16:10 +0000 asked a question catching EVERY packet going to a website

catching EVERY packet going to a website Hello, according to Wireshark information: Wireshark can capture traffic

2022-05-29 17:39:48 +0000 commented question Catch packets from my website

Thank you very much :)

2022-05-29 17:30:22 +0000 commented answer Catch packets from my website

how can I catch TLS packets?

2022-05-29 17:29:46 +0000 marked best answer Catch packets from my website

Hello, so I have an HTML code which I run based on Github websites and I want to see packets going through my computer to the website which I created.

The HTML code:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Http Requests & JavaScript</title>
  <link rel="stylesheet" href="app.css">
  <link href="xhr.js">
  <script src="xhr.js" defer></script>
</head>
<body onload="initRequestInterval()">
  <section id="control-center">
    <button id="get-btn">GET Data</button>
    <button id="post-btn">POST Data</button>
  </section>
</body>
</html>

Where "initRequestInterval()" sends 5 HTTP GET requests to the client every second

Website page:

https://pages.cs.huji.ac.il/nir-vakni...

The problem:

I don't see the packets because I don't know the public IP of that website I tried to do nslookup command and the DNS tells me that he didn't find the public IP of the website. I tried to Isolate the packets I sent from my computer so I can see the HTTP GET packets from the website but without success.

Possible explanation but I am not quite sure: I use dummy HTTP GET request such as: https://reqres.in/api/users so not actual data being sent, maybe because of that?

How can I capture the HTTP request on Wireshark console?

2022-05-29 17:29:25 +0000 commented question Catch packets from my website

Can you please tell me what method did you use to search for the IP?

2022-05-27 18:11:12 +0000 asked a question Catch packets from my website

Catch packets from my website Hello, so I have an HTML code which I run based on Github websites and I want to see packe

2022-05-14 10:54:35 +0000 commented answer Filter udp packets using lua script

Ty very much :)

2022-05-14 10:54:15 +0000 marked best answer Filter udp packets using lua script

So I have tshark and lua script which i am trying to run. I am running with the command:

sudo tshark -X lua_script:luascript.lua -c 100

Where my lua scrpit looks like this:

do
     packets = 0;
     file = io.open("result.txt","a")
     local function init_listener()
          local tap = Listener.new(nil,"ip.addr == 10.0.2.15&&udp")
          function tap.reset()
               packets = 0;
          end
          function tap.packet()
               packets = packets + 1
               io.output(file)
          end
          function tap.draw()
                print("Packets to/from 10.0.2.15",packets)
          end
     end
     init_listener()
     io.close(file)
end

So when i ran tshark I get each packet ouputs to the command line like this one:

98 5.300306453 142.250.179.136 → 10.0.2.15    TCP 60 443 → 54114 [ACK] Seq=1 Ack=1031 Win=65535 Len=0

And everytime udp packet comes up i want to save it to output file(with all the information). So indeed tap.packet() captures Those packets but what i want is to write them to output file using lua script.

How do i do that?

2022-05-14 10:54:15 +0000 received badge  Scholar (source)
2022-05-13 16:23:49 +0000 asked a question Filter udp packets using lua script

Filter udp packets using lua script So I have tshark and lua script which i am trying to run. I am running with the comm