05 October 2012

A script to check PNR status

# cat << EOF > pnrdata
lccp_pnrno1=MYPNRNO
EOF

# cat pnrdata
lccp_pnrno1=MYPNRNO

# url=http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi
# lynx -post_data $url < ./pnrdata | 
  grep -A32 PNR | grep "Passenger [0-9]"
   Passenger 1 W/L 114,GNWL W/L 21

wget --user-agent="Myscript 1.0;" \
--header="Content-Type: application/x-www-form-urlencoded" \
--post-data="lccp_pnrno1=MYPNRNO" \
"http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi" -O- 2>/dev/null \
| grep -A2 "Passenger 1"
<TD class="table_border_both"><B>Passenger 1</B></TD>
<TD class="table_border_both"><B>W/L  114,GNWL  </B></TD>
<TD class="table_border_both"><B>W/L   21</B></TD>


Reference:
http://wiki.linux-delhi.org/cgi-bin/twiki/view/Main/LinuxTricks
http://akhileshss.blogspot.com/2008/09/script-to-periodically-check-pnr-status.html

26 September 2012

wireless security a small peep

802.11i defines set of procedures (RSN) that tells how keys are derived and distributed.
802.11i provides sophisticated authentication using a variety of protocols (PSK, 802.1X) and strong security with the AES-CCMP encryption protocol.
WEP
--> uses RC4 encryption

WPA - draft of 802.11i (Home and small office)
TKIP
-> automatic key management (key mixing)
-> per-frame keying (key mixing)
-> sequence counter / 48bit IV (replay protection)
-> new message integrity check (Michael integrity check)
=> uses RC4 encryption

WPA2 - 802.11i - RSN (Home and small office)
CCMP - AES

RSN
The earlier EAP exchange or WPA2-PSK has provided the shared secret key PMK
PTK = PBKDF2-SHA1(PMK + ANonce + SNonce + AP MAC + STA MAC)


RSN packets
PEAP packets
WEP - Wired Equivalent Privacy
WPA - WiFi Protected Access
TKIP - Temporal Key Integrity Protocol
CCMP - Counter Mode with CBC-MAC Protocol

RSN - Robust Security Network
PMK - Pairwise Master Key
PTK - Pairwise Transient Key

PEAP

29 July 2012

Simple Search Plugin for Firefox

This tutorial will show you a very simple Firefox hack that allows you to search any blog straight from the Firefox search bar without having to visit the actual blog.

1. go to http://www.scriptsocket.com/cgi-bin/firefoxplugins/generate.cgi
2. updated fields with values given in the pic below
3. generate an install search plugin

plugin will get installed in
%APPDATA%\Mozilla\Firefox\Profiles\xxxxxxxx.default\searchplugins
where xxxx is a random string

sample search plugin can be found here humbles-blog.xml
Install 'Humble's Blog' Firefox Search Plugin



Reference:
http://labnol.blogspot.in/2006/09/learn-to-create-firefox-search-plugin.html
http://fahdshariff.blogspot.in/2008/07/write-search-plugin-for-firefox-howto.html
https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox
http://ss64.com/nt/syntax-variables.html
http://www.scriptsocket.com/cgi-bin/firefoxplugins/generate.cgi
https://developer.mozilla.org/en/Adding_search_engines_from_web_pages