Posts

tcpdump to grab http headers from a specific domain

If you find tcpdump as a very useful tool and you wanted to work in the shell or in a terminal, let say you're into hacking. So it's useful to sneak on the packets using tcpdump. To grab the headers by using tcpdump, you can use the command below, $> for((i=0;i<13;i++)) { clear; } // can also be done by `while(true) do clear; done` then press ctrl+c to stop $> tcpdump -i en1 -s 1024 -l -A 'port 80 and host domain.com' where  -i  specifies the interface, -s specifies the number of bytes that you wanted to Snarf or sneak. From man page, it says "Snarf snaplen bytes of data from each packet rather than the default of 68" -l  print the buffer result into stdout -A    From man page, "Print each packet (minus its link level header) in ASCII.  Handy for capturing web pages." then the string enclosed with single quote is the rule that I wanted to do, to grab or filter packets from port 80 and host  domain.com. Just change "doma...

reading e-mail using telnet

Reading an e-mail in telnet is very efficient way if you're in a terminal. Using telnet, this is how we can read e-mail. #> telnet mail.example.com 110 Trying 111.143.22.11... Connected to mail.example.com. Escape character is '^]'. +OK Dovecot ready. user user@example.com +OK pass myPass +OK Logged in. list +OK 336 messages: 1 12235 2 6577 3 14192 4 12238 5 5575 6 16008 7 8474 . retr 2 +OK 6577 octets Return-path: Envelope-to: useranother@ example.com Delivery-date: Thu, 05 Jan 2012 16:17:35 -0700 Received: from ip20-166-235-224.ph.ph.cox.net ([20-166-235-224]:2273 helo=D99DBHK1) by example.com with esmtp (Exim 4.69) (envelope-from ) id 1RiwYw-0006bM-RB for user@ example.com; Thu, 05 Jan 2012 16:17:35 -0700 From: "Mike Batista" < username@ example.com> To: "'My Test anonymous name'" < username@ example.com> Subject: test Date: Thu, 5 Jan 2012 16:17:41 -0700....

tunneling using SSH and connect via MySQL in different port

I use the command below with -f [requests ssh to run in the background], and -N [to not execute a remote command] $> ssh username@example.com -L 3307:example.com:3306 -p 2222 -f -N the -L argument specifies that 3307 is the port to be used locally from example.com [the remote server] on its 3306 port [MySQL default port]. Then run the command below to connect to MySQL with port 3007. $> mysql --host=127.0.0.1 --port=3307 --protocol=TCP -u mysqluser -p Hope this helps.

Benchmarking DSA vs RSA using openssl

I came to the curiosity today with these signing encryption algorithm with DSA and RSA when I was looking for public key based authentication for ssh. So I got this command from openssl to benchmark which of these encryption performs faster. #> openssl speed Doing mdc2 for 3s on 16 size blocks: 1902676 mdc2's in 3.00s Doing mdc2 for 3s on 64 size blocks: 527773 mdc2's in 3.00s Doing mdc2 for 3s on 256 size blocks: 135799 mdc2's in 3.00s Doing mdc2 for 3s on 1024 size blocks: 33896 mdc2's in 3.00s Doing mdc2 for 3s on 8192 size blocks: 4233 mdc2's in 3.00s Doing md4 for 3s on 16 size blocks: 6152933 md4's in 3.00s Doing md4 for 3s on 64 size blocks: 5104109 md4's in 3.00s Doing md4 for 3s on 256 size blocks: 3207656 md4's in 2.99s Doing md4 for 3s on 1024 size blocks: 1344698 md4's in 3.00s Doing md4 for 3s on 8192 size blocks: 205278 md4's in 3.00s Doing md5 for 3s on 16 size blocks: 4881899 md5's in 3.00s Doing md5 for 3...

mysql revoke privileges

Just to take this note that to revoke a privilege in MySQL, you need to execute the command below, mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'dealme'@'192.168.1.1'; mysql> flush privileges; and specifying the HOST/IP address would allow the user to be validated and verified by its IP allowing to connect into the host, i.e. remote logged in which can be done by the grant command below. mysql> GRANT ALL ON *.* TO 'dealme'@'192.168.1.1' IDENTIFIED BY 'dealmepassword' and the command above will allow the user to connect to all database and with all privileges granted. This can be seen by querying into the database. mysql> use mysql mysql> select * from user where User='dealme' \G \G would view the result vertically.

GraphViz error with SchemaSpy

Just want to notify this myself, if encountering this problem [below], Failed to query Graphviz version information   with: dot -V   java.io.IOException: Cannot run program "dot": error=2, No such file or directory Just install Graphviz  and this will gone.

tcpdump - just for my notes

Well, I just want to put this to my blog for my own sake. tcpdump -nq -s 0 -A -vvv -i eth0 port 80 Thanks to tcpdump.