Get Client Hello from Wireshark - client-server

I need to get the Client Hello Cipher Suite for a website. The website is https://stripe.com/ When I start Wire-shark I start capturing and wait about 15 seconds then stop it and filter the data to
ip.src == 54.187.119.242
IP address changes every minute, need to ping stripe.com in cmd
I get a Server Hello, but not a Client Hello. Am I not supposed to be getting the Client Hello? Here is the server Hello:
Do I need to wait more, or do something, or does it not show the Client Hello at all. Have not really used Wire Shark that much, so newbie question.

If you want bi-directional traffic, you need to either specify ip.addr == 54.187.119.242, or filter on IP pairs, e.g.:
(ip.src == 54.187.119.242 && ip.dst == X.X.X.X) || (ip.src == X.X.X.X && ip.dst == 54.187.119.242)

Related

Wireshark and T Shark DNS

I’m creating a small script to take the output from tshark and print it out to terminal. I'm trying to to only filter by requests made through the browser address bar.
So when www.facebook.com is loaded, the terminal only prints out facebook.com, rather than fbstatic-a.akamaihd.net etc .. (other DNS requests made through the requested website)
This program loops forever repeating dns requests and writes to the terminal.
Any ideas?
Would the following work for you?
$ tshark -r dns.pcap -T fields -e dns.qry.name -Y "dns.qry.type == 0x0001 and udp.dstport == 53"
www.yahoo.com
The display filter (the part after "Y") is to limit the query type to be for A record (you want to avoid CNAME etc) in the request.
dns.qry.type == 0x0001 is for A record, udp.dstport == 53 is for DNS request.
Hope it helps.

Recieve and reply to sms on huawei modem, gammu-smsd: Process failed with exit status 2

I Have a Huawei E220 HSDPA Modem on linux xubuntu
I wanted to recieve sms and reply automatically to the sender.
I Use gammu and Gammu-smsd to do this.
To automatically send sms back I added runOnRecieve = /path/to/bash/file into the /etc/gammu-smsdrc configuration-file.
Here is the script:
#!/bin/bash
str=$SMS_1_TEXT //string containing text from sender
tlf=$SMS_1_NUMBER //containing number from sender
tlf=${tlf:3}
if test "$str" = "today"; then
echo "[Weather for today in Norway]
Sol, noe overskyet
[Vind fra sørøst]
Ha en fin dag!" | gammu-smsd-inject TEXT $tlf -unicode -autolen 200
else
echo "fail" >> /home/mattis/sms.txt
fi
This is how I start the daemon
$ sudo gammu-smsd
This works if I run the bash script from terminal using test-input, but when the program gammu-smsd calls the script I get.
gammu-smsd[3183]: Process failed with exit status 2
Now i can remove "gammu-smsd-inject" from the code and replace with "gammu sendsms" , but that would just give me gibberish letters instead of "æøå and [ ]" when received back to the mobile.
Hoping for positive answers.
--//--Working code--//--
The thing is: Gammu sms inject acctually sends data to mysql database called smsd.
Creating this database:
This should be created as specified in wammu sql database. Storing the SQL script for creating tables in MySQL database will able you to import it with phpmyadmin(gui) or any other way to interface mysql.
Run on recieve
Add to the end of /etc/gammu-smsdrc --configuration file for gammu
runOnRecieve = /path/to/bash/file
Open the /path/to/bash/file
#!/bin/bash
str=$SMS_1_TEXT //codeword "weather"
tlf=$SMS_1_NUMBER //+47 41412424
tlf=${tlf:3} //remove +47
if test "$tlf" = "41412424"; then
toSend = "[Weather for today in Norway]"
else
toSend = "[you are not part of this group]"
echo "Someone outside the group send to this number" > /home/user/activity.txt
fi
mysql --host=localhost --user=username --password=pw smsd << EOF
INSERT INTO outbox (
DestinationNumber,
TextDecoded,
CreatorID,
RelativeValidity
) VALUES (
'$tlf',
'$toSend',
'Program',
'255'
);
EOF
Start the daemon
$ sudo gammu-smsd
That should be it!
Extra tips:
Use $ gammu-detect to find out where the device is connected. Look for name = Phone on USB serial port HUAWEI_Technology HUAWEI_Mobile or something similar. Put this info in the configfile.
Be shure to add right permission to the bashfile. Make it readable to user running gammu-smsd.
Make the bashfile executable using chmod u+x /path/to/bash/file.
The gammu-smsd-monitor can be used to check how good signal you have. Be shure not to stop running the gammu-smsd when trying to run this.
You can test the bashfile by running it with dummy tlf and dummytext as input. $ ./bashfile.sh.

