Giter Site home page Giter Site logo

decoy's Introduction

Decoy

An educational example program of Go programming based on having some fun creating an old school decoy program. This is an old hacker trick, to give people you password. No, you are not supposed to use this to actually trick people and you most likely can't because most login systems don't work like this anymore.

This is more for fun and historical perspective.

How Does it Work?

When people use text based login systems like this:

Login: erik
Password: qwerty
Большая Электронно-Счётная Машина 6
Welcome to БЭСМ-6 comrade erik: March 29, 2021
> 

The name of the computer is from the Soviet Mainframe BESM-6 from 1965

What a nefarious hacker could easily do is to make a program that looks exactly like this, but which instead of logging the user in, stores the user password. Thus the hacker can come back later and read a file containing the passwords of users who have previously tried to log in.

What is the Point?

The point of this program is to teach basic things like: reading files, dealing with input and output, string manupulation and hash functions in Go by pretending to be hackers. If you want to be an actual hacker, you need to find other tools as this is a totally outdated approach.

Building, Running and Using Programs

This module is setup as multiple packages which produce a number of command line tools such as runlogin, generate, encrypt, decrypt and addpasswd.

You can build these tools in the following way:

❯ go build github.com/ordovician/decoy/cmd/runlogin ❯ go build github.com/ordovician/decoy/cmd/addpasswd ❯ go build github.com/ordovician/decoy/cmd/decryp

Why exactly this long build line? It stems from the go.mod file defining the root of the package like this:

❯ cat go.mod
module github.com/ordovician/decoy

go 1.16

However you can use local paths by prefixing with ./ like this:

❯ go build ./cmd/runlogin

The build command will use this defined module name when building. You can also directly run commands this way:

❯ go run github.com/ordovician/decoy/cmd/runlogin
❯ go run ./cmd/runlogin

However after building you will get local executables which you can run like this:

❯ ./runlogin
Login: thomas
Password: qwerty
Большая Электронно-Счётная Машина 6: June 6, 2022
Welcome to БЭСМ-6 comrade thomas

decoy's People

Contributors

ordovician avatar translusion avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.