Skip to content

nazarsh/cs50final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Final Project for CS50 - Nazar Sharunenko 2015

Final CS50 project. Program that:

  • reviews your ssh config file and provides guidelines
  • monitors ssh activity (/var/log/auth.log)
  • blacklists attempts to log in with username/password
  • provides statistics on login attempts

User Stories

  • Create a daemon process scaffold for the program (2)
  • Add root checks when program is executed (1)
  • Add color for output (1)
  • Add flag processing (2)
  • Add "analyze" flag and functionality (epic)
    • Add a bill of health config file (1)
    • Generate default bill if file is not found (2)
    • Add reading of bouncer config(1)
    • Add reading of the sshd_config (1)
    • Implement comparison of bill and config file (2)
    • Print results of comparison (1)
  • Add "defend" flag and functionality (epic)
    • read auth.log file (1)
    • figure out a way to "tail" the log file (3)
    • string match and extract the offending IP addresses (3)
    • produce firewall rules based on offending IPs (2)
    • log activity for stats! (1)
  • Print a general setup guide (2)
  • Add health bill check into argv param handling
  • Only block subsequent ssh requests for now
  • Add a demo of "stats" flag and functionality (epic)
    • Setup sqlite3 database (3)
    • Figure out a sample query and return results (2)

Stretch Goals

  • Add "stats" flag and functionality (epic)
    • Ingest, store, use country <=> ip map. (3)
    • Add download capability to get fresh country <=> ip map. (2)
  • Add unit testing framework (2)
  • Add support for IPv6

References

  1. Creating a Daemon Process in C Language with an Example Program by HIMANSHU ARORA on FEBRUARY 24, 2012
  2. Check if user is root in C? (Stackoverflow)
  3. User identifier (Wikipedia)
  4. Using C/C++, how do you print to stdout in color, but only if the terminal supports it? (Stackoverflow)
  5. stdlib and colored output in C (Stackoverflow)
  6. The GNU C Library: Host Address Functions (GNU C Library)
  7. An Introduction To The SQLite C/C++ Interface
  8. The GNU C Library: Getopt (GNU C Library)
  9. Download file using libcurl in C/C++ (Stackoverflow)
  10. Is there a C project Default Directory Layout? (Stackoverflow)
  11. How can I add an empty directory to a Git repository? (Stackoverflow)
  12. SSH Essentials: Working with SSH Servers, Clients, and Keys (DigitalOcean)
  13. What's the best way to check if a file exists in C? (cross platform) (Stackoverflow)
  14. How to get size of file in C (LinuxQuestions)
  15. getline(3) - Linux man page (Die.net)
  16. fgetpos(), fsetpos() (Beej's Guide to C)
  17. cstring (string.h) (cplupluc.com)
  18. INET_PTON(3) (Linux Programmer's Manual)
  19. Iptables Drop IP Address (nixCraft)
  20. Initial Server Setup with Ubuntu 14.04 (DigitalOcean)
  21. how to import .sql into sqlite3 (Stackoverflow)
  22. Using SQLite in C programs
  23. ip2nation

About

Final Project for CS50

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published