Author Topic: Short and Sweet - Tips and Tricks  (Read 3764 times)

0 Members and 1 Guest are viewing this topic.

Offline cyberdrifter

  • Knight
  • **
  • Posts: 176
  • Cookies: -90
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #15 on: February 03, 2015, 04:11:18 am »
For fucks sake I did something like this a few months ago.. it never took off.
Gotta link? I'd like to see your offerings.
« Last Edit: February 03, 2015, 04:11:29 am by cyberdrifter »
.- / .-.. .. - - .-.. . / -... . - - . .-. --..-- / . ...- . .-. -.-- / -.. .- -.-- .-.-.-
Go ahead tubby, you clearly want/need those cookies more than me.  :P

Offline Matriplex

  • Knight
  • **
  • Posts: 323
  • Cookies: 66
  • Java
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #16 on: February 03, 2015, 05:20:42 am »
Nobody replied to the thread... I had something on there to do with Java for a kick starter I think. It's not important.
\x64\x6F\x75\x65\x76\x65\x6E\x00

Offline Spectrum_963

  • Peasant
  • *
  • Posts: 83
  • Cookies: 20
  • Where shit goes down
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #17 on: February 03, 2015, 11:54:44 am »
Here's a tip, familiarize yourself with the sh mod in python. Sure you've for the os mod that can already do a lot of the things the sh mod can but I've found it extremly useful so far.
Sticky, anyone?

@Matriplex - more people fiddle with python and bash than with java. It's only natural.
« Last Edit: February 03, 2015, 11:56:09 am by Spectrum_963 »
"The same human mind that creates the most beautiful works of art and extraordinary marvels of technology is equally responsible for the perversion of it's own perfection."

Offline cyberdrifter

  • Knight
  • **
  • Posts: 176
  • Cookies: -90
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #18 on: February 03, 2015, 04:18:18 pm »
Here's a tip, familiarize yourself with the sh mod in python. Sure you've for the os mod that can already do a lot of the things the sh mod can but I've found it extremly useful so far.
The idea was to post specific commands, do you have a brief example to justify why you think the sh mod is useful?
« Last Edit: February 03, 2015, 09:11:58 pm by cyberdrifter »
.- / .-.. .. - - .-.. . / -... . - - . .-. --..-- / . ...- . .-. -.-- / -.. .- -.-- .-.-.-
Go ahead tubby, you clearly want/need those cookies more than me.  :P

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #19 on: February 05, 2015, 08:28:26 am »
Sometimes I want to fetch x number of files from a larger file base.
The following command copies 1000 files randomly from the current folder to the dest folder

Code: [Select]
ls . | shuf -n 1000 | xargs -i -t cp {} dest

Offline cyberdrifter

  • Knight
  • **
  • Posts: 176
  • Cookies: -90
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #20 on: February 05, 2015, 05:55:21 pm »
Bang Bang:

This is an incredibly simple command, that I'm always surprised to see people don't know, so:

Code: [Select]
$ make sandwich
error: you cannot perform this operation unless you are root.
$ sudo !!
Ofcourse I'll make you a sandwich!

For instance when you run a command that requires admin privs (but forgot to type sudo), instead of typing the whole command again, just use two exclamations to represent your previous command.
« Last Edit: February 05, 2015, 05:57:13 pm by cyberdrifter »
.- / .-.. .. - - .-.. . / -... . - - . .-. --..-- / . ...- . .-. -.-- / -.. .- -.-- .-.-.-
Go ahead tubby, you clearly want/need those cookies more than me.  :P

Offline cyberdrifter

  • Knight
  • **
  • Posts: 176
  • Cookies: -90
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #21 on: February 27, 2015, 03:57:49 am »
Create list of network connections that updates every second, it will tell you:
  • what program is using the connection
  • what user initiated the connection
  • the PID of the program running the connection
  • the destination address either by domain name or IP
  • the port number that it is connecting through
  • what connection protocol is used: udp/tcp/etc
  • It will also tell you if a connection is listening or established
Code: [Select]
watch -n 1 lsof -i -P

Breakdown

Watch - Executes a program periodically.
    -n 1 - this switch tells Watch to run at an interval of once every 1 second