TCP Minecraft Server in Ruby

I'm attempting to create a script in ruby that connects to a Minecraft server via TCP and fetches the current number of players much like the PHP script at http://www.webmaster-source.com/2012/07/05/checking-the-status-of-a-minecraft-server-with-php/
When running the code below I get �Took too long to log in
require 'socket'
server = TCPSocket.new '192.241.174.210', 25565
while line = server.gets
puts line
end
server.close
What am I doing wrong here?
you're not sending this:
fwrite($sock, "\xfe");
from the script you linked. You have to send that before you call read, like they do.
Basically the server is waiting for you to send data and when you don't after a timeout, you are disconnected.

Loop for checking string change in system function output (monitoring a DNS update)

I am switching DNS servers and I'd like to write a short ruby script that runs every 10s and triggers a local Mac OS X system notification as soon as my website resolves to a different IP.
Using terminal-notifier sending a system notification is as easy as this
terminal-notifier -message "DNS Changed"
I'd like to trigger it as soon as the output of
ping -i 10 mywebsite.com
... changes or simply does not contain a defined IP string anymore.
> 64 bytes from 12.34.56.789: icmp_seq=33 ttl=41 time=241.564 ms
in this case "12.34.56.789".
How do I monitor the change of the output string of the ping -i 10 mywebsite.com and call the notification function once a change has been detected?
I thought this might be a nice practice while waiting for the DNS to be updated.
Try this:
IP = "12.34.56.789"
p = IO.popen("ping -i 10 mywebsite.com")
p.each_line do |l|
if(! l =~ /from #{IP}/) #The IP has changed
system("terminal-notifier -message \"DNS Changed\"")
end
end

how to know 2 lan pc is connetced with my program in php?

I have 4 PCs which are connected through the LAN. I am making a PHP program that will
differentiate each PC separately and i will keep each pc record.
But when i am getting an IP address i am getting same IP for all. I guess i should retrieve MAC address for all pcs separately, but i don't know how will i fetch MAC address.
I am using Linux OS.
Programing tips will be appreciated.
As far as I know, you cannot do this with PHP alone. However, if you have exec() rights on the server, the you might be able to use:
arp -a ipaddress
Where ipaddress is the IP address of the computer on your LAN. You would need to use something like regex to seperate the MAC address from the rest of the output.
I don't think that the mac-adress is included in the http-header. So it is probably hard to get it via php. I think you're better off trying to fix the ip-issue. Sorry I can't help you more.
Edit:
Actually... searching around a little I found a possible solution:
$mac = `ping -c 1 $ip && arp -a | grep $ip`
You probably have to parse the output though. I get:
xxx.xxx.local (192.168.0.10) at d5:c2:c3:13:a2:b1 [ether] on eth0
When doing arp -a 192.168.0.10
Edit:
Like the post under states, you would need exec-rights.
Edit:
Sorry, just realized that in order for this to work, you would need the ip... Which you don't have.
PEAR’s Net_Ping is a niffty wrapper class for executing ping calls from PHP. You can use it to check if a remote server is responding correctly. The library can be download from here.
pear install Net_Ping-2.4.4
<?php
require_once "Net/Ping.php";
$ping = Net_Ping::factory();
if(PEAR::isError($ping))
echo $ping->getMessage();
else
{
/* Number of packets to send */
$ping->setArgs(array('count' => 4));
$rawData = $ping->ping('google.com');
print_r($rawData);
}
?>

Resources