Facebook Timeline brings great new set of features to give totally a new facebook experience. The recent Facebook Christmas Theme spam gone viral couple of days ago and many profile got infected. It is important to protect your facebook timeline
against such spam attacks, as you will stand as the origin to spread
the same spam message to your friends profile. You should do little
modification of privacy settings to prevent your friends or friends of friends posting on your timeline.
Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts
Monday, December 26, 2011
Friday, May 27, 2011
Network programming in C under Linux
In this tutorial we will deal with networkprogramming under LINUX (/UNIX).
During this we
will only work with the Programminglanguage C. Precognition of C are needed.
You should know what a describtor or a string is. #
Furthermore the reader has to be intrested, so when you don't know one of the listed functions (e.g. "read", "write") you should check out the according manual ( $ man function).
Misspellings are due to the state of mind of the author. The text is written in a simple form and only contains the main important details of the functions.
A little bit of knowlegde about TCP/IP should be enough to understand the topic, wheras we will only deal with IPv4 here. We will emphasise on TCP.
So this Tut is an introduction and topics like threading or multicasting will not be discussed.
Furthermore the reader has to be intrested, so when you don't know one of the listed functions (e.g. "read", "write") you should check out the according manual ( $ man function).
Misspellings are due to the state of mind of the author. The text is written in a simple form and only contains the main important details of the functions.
A little bit of knowlegde about TCP/IP should be enough to understand the topic, wheras we will only deal with IPv4 here. We will emphasise on TCP.
So this Tut is an introduction and topics like threading or multicasting will not be discussed.
Saturday, January 8, 2011
Which IP addresses and hostnames are used for wireless clients?
Here is script that can give the list of IP addresses and hostnames that are used for wireless clients
Note: Only work if you get an IP address from DHCP
SCRIPT :
Output:# mkdir -p /tmp/www
while [ 1 ];
do
wl assoclist | awk '{print tolower($2)}' > /tmp/assocLIST
# echo "<meta http-equiv="refresh" content="10"><b>Hostnames and IP addresses of WLAN clients</b> (last update: $(date))<p>" > /tmp/www/wlan.html
while read assocLINE
do
dumpleases | awk '/'"$assocLINE"'/ {print "Hostname: " $1, "MAC: " $2, "IP: " $3}'
# echo "<br>";
done < /tmp/assocLIST # >> /tmp/www/wlan.html
sleep 10;
done;
Hostname: tp MAC: 01:81:18:3d:49:5e IP: 192.168.2.101You can change the order of "$1, $2, $3" or cut-out:... awk '{print $1,$3}'Output:tp 192.168.2.101A QUESTIONS FOR YOU :->
"How can I output the signal strength (wl rssi ) at the sametime by feeding MAC Addr from assoclist without typing MAC addr eachtime in telnet?"
Thanks...
Friday, January 7, 2011
Some Linux tweaks...
Change the values above as desired, depending on your internet connection and maximum bandwidth/latency.There are other parameters you can change from the default if you'reconfident in what you're doing - just find the correct syntax of thevalues in /proc/sys/net/... and add a line in the above code analogousto the others. To revert to the default parameters, you can justcomment or delete the above code from /etc/rc.local and restart. The TCP/IP parameters for tweaking a Linux-based machine for fast internet connectionsare located in /proc/sys/net/... (assuming 2.1+ kernel). This locationis volatile, and changes are reset at reboot. There are a couple ofmethods for reapplying the changes at boot time, ilustrated below.
Locating the TCP/IP related parameters
All TCP/IPtunning parameters are located under /proc/sys/net/... For example,here is a list of the most important tunning parameters, along withshort description of their meaning:
/proc/sys/net/core/rmem_max - Maximum TCP Receive Window
/proc/sys/net/core/wmem_max - Maximum TCP Send Window
/proc/sys/net/ipv4/tcp_timestamps - timestamps (RFC 1323) add 12 bytes to the TCP header...
/proc/sys/net/ipv4/tcp_sack - tcp selective acknowledgements.
/proc/sys/net/ipv4/tcp_window_scaling - support for large TCP Windows (RFC 1323).
Needs to be set to 1 if the Max TCP Window is over 65535.
Keep in mind everything under /proc is volatile, so any changes you make are lost after reboot.
There are some additional internal memory buffers for the TCP Window, allocated for each connection:
/proc/sys/net/ipv4/tcp_rmem - memory reserved for TCP rcv buffers (reserved memory per connection default)
/proc/sys/net/ipv4/tcp_wmem - memory reserved for TCP snd buffers (reserved memory per connection default)
Thetcp_rmem and tcp_wmem contain arrays of three parameter values: the 3numbers represent minimum, default and maximum memory values. Those 3values are used to bound autotunning and balance memory usage whileunder global memory stress.
Applying TCP/IP Parameters at System Boot
You can edit /etc/rc.local, or /etc/boot.local depending on your distribution so the parameters get automatically reapplied at boot time. The TCP/IP parameters should be self-explanatory: we're basically setting the TCP Window to 256960, disabling timestamps (to avoid 12 byte header overhead), enabling tcp window scaling, and selective acknowledgements:
echo 256960 > /proc/sys/net/core/rmem_default
echo 256960 > /proc/sys/net/core/rmem_max
echo 256960 > /proc/sys/net/core/wmem_default
echo 256960 > /proc/sys/net/core/wmem_max
echo 0 > /proc/sys/net/ipv4/tcp_timestamps echo 1 > /proc/sys/net/ipv4/tcp_sack echo 1 > /proc/sys/net/ipv4/tcp_window_scalingNotes:Another method to reapply the values upon boot is to include the following in your /etc/sysctl.conf (adjust RWIN values as needed):
Execute sysctl -p to make these new settings take effect.net.core.rmem_default = 256960
net.core.rmem_max = 256960
net.core.wmem_default = 256960
net.core.wmem_max = 256960
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
To manually set the MTU value under Linux, use the command:
ifconfig eth0 mtu 1500 (where 1500 is the desired MTU size)
Changing Current Values without rebooting
The current TCP/IP parameters can be edited without the need for reboot in the following locations: /proc/sys/net/core/rmem_default = Default Receive WindowYou'll find timestamps, window scalling, selective acknowledgements, etc.
rmem_max = Maximum Receive Window
wmem_default = Default Send Window
wmem_max = Maximum Send Window
/proc/sys/net/ipv4/
Keepin mind the values in /proc will be reset upon reboot. You still needto add the code in /etc/rc.local or /etc/boot.local in order to havethe changes applied at boot time as described above.
Other TCP Parameters to consider
TCP_FIN_TIMEOUTThis setting determines the time that must elapse before TCP/IPcan release a closed connection and reuse its resources. During thisTIME_WAIT state, reopening the connection to the client costs less thanestablishing a new connection.
By reducing the value of this entry, TCP/IPcan release closed connections faster, making more resources availablefor new connections. Addjust this in the presense of many connectionssitting in the TIME_WAIT state:
# echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout(default: 60 seconds, recommended 15-30 seconds)Notes:
You can use any of the earlier described methods to reapply these settings at boot time.
Here is a quick way to view the number of connections and their states:
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
TCP_KEEPALIVE_INTERVAL
This determines the wait time between isAlive interval probes. To set:
echo 30 > /proc/sys/net/ipv4/tcp_keepalive_intvl
(default: 75 seconds, recommended: 15-30 seconds)
TCP_KEEPALIVE_PROBES
This determines the number of probes before timing out. To set:
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes
(default: 9, recommended 5)
TCP_TW_RECYCLEIt enablesfast recycling of TIME_WAIT sockets. The default value is 0 (disabled).
The sysctl documentation incorrectly states the default as enabled. Itcan be changed to 1 (enabled) in many cases. Known to cause some issueswith hoststated (load balancing and fail over) if enabled, should be used with caution.
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycleTCP_TW_REUSE
(boolean, default: 0)
This allows reusing sockets in TIME_WAIT state for new connections when it is safe from protocol viewpoint. Default value is 0 (disabled). It is generally a safer alternative to tcp_tw_recycle
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse(boolean, default: 0)Note:The tcp_tw_reuse setting is particularly useful in environments wherenumerous short connections are open and left in TIME_WAIT state, suchas web servers. Reusing the sockets can be very effective in reducing server load.
Kernel Recompile Option
There is another method one can use to set TCP/IP parameters, involving kernel recompile... If you're brave enough. Look for the parameters in the following files: /LINUX-SOURCE-DIR/include/linux/skbuff.h
Look for SK_WMEM_MAX & SK_RMEM_MAX
/LINUX-SOURCE-DIR/include/net/tcp.h
Look for MAX_WINDOW & MIN_WINDOW
Thanks...
How to block incoming attacks? OR How to close opened ports?
Limit your exposure to the outside world by blocking incomming connections.
STEPS:
Start - Settings - Control Panel - Network Connections
Rightclick on "Local Area Network"
And go to "Properties",
In the scrollbox, Click on "Internet Protocol (IP/TCP)" and then click on the"Properties" button.
In the new window, Click on the "Advanced.."button.
Then in the other new window go to the "Options" tab, Click on"TCP/IP Filtering" and hit "Properties".
Check off "Enable TCP/IPfiltering (All adapters)" next In the Above "TCP Ports" Click on theRadio button "Permit Only" and then add in the ports that you wantpeople to be able to access...
If you're running a web server add in80, If you're running an FTP server add in 21... And so on...
Then hit"OK" And close all the other windows, And reboot when it asks you too.
Thisway you can close the ports that you do not need to be open to theoutside world. An alternative to this tweak could be running afirewall or enabling windows built in firewall. Please note that inorder for other computers to connect to you, for example sending a fileover AOL Instant Messenger or using Windows Messenger to send a file,make sure that the required port is not blocked on your system. Otherwise, nothing will go through.
Thanks...
How to properly disable IPv6?
Starting in WindowsVista and Server 2008, Microsoft includes native support for IPv6(Internet Protocol Version 6) and is enabled by default. IPv6 is thenew computer address protocol that will eventually replace IPv4 whichis currently the most popular standard. Unless you network has aspecific requirement for IPv6, very few do, you can safely disableIPv6. Unlike other protocols, you cannot disable IPv6 by disabling theprotocol on each of your network interfaces. While that will disablethe protocol for the interfaces the loopback and tunnel interfaces willstill have it enabled that can cause problems with applications. Theproper way to disable IPv6 is to disable via the registry.
First, click on the Start Button and thn RUN (or you can directly access RUN via pressing Windows Key + R) type in regedit and hit Enter.
Then,navigate through
Name the new valueDisabledComponents and hit Enter.
Now right click on the newDisabledComponents value you just created and select Modify.
Set thevalue of DisabledComponents to FFFFFFFF and click OK.
After a reboot IPv6 will be disabled on all interfaces.
Thanks...
First, click on the Start Button and thn RUN (or you can directly access RUN via pressing Windows Key + R) type in regedit and hit Enter.
Then,navigate through
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/TCPIP6 and ParametersRight click on Parameters and selectNew and then DWORD (32-bit) Value.
Name the new valueDisabledComponents and hit Enter.
Now right click on the newDisabledComponents value you just created and select Modify.
Set thevalue of DisabledComponents to FFFFFFFF and click OK.
Thanks...
Best networking tweaks for Windows Server, Vista n XP...
Like most Sys Admins, my job (in home, just for practice or tweak) includes managing both Linux andWindows machines. This is the start of a two-part series regardingtweaks I have found for networking in each type of system.
First up:Windows.
I have labeled my findings based on where you'll find it: either asan operating system feature, or in the device manager of the Ethernetadapter you're using.
Driver: Interrupt Coalescing / Moderation
Gigabit adapters in particular implement new algorithms to try toaccommodate different forms of network traffic: especially when a goodportion of it may not need that kind of speed (think web-facingadapters on 10/100 lines). However, it has been my own experience thatQuickbooks can be particularly jumpy with this feature enabled. It goesby several different names (depends on the vendor) but you should onlyneed to leave this on if you're using a gigabit interface on anInternet-facing server.Driver: Offloading (IP / TCP / UDP)
Many adapter drivers come with a form of offload engine for layer 3 or 4 protocols; there is also a "Large Segment Offload"feature on some adapters.These features are meant to reduce CPUoverhead by having the network adapter do more of the work: however, alot of network adapters are sub-par, and there is no harm in having theCPU do these tasks (disabling the offloads) for anything short of aserver-grade adapter. The exception would be checksum offloading: that seems to be easily doable by any hardware.
2003 & Older: SMB tweaking
Microsoft has offered a set of registry tweaksthat should improve file sharing performance on older Windows systems:they will have little or no impact on newer systems, for they use SMB version 2.XP & Newer: Automatic IPv6 Tunneling
At GoGoNet Live,I was fortunate to question a Cisco engineer that took credit forhaving Windows implement automatic tunneling with XP and newer: hebelieved that providing IPv6 access, "native" or not, would spurapplication developers to honor API changes and continue to embrace thenew protocol.Now that 2010 is almost out: 6to4 has been maligned by Google and Apple for breaking website access; ISATAP can be hard to work with; Teredo tunnelingcan be hit or miss (Microsoft does host some servers for use); and thatdesired application uptake has been largely ignored by the likes of Pidgin,Steam, and others.
The speaker can be forgiven that his intentions wentawry, when quite a few people (Linux and Windows) think the best way tohandle IPv6 is to turn it off completely. Fortunately, you don't have to slay the IPv6 beast: its a known fact we'll be living with it starting in 2011, like it or not.
1. Commands to use on an "administrator" command prompt...
2. On Windows XP systems, you can also disable the "IP Helper" service: however, you'll lose use of the portproxy function.netsh interface ipv6 6to4 set state state=disabled
netsh interface ipv6 isatap set state state=disabled
netsh interface ipv6 set teredo disable
3. If you want to use IPv6, and your ISP doesn't have it, consider free (and stable) tunnel services from HE, GoGoNet, and SixXS.
XP x64 & Server 2003: Compound TCP
With the Vista networking stack, a modified TCP stackwas introduced. I use this "Compound TCP" when I can on the newersystems: fortunately, it has been backported to the 2003-based systemsvia hotfix 949316.
Vista & Newer: Standard Networking Tweaks
1. I make prudent use of Compound TCP, TCP timestamping, and TCP Chimney: the latter is a function of Windows that does partial TCP offloading when able.
At the "administrator" command prompt...
2. I prefer not to use IPv6 privacy addressing for troubleshooting purposes; it can be disabled with the following command...netsh interface tcp set global congestion=ctcp
netsh interface tcp set global time=enabled
netsh interface tcp set global chimney=enabled
3. There is an additional tweak that can help deal with propertraffic routing: however, many routers don't implement it correctly,and Battlefield Heroes doesn't like it at all. Use at your caution.netsh interface ipv6 set privacy state=disable
And there you have ... my list of favorite tweaks.netsh interface tcp set global ecn=enabled
Thanks...
Monday, November 8, 2010
How to attack a remote network across the Internet?
This is my one of the best post bcz with the help of this you can attack/hack a remote network just in seconds...
On a theoretical level, attacking aremote network across the Internet is very simple.
First, you research to discover allof the IP address ranges used by the target. Search the web, search Usenet,search Internet, search RIPE, search APNIC, search everywhere.
Second, you identify all hosts inthose IP address ranges. This may be as simple as pinging each possible host inthose networks. Be warned, however, that many hosts will be protected byfirewalls that prvent ICMP ECHO Requests (used by ping) from reaching them.Those hosts may still have vulnerable services running on them.
Third, you identify all open portson each of those hosts. For example, one host may be providing dns, bootp, andtime services.
This is normally done by "port scanning" the host.
Port scanning UDP ports is much slower than port scanning TCP ports.
TCP portswill respond negatively when they are not open.
UDP ports require you to waitfor a timeout.
You may choose to scan only known ports, or to scan only portsbelow 1024, or to scan all 65,535 ports.
Fourth, you attack vulnerableservices. If you see a time server running and you know of a time serverexploit, you try it out. Perhaps the target is running an OS that is notvulnerable, or perhaps the system administrator has patched the target host.Or, maybe you will succeed. Vulnerability information can be gleaned fromInternet WWW sites or mailing lists, traded privately, or developed on yourown.
Keep enjoying....
Keep enjoying....
Subscribe to:
Posts (Atom)
Monday, December 26, 2011
Anu