lsof      -This program is used to list open files (everything's a file in linux... even connections)
    -i      -This tells lsof to only list network/internet related files
    -P     -This tells lsof to tells lsof to list port numbers instead of converting them to the human readable form (ie it will show 80 instead of HTTP), this helps speed up the command.


.- / .-.. .. - - .-.. . / -... . - - . .-. --..-- / . ...- . .-. -.-- / -.. .- -.-- .-.-.-
Go ahead tubby, you clearly want/need those cookies more than me.  :P

Offline Darkvision

  • EZ's Fluffer
  • VIP
  • Royal Highness
  • *
  • Posts: 755
  • Cookies: 149
  • Its not a bug, It's a Chilopodas.
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #22 on: February 27, 2015, 07:36:51 am »
soo ill change things up and toss out a Win tip/trick :)

Always have some form of " Preinstallation Environment"(PE) both on disk(cd/dvd) and USB. I also like to tack on my favorite "must have" softwares onto the image/USB such as a virus scanner, malware remover etc. For XP and before BartPE is my hands down favorite, but since they stoped releasing you either have to pay(or get cracked) for a winternals version or get the WinPE as your two best choices. To iterate just a "few" uses:File recovery, password changing, system monitoring. 
The internet: where men are men, women are men, and children are FBI agents.

Ahh, EvilZone.  Where networking certification meets avian fecal matter & all is explained, for better or worse.

<Phage> I used an entrence I never use

Offline cyberdrifter

  • Knight
  • **
  • Posts: 176
  • Cookies: -90
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #23 on: February 27, 2015, 09:39:53 pm »
soo ill change things up and toss out a Win tip/trick :)

Always have some form of " Preinstallation Environment"(PE) both on disk(cd/dvd) and USB. I also like to tack on my favorite "must have" softwares onto the image/USB such as a virus scanner, malware remover etc. For XP and before BartPE is my hands down favorite, but since they stoped releasing you either have to pay(or get cracked) for a winternals version or get the WinPE as your two best choices. To iterate just a "few" uses:File recovery, password changing, system monitoring.
To reiterate what was said in the original post in this thread:
we're looking for actual commands.

That are: short, concise, and can be quickly explained.


Do you have an example of a command that you'd use with this method?
« Last Edit: February 27, 2015, 09:41:16 pm by cyberdrifter »
.- / .-.. .. - - .-.. . / -... . - - . .-. --..-- / . ...- . .-. -.-- / -.. .- -.-- .-.-.-
Go ahead tubby, you clearly want/need those cookies more than me.  :P

Offline cyberdrifter

  • Knight
  • **
  • Posts: 176
  • Cookies: -90
    • View Profile
Re: Short and Sweet - Tips and Tricks
« Reply #24 on: March 19, 2015, 05:20:34 pm »
Simple ROT13 Encoding function
Code: [Select]
rot13()
{
echo "$@" | tr '[a-m][n-z][A-M][N-Z][0-4][5-9]' '[n-z][a-m][N-Z][A-M][5-9][0-4]'
}

The above function can be added to your .bashrc for ease of use (or as a stand alone script).



Once in your sourced bashrc simply type:
Code: [Select]
rot13 "whatever you want to encode" (without quotes) and your string will be encoded.
You can use this to encode whole files replacing echo with cat in the above code in which case you'd use
Code: [Select]
rot13 "Nameoffile.txt"

To decode simply input the encoded message back into rot13 and it reverses the process.



One way that someone could use this is a simple method to additionally harden passwords. If for instance you use pass phrases with real words, this will help garble those words up which will help prevent dictionary attacks. While allowing you to have a simple way to encode/decode them.


WARNING: This is NOT encryption, it is a simple encoding method, and it is not a secure method to transfer sensitive information. This is just a simple shift cipher that can help you with in very specific situations.
« Last Edit: March 19, 2015, 05:21:12 pm by cyberdrifter »
.- / .-.. .. - - .-.. . / -... . - - . .-. --..-- / . ...- . .-. -.-- / -.. .- -.-- .-.-.-
Go ahead tubby, you clearly want/need those cookies more than me.  :P